Do you have a link to the site in question? It sounds like there’s other reCAPTCHA in play somehow, and we’d like to see if we can identify how.
Hello –
Yep, here is one of them:
https://www.youngslandscape.com/contact/
There is a Caldera Forms contact form on the page that is supposed to have recaptcha but since there is a CC Newsletter Sign up form in the right sidebar, this JS error is preventing the recaptcha from rendering on the other form. This was working (probably previous to this last update), may have to roll back to 1.8.5 to see.
Thanks
Hello –
Nope, does the same thing in 1.8.5 as well. Not sure why it is trying to use recaptcha if it is not enabled for the plugin or why it is trying to force someone to use it. This doesn’t seem right at all.
At what point was the “Spam Control” introduced into the plugin because if you can’t provide a quick fix for this, I may have to roll back to the version before it was added.
Thanks
Confirming that I’m seeing this output in the code, which is a little odd because last I knew, we intended to only load parts when needed.
<script type='text/javascript' src='https://www.youngslandscape.com/wp-content/plugins/constant-contact-forms/assets/js/ctct-plugin-recaptcha-v2.min.js'></script>
Will get back to you with a bit more shortly.
Hello –
Same error is showing on 3 other sites we maintain for clients. Hopefully you can fix this soon.
Can you try dropping this code into one of the sites in question?
function ctct_support_remove_recaptcha_v2() {
$recaptcha_base = new ConstantContact_reCAPTCHA();
if ( ! $recaptcha_base::has_recaptcha_keys() ) {
wp_dequeue_script('recaptcha-v2');
wp_dequeue_script('recaptcha-lib-v2');
}
}
add_action( 'wp_enqueue_scripts', 'ctct_support_remove_recaptcha_v2' );
What the code will do is check if the site has some reCAPTCHA keys set in the options, and if NOT, then it’ll remove the 2 javascript files from loading in the end. If there are keys, then it will.
It’s hard to call it a bug because technically things are running as they should. However, I was mistaken in that we were enqueuing only when needed, and I’ll be filing an internal issue to look into changing that.
Hello –
That seems to have done the trick. Thanks for the fix.
Thanks for confirming. Hopefully we’ll have a release out soon that doesn’t require this custom code for you.