Archive for the 'Wordpress' Category
reCAPTCHA plugin error messages
By default, on two of my installs of reCAPTCHA Plugin for WordPress - v2.7, I receive no error message if the captcha is entered incorrectly… the user of the weblog is to assume that they made a mistake I guess…
That is until I wrote this script to check for error messages being passed around on the URL by the plugin:
if (window.location.search != "") {
var searchArray = window.location.search.split("&");
for (var i=0; i < searchArray.length; i++) {
var searchSubArray = searchArray[i].split("=");
if (searchSubArray[0] == "rerror" &&
searchSubArray[1] == "incorrect-captcha-sol") {
document.write("<p><small style=\"color: red;\">The two words in the picture were typed incorrectly.</small></p>");
}
}
}
</script>
Just drop that snippet into your “comments.php” template. When the captcha is filled in incorrectly, the plugin adds “rerror=incorrect-captcha-sol” to the url. This checks for that string, and if found, writes an error message in red.
Posted by Karl Herrick on February 3rd, 2008 in Javascript, Wordpress, PHP, Web Development | 2 Comments »
Spam away
I implemented reCAPTCHA on this blog because of comment spam. If you are having issues leaving a comment let me know. ![]()
Posted by Karl Herrick on January 13th, 2008 in Wordpress, Web Development | 1 Comment »
reCAPTCHA plugin styling
Installing a CAPTCHA implementation on Wordpress is quite easy when using the reCAPTCHA plugin, however the styling is hard coded into the main php file included.
Goto the installation directory, for example, “wp-content/plugins/recaptcha-wordpress-2.7″ and edit recaptcha.php. Look for the line that embeds the theme type and change it.
var RecaptchaOptions = { theme : "red", tabindex : 5 };
</script>
I used the “clean” theme. There are other options and ideas for editing the code with css changes.
Posted by Karl Herrick on January 13th, 2008 in Wordpress, PHP, Web Development | No Comments »