• Resolved alphavisual

    (@alphavisual)


    WP Security > Brute Force > Login Captcha

    I am using reCAPTCHA v2 invisible option. If I tick “Use Google reCAPTCHA as default” and have ticked “Login Form Captcha Settings”, “Custom Login Form Captcha Settings” and “Lost Password Form Captcha Settings” then I get the following JS Error….

    “Uncaught Error: reCAPTCHA placeholder element must be an element or id” . in file recaptcha_en.js line 508. Sometimes this seems to be intermittent so to repeat use incognito browser mode.

    If I untick “Use Google reCAPTCHA as default” which reverts to plain maths the javascript error goes away.

    I also have Elementor pro and this has reCAPTCHA in the forms, however there are no JavaScript errors when Elementor pro reCAPTCHA is running on it’s own.

    I currently have “Use Google reCAPTCHA as default” unticked so that the JavaScript error does not occur, however I would like to use this feature in the future so please let me know if you know how to fix it.

    Thanks heaps

    • This topic was modified 5 years, 11 months ago by alphavisual.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi,

    “Uncaught Error: reCAPTCHA placeholder element must be an element or id” . in file recaptcha_en.js line 508. Sometimes this seems to be intermittent so to repeat use incognito browser mode.

    recaptcha_en.js file does not belong to our plugin. Do you know if it belongs to another plugin or your theme?

    Kind regards

    Thread Starter alphavisual

    (@alphavisual)

    The only other reCatcha that I have is with the builder Elementor. I only see the JS error when I have “Use Google reCAPTCHA as default” ticked and use Chrome incognito or it’s a fresh page load. On subsequent page loads the JS error goes away and there is a console log message that says …

    recaptcha__en.js:514 “reCAPTCHA couldn’t find user-provided function: onloadCallback”

    So there might be a code loading order issue perhaps. e.g initial page load the file hasn’t loaded and then subsequently the file is browser cached.

    If I remove the reCaptch on Elementor I still get this JS error when I tick “Use Google reCAPTCHA as default”.

    This plugin is amazing by the way. You guys have done a nice job of it.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, I guess this might be a unique issue between AIOWPS and Elementor when Google reCAPTCHA is enabled. Perhaps you might also like to get in contact with the developers of Elementor. See if they can come up with a solution.

    Let me know what they say.

    Thank you

    • This reply was modified 5 years, 11 months ago by mbrsolution.
    • This reply was modified 5 years, 11 months ago by mbrsolution.

    Hello,

    Same here, can you update to v3? I can’t use contact form 7 (last version with v3 api) and login option. ??

    Plugin Contributor mbrsolution

    (@mbrsolution)

    @templatetuners, can you start a new support ticket.

    Thank you

    I just ran in to this as well, I think the problem has to do with the WooCommerce reCAPTCHAs. In classes/wp-security-wp-footer-content.php lines 38-43 are always attempting to initialize reCAPTCHAs for #woo_recaptcha_1 and #woo_recaptcha_2, and those elements aren’t always rendered on the page.

    A very simple solution would be to just verify that the elements exist before trying to render them as reCAPTCHAs. See below.

    if (document.getElementById('woo_recaptcha_1')) {
        grecaptcha.render('woo_recaptcha_1', {
            'sitekey' : '<?php echo $site_key; ?>',
        });
    }
    if (document.getElementById('woo_recaptcha_2')) {
        grecaptcha.render('woo_recaptcha_2', {
            'sitekey' : '<?php echo $site_key; ?>',
        });
    }
    • This reply was modified 5 years, 11 months ago by JacobTheDev.
    • This reply was modified 5 years, 11 months ago by JacobTheDev.
    Plugin Contributor mbrsolution

    (@mbrsolution)

    @revxx14, would it be possible for you to report this to the WooCommerce developers. I am curios to know what they say.

    Thank you

    Hello, I’m having this same issue in my site running Wordpres 5.0 and almost any plugin activated (only i have plugins for ssl, https and cloudflare connection activated) It may be a problem with the way AIOWPS is displaying Re-captcha?

    Plugin Contributor mbrsolution

    (@mbrsolution)

    @nakoruru666, can you start a new support thread.

    Thank you

    Plugin Contributor wpsolutions

    (@wpsolutions)

    Hi @revxx14 and others,
    Yes thanks. I have already applied a fix/check for the elements and this will be reflected in the upcoming release.

    • This reply was modified 5 years, 11 months ago by wpsolutions.

    @wpsolutions excellent, thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘google recaptcha v2 JS error when ticked’ is closed to new replies.