WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Forms not sending with Super Cache enabled? (10 posts)

  1. SimmoSays
    Member
    Posted 2 years ago #

    Since updating something none of my Contact 7 forms are working if WP-Super Cache is enabled. This is a NEW problem for me and it's happening on multiple sites.

    The following error is being displayed:

    Failed to send your message. Please try later or contact administrator by other way.

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

  3. rjdougan
    Member
    Posted 2 years ago #

    I just discovered this same issue on one of my site. For now I have gone into WP Super Cache and told it not to cache any pages that have a form install on it and it appears to have clear getting the error and forms are now being successfully submitted. Is the problem with Contact 7 or is it with WP Super Cache?

    These are two of the most widely used plugins and they need to play well together I hope someone addresses this quickly.

  4. goranpro
    Member
    Posted 2 years ago #

    Is this problem solved until now?

  5. Donncha O Caoimh
    Member
    Posted 2 years ago #

    Odd, this was brought up on my blog earlier.

    The problem is that Contact Form 7 uses a secret key that changes to make sure the user submitting the form is real. WP Super Cache is caching that value and it goes out of date. Contact Form 7 needs to define the constant DONOTCACHEPAGE which will stop Supercache (and W3 Total Cache too) from caching the page.

    You could also try entering the url of the pages with your contact form in the exclude list on the supercache settings page but having Contact Form 7 do it with the constant is a better way.

  6. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

    Hello Donncha. Thank you for WP Super Cache. I use it on contactform7.com.

    Contact Form 7 uses WP nonce as secret key. As nonce life is 24 hours by default, if cache clears less than 24 hours, the two plugins should work without problem, even if the page is cached.

    I recommend in FAQ that users do garbage collection frequently.

  7. goranpro
    Member
    Posted 2 years ago #

    I think that there should be clear instructions in FAQ about how to handle this with the most common cache plugins (WP Total/Cuper Cache). If there is somehow possible it would be best to disable the caching with DONOTCACHEPAGE like Donncha mentioned.

    Im quite sure that there are a lot of people that are not aware of this problem and their client emails are not getting delivered. I use the plugin for purchase requests on one of our real estate stites (brunarice.org) and we lost a quite a bit in sales before one of our clients reported this(i took 1-2 months to realize this).

  8. Donncha O Caoimh
    Member
    Posted 2 years ago #

    Takayuki - it might be worth adding a checkbox to the contact form settings page that disables caching on the form page. It would just set the DONOTCACHEPAGE constant and then WP Super Cache and W3 Total Cache will not cache that page.

  9. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

    Actually, it's difficult for Contact Form 7 to know which page contains contact forms. You can place contact forms in post/page contents, text widget contents, directly in the theme's template, or anywhere you like. So I'm thinking of writing FAQ how users can set DONOTCACHEPAGE to exclude pages from cache, or making nonce-checking off by default in the next release of Contact Form 7.

  10. Donncha O Caoimh
    Member
    Posted 2 years ago #

    It's simpler than that! If the option was set on the settings page you just set that constant whenever you display the contact form. Your plugin doesn't need to know where it is shown!

    Caching is done at the end of the request so the plugin disables caching when that constant is defined.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic