• Hi metforms team,

    Submitting a MetForm with reCAPTCHA enabled fails with “Something went wrong. Google captcha token not found.” in MetForm 4.1.4.

    v3: badge appears, but the hidden g-recaptcha-response-v3 input is never populated.
    v2: the checkbox widget never renders (g-recaptcha div stays empty, offsetHeight: 0).
    Already ruled out: theme switch (Twenty Twenty-Five → Twenty Twenty-Three), deactivating all non-essential plugins, cache flushes, wrong site key / domain mismatch (manual grecaptcha.execute(sitekey, {action: 'submit'}) from the browser console returns a valid token on the same page).

    In metform/public/assets/js/app.js, the renderReCaptcha method that calls grecaptcha.render() (v2) or grecaptcha.execute() (v3) is bound via window.onload = function(e) { t.renderReCaptcha(r, e) }. Since the bundle is enqueued in the footer and arrives after the load event has fired, the handler is never executed.

    A readyState-safe binding (if (document.readyState === 'complete') renderReCaptcha(); else window.addEventListener('load', …)) should fix both cases.

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support Reedwanul Haque

    (@reedwanul)

    Dear @niklasmoselewski ,

    Thanks for reaching out to us & extremely sorry for the delayed response.

    I would like to inform you that Google reCAPTCHA is working fine in the latest version of MetForm. Please check this video for clarification: https://d.pr/v/1cfkdW. Kindly make sure you are using a valid site key and secret key.

    If the issue persists, then it must be caused by the cache or the blocking of core JS in most cases. Please check your cache and optimization settings properly to see if any option is causing this. Also, follow the steps below: You need to exclude the following URL of MetForm to avoid optimization:

    Exclude from CSS: ” /wp-content/plugins/metform/public/assets/css/style.css “
    Exclude from JS: ” /wp-content/plugins/metform/public/assets/js/app.js “

    After excluding these files, you should no longer encounter this problem if there are no underlying issues. Also, please check and apply the fixes mentioned in this article: https://wpmet.com/doc/something-went-wrong/.

    Please let us know the update if you are able to solve this. If the issue still persists, kindly share your form URL; we will inspect & take the necessary steps. We appreciate your patience & cooperation.

    Thanks,
    Reju

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.