recaptcha icon indicating copy to clipboard operation
recaptcha copied to clipboard

Why would my V2 validation fail?

Open razzerar opened this issue 4 years ago • 8 comments

I have had reCAPTCHA V2 on my contact form for 1 year without a problem. Now since 5-7 days it has stopped working and i don't now why, all responses fail all of a sudden. I have done 0 changes on the site or any of the files for several months. If you tick the checkmark in the ReCaptacha box you will get the error "Validation Required!" which is the response given if the validation should fail as you can see in the code bellow.

Anyone got any idea why it would stop working just out of the blue when 0 changes has been done? I have had 10 different people try to use the contact form but everyone get's "Validation Required!" as an error.

Can recaptacha get blocked by the server firewall or something?

    //reCAPTCHA validation
    if (isset($_POST['g-recaptcha-response'])) {

            require('component/recaptcha/src/autoload.php');

            $recaptcha = new \ReCaptcha\ReCaptcha(SECRET_KEY, new \ReCaptcha\RequestMethod\SocketPost());

            $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);

              if (!$resp->isSuccess()) {
                            $output = json_encode(array('type'=>'error', 'text' => '<b>Captcha</b> Validation Required!'));
                            die($output);
              }
    }

razzerar avatar Apr 06 '20 17:04 razzerar

I'm having exactly the same problem :-(

jackmalago avatar Apr 12 '20 14:04 jackmalago

Make sure you don't use www for non-www recaptcha.

b00f avatar Apr 13 '20 08:04 b00f

the same problem, only the error is different ... Someone got into the codes on Google.

l2toplist avatar Apr 24 '20 19:04 l2toplist

me too but for me it only works locally :/

l1444 avatar May 13 '20 14:05 l1444

same issue here

inet45 avatar Jun 03 '20 05:06 inet45

Same issue here.

Coop920 avatar Jun 03 '20 18:06 Coop920

I pushed an update back in March, could you verify you're on the latest version of the library and if that fixes the issue?

rowan-m avatar Aug 14 '20 11:08 rowan-m

same issue. in local works. but in server error validation.

alimkinpark avatar Aug 15 '20 17:08 alimkinpark