Really Simple CAPTCHA
March 14, 2009
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.
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
-
CAPTCHA does not work; the image does not show up.
Really Simple CAPTCHA needs GD and FreeType library installed on your server. Ask your server administrator if they are installed.
Also, make the temporary file folder writable. The location of the temporary file folder is managed by the instance variable
tmp_dirof ReallySimpleCaptcha class. Note that the setting varies depending on the calling plugin. For example, Contact Form 7 uses wp-contents/uploads/wpcf7_captcha as the temporary folder basically, but it can use different folder depending on your settings.
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 の設定によっては別のフォルダが使われます。



June 12, 2009 at 2:27 am
Just to add that I have asked host and GD and Freetype are installed
June 12, 2009 at 8:38 pm
How IT works ??
June 17, 2009 at 6:58 pm
Any support for WP 2.8?
June 18, 2009 at 2:15 pm
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! :)
June 19, 2009 at 1:13 am
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
June 20, 2009 at 2:37 am
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??
June 20, 2009 at 2:40 am
@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!
June 21, 2009 at 5:14 am
How can I use the Really Simple CAPTCHA on my comments?
June 23, 2009 at 6:29 am
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.
June 24, 2009 at 3:20 am
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?
June 26, 2009 at 11:26 pm
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
July 3, 2009 at 5:30 am
Thanks for beatiful plugins.
July 8, 2009 at 5:00 am
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!
July 9, 2009 at 2:06 pm
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 ?
July 14, 2009 at 10:57 am
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.
July 16, 2009 at 9:01 pm
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.
July 19, 2009 at 9:22 am
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.
July 22, 2009 at 1:00 pm
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.
July 24, 2009 at 7:31 pm
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]
July 25, 2009 at 7:30 pm
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!
July 30, 2009 at 9:51 pm
This is an excellent plugin.. just now i installed in my wordpress
August 24, 2009 at 7:20 am
how can we use this for our forms
thank you for this great work,
August 24, 2009 at 9:22 pm
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?
September 1, 2009 at 1:15 am
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!
September 2, 2009 at 2:24 pm
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.
September 4, 2009 at 9:26 pm
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?
September 5, 2009 at 3:38 am
Why did you delete my comment?
I’am wondering if this plugin is working with the newest version of WP?
September 6, 2009 at 3:03 am
Works great for me on 2.8.4 – looks good as well
September 6, 2009 at 10:26 am
Okay, but i have GD with Free library. Why would it not work then?
September 22, 2009 at 6:36 am
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
September 24, 2009 at 3:38 am
Unfortuantely, your plugin no longer works.
So I have had to move to cformsII:
http://www.deliciousdays.com/cforms-plugin
September 24, 2009 at 7:43 pm
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
September 25, 2009 at 7:40 am
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.
September 27, 2009 at 2:55 am
I have used Really Simple CAPTCHA plugin and 100% can integrated with contact form 7.
October 6, 2009 at 4:22 am
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.
October 9, 2009 at 7:26 am
[...] Form 7 and Really Simple Captcha. Great lil combo for my contact page, and very easy to set up. Just the way I like [...]
October 13, 2009 at 4:17 am
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
October 17, 2009 at 11:16 pm
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
October 22, 2009 at 2:14 am
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
October 22, 2009 at 3:15 am
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.
October 22, 2009 at 7:34 am
@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.
October 23, 2009 at 1:26 am
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);
}
}
}
}
October 25, 2009 at 7:23 pm
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.
October 30, 2009 at 7:03 pm
Hi,
I solved the problem with black .png images.
I converted the sql-database to UTF-8 with Notepad++
Wbr
Jan
November 7, 2009 at 2:45 am
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!