Comment form CAPTCHA using Really Simple CAPTCHA plugin. Proof-of-concept for other plugin developers.
Make sure you have the Really Simple CAPTCHA plugin installed and activated.
Refer to Dashboard -> Settings -> Discussion to configure Plugin settings:
// Characters to use in CAPTCHA image.
$comment_captcha->chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
// Number of characters in CAPTCHA image.
$comment_captcha->char_length = '4';
// Width/Height dimensions of CAPTCHA image.
$comment_captcha->img_size = array( '72', '24' );
// Font color of CAPTCHA characters, in RGB (0 - 255).
$comment_captcha->fg = array( '0', '0', '0' );
// Background color of CAPTCHA image, in RGB (0 - 255).
$comment_captcha->bg = array( '255', '255', '255' );
// Font Size of CAPTCHA characters.
$comment_captcha->font_size = '16';
// Width between CAPTCHA characters.
$comment_captcha->font_char_width = '15';
// CAPTCHA image type. Can be 'png', 'jpeg', or 'gif'
$comment_captcha->img_type = 'png';
Note, the following API-configurable option is not exposed by the Plugin, but can be modified via filter:
// oordinates for a text in an image.
$this->base = array( 6, 18 );
// Comment form CAPTCHA field label text
$comment_captcha_form_label = 'Anti-Spam:';
The HTML output is wrapped in a paragraph tag, with class="comment-form-captcha".
Requires: 3.1 or higher
Compatible up to: 3.5.1
Last Updated: 2012-12-20
Downloads: 8,465
0 of 1 support threads in the last two months have been resolved.
Got something to say? Need help?