Thread Starter
yvett
(@yvett)
After digging into the plugin code, found two bugs in frontend/classes/Shortcode.class.php:
Bug 1: Missing script dependencies
spotler-form-additions is registered with an empty dependency array, so WordPress doesn’t wait for jquery-validate before running it. Fix:
wp_enqueue_script(
‘spotler-form-additions’,
SPOTLER_PLUGIN_URL . ‘public/js/form_additions.js’,
[‘jquery’, ‘jquery-validate’], // was []
filemtime( SPOTLER_PLUGIN_DIR . ‘public/js/form_additions.js’ )
);
Bug 2: External CDN, no fallback
wp_enqueue_script( 'jquery-validate', '//static.mailplus.nl/jq/jquery.validate.min.js', … );
If static.mailplus.nl is slow or blocked, the whole form breaks. jquery.validate.min.js is MIT licensed. You could bundle it inside the plugin and load it locally to remove this dependency.
And why the math question flashes: form_additions.js fires an AJAX call on document.ready to refresh the security question. When validation isn’t initialized, the form’s own init script never runs, so the raw math label briefly appears before AJAX replaces it. Bug 1 is the direct cause.
Hi Developer / Plugin Maintainer,
I am writing this on behalf of our agency and our client. This issue is currently highly critical for us as it is causing a massive drop in business leads and has been ongoing for over 6 months.
Our client’s support ticket with Spotler Official Support (Ticket #2428477) was officially referred to this forum because Spotler support stated that this WordPress plugin is managed by an external partner and they do not have backend access to resolve plugin bugs.
We can 100% confirm the bug described by @yvett in this thread. We have done extensive testing and can add the following crucial findings:
- It is NOT a caching issue: We have completely disabled all caching layers (including W3 Total Cache, server cache, and CDN), yet the form continues to randomly fail upon submission with the following specific error: “U heeft een foutief antwoord ingevuld bij de optelsom. / You have entered an incorrect response to the sum total.”
- Silent Race Condition Fail: When simulating a slower connection (e.g., ‘Slow 3G’ throttling in Chrome DevTools), the automatic anti-spam math question briefly flashes and then completely vanishes. Crucially, no errors are thrown in the console. The script fails silently.
- Bug 1 is the exact cause: Because
spotler-form-additions does not list jquery-validate as a dependency, form_additions.js fires its document.ready AJAX call before the validation engine is ready. It clears/hides the fallback math field but fails to successfully initialize the new captcha/math validation.
Because the script crashes on the frontend, the captcha is never correctly processed. When a user populates the rest of the form and clicks submit, the Spotler backend rightfully rejects it because the required math question response is missing or invalid.
Since this plugin handles core lead generation for corporate websites, a silent script crash that blocks submissions is unacceptable. We urgently request you to release an update fixing the script dependencies (wp_enqueue_script array) as proposed by @yvett .
Looking forward to your swift action on this.
Hi Developer / Plugin Maintainer,
We would like to add to this thread as we are experiencing the exact same issue, where forms intermittently fail due to the validation script not being properly loaded or initialized.
Impact (critical): This issue is not minor – it directly affects lead generation. Users are unable to submit forms successfully, which results in lost inquiries and business impact. From our monitoring, this is happening frequently enough to be a serious problem.
What we observe:
- The validation script (
jquery.validate.min.js) is not reliably available when the form initializes
- The anti-spam math question briefly appears and then disappears
- Submitting the form results in validation errors, even when inputs are correct
- The issue becomes much worse under slower network conditions
Important confirmation: We can also confirm that:
- This is not related to caching (all layers disabled during testing)
- This is a race condition in the plugin itself
- The root cause matches exactly what @yvett and @lucstofpruuk described: missing script dependencies
Because spotler-form-additions does not depend on jquery-validate, the initialization order is unreliable. This causes the form JS to run before validation is available, leading to silent failures.
Why this must be addressed urgently: This plugin is used for business-critical forms. A frontend script failing silently without errors – while blocking submissions – is a severe reliability issue.
Requested fix: We strongly support the proposed solution:
- Add the correct dependency:
- Avoid reliance on an external CDN without fallback (bundle locally or implement a fallback mechanism)
- Ensure forms are not interactive before required scripts are fully loaded
Given that this issue has now been reproducible, confirmed by multiple parties, and is impacting corporate websites, we kindly but urgently request a patch release.
Thank you in advance for your prompt attention.
Hi @yvett , @lucstofpruuk & @joelledw ,
Let me start of by making apologies for the late response, we clearly did not have our notifications correctly set up. We have adjusted this so we can respond more quickly next time.
I think you guys are completely correct with suggesting that we need to add the dependency: jquery & jquery-validate to the function wp_enqueue_script that currently loads the spotler-form-additions handle.
The suggestion regarding bundling the script static.mailplus.nl/jq/jquery.validate.min.js that @yvett made is also a solid improvement.
Thanks a lot for the thorough research you guys have been doing, this helped a lot. I again apologize for the late response, I can imagine that this is a dire situation given that this can/will block leads.
We plan on releasing the fix next week.
Thanks for the update and for acknowledging the issue! Glad to hear the notifications are sorted for the future.
Good to know the fix is planned for this week. Looking forward to the update!
Thanks for your patience!
We’ve just made a new release that contains the following fixes:
- Moved the jquery.validate.min.js script locally within the plugin instead of relying on the external version on the Spotler servers.
- Applied a blocker that will prevent a submit from happening when the form is not fully initialised yet.
- Updated the dependencies for the scripts to make sure we have the correct loading order.
Regarding the flickering input fields (most noticeable for the check sum input field), we currently don’t see a good way of preventing this from happening from within the plugin. Currently this part is maintained by Spotler themselves (within the external JS script that gets loaded through the API), we will discuss this issue further with Spotler to see what our options are.
We hope this solves the problems you guys we’re experiencing, if not please let us know!