WordPress.org

Support

Support » Plugins and Hacks » WP-Super Cache breaks TDO Mini Forms

WP-Super Cache breaks TDO Mini Forms

  • the_dead_one
    Member

    @the_dead_one

    Is it possible for other plugins to tell WP-Super Cache not to cache specific pages?

    With my plugin TDO Mini Forms, it generates custom forms for users (and non-logged in users) to submit posts. However I’ve implemented a simple security feature that each time a form is generated it has a unique key in it. Of course if the page containing the form is cached, it caches the last key used and so breaks the security check.

    Is it possible for another plugin to tell wp-super-cache not to cache specific pages or is there another solution I could implement?

    http://wordpress.org/extend/plugins/wp-super-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • You could add a regular expression to the “Rejected URIs” box to catch that page?

    the_dead_one
    Member

    @the_dead_one

    Yes you could and I plan to put a section in the readme.txt for tdo-mini forms to explain that.

    However I was wondering if there was an automatic way I could do it within the code so that users don’t have to worry about configure wp-super cache to work with tdo-mini forms.

    Sure, look around line 533 of wp-cache.php. That’s where the regular expression list is written out to the config file. You need to either:

    1. Check if the “wp_cache_replace_line” function exists and use that to add your regex.
    2. Write your own version of that function and do the same.

    Another option is to check if add_cacheaction() exists and use that to add a hook onto “add_cacheaction” to modify the list of rejected URIs, $cache_rejected_uri.

    Or you can put a section in your readme. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP-Super Cache breaks TDO Mini Forms’ is closed to new replies.