Improve Compatibility Between asy_jpcache and zem_contact_reborn
My latest Textpattern plugin helps two other plugins co-exist peacefully: the full-page caching of asy_jpcache and the powerful form processing of zem_contact_reborn (ZCR). These plugins usually clash due to the way ZCR fights spam.
My plugin works together with zem_contact_reborn to resolve part of this conflict. Fully reconciling the two plugins requires some adjustments to asy_jpcache settings, which are explained below. If you have problems getting the plugin to work properly, please let me know by posting a message in the plugin’s support thread on the Textpattern forum.
Download aam_zcr_clearcache-0.12.txt (8.2KB, 329 downloads)
About aam_zcr_clearcache
The anti-spam measures built into zem_contact_reborn can cause conflicts with the full-page caching plugin asy_jpcache. When a ZCR form is cached after submission, one person filling out a form can prevent another person from filling out the same form a few minutes later. Instead of a thank you message, everyone else who submits that form receives a “form already used” error until the cached version of the page expires. This error is caused by a conflict between the full-page caching of asy_jpcache and the hidden codes used by ZCR to fight spam.
The aam_zcr_clearcache plugin prevents “form already used” errors by making asy_jpcache treat ZCR forms the same as it treats comment forms: the cache gets cleared whenever a ZCR form is submitted. Basically, this plugin is a wrapper around the cache plugin’s asy_flushdir() function. For it to work, you need to be using asy_jpcache and have the asy_jpcache Textpattern plugin installed and active.
The Rest of the Solution
This plugin only works to prevent “form already used” errors that occur when using zem_contact_reborn and asy_jpcache together.
For full compatibility between these two plugins, you’ll also need to set your jpcache expiration time to a value of less than 10 minutes (600 seconds). This is done by changing the value of the $JPCACHE_TIME variable in the jpcache-config.php file.
Taking this extra step will also eliminate the “form expired” errors that can crop up when these plugins are used together.
Usage
Just install and activate. No template tags are required for this plugin to work.
License
This plugin and its documentation are copyright © 2007 Adam Messinger, and are provided under the terms of the BSD license.






