Can’t submit form after enabling reCAPTCHA v3
-
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
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.