• Resolved Anonymous User 18721493

    (@anonymized-18721493)


    Hello Jordy!

    Using PHP 8.0

    The plugin keeps throwing this erros in my log:

    [02-Nov-2022 09:36:51 UTC] PHP Warning: Undefined property: stdClass::$score in /home/arquisp/public_html/wp-content/plugins/contact-form-block/classes/addons/recaptcha_v3.php on line 52
    [02-Nov-2022 15:57:14 UTC] PHP Warning: Undefined property: stdClass::$score in /home/arquisp/public_html/wp-content/plugins/contact-form-block/classes/addons/recaptcha_v3.php on line 52

    I’m using the recaptcha add-on, and it seems that i am not having any problems receiving messages.

    Any idea on that? Should I ignore these warnings?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @osaopaulo,

    I am not sure it’s a good news though; it seems like ReCaptcha is not returning the result, and it’s ignored.

    What happens if you replace this:

    
    if ( $recaptcha->score >= 0.5 )
      return $error;
    

    By this:

    if ( property_exists( $recaptcha, 'score' ) ) {
    	if ( $recaptcha->score >= 0.5 ) {
    		return $error;
    	}
    }
    else {
    	error_log( "The 'score' property was not returned by Google ReCaptcha. This is what was received instead: " . print_r( $recaptcha, true ) );
    }

    `

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin throwing PHP errors’ is closed to new replies.