Optimization and Caching Plugin Issues

Many site owners use optimization and caching plugins to speed up their sites. However, some features from these plugins can cause WPForms functions to not work properly.

This article is for after you have identified a JavaScript issue, and suspect an optimization plugin that is installed on a customer’s site.

Troubleshooting

Optimization Plugins

JavaScript issues caused by optimization plugins are usually due to these commonly found features:

  • Minify – Removes unnecessary characters from the code, such as white spaces, which produces a smaller file so that less dat needs to be transferred.
  • Combine – Merges separate JavaScript/CSS files into one to reduce the number of calls made to the server.
  • Load Deferred/Asynchronously – Separates the JavaScript and CSS files from being loaded and executed during page load, so that the page doesn’t need to “wait” for them.

Additionally, the following scripts should be excluded from any optimizations in any plugin by default.

js.stripe.com/v3/
simpay-public-shared.min.js
simpay-public.min.js
accounting.min.js
simpay-public-pro.min.js

If any of these are not excluded, issues will occur.

Caching Plugins

Caching can prevent users from seeing changes that are applied in the form. WPBeginner has a helpful guide on how to clear cache in WordPress.

Troubleshooting Specific Plugin Settings

This section has been removed and replaced with this link: https://wpsimplepay.com/doc/caching/.

The documentation is kept up to date and it is easier to just refer you there.

Service: Content Delivery Network (CDN)

CDN works in a similar fashion to caching, so the issues they can cause for WPForms are similar as well.

♥ How to Test/Fix:

If you’re getting the “The form was unable to submit. Please contact the site administrator.” error message (which usually indicates an issue with form tokens), but the site does not have any JS errors nor any optimization/caching plugins active, then check whether or not a CDN service is in use for the site.

If a CDN is in use, try flushing the CDN’s Point of Presence (PoP) cache, and then test to see if the issue is resolved. If this helped, then it confirms that the CDN is the issue by causing the page to be cached for longer than the form token is valid for, and if the form token is invalid the form cannot be submitted.

To fix this:

  • The customer needs to adjust the length of time their CDN caches their site so that it is LESS than the time form tokens are valid for (which is 48 hours by default), OR
  • Make adjustments to both the CDN cache time and the form token time so that they meet in between. The form token time MUST be longer than the cache time.

Leave a Reply

Your email address will not be published. Required fields are marked *