Hi there,
Donation Platform for WooCommerce uses WordPress nonces to verify requests and avoid?CSRF?issues. These nonces have a lifetime of one day. If you enable caching that caches HTML pages for longer than one day, the nonces become invalid and potential donors get error messages. With a shorter cache time the problem can generally be solved.
Feel free to share your experiences about different cache & site optimizer plugins with me.
Troubleshooting Nonce Verification Issues
1. Use a Shorter Cache Time
To prevent nonces from expiring, configure your caching plugin to use a shorter cache time. Ideally, set the cache expiration time to something like 4 hours. This can help avoid nonce-related errors during the donation process.
2. Disable Cache for Affected Pages
If you are experiencing nonce verification failures on specific pages, consider disabling caching for those pages. Most caching plugins allow you to exclude specific URLs or pages from caching. By excluding donation-related pages from caching, you can ensure that nonces remain valid and donations process smoothly.
3. Consider a Different Caching Plugin
If you continue to encounter nonce verification issues despite making adjustments to your current caching plugin, consider trying a different caching plugin. Not all caching plugins behave the same way, and switching to one that is more compatible with WooCommerce and Donation Platform for WooCommerce may resolve the problem.
4. Use Cache Purging
Some caching plugins offer cache purging options, allowing you to clear the cache manually or automatically when specific events occur, such as product updates or new donations. By implementing cache purging, you can ensure that the cache is always up-to-date and that nonce issues are less likely to occur.
see https://wcdp.jonh.eu/documentation/usage/caching-website-speed/
Best,
Jonas