atsam
Forum Replies Created
-
I don’t have login captchas enabled so I’m afraid I don’t really know.
One point that I didn’t mention in my earlier posts is that there is a second wp_register_script call, in admin-options.phpThat line was also changed in V1.4.5
If the login forms use admin-options.php rather than recaptcha-woo.php (I have no idea if they do) then that could be the solution.
Same change as before, add the render=explicit argument.I’ve now submitted a patch with this change.
I see that this parameter was removed in V1.4.5, which I think just breaks the plugin.
It looks like it was removed because of an error about “Incorrect call of JavaScript resource parameter”, I think passing ‘render=explicit’ rather than just ‘explicit’ is the correct way to resolve that error too.I didn’t have a lot of time to experiment in the end, but I found a quick fix that seems to have worked for me.
I simply added the parameter ‘render=explicit’ to the wp_enqueue_script call in recaptcha-woo.php
So the line becomes:
wp_enqueue_script( ‘recaptcha’, ‘https://www.google.com/recaptcha/api.js?render=explicit&hl=’ . get_locale(), array(), null, array(‘strategy’ => ‘defer’));
I believe this just prevents the recaptcha api from automatically rendering and allows your javascript bindings to run as intended.
I still think that using the onload=callback parameter might be the preferred method here, but as I say I’m a little short on time and this is outside my normal experience anyway.
I’ll try to submit a patch next week, if that’s something I can do, but if a developer sees this before I get to it then please do make the change yourself.After a while browsing the codebase and the reCAPTCHA developer pages, I wonder if the solution would be to pass the parameter onload=renderRecaptcha to the reCAPTCHA api (as documented here https://developers.google.com/recaptcha/docs/display#render_param) rather than relying on a MutationObserver or wordpress callback to trigger the render.
I don’t have time to test that today, I’ll give it a try later in the week.