Really Simple CAPTCHA

Really Simple CAPTCHA is a CAPTCHA module intended to be called up from other plugin. It was originally created for my Contact Form 7 plugin, and is now an independent, stand-alone plugin.

If you are a WordPress plugin developer and are considering putting a simple CAPTCHA into your plugin, this would be a good choice.

Download | Support Forum

Click here to lend your support to: Support Really Simple CAPTCHA plugin for WordPress and make a donation at www.pledgie.com !

A Note for Contact Form 7 Users

Note: You will need this Really Simple CAPTCHA plugin installed on WordPress if you use CAPTCHA with the next (Version 1.9.4) and subsequent releases of Contact Form 7. If you don’t use CAPTCHA, you don’t have to do so.

The key reason why I’ve separated the CAPTCHA module out is to solve current problems related to the automatic upgrading of the plugin; I often receive trouble reports of failed automatic upgrades from Contact Form 7 users.

I’m guessing that the cause of the problem is in the CAPTCHA module itself. The CAPTCHA module includes font files which are relatively large binary files. It doesn’t normally cause any difficulty on most hosts; however, in some specific environments it is possible that they may cause problems.

To reduce the risk of failing automatic upgrades of Contact Form 7, I have extracted the CAPTCHA module to stand as an independent plugin. As the frequency of updating the CAPTCHA module is much less than the frequency of updating Contact Form 7, it will be less frustrating for you, even if you continue to have trouble when you upgrade the CAPCHA module.

Troubleshooting

See also: Tips for troubleshooting Really Simple Captcha issues


(以下、日本語)

Really Simple CAPTCHA は別のプラグインからコールされることを意図して作られた CAPTCHA のモジュールです。元は Contact Form 7 用に作ったモジュールですがこの度スタンドアロンのプラグインとして独立させました。

もしあなたがプラグインの開発者で、自分のプラグインに簡単な CAPTCHA 機能を組み込みたいなら、これを使うと便利かもしれません。

Contact Form 7 をお使いの方へ

お知らせ: 次期バージョン (1.9.4) 以降の Contact Form 7 で CAPTCHA を使用する場合にはこの Really Simple CAPTCHA プラグインのインストールが別途必要になります。CAPTCHA を使用しない場合は必要ありません。

現在、Contact Form 7 のユーザーから「プラグインの自動アップグレードに失敗する」という報告を頻繁に頂いています。CAPTCHA モジュールを分離したことの隠れた真の理由はこれの解決にあります。

自動アップグレードに失敗する原因のひとつとして考えられるのは、CAPTCHA モジュールで同梱使用しているフォントファイルが大きすぎることです。たいていのホストでは問題なく処理できる大きさではあるのですが、一部の環境で問題を生じる可能性は否定できません。

Contact Form 7 の自動アップグレード時の失敗リスクを軽減するために、CAPTCHA モジュールをパッケージの外に出すことにしました。CAPTCHA モジュールを更新する頻度は Contact Form 7 を更新する頻度と比べてずっと低いですので、あるいは今後も CAPCHA モジュールのアップグレード時につまづくことがあるかもしれませんが、それでも今よりイライラの回数は減るはずです。

トラブルシューティング

  • CAPTCHA が機能しません。画像が表示されないのです。

    Really Simple CAPTCHA は GD および FreeType ライブラリを必要とします。それらがサーバーにインストールされていることをサーバー管理者にお問い合わせください。

    それから、一時ファイルが置かれるフォルダが書き込み可能になっていることを確認してください。一時ファイルのフォルダの位置は ReallySimpleCaptcha クラスの tmp_dir インスタンス変数の値で指定されます。この設定は呼び出し側のプラグインの設定により異なるので注意してください。例えば Contact Form 7 は通常 wp-contents/uploads/wpcf7_captcha を一時フォルダに使いますが、WordPress の設定によっては別のフォルダが使われます。


Comments

180 responses to “Really Simple CAPTCHA”

  1. squaremonitor Avatar
    squaremonitor

    Just to add that I have asked host and GD and Freetype are installed

  2. dziubin Avatar
    dziubin

    How IT works ??

  3. Any support for WP 2.8?

  4. Please, i need to know if is possible use this captcha in comments… I didn’t find anything like this to protect my comments against spams. This captcha is perfect, and i want put it in my comments with urgency! :)

  5. I really like your plug-ins, but I am a noob and having some issues.

    I am getting the common problem that CAPTCHA is not recognizing the image, which from what I have read is likely that I either don’t have GD and FreeType installed or folder is not writable. I am using a hosting company (JustHost).

    Can you please tell me how to check to see if I have GD and FreeType installed? and if not, where do I find these to install? How do I determine if the folder is writable? I don’t see any options for changing this status.

    Thank you for your assistance.

    Damon

  6. I haven’t had a response yet from this ticket:

    http://wordpress.org/support/topic/281742?replies=2

    What would make the Captcha image blank??

  7. @Damon Just create a test.php file with and upload it and you should find out all about what you need to know as far as GD and FreeType being installed!

  8. How can I use the Really Simple CAPTCHA on my comments?

  9. I must be missing something. I’ve been messing with this for 2 days trying to get RSCaptcha into my contact form 7. I have GD and Freetype. I cannot find the tempfiles but even if I do , who do I make them writable for? User,World, etc..? The input box is showing up on my page BUT not the image. Can anyone please lend a hand.

  10. pillingers Avatar
    pillingers

    How do I get text to appear above the Captcha image and response box? They show up all right when I add

    [captchac captcha-1] [captchar captcha-1]

    But if I try to put an instruction above, like:

    Anti-spam word (Required)
    [captchac captcha-1] [captchar captcha-1]

    — the text does not appear.

    Can anyone help?

  11. I just installed the CAPTCHA plugin for wordpress 2.8. It seems to work fine on FF 3 but doesn’t work on IE7. Is this going to be fixed soon?
    Thanks,
    Jack

  12. With all due respect because your contact form 7 is a great product but now I want to use “really simple CAPTCHA”. I do not understand why you do not provide an easy step-by-step instruction for someone who knows nothing about things like “First, create an instance of ReallySimpleCaptcha class:” which is in your readme file. What in the world does that mean? Please, if you are going to be gracious enough to provide this (as you are) which obviously was originally made for contact form 7, give a detailed instruction such as “go here (“here” being exact location) to create “an instance” and so on. Now this is completely useless to me because I do not have the knowledge to install it. Would you please be kind enough to outline the necessary steps so I may use it. Thanks much!

  13. jerome Avatar
    jerome

    hello,
    Contact Form 7 and Really simple captcha dosn’t work in my WP-2.8…
    error code is: Warning: imagettftext() [function.imagettftext]: Could not read font in /home/…../wp-content/plugins/really-simple-captcha/really-simple-captcha.php on line 96

    chmod 777 is ok in the correct directories…
    (when i was on WP-2.7.1 it worked…

    how can i resolve the problem ?

  14. hi! I have the same problem as jerome.. but the weird thing is.. for sometime the contact form 7 and captcha plug-in worked well with WP2.8 version…but now I am having the same error message as jerome.. I hope you could provide some answer.

  15. I also got the same error code is: Warning: imagettftext() [function.imagettftext]: Could not read font in /home/…../wp-content/plugins/really-simple-captcha/really-simple-captcha.php on line 96.

    Has there been a reply to do this.

  16. Works Great. Credit to you skills, time and effort. It would be fantastic if RSCaptcha worked in comments. Does anyone know of a plugin that uses this? It is probably a lot harder to code than a contact form.
    Thanks for a great plugin.

  17. RSCaptcha works beautifully with WP Contact Form 7. However, I wish that it’s more artistic with a patterned background, as well as, colored and artistic fonts. Moreover, it incorporates a feature whereby the user can click on the RSCaptcha image for a new text-image.

    An example of such features is shown on: http://www.crystalpower2u.com/modules/liaise/

    Thank you.

  18. Works perfectly well with WP 2.8

    For those wondering on usage, past this code inside the configuration of Contact 7 right above the “submit button”. That´s it.

    [captchac your-captcha]
    Enter the code: [captchar your-captcha]

  19. Hello,
    I use Really Simple CAPTCHA with Contact Form 7 and I have the problem, that the entered code for the first try is always shown as wrong, although I entered the right characters. The second try works fine, but I always need two tries.

    Nevertheless: I thank you for your great work!

  20. This is an excellent plugin.. just now i installed in my wordpress

  21. how can we use this for our forms
    thank you for this great work,

  22. I am also having the same problem with the Captcha image not getting displayed. I’m running WP 2.8.1 and Captcha 7 2.0.1

    Directories are writable and I have GD and Freetype installed at Host, and the site has been moved to a different server

    There apparently appears to be some sort of bug as many people are having the same issues. Does anyone have a fix for this bug?

  23. Hey, how can I use the great plugin also in my comments. I don’t want to use two different captcha plugins!

    Thank you for your help!

  24. Upgrading troubles for me seemed to be related to the fact that it’s so enourmous. Other BIG plug ins had the same trouble – they’d just stop during the update. Same for updates to WordPress it’s self.

    This was solved when PHP5 became available on my ISP’s server and I switched to it.

  25. Hi,

    I can’t get this plugin to work with Contact Form 7 and WP Version 2.8.4. Should it be working with 2.8.4?

  26. Why did you delete my comment?

    I’am wondering if this plugin is working with the newest version of WP?

  27. Works great for me on 2.8.4 – looks good as well

  28. Okay, but i have GD with Free library. Why would it not work then?

  29. I installed Contact Form 7 and Captcha plugins for my site. They were working find when I built the site in a sub-directory on my server. Then, when I moved all of my site files up to the root on my server, the captcha image did not appear any more. When I look at my directory, it looks like Contact Form 7 is still trying to write the captcha files to the old sub-directory.

    Does anyone know what I need to fix? I’ve tried uninstalling, deleting, and reinstalling both plugins, but the same issue exists.

    Thank you in advance!

    http://wordpress.org/support/topic/313276?replies=1

  30. Unfortuantely, your plugin no longer works.

    So I have had to move to cformsII:
    http://www.deliciousdays.com/cforms-plugin

  31. Dear idEric,
    i m using this plugin in my website, maybe you have a session problem.

    you can check it from this link

    http://www.kargamedya.com/kisiye_ozel_cocuk_kitaplari/toplu-siparisler.html

  32. I don’t know if anyone has commented on this so sorry if it’s redundant.

    I am using the captcha directly in Contact Form 7

    I am trying to style the image and nothing seems to be working. I am editing the really-simple-captcha.php file. I am trying to increase the font-size and change the height and width of the image. The only thing that seems to show up is I can change the character count.

  33. I have used Really Simple CAPTCHA plugin and 100% can integrated with contact form 7.

  34. Hi.

    It is great and really simple. I think that thos who have some troubles are just not doing it well. I have just edited my form, clicked on the “generate label” button, selected CAPTCHA and copied BOTH fields, the “captchac” and the “captchar”. It worked just fine. You can view it working in http://www.catsanet.com.mx/?page_id=495.

    I hope this help you guys.

    Cheers.

  35. […] Form 7 and Really Simple Captcha. Great lil combo for my contact page, and very easy to set up. Just the way I like […]

  36. I’ve been having issues with the Really Simple CAPTCHA.

    See:

    http://wordpress.org/support/topic/320319
    and
    http://wordpress.org/support/topic/249766

    The CAPTCHA worked before, and quit working after the most recent upgrade for Contact Form 7.

    Multiple sites getting the same error!

    Fatal error: Call to undefined function imagetypes() in /../../../wp-content/plugins/contact-form-7/modules/captcha.php on line 201

  37. Hi,

    I have a problem with black .png images.

    You can see the problem description on http://wordpress.org/support/topic/313250

    Do somebody recognize this problem?

    Wbr

  38. Hi there,
    I don’t know if you figured out the “Warning: imagettftext() [function.imagettftext]: Could not read font” problem yet… didn’t saw here anything.
    I looked at the plugin code and found kindda “include” of 4 fonts while in the gentium folder are only 3, so I terminated the include after the third font and commented out the last line, like this:
    #####
    /* Array of fonts. Randomly picked up per character */
    $this->fonts = array(
    dirname(__FILE__) . ‘/gentium/GenAI102.TTF’,
    dirname(__FILE__) . ‘/gentium/GenAR102.TTF’,
    dirname(__FILE__) . ‘/gentium/GenI102.TTF’);
    // dirname(__FILE__) . ‘/gentium/GenR102.TTF’);
    #####

    cya

  39. Hi, i just was wondering if CAPTCHA has a built-in option to delete abandoned temporary files from wp-content\uploads\wpcf7_captcha\ folder? E.g. any function that would clean up all the contents of wpcf7_captcha when needed. If user opens the contact form which uses CAPTCHA, but doesn’t hit submit button, the .php and .png files will remain in the temp folder. This is a serious security fault to me. Theoretically, the space on the hosting server might be eventually exhaused by simple automated script which infinitely refreshes page with contact form loaded in attacker’s browser. Each refresh will result in generation of nes .php and .png files which will never be deleted thus resulting in DoS attack.

  40. @Dmitriy thanks. But you did the same comment 3 times on this blog, is it a warning of DOS attack? ;)

    Sorry, seriously speaking, yes it can be a security flaw as you wrote. Currently Contact Form 7 does clean up files older than 6 hours. This should be shorten to 1 or 2 hours. And, I should add an utility function of cleaning up files to Really Simple CAPTCHA in order to allow other plugins to use it. But even these changes will be difficult to block serious DOS attacs. If someone has good idea for it, please tell me.

  41. Hi Miyoshi,

    That was not a DOS attack, for sure. ;) I didn’t notice that your blog outputs the earliest comments first. After 3rd attempt to post comment I realized that the problem is rather with my head than with your blog. ;)

    I have already found that Contact Form 7 has a hardcoded functionality to purge temp files older than 6 hours. But I thought it would be nice for me to not have a dependency on Contact Form 7. Therefore I have spent 20 min yesterday and sorted out this problem by adding a couple lines of code in really-simple-captcha.php. Now I just would like to share it in case if somebody needs to have the same functionality too (should be called manually the same way as function remove() which is described in RSCaptcha FAQ):

    /* function cleans up the temporary folder from abandoned temp files (older than $minutes) */
    function clean($minutes) {
    $dirs=scandir($this->tmp_dir);
    foreach($dirs as $dir) {
    $file = $this->tmp_dir . $dir;
    if (is_file($file)) {
    $expires=time()-60*$minutes; // $minutes ago
    if (filectime($file)<$expires) {
    unlink($file);
    }
    }
    }
    }

  42. Sorry for bothering, I found out that my error was caused by an partly interrupted transfer of the plugin to my server :-(.
    So there was no “missing font”, it’s working fine.
    Bye.

  43. Hi,

    I solved the problem with black .png images.

    I converted the sql-database to UTF-8 with Notepad++

    Wbr
    Jan

  44. mistake :)

    can I change font color inside “contact form 7”?

    I am having a problem with typing there, my fonts are white
    and background is white, too, so I can`t see any fonts

    any ideas?

    thanks!

  45. Just used it with my Contact Form 7… brilliant.
    Not too difficult and looks stylish.

    One point, I notice that the letters are not case sensitive, it might be useful to have a small note next to the CAPTCHA, saying “not case sensitive”.
    Just a thought.

  46. islandscript Avatar
    islandscript

    nice tool for CAPTCHA. it is work for me. here a link

    Can i place to comment. please show me a guide.

    Thank

  47. […] Setiap url yang berubah akan ditambah secare auto 303 di setiap entri yang berubah urlnye. 11- Really Simple CAPTCHA Tambahan plugin untuk Contact Form 7. 12- Secure WordPress Little basic keselamatan wordpress. […]

  48. […] Really Simple CAPTCHA is what I use in conjunction with Contact Form 7 to manage the CAPTCHA on my contact page. ↩ […]

  49. All libraries enabled (GD, Freetype), all proper rights are applied (php and png files are being created in the right folder), upload path correct. Yet the image remains blank.

    I’m running WP 2.9

Leave a comment