• Resolved pyac

    (@pyac)


    Hi,

    When I enable AO Contact form 7 Recpatcha does not work, I tried to exclude all contact form 7 scripts and js files and it doesnt work. Once i disable AO recaptcha works fine. Right now when you try to submit an URL it gives you There was an error trying to send your message. Please try again later.

    I checked in console and I am getting (index):3026 Uncaught ReferenceError: grecaptcha is not defined

    Please help ??

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    the problem more then likely is the fact that you are loading the base recaptcha JS with async & defer attributes, so it is not guaranteed to be available when inline JS (which depends on said recaptcha JS) is executed;

    <script src="//www.google.com/recaptcha/api.js" async defer type="88c906a1f097d3d4a35c2a15-text/javascript"></script>

    this is likely made even more fragile by using AO (which also defers the aggregate JS), asyncjs (which defers non-autoptimized JS) and cloudflare’s rocketloader (which has it’s own, different method of deferring). I also see jQuery is not defined errors by the way, so you will have to look into that as well I guess.

    hope this helps,
    frank

    Thread Starter pyac

    (@pyac)

    Hi Frank,

    Thank you so much, I just added that script after i posted this article and it fixed the issue temporarily. If i remove that script from the header, it breaks the form and recaptcha again.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Ah OK … in that case can you try adding recaptcha/api.js to AsyncJS’s exclusion list?

    Thread Starter pyac

    (@pyac)

    Thank you for all the help, but i am getting this error now in console

    Uncaught ReferenceError: grecaptcha is not defined
    at <anonymous>:51:2
    at t.activateScript (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at t.run (rocket-loader.min.js:1)
    at rocket-loader.min.js:1
    at rocket-loader.min.js:1

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    do you still get said error with rocketloader disabled?

    Thread Starter pyac

    (@pyac)

    If i disable rocket loader it works, there is a plugin I downloaded called WP CloudFlare CloudFlare Rocketscript Options and it allows you to turn off rocketloader on specific scripts which works but I prefer not to run any plugins as it’s slowing down pagespeed

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    yeah, performance optimization often is about making though choices between different options that each have their advantages and disadvantages ??

    Thread Starter pyac

    (@pyac)

    I know any way we can fix that ? ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, my 2c;
    * you’re using to many optimization solution concurrently, I would cut down on that
    * don’t focus on pagespeed (or other) scores, but on clear user-centric time-based KPI’s such as first paint, onLoad, speed index

    Thread Starter pyac

    (@pyac)

    Hi I am getting an error now with an youtube player you can see here can you please suggest a way to fix it ??

    https://drtorgerson.com/video-library/

    yrc.js?1.4-pro:12 Uncaught ReferenceError: yrc_is_pro is not defined
    at yrc.js?1.4-pro:12

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I’m also seeing the same error when AO is disabled (with the ?ao_noptimize=1 parameter) pyac;

    so this is probably caused by something else?

    Thread Starter pyac

    (@pyac)

    I have async i disabled that and also added the plugin into exclusion that didnt help, when i am logged in everything works fine as its not caching for logged in users. When logged out or incognito it does not work. Do you have any suggestions I would really appreciate it.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The only thing I can advise is to disable other plugins one at a time until you find the culprit?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Uncaught ReferenceError: grecaptcha is not defined’ is closed to new replies.