pfeifferNet

Captcha
in package

Provides functionality to use Google reCAPTCHA V3.

Tags
since
1.0.0
since
5.5.0

Inherit standard singleton class.

since
5.11.0

Deprecated global singleton.

since
6.0.0

Use explicit notice, rather than floating badge.

used-by
Form_Contact::__construct()
used-by
Form_Register::__construct()

Table of Contents

Constants

GOOGLE_PRIVACY_URL  = 'https://policies.google.com/privacy'
Google privacy policy URL.
GOOGLE_TERMS_URL  = 'https://policies.google.com/terms'
Google terms of service URL.
RECAPTCHA_NOTICE  = 'recaptcha-notice.php'
Required Google reCaptcha notice partial.
VERIFY_URL  = 'https://www.google.com/recaptcha/api/siteverify'
Google reCAPTCHA verification script URL.

Properties

$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$recaptcha_notice  : string
The fully qualified path to the Google reCAPTCHA required notice.
$secret_key  : string
Google reCAPTCHA secret key.
$threshold  : float
Google reCAPTCHA score threshold.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
get_notice()  : string
Get the required reCAPTCHA notice.
verify()  : WP_Error
Verify the reCAPTCHA response.
__construct()  : void
Initialise the class and set its properties.

Constants

GOOGLE_PRIVACY_URL

Google privacy policy URL.

protected string GOOGLE_PRIVACY_URL = 'https://policies.google.com/privacy'
Tags
since
6.0.0

GOOGLE_TERMS_URL

Google terms of service URL.

protected string GOOGLE_TERMS_URL = 'https://policies.google.com/terms'
Tags
since
6.0.0

RECAPTCHA_NOTICE

Required Google reCaptcha notice partial.

protected string RECAPTCHA_NOTICE = 'recaptcha-notice.php'
Tags
since
6.0.0

VERIFY_URL

Google reCAPTCHA verification script URL.

protected string VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'
Tags
since
5.3.0

Properties

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

$recaptcha_notice

The fully qualified path to the Google reCAPTCHA required notice.

protected string $recaptcha_notice = ''
Tags
since
6.0.0

$secret_key

Google reCAPTCHA secret key.

protected string $secret_key = ''
Tags
since
6.3.0

$threshold

Google reCAPTCHA score threshold.

protected float $threshold = 0.5
Tags
since
1.4.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

verify()

Verify the reCAPTCHA response.

public verify(WP_Error $errors, array<string|int, string> $post_vars, array<string|int, string> $server_vars, string $data_action) : WP_Error
Parameters
$errors : WP_Error

The WP_Error object to filter.

$post_vars : array<string|int, string>

The sanitised $_POST arguments.

$server_vars : array<string|int, string>

The sanitised $_SERVER arguments.

$data_action : string

The data-action attribute sent to reCAPTCHA.

Tags
since
1.0.0
since
5.10.0

Renamed function and improved error andling.

Return values
WP_Error

The maybe modified WP_Error object.

__construct()

Initialise the class and set its properties.

protected __construct() : void
Tags
since
1.0.0
since
6.3.0

Use the Settings class.

uses
Settings
uses
Settings::get()

        
On this page

Search results