Commit 7b700183 authored by lucha's avatar lucha

removed unused plugin wp-recaptcha

parent e4580971
Copyright (c) 2008 reCAPTCHA -- http://recaptcha.net
AUTHORS:
Mike Crawford
Ben Maurer
Jorge Peña
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
*
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?php
require_once('wp-plugin.php');
if (!class_exists('MailHide')) {
class MailHide extends WPPlugin {
// member variables
private $mcrypt_loaded;
function MailHide($options_name) {
$args = func_get_args();
call_user_func_array(array(&$this, "__construct"), $args);
}
function __construct($options_name) {
// instantiate super class (sets: options, environment, options_name)
parent::__construct($options_name);
$this->register_default_options();
// require the recaptcha library
$this->require_library();
// verify mcrypt is loaded
$this->verify_mcrypt();
// register the hooks
$this->register_actions();
$this->register_filters();
// keep this in the arsenal just in case
// disable the make_clickable filter cause it screws things up
/*
if ($this->mailhide_enabled()) {
remove_filter('comment_text', 'make_clickable', 9);
}*/
}
function register_actions() {
// load the plugin's textdomain for localization
add_action('init', array(&$this, 'load_textdomain'));
// options
register_activation_hook(WPPlugin::path_to_plugin_directory() . '/wp-recaptcha.php', array(&$this, 'register_default_options')); // this way it only happens once, when the plugin is activated
add_action('admin_init', array(&$this, 'register_settings_group'));
add_action('admin_init', array(&$this, 'settings_section'));
// admin notice
add_action('admin_notices', array(&$this, 'missing_mcrypt_notice'));
add_action('admin_notices', array(&$this, 'missing_keys_notice'));
}
function register_filters() {
// add the filters only if mcrypt is loaded
if ($this->mcrypt_loaded) {
if ($this->options['use_in_posts'])
add_filter('the_content', array(&$this, 'mailhide_emails'), 9000);
if ($this->options['use_in_comments'])
add_filter('comment_text', array(&$this, 'mailhide_emails'), 9000);
// todo: this seems like it doesn't work: http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content_rss
// instead check for is_feed() on 'the_content' filter
// the_excerpt_rss filter works fine
// concern: it seems like the feeds still show the email encoded in CDATA
if ($this->options['use_in_rss']) {
add_filter('the_content_rss', array(&$this, 'mailhide_emails'), 9000);
add_filter('the_excerpt_rss', array(&$this, 'mailhide_emails'), 9000); // this one is sometimes used instead
}
// todo: atom requires the html to be escaped, rss does not. do so accordingly in the preg_replace_callbacks
// todo: also be sure to escape replace_link_with
// - use htmlentities($var, ENT_QUOTES); for escaping?
if ($this->options['use_in_rss_comments'])
add_filter('comment_text_rss', array(&$this, 'mailhide_emails'), 9000);
}
}
function mailhide_enabled() {
return ($this->options['use_in_posts'] || $this->options['use_in_comments'] || $this->options['use_in_rss'] || $this->options['use_in_rss_comments']);
}
function keys_missing() {
return (empty($this->options['public_key']) || empty($this->options['private_key']));
}
function create_error_notice($message, $anchor = '') {
$options_url = admin_url('options-general.php?page=wp-recaptcha/recaptcha.php') . $anchor;
$error_message = sprintf(__($message . ' <a href="%s" title="WP-reCAPTCHA Options">Fix this</a>', 'recaptcha'), $options_url);
echo '<div class="error"><p><strong>' . $error_message . '</strong></p></div>';
}
function missing_mcrypt_notice() {
if ($this->mailhide_enabled() && !$this->mcrypt_loaded) {
$this->create_error_notice('You enabled MailHide but the mcrypt PHP extension does not seem to be loaded.', '#mailhide');
}
}
// todo: make a check in mailhide_settings partial so that if the keys are missing, the appropriate box is highlighted with #FFFFE0 bg-color 1px solid #E6DB55 border
function missing_keys_notice() {
if ($this->mailhide_enabled() && $this->keys_missing()) {
$this->create_error_notice('You enabled MailHide, but some of the MailHide API Keys seem to be missing.', '#mailhide');
}
}
function settings_section() {
add_settings_section('mailhide_options', '', array(&$this, 'show_settings_section'), 'recaptcha_options_page');
}
function show_settings_section() {
include('mailhide_settings.php');
}
function verify_mcrypt() {
$this->mcrypt_loaded = extension_loaded('mcrypt');
}
// require the recaptcha library
function require_library() {
require_once(WPPlugin::path_to_plugin_directory() . '/recaptchalib.php');
}
function load_textdomain() {
load_plugin_textdomain('recaptcha', false, 'languages');
}
function register_default_options() {
if ($this->options)
return;
$option_defaults = array();
$old_options = WPPlugin::retrieve_options("recaptcha");
if ($old_options) {
// keys
$option_defaults['public_key'] = $old_options['mailhide_pub']; // mailhide public key
$option_defaults['private_key'] = $old_options['mailhide_priv']; // mailhide private key
// placement
$option_defaults['use_in_posts'] = $old_options['use_mailhide_posts']; // mailhide for posts/pages
$option_defaults['use_in_comments'] = $old_options['use_mailhide_comments']; // use mailhide for comments
$option_defaults['use_in_rss'] = $old_options['use_mailhide_rss']; // use mailhide for the rss feed of the posts/pages
$option_defaults['use_in_rss_comments'] = $old_options['use_mailhide_rss_comments']; // use mailhide for the rss comments
// bypass levels
$option_defaults['bypass_for_registered_users'] = ($old_options['mh_bypass'] == "on") ? 1 : 0; // whether to sometimes skip the MailHide filter for registered users
$option_defaults['minimum_bypass_level'] = $old_options['mh_bypasslevel']; // who can see full emails normally (should be a valid WordPress capability slug)
if ($option_defaults['minimum_bypass_level'] == "level_10") {
$option_defaults['minimum_bypass_level'] = "activate_plugins";
}
// styling
$option_defaults['replace_link_with'] = $old_options['mh_replace_link']; // name the link something else
$option_defaults['replace_title_with'] = $old_options['mh_replace_title']; // title of the link
}
else {
// keys
$option_defaults['public_key'] = ''; // mailhide public key
$option_defaults['private_key'] = ''; // mailhide private key
// placement
$option_defaults['use_in_posts'] = 0; // mailhide for posts/pages
$option_defaults['use_in_comments'] = 0; // use mailhide for comments
$option_defaults['use_in_rss'] = 0; // use mailhide for the rss feed of the posts/pages
$option_defaults['use_in_rss_comments'] = 0; // use mailhide for the rss comments
// bypass levels
$option_defaults['bypass_for_registered_users'] = 0; // whether to sometimes skip the MailHide filter for registered users
$option_defaults['minimum_bypass_level'] = 'read'; // who can see full emails normally (should be a valid WordPress capability slug)
// styling
$option_defaults['replace_link_with'] = ''; // name the link something else
$option_defaults['replace_title_with'] = ''; // title of the link
}
// add the option based on what environment we're in
WPPlugin::add_options($this->options_name, $option_defaults);
}
function register_settings_group() {
register_setting('mailhide_options_group', 'mailhide_options', array(&$this, 'validate_options'));
}
function validate_dropdown($array, $key, $value) {
// make sure that the capability that was supplied is a valid capability from the drop-down list
if (in_array($value, $array))
return $value;
else // if not, load the old value
return $this->options[$key];
}
function validate_options($input) {
// keys
$validated['public_key'] = trim($input['public_key']); // mailhide public key
$validated['private_key'] = trim($input['private_key']); // mailhide private key
// placement
$validated['use_in_posts'] = ($input['use_in_posts'] == 1 ? 1 : 0); // mailhide for posts/pages
$validated['use_in_comments'] = ($input['use_in_comments'] == 1 ? 1 : 0); // use mailhide for comments
$validated['use_in_rss'] = ($input['use_in_rss'] == 1 ? 1 : 0); // use mailhide for the rss feed of the posts/pages
$validated['use_in_rss_comments'] = ($input['use_in_rss_comments'] == 1 ? 1 : 0); // use mailhide for the rss comments
$capabilities = array('read', 'edit_posts', 'publish_posts', 'moderate_comments', 'activate_plugins');
// bypass levels
$validated['bypass_for_registered_users'] = ($input['bypass_for_registered_users'] == 1 ? 1: 0); // whether to sometimes skip the MailHide filter for registered users
$validated['minimum_bypass_level'] = $this->validate_dropdown($capabilities, 'minimum_bypass_level', $input['minimum_bypass_level']); // who can see full emails normally (should be a valid WordPress capability slug)
// styling
$validated['replace_link_with'] = $input['replace_link_with']; // name the link something else
$validated['replace_title_with'] = $input['replace_title_with']; // title of the link
return $validated;
}
function build_dropdown($name, $keyvalue, $checked_value) {
echo '<select name="' . $name . '" id="' . $name . '">' . "\n";
foreach ($keyvalue as $key => $value) {
if ($value == $checked_value)
$checked = ' selected="selected" ';
echo '\t <option value="' . $value . '"' . $checked . ">$key</option> \n";
$checked = NULL;
}
echo "</select> \n";
}
function capabilities_dropdown() {
// define choices: Display text => permission slug
$capabilities = array(
__('all registered users', 'recaptcha') => 'read',
__('edit posts', 'recaptcha') => 'edit_posts',
__('publish posts', 'recaptcha') => 'publish_posts',
__('moderate comments', 'recaptcha') => 'moderate_comments',
__('activate plugins', 'recaptcha') => 'activate_plugins'
);
$this->build_dropdown('mailhide_options[minimum_bypass_level]', $capabilities, $this->options['minimum_bypass_level']);
}
function mailhide_emails($content) {
global $user_ID;
// set the minimum capability needed to skip the MailHide if there is one
if ($this->options['bypass_for_registered_users'] && $this->options['minimum_bypass_level'])
$needed_capability = $this->options['minimum_bypass_level'];
// skip the MailHide display if the minimum capability is met
// todo: only 'use in comments' is checked, have to check each of them?
// todo: wait, is that necessary? the filter isn't even added if that field is false, removed
if ($needed_capability && current_user_can($needed_capability)) {
// remove the nohides
$content = preg_replace('/\[\/?nohide\]/i','',$content);
return $content;
}
// Regular Expressions thanks to diabolic from EFNet #regex
// match hyperlinks with emails
$regex = '/(?!\[nohide\])<a[^>]*href="((?:mailto:)?([^@"]+@[^@"]+))"[^>]*>(.+?)<\/a>(?!\[\/nohide\])/i';
$content = preg_replace_callback($regex, array(&$this, "replace_hyperlinked"), $content);
// match emails
// this seems to no longer be necessary because wordpress automatically linkifies all plaintext emails
$regex = '/\b([\w.+-]+@[a-z\d.-]+\.[a-z]{2,6})\b(?!\s*\[\/nohide\]|(?:(?!<a[^>]*>).)*<\/a>)/i';
$content = preg_replace_callback($regex, array(&$this, "replace_plaintext"), $content);
// remove the nohides
$content = preg_replace('/\[\/?nohide\]/i','',$content);
return $content;
}
// replace the hyperlinked emails i.e. <a href="haha@lol.com">this</a> or <a href="mailto:haha@lol.com">that</a>
function replace_hyperlinked($matches) {
$html = "";
$email = $matches[2];
$text = $matches[3];
if ($email == $text) {
// employ the use of email parts instead
$html = recaptcha_mailhide_html($this->options['public_key'], $this->options['private_key'], $email);
// style it
$html = '<span class="mh-email">' . $html . "</span>";
}
else {
// get the url, the part inside the href. this is the email of course
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $email);
// construct a new hyperlink with the url hidden but the link text the same
$html = "<a href='" . $url . "' onclick=\"window.open('" . htmlentities ($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\">" . $text . "</a>";
// style it
$html = '<span class="mh-hyperlinked">' . $html . "</span>";
}
return $html;
}
// replace the plain text emails i.e. haha@lol.com
function replace_plaintext($matches) {
if ($this->options['replace_link_with'] == "" && $this->options['replace_title_with'] == "") {
// find plain text emails and hide them
$html = recaptcha_mailhide_html($this->options['public_key'], $this->options['private_key'], $matches[0]);
}
else {
// replace both things
if ($this->options['replace_link_with'] != "" && $this->options['replace_title_with'] != "") {
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $matches[0]);
$html = "<a href='" . htmlentities($url, ENT_QUOTES) .
"' onclick=\"window.open('" . htmlentities($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"" . $this->options['replace_title_with'] . "\">" . $this->options['replace_link_with'] . "</a>";
}
// only replace the link
else if ($this->options['replace_link_with'] != "" && $this->options['replace_title_with'] == "") {
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $matches[0]);
$html = "<a href='" . htmlentities($url, ENT_QUOTES) .
"' onclick=\"window.open('" . htmlentities($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">" . $this->options['replace_link_with'] . "</a>";
}
// only replace the title
else if ($this->options['replace_link_with'] == "" && $this->options['replace_title_with'] != "") {
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $matches[0]);
$emailparts = _recaptcha_mailhide_email_parts ($matches[0]);
$html = htmlentities($emailparts[0], ENT_QUOTES) . "<a href='" . htmlentities($url, ENT_QUOTES) .
"' onclick=\"window.open('" . htmlentities($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"" . $recaptcha_opt['replace_title_with'] . "\">...</a>@" . htmlentities($emailparts[0], ENT_QUOTES);
}
}
// style it
$html = '<span class="mh-email">' . $html . "</span>";
return $html;
}
} // end class declaration
} // end class exists clause
?>
\ No newline at end of file
<?php
if (defined('ALLOW_INCLUDE') === false)
die('no direct access');
?>
<a name="mailhide"></a>
<h2><?php _e('MailHide Options', 'recaptcha'); ?></h2>
<p><?php _e('One common misconception about MailHide is that it edits your email addresses on the database. This is false, your actual content is never actually modified. Instead, it is "filtered" such that it appears modified to the reader.', 'recaptcha'); ?></p>
<form method="post" action="options.php">
<?php settings_fields('mailhide_options_group'); ?>
<h3><?php _e('Authentication', 'recaptcha'); ?></h3>
<p><?php _e('These keys are required before you are able to do anything else.', 'recaptcha'); ?> <?php _e('You can get the keys', 'recaptcha'); ?> <a href="http://mailhide.recaptcha.net/apikey" title="<?php _e('Get your reCAPTCHA API Keys', 'recaptcha'); ?>"><?php _e('here', 'recaptcha'); ?></a>.</p>
<p><?php _e('Be sure not to mix them up! The public and private keys are not interchangeable!'); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Public Key', 'recaptcha'); ?></th>
<td>
<input type="text" name="mailhide_options[public_key]" size="40" value="<?php echo $this->options['public_key']; ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Private Key', 'recaptcha'); ?></th>
<td>
<input type="text" name="mailhide_options[private_key]" size="40" value="<?php echo $this->options['private_key']; ?>" />
</td>
</tr>
</table>
<h3><?php _e('General Options', 'recaptcha'); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Use MailHide in', 'recaptcha'); ?></th>
<td>
<input type="checkbox" id="mailhide_options[use_in_posts]" name="mailhide_options[use_in_posts]" value="1" <?php checked('1', $this->options['use_in_posts']); ?> />
<label for="mailhide_options[use_in_posts]"><?php _e('Posts and Pages', 'recaptcha'); ?></label><br />
<input type="checkbox" id="mailhide_options[use_in_comments]" name="mailhide_options[use_in_comments]" value="1" <?php checked('1', $this->options['use_in_comments']); ?> />
<label for="mailhide_options[use_in_comments]"><?php _e('Comments', 'recaptcha'); ?></label><br />
<input type="checkbox" id="mailhide_options[use_in_rss]" name="mailhide_options[use_in_rss]" value="1" <?php checked('1', $this->options['use_in_rss']); ?> />
<label for="mailhide_options[use_in_rss]"><?php _e('RSS Feed of Posts and Pages', 'recaptcha'); ?></label><br />
<input type="checkbox" id="mailhide_options[use_in_rss_comments]" name="mailhide_options[use_in_rss_comments]" value="1" <?php checked('1', $this->options['use_in_rss_comments']); ?> />
<label for="mailhide_options[use_in_rss_comments]"><?php _e('RSS Feed of Comments', 'recaptcha'); ?></label><br />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Target', 'recaptcha'); ?></th>
<td>
<input type="checkbox" id="mailhide_options[bypass_for_registered_users]" name="mailhide_options[bypass_for_registered_users]" value="1" <?php checked('1', $this->options['bypass_for_registered_users']); ?> />
<label for="mailhide_options[bypass_for_registered_users]"><?php _e('Show actual email addresses to Registered Users who can', 'recaptcha'); ?></label>
<?php $this->capabilities_dropdown(); ?>
</td>
</tr>
</table>
<h3><?php _e('Presentation', 'recaptcha'); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Replace Link With', 'recaptcha'); ?></th>
<td>
<input type="text" name="mailhide_options[replace_link_with]" size="70" value="<?php echo $this->options['replace_link_with']; ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Replace Title With', 'recaptcha'); ?></th>
<td>
<input type="text" name="mailhide_options[replace_title_with]" size="70" value="<?php echo $this->options['replace_title_with']; ?>" />
</td>
</tr>
</table>
<h3><?php _e('Styling', 'recaptcha'); ?></h3>
<p>You can style hidden emails using a variety of classes. Style the classes in your theme's stylesheet and be sure to clear any caches you might have to see the results.</p>
<ul>
<li><strong>.mh-email</strong> is assigned to the complete email</li>
<li><strong>.mh-first</strong> is assigned to the first part of the email</li>
<li><strong>.mh-middle</strong> is assigned to the middle of the email (the link)</li>
<li><strong>.mh-last</strong> is assigned to the last part of the email</li>
</ul>
<p>The following is an example of the structure:</p>
<code>
&lt;span class=&quot;mh-email&quot;&gt; <br \>
&nbsp;&nbsp;&nbsp; &lt;span class=&quot;mh-first&quot;&gt;jorg&lt;/span&gt; <br \>
&nbsp;&nbsp;&nbsp; &lt;a href=&quot;url&quot; class=&quot;mh-middle&quot;&gt;...&lt;/a&gt; <br \>
&nbsp;&nbsp;&nbsp; &lt;span class=&quot;mh-last&quot;&gt;@gmail.com&lt;/span&gt; <br \>
&lt;/span&gt;
</code>
<p class="submit"><input type="submit" class="button-primary" title="<?php _e('Save MailHide Options') ?>" value="<?php _e('Save MailHide Changes') ?> &raquo;" /></p>
</form>
\ No newline at end of file
=== Plugin Name ===
Contributors: recaptchanet
Tags: comments, registration, recaptcha, antispam, captcha
Requires at least: 2.7
Tested up to: 2.9.1
Stable tag: 4.1
Integrates reCAPTCHA anti-spam methods with WordPress including comment and registration spam protection.
== Description ==
What is reCAPTCHA?
reCAPTCHA is a free CAPTCHA service that protects your site against spam, malicious registrations and other forms of attacks where computers try to disguise themselves as a human; a CAPTCHA is a Completely Automated Public Turing test to tell Computers and Human Apart. reCAPTCHA comes in the form of a widget that you can easily add to your blog, forum, registration form, etc.
In addition to protecting your site, reCAPTCHA also helps us digitize old books and newspapers, transcribe street numbers and solve hard AI problems. [Learn how reCAPTCHA works](http://www.google.com/recaptcha) and join our [forum](https://groups.google.com/forum/#!forum/recaptcha).
== Installation ==
To install in regular WordPress and [WordPress MultiSite](http://codex.wordpress.org/Create_A_Network):
1. Upload the `wp-recaptcha` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the `Plugins` menu in WordPress
3. Get the reCAPTCHA keys [here](https://www.google.com/recaptcha/admin#whyrecaptcha).
== Requirements ==
* You need the reCAPTCHA keys [here](https://www.google.com/recaptcha/admin#whyrecaptcha).
* Your theme must have a `do_action('comment_form', $post->ID);` call right before the end of your form (*Right before the closing form tag*). Most themes do.
== ChangeLog ==
= Version 4.0
* Upgrade to reCAPTCHA V2.
* Increase supported languages to 40+.
= Version 3.2
* Transferred ownership back to Google
= Version 3.1.6 =
* WordPress MS fixes. Should now work out of the box at the individual blog level. Thanks to [huyz](http://huyz.us/)
* NOTICE: If anyone is interested in taking up development of this plugin, please contact me at blaenk@gmail.com.
= Version 3.1.5 =
* Thanks to [Ken Newman](https://github.com/WraithKenny) for these changes
* Update author website
* Stop generating javascript errors on unnecessary pages
* Better SSL support
= Version 3.1.4 =
* Fixed an XSS vulnerability
= Version 3.1.3 =
* Added a collision aversion prefix to the Plugin class. bbouton from github alerted me to a collision between WP-reCAPTCHA's plugin class and the JW Player Plugin's Plugin class.
= Version 3.1.2 =
* Fixed option migration. The plugin was actually written to be made to import the old options, but the hook that functionality was registered to does not fire when the wordpress interface updates a plugin, only when a plugin is updated manually. Now the plugin will import or register default options as long as the options don't already exist.
* Fixed a case where recaptcha theme would not change. This happened because of the above problem, creating a situation in which the tab index field could be empty, and being empty this then caused a problem with the recaptcha options when they were output to the page. If you're running version 3.0 of the plugin, go ahead and add a number to the tab index (e.g. 5 for comments, 30 for registration), if not, this plugin should automatically fix it next time you change save the settings.
* Modified the options page submit buttons to more explicitly show that they are specific to their own respective sections, that is, one button ONLY saves the changes for one reCAPTCHA, and the other ONLY saves the changes for MailHide.
= Version 3.0 =
* Rewrote the entire plugin in an object-oriented manner with separation of concerns in mind to increase maintainability and extensibility
* Implemented the ability to import the options from the option set of older versions of the plugin, such as 2.9.8.2 and less
* Redesigned the options page for the plugin, now using newer wordpress options/form functionality with support for input-validation
* Options for recaptcha and mailhide are independent of each other
* Added support for localization, using gettext
* Fixed the issue where comments would not be saved if the reCAPTCHA was entered incorrectly (or not entered at all). requires javascript
* Fixed an issue where saved comments (from bad reCAPTCHA response) would replace double quotes with backslashes
* Fixed an issue in wordpress 3 and above in which mailhide would not work due to interference with a new filter, make_clickable, which auto-links emails and URLs
* Fixed a role-check issue in wordpress 3 and above. level_10 (and all levels for that matter) have been deprecated. now using activate_plugins instead.
= Version 2.9.8.2 =
* Fixed a bug with WordPress 3.0 Multi-Site
= Version 2.9.8 =
* Added support for WordPress 3.0 Multi-Site thanks to Tom Lynch
= Version 2.9.7 =
* Fixed a relatively new [critical bug](http://www.blaenkdenum.com/2010/03/recaptcha-marking-all-comments-as-spam/) which marked new comments as spam regardless of reCAPTCHA response
= Version 2.9.6 =
* Fixed a careless bug affecting custom hidden emails
* Fixed broken links in readme.txt
= Version 2.9.5 =
* Added flexibility to the enabling of MailHide. Can now separately choose to enable/disable MailHide for posts/pages, comments, RSS feed of posts/pages, and RSS feed of comments
* Fixed an ['endless redirection' bug](http://wordpress.org/support/topic/245154?replies=1 "endless redirection in wp-reCAPTCHA options form") thanks to Edilton Siqueira
* Fixed a bug in WPMU where wp-admin/user-new.php kept trying to validate the user registration with reCAPTCHA information despite not having shown the reCAPTCHA form, thanks to [Daniel Collis-Puro](http://blogs.law.harvard.edu/ "Weblogs at Harvard Law School") for letting me know
* Added a line break after the reCAPTCHA form to add some padding space between it and the submit button. Due to [popular demand](http://www.chriscredendino.com/2009/03/08/adding-space-between-recaptcha-and-the-comment-submit-button-on-wordpress/ "Adding space between reCAPTCHA and the comment Submit Button on WordPress")
* Fixed a validation problem where a style attribute was missing. Thanks to [nv1962](http://wordpress.org/support/profile/304093 "nv1962's profile")
* Public and Private keys are now trimmed since they are usually pasted from the recaptcha site, to avoid any careless errors
* Fixed the regular expressions for matching the emails, email@provider.co.uk type emails now work
= Version 2.9.4 =
* Fixed a bug where the comment would not be saved if the CAPTCHA wasn't entered correctly. Thanks to Justin Heideman.
= Version 2.9.3 =
* Fixed the `recaptcha_wp_saved_comment` function. Thanks to Tomi M.
= Version 2.9.2 =
* 'Beautified' the options page.
* Added two options to allow users to enter their own custom error messages. Also good for foreign language support.
* Fixed a conflict bug with the OpenID plugin where the reCAPTCHA form would show under the OpenID section in the registration form.
* Added two new options which allow one to choose the text to be shown for all hidden Emails and/or the title of the link.
* Fixed a 'Could not open socket' error in recaptchalib.php. [Bug ID 26](http://code.google.com/p/recaptcha/issues/detail?id=26 "recaptchalib.php: Could not open socket (Fix included)")
* Fixed a WPMU issue where blog registrations weren't possible due to a redirection to the first step in the registration process. Thanks to [Edward](http://yisheng.wordpress.com/2008/08/14/wp-recaptcha-for-wpmu-26/ "Edward").
= Version 2.9.1 =
* Forgot that if you can see emails in their true form, then you shouldn't have to see the [nohide][/nohide] tags either. Fixed.
= Version 2.8.6 =
* Administration interface is now integrated with 2.5's look and feel. Thanks to [Jeremy Clarke](http://simianuprising.com/ "Jeremy Clarke").
* Users can now have more control over who sees the reCAPTCHA form and who can see emails in their true form (If MailHide is enabled). Thanks to [Jeremy Clarke](http://simianuprising.com/ "Jeremy Clarke").
* Fixed a very stupid (**One character deal**) fatal error on most Windows Servers which don't support short tags (short_open_tag). I'm speaking of the so called 'Unexpected $end' error.
* Accommodated for the fact that in +2.6 the wp-content folder can be anywhere.
== Frequently Asked Questions ==
= HELP, I'm still getting spam! =
There are four common issues that make reCAPTCHA appear to be broken:
1. **Moderation Emails**: reCAPTCHA marks comments as spam, so even though the comments don't actually get posted, you will be notified of what is supposedly new spam. It is recommended to turn off moderation emails with reCAPTCHA.
1. **Akismet Spam Queue**: Again, because reCAPTCHA marks comments with a wrongly entered CAPTCHA as spam, they are added to the spam queue. These comments however weren't posted to the blog so reCAPTCHA is still doing it's job. It is recommended to either ignore the Spam Queue and clear it regularly or disable Akismet completely. reCAPTCHA takes care of all of the spam created by bots, which is the usual type of spam. The only other type of spam that would get through is human spam, where humans are hired to manually solve CAPTCHAs. If you still get spam while only having reCAPTCHA enabled, you could be a victim of the latter practice. If this is the case, then turning on Akismet will most likely solve your problem. Again, just because it shows up in the Spam Queue does NOT mean that spam is being posted to your blog, it's more of a 'comments that have been caught as spam by reCAPTCHA' queue.
1. **Trackbacks and Pingbacks**: reCAPTCHA can't do anything about pingbacks and trackbacks. You can disable pingbacks and trackbacks in Options > Discussion > Allow notifications from other Weblogs (Pingbacks and trackbacks).
1. **Human Spammers**: Believe it or not, there are people who are paid (or maybe slave labor?) to solve CAPTCHAs all over the internet and spam. This is the last and rarest reason for which it might appear that reCAPTCHA is not working, but it does happen. On this plugin's [page](http://www.blaenkdenum.com/wp-recaptcha/ "WP-reCAPTCHA - Blaenk Denum"), these people sometimes attempt to post spam to try and make it seem as if reCAPTCHA is not working. A combination of reCAPTCHA and Akismet might help to solve this problem, and if spam still gets through for this reason, it would be very minimal and easy to manually take care of.
= Why am I getting Warning: pack() [function.pack]: Type H: illegal hex digit?
You have the keys in the wrong place. Remember, the reCAPTCHA keys are different from the MailHide keys. And the Public keys are different from the Private keys as well. You can't mix them around. Go through your keys and make sure you have them each in the correct box.