Invisible reCaptcha

By BerryPress

★ 4.3/5 (133 ratings)70,000+ active installationsVersion 1.3.4

Use reCaptcha v2 by Google to combat spam at your login and registration forms, WooCommerce account forms, contact forms, and more!

Description

Invisible reCaptcha for WordPress is an extremely powerful plugin which integrates the new Invisible reCaptcha by Google with your WordPress site.

Notice: As of version 1.3.0, this plugin is now maintained by @berrypress.

External service disclosure

This plugin is designed to integrate reCAPTCHA by Google into your site, which is an external third-party service used to implement security and fraud prevention measures. The plugin may communicate with the reCAPTCHA service via API and/or by loading assets on your site’s frontend, resulting in data transfer with the reCAPTCHA service when the site frontend is accessed and/or when reCAPTCHA validation is triggered by to user actions. In addition to authentication and operational data such as API keys and reCAPTCHA identifiers, the service may receive information from your and your users’ browser and network, such as their IP address, user agent, etc.

Use of the reCAPTCHA service is subject to the Google Cloud Terms of Service, Service Specific Terms, Google Privacy Policy, and the Cloud Data Processing Addendum.

This plugin is not affiliated with or endorsed by Google.

Summary of features

WordPress Invisible reCaptcha

- Login form protection - annihilates Brute Force attacks
- Registration form protection
- Comments form protection
- Forgot Password form protection

WooCommerce Invisible reCaptcha

- Login form protection
- Registration form protection
- Product Review form protection
- Lost Password form protection
- Reset Password form protection

Contact Form 7 Invisible reCaptcha
– Protect your Contact Form 7 forms with Invisible reCaptcha

Gravity Forms Invisible reCaptcha
– Protect your Gravity Forms with Invisible reCaptcha

Ultra Community Invisible reCaptcha
– Login form protection
– Registration form protection

BuddyPress Invisible reCaptcha
– Protect your BuddyPress registration form with Invisible reCaptcha

Compatibility

On a WP Multisite you can either activate the plugin network wide or on a single site.

How-To

Check out the Invisible reCAPTCHA v2 Guide: https://developers.google.com/recaptcha/docs/invisible

  1. Create a reCAPTCHA v2 site using the Invisible reCAPTCHA badge option: https://www.google.com/recaptcha/admin/create
  2. Copy the Site Key and Secret Key from the Google reCAPTCHA admin console.
  3. In WordPress, go to BerrySecure > Invisible reCaptcha.
  4. Enter your Site Key and Secret Key.
  5. Save the settings.
  6. In the settings, choose which forms should be protected by reCAPTCHA.
  7. Visit a page containing a protected form and verify that the reCAPTCHA badge is displayed and that form submissions are working correctly.

Extending Invisible reCaptcha

Here are some useful hooks to help developers integrate Invisible reCaptcha with any plugin or custom form

Actions

- google_invre_render_widget_action - renders the recaptcha widget

Filters

- google_invre_is_valid_request_filter   - used to check if Google approved the request (returns bool true/false)
- google_invre_widget_output_html_filter - used to change the recaptcha widget output
- google_invre_language_code_filter      - used to change the badge/challenge language code
- google_invre_badge_position_filter     - used to change the badge position (possible returning values are: 'bottomright', 'bottomleft', 'inline')
- google_invre_ajax_submit_classnames    - used to change the CSS class names of submit buttons that trigger reCaptcha on AJAX forms (default: array('wpcf7-submit', 'invisible-recaptcha-do-submit'))
- google_invre_is_gf_excluded            - used to exclude a Gravity Forms form from protection (receives bool $is_excluded and int $form_id)

Constants (wp-config.php)

- INVISIBLE_RECAPTCHA_OVERRIDE - define as true to treat every request as valid (e.g. automated tests, staging) or as false to treat every request as invalid. Leave undefined for normal behavior.

Examples of using Invisible reCaptcha hooks

  • Add Invisible reCaptcha into any form

    Just call
    do_action(‘google_invre_render_widget_action’);
    anywhere before form closing tag

  • Validate form post request

    $is_valid = apply_filters(‘google_invre_is_valid_request_filter’, true);
    if( ! $is_valid )
    {
    // handle error here
    }
    else
    {
    // continue with your logic
    }

  • Change the badge/challenge language code

    add_filter( ‘google_invre_language_code_filter’, ‘myprefix_change_recaptcha_language’ );
    function myprefix_change_recaptcha_language($language_code){
    $language_code = ‘fr’; // French
    return $language_code;
    }

See all reCaptcha Language Codes

Note: This plugin requires PHP 7.1 or higher to be activated.

Important Upgrade Notice

View full changelog below.

1.3.2

  • Requires PHP 7.1 or newer. Fixes the conflict with two-factor authentication plugins, adds support for wp_login_form(), and fixes several issues with Contact Form 7, Gravity Forms and WooCommerce.

1.3.1

  • Maintenance release requiring PHP 7.0 or newer, updating WordPress compatibility metadata, external service disclosure, and setup documentation while removing inactive code.

1.3.0

  • In accordance with current best practices, the custom CSS feature is no longer supported in this plugin. Before updating to v1.3.0+, make a copy of any custom CSS you have defined in Invisible Recaptcha settings, and use a different method to load it on the frontend of your site.

Changelog

1.3.4

  • Gravity Forms: when an entry is marked as spam because reCAPTCHA failed, an entry note now records the reason (for example a missing token, a Google error or a rejected token).
  • Redesigned admin screens using the BerryPress admin framework: the settings now live under the BerrySecure menu with tabs, plus a LoginBerry page.
  • Hardened the Google response handling: the HTTP status code is checked, invalid JSON no longer triggers warnings, and the returned error codes are sanitized.
  • Added a dismissable Black Friday promotion notice to the plugin’s admin pages.

1.3.3

  • Fixed forms being marked as spam with a missing reCAPTCHA token on the second submit: the widget is now rendered again when a form is replaced or added after the page loads (Gravity Forms AJAX validation errors, multi-page forms and confirmations, popups and page builders).
  • A failure while rendering one form no longer disables reCAPTCHA for the other forms on the page.

1.3.2

  • Fixed conflict with two-factor authentication plugins (Wordfence, Two Factor and others): the second step of the login no longer requires a new reCAPTCHA token. A short-lived hash tied to the user is issued once reCAPTCHA has passed.
  • Added support for wp_login_form() via the login_form_bottom filter.
  • Added the INVISIBLE_RECAPTCHA_OVERRIDE constant to force the validation result from wp-config.php.
  • Added the google_invre_ajax_submit_classnames filter to customize the submit button class names used for AJAX forms.
  • Contact Form 7 and Gravity Forms: reCAPTCHA is now placed at the bottom of the form, and an existing spam verdict is no longer overridden by a valid token.
  • WooCommerce: earlier validation errors on login, registration and password reset are no longer overridden.
  • Fixed the reCAPTCHA widget being rendered for the wrong form when forms are nested.
  • Fixed a fatal error (infinite recursion) when Contact Form 7 protection was enabled.
  • Fixed Undefined property: WP_Error::$ID warnings when a login was rejected.
  • PHP 8.x: removed the spl_autoload_register() deprecation notices and the dynamic property deprecations.
  • Fixed a possible TypeError on the settings page when no page object is available.
  • Minimum supported PHP version is now 7.1.
  • Updated “Tested up to” to WordPress 7.1.

1.3.1

  • Removed inactive WooCommerce checkout protection code (commit details).
  • Removed unused licensing and external module-loading infrastructure.
  • Declared PHP 7.0 as the minimum supported PHP version.
  • Updated WordPress compatibility metadata.
  • Added a link to the Google Privacy Policy to the external service disclosure.
  • Corrected the setup documentation to specify Invisible reCAPTCHA v2.

1.3.0

  • PHP 8 compatibility
  • Removed the custom CSS feature

1.2.3

1.2.2

  • Fixed the compatibility with WPML 4.x – the multilingual WordPress plugin

1.2.1

1.2

1.1

  • Fixed PHP wrong Namespace issue
  • Fixed PHP warning when contact forms settings were saved for the first time
  • Moved Plugin Menu to Settings
  • Fixed PHP warning when contact forms settings were saved for the first time
  • Moved Plugin Menu to Settings

1.0.8

1.0.6

  • Fixed WooCommerce login and registration issue
  • Added Invisible reCaptcha for BuddyPress

1.0.5

  • Fixed Contact Form 7 issue reported by @silvercode
  • Added Invisible reCaptcha for Gravity Forms

1.0.4

  • Multisite compatible
  • Network interface ready
  • Fixed PHP7 warning

1.0.3

  • Added WordPress hooks for custom forms/plugins integrations

1.0.2

  • Added Badge Position option
  • Added Badge Custom CSS option
  • Added Language option

1.0.1

  • Fixed the Strict Standards Warning on PHP 5.4+

1.0

  • Initial release