Really Simple CAPTCHA
Takayuki MiyoshiReally Simple CAPTCHA does not work alone and is intended to work with other plugins. It is originally created for Contact Form 7, however, you can use it with your own plugin.
Note: This product is “really simple” as its name suggests, i.e., it is not strongly secure. If you need perfect security, you should try other solutions.
How does it work?
Really Simple CAPTCHA does not use PHP “Sessions” for storing states, unlike many other PHP CAPTCHA solutions, but stores them as temporary files. This allows you to embed it into WordPress without worrying about conflicts.
When you generate a CAPTCHA, Really Simple CAPTCHA creates two files for it; one is an image file of CAPTCHA, and the other is a text file which stores the correct answer to the CAPTCHA.
The two files have the same (random) prefix in their file names, for example, “a7hk3ux8p.png” and “a7hk3ux8p.txt.” In this case, for example, when the respondent answers “K5GF” as an answer to the “a7hk3ux8p.png” image, then Really Simple CAPTCHA calculates hash of “K5GF” and tests it against the hash stored in the “a7hk3ux8p.txt” file. If the two match, the answer is confirmed as correct.
How to use with your plugin
Note: Below are instructions for plugin developers.
First, create an instance of ReallySimpleCaptcha class:
$captcha_instance = new ReallySimpleCaptcha();
You can change the instance variables as you wish.
// Change the background color of CAPTCHA image to black
$captcha_instance->bg = array( 0, 0, 0 );
See really-simple-captcha.php if you are interested in other variables.
Generate a random word for CAPTCHA.
$word = $captcha_instance->generate_random_word();
Generate an image file and a corresponding text file in the temporary directory.
$prefix = wp_rand();
$captcha_instance->generate_image( $prefix, $word );
Then, show the image and get an answer from respondent.
Check the correctness of the answer.
$correct = $captcha_instance->check( $prefix, $the_answer_from_respondent );
If the $correct is true, go ahead. Otherwise, block the respondent — as it would appear not to be human.
And last, remove the temporary image and text files, as they are no longer in use.
$captcha_instance->remove( $prefix );
That’s all.
If you wish to see a live sample of this, you can try Contact Form 7.
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_dir
of 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.
If you have any further questions, please submit them to the support forum.
Works great with Gravity Forms in 2024!
By Maxcom on August 19, 2024
Nothing but positives. We added this to our Gravity Form in order to obtain the dynamic math captcha. One can create a simple math captcha in GF but not dynamically changing for each form load insofar as I can determine. And GF google captcha Ver 3 is a pain with the need for google api keys.
So we added this plugin and it was very easy - add the captcha field to the form, select "math" in the settings for the field and done!
We find that Gravity Forms Zero Spam plugin was helping to deter spam entries but it with this captcha is 100% so far for spam prevention.
Thank you Takayuki Miyoshi!
Good Simple Banner
By nicolasvsedeco on October 25, 2023
Helo, very simple banner for cookies but there is a little bug. The banner Cookies are shown in Widgets page.
Bad and not work to stabilite
By gurcantet on April 11, 2023
spam is continue to come...
test
By rahzan on September 16, 2022
c'est quoi ce truc
By laurentino7 on January 21, 2022
Great work - easy to implement
By Blackbam on December 17, 2021
perfect
By wonadoomore on January 21, 2021
Spam keep comming!
By athinaok on January 16, 2021
Very helpful captcha
By gertrudew on November 18, 2020
It's really simple but really don't work
By vlkplk on July 24, 2020
2.3
- Bumps up the minimum required WordPress version to 6.4.
2.2
- Bumps up the minimum required WordPress version to 6.1.
- Bumps up the minimum required PHP version to 7.4.
- Replaces
ReallySimpleCaptcha::normalize_path()
withwp_normalize_path()
. - Updates Apache directives.
In most cases you can install automatically from WordPress.
However, if you install this manually, follow these steps:
- Upload the entire
really-simple-captcha
folder to the/wp-content/plugins/
directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
FYI: There is no “control panel” for this plugin.
Reviews
4.2 out of 5 stars
- Version: 2.3
- Last updated: 6 months ago
- Active installations: 400K
- WordPress version: 6.4
- Tested up to: 6.5.5
- PHP version: 7.4