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.
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
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
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 ? 🙂
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
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.
The only thing I can advise is to disable other plugins one at a time until you find the culprit?