Contact Form 7 5.4 tries to load rCaptcha V3 instead of V2
-
Hi,
Contact Form 7: 5.4
ReCaptcha v2 for Contact Form 7: 1.3.2
WordPress: 5.6.2ReCaptcha version set to v2, source google
integration fine (worked before the update)I see that iqfix_wpcf7_recaptcha_form_tag_handler hooked to wpcf7_init and called before iqfix_wpcf7_recaptcha_enqueue_scripts registers the script in:
wp_register_script( ‘google-recaptcha’, $url, array( ‘wpcf7-recaptcha-controls’ ), ‘2.0’, true );And iqfix_wpcf7_recaptcha_form_tag_handler tries to enque google-recaptcha script so first checks if it is registered in this if statement
if ( ! wp_script_is( ‘google-recaptcha’, ‘registered’ ) && function_exists( ‘wpcf7_recaptcha_enqueue_scripts’ ) ) {
wpcf7_recaptcha_enqueue_scripts();
}
it has not been registered that time so evaluates true and executes
wpcf7_recaptcha_enqueue_scripts();
from wpcf7 which tries to load V3 with the V2 site key that results in a 400 Bad Request error.If I register with iqfix_wpcf7_recaptcha_enqueue_scripts before the if statement or call iqfix_wpcf7_recaptcha_enqueue_scripts in the if statement it loads the V2 without error.
I do not know if there is a local problem on my side or there is a bug in the plugin, so any feedback is appriciated.
Thank you.
- The topic ‘Contact Form 7 5.4 tries to load rCaptcha V3 instead of V2’ is closed to new replies.