WordPress.org

Plugin Directory

Simple reCAPTCHA

Add Google's reCAPTCHA to any custom form.

What this plugin does

Provide a function to add reCAPTCHA to any custom form.

What this plugin does NOT do

Add reCAPTCHA to standard WordPress forms like logins or comments. For that, try Google Captcha by BestWebSoft.

Features

  • A single lightweight module for use by other plugins and themes.
  • Store the reCAPTCHA keys in one place, independent of any other plugin or theme.
  • Display and validate the reCAPTCHA with a few lines of code.
  • Four themes by Google (Red, White, BlackGlass, and Clean).
  • Multisite compatible.

This plugin has room to grow and all ideas and feedback are welcome.

How to use

Step 1. Enter your reCAPTCHA keys in Settings > Simple reCAPTCHA.

Step 2. Add the reCAPTCHA box to your form:

<?php
// is Simple reCAPTCHA active?
if ( function_exists( 'wpmsrc_display' ) ) { 
    echo wpmsrc_display();
}
?>

Step 3. Check the reCAPTCHA response in your server-side form validation:

<?php
// is Simple reCAPTCHA active?
if ( function_exists( 'wpmsrc_check' ) ) {

    // check for empty user response first (optional)
    if ( empty( $_POST['recaptcha_response_field'] ) ) {
    
        $errors['captcha'] = __( 'Please complete the CAPTCHA.', 'yourtextdomain' );
    
    } else {
    
        // check captcha
        $response = wpmsrc_check();
        if ( ! $response->is_valid ) {
            $errors['captcha'] = __( 'The CAPTCHA was not entered correctly. Please try again.', 'yourtextdomain' );
            // $response['error'] contains the actual error message, e.g. "incorrect-captcha-sol"
        }
        
    }
    
}
?>

Translations

Since version 0.6:

Can you help? Contact me.

Requires: 3.0 or higher
Compatible up to: 4.2.2
Last Updated: 2015-4-22
Active Installs: 500+

Ratings

5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1
100,1,1 100,3,3
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1