Firstly, I’d like to express my deep appreciation for your efforts towards script delay improvements. I’m eagerly looking forward to testing the new version, hoping it will ensure a seamless and error-free experience with hCaptcha when using WP Rocket.
Currently, my primary objective is to achieve simultaneous functionality of two captchas on a single page. I’ve documented various test configurations:
CONFIGURATION #A:
hCaptcha inserted within a Ninja Forms form (via the hCaptcha plugin) + reCaptcha v3 embedded elsewhere on my page (e.g., with Passster).
hCaptcha Settings: “Disable reCAPTCHA Compatibility” (checked) + Ninja Forms feature integration (checked).
WP Rocket Exclusions (deferred + report delay):
- /wp-content/plugins/hcaptcha-for-forms-and-more/assets/js/(.*).js
- /wp-content/plugins/ninja-forms/assets/js/(.*).js
Results:
- Without caching: Both hCaptcha and reCaptcha work flawlessly on the same page without errors.
- With caching: Three errors emerge, listed sequentially below:
- Uncaught TypeError: Cannot read properties of undefined (reading ‘ChildViewContainer’) => /wp-content/plugins/ninja-forms/assets/js/min/front-end-deps.js
- Uncaught ReferenceError: Marionette is not defined => /wp-content/plugins/hcaptcha-for-forms-and-more/assets/js/hcaptcha-nf.min.js
- Uncaught ReferenceError: Backbone is not defined => /wp-content/plugins/ninja-forms/assets/js/min/models/fieldErrorModel.js (I had to create this nonexistent folder).
CONFIGURATION #B:
Two hCaptchas – one in a Ninja Forms form (via the hCaptcha plugin) and another elsewhere on my page (e.g., with Passster).
hCaptcha Settings:
- <span style=”text-decoration: underline;”>First scenario</span>: Ninja Forms feature integration (enabled) & “Disable reCAPTCHA Compatibility” not used. Without caching, hCaptcha ceases to work (no checkbox appears). With caching, three errors emerge in the order listed above.
- <span style=”text-decoration: underline;”>Second scenario</span>: Ninja Forms feature integration (disabled). Without caching, the hCaptcha no longer appears (as the NF integration is off), but the second hCaptcha (via Passster) works correctly. With caching, two errors appear from the order listed above.
Considering these tests, I’d like to highlight the most pressing issues:
- CONFIGURATION #A: Works perfectly without caching.
- CONFIGURATION #B: There seems to be a conflict. Perhaps an option equivalent to “Disable reCAPTCHA Compatibility” could be introduced to support displaying multiple hCaptchas on a single page?
I apologize for the length of this message, but I felt it was vital to provide comprehensive details, hoping it would shed light on the underlying issues.
Thank you once again for the plugin update. As soon as it becomes available, I’ll carry out additional tests and promptly share my feedback here.
P.S.: Regarding WP Rocket, under their JS delay settings (“One-click Exclusions”), there’s a pre-configured third-party services list. I’ve selected “Google reCaptcha” from this list. Ideally, it would be beneficial to have an option for hCaptcha, ensuring native management from WP Rocket. However, I’m not privy to any discussions or agreements between your teams on this matter.