Can’t submit form after enabling reCAPTCHA v3

[ad_1]

Messages marked as SPAM: There was an error trying to send your message. Please try again later.

WordPress Version 6.6.2

Contact Form Version 5.9.8

Looks like plugin is using outdated API version/endpoints.

Here’s what I see in the code:

        public function verify( $token ) {
$is_human = false;

if ( empty( $token ) or ! $this->is_active() ) {
return $is_human;
}

$endpoint="https://www.google.com/recaptcha/api/siteverify";

if ( apply_filters( 'wpcf7_use_recaptcha_net', false ) ) {
$endpoint="https://www.recaptcha.net/recaptcha/api/siteverify";
}

$sitekey = $this->get_sitekey();
$secret = $this->get_secret( $sitekey );

$request = array(
'body' => array(
'secret' => $secret,
'response' => $token,
),
);

Here’s what I see in the API DOCs:

request body:

{
"event": {
"token": "TOKEN",
"expectedAction": "USER_ACTION",
"siteKey": "****************************",
}
}

Endpoint:

https://recaptchaenterprise.googleapis.com/v1/projects/<PROJECT NAME>/assessments?key=API_KEY

Apparently endpoints in the code are different (and lacking project name in configuration)

Looks like “secret” JSON key should be renamed to “siteKey”, “expectedAction” JSON key is also seem to be missing from request body.

Here’s what I see in Google API console: https://imgur.com/a/iUUdqHM

  • This topic was modified 13 hours, 33 minutes ago by pavelsg.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer