New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd Party Plugin Compatibility: Contact Form 7 #500

Closed
raamdev opened this Issue Jun 11, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@raamdev
Contributor

raamdev commented Jun 11, 2015

See: https://wordpress.org/plugins/contact-form-7/

This plugin has over 1 million active installs and is often used in conjunction with Really Simple CAPTCHA (see #499).

There have been some reports of issues between ZenCache and Contact Form 7 and it would be nice if ZenCache worked seamlessly (or at least provided the necessary Dashboard messaging to ensure smooth operation).


Support threads referencing this issue

@jaswrks

This comment has been minimized.

Member

jaswrks commented Jul 28, 2015

I tested this a while back...

Problems

Contact Form 7 lacks a cache-friendly design. The author of this plugin has not implemented DONOTCACHEPAGE when appropriate.

Short-Term Workaround

Add _wpcf7_is_ajax_call to your list of ZenCache URI Exclusions.

Possible Long-Term Solution

The Contact Form 7 developer might want to consider using DONOTCACHEPAGE in their AJAX handler in order to prevent WordPress caching plugins from caching the response that is dynamic. Referencing: https://github.com/wp-plugins/contact-form-7/blob/master/includes/controller.php

See also: websharks/comet-cache-kb#47

@renzms

This comment has been minimized.

renzms commented Nov 23, 2016

@raamdev

Bug Confirmed when _wpnonce Caching is enabled for logged-in users

Tested with

  • WordPress 4.6.1
  • Comet Cache™ Pro v161119 with _wpnonce Caching enabled for logged-in users
  • Contact Form 7 Version 4.5.1 + reCAPTCHA

Observed Behavior with logged-out users

The page itself with the form is not cached due to the presence of _wpnonce

screen shot 2016-11-23 at 11 43 28 pm

Observed Behavior with nonce caching enabled for logged-in users

The page with the form is cached and does not update even with Auto Cache Clearing Enabled. When options on the form change or are removed (e.g, a field is removed/updated, field name change) the form remains the same for the logged-in user. The form only updates when cache is manually cleared.

screen shot 2016-11-23 at 11 44 33 pm

@raamdev raamdev added bug and removed needs testing todo bug labels Nov 23, 2016

@raamdev

This comment has been minimized.

Contributor

raamdev commented Nov 23, 2016

@renzms Thank you.

So to reiterate, here's what needs to happen to improve compatibility with Contact Form 7 at this point:

  • When a change is made to a form in Contact Form 7, the cache for any pages showing the form needs to be cleared (namely the logged-in user cache, since the presence of a nonce in the page source prevents caching otherwise).

I'm not sure if this is even going to be possible. I believe Contact Form 7 just provides a shortcode that you place on a Post/Page to show the form. If that's the case, then there might not be any way to know which Posts/Pages contain a Contact Form 7 shortcode without somehow going through all of the page content in WordPress looking for the shortcode (not an option given the high workload of such a task).

A better workaround would be for the site owner to use the Comet Cache URI Exclusion patterns to exclude any pages that contain Contact Form 7 shortcodes from be cached, or if they prefer to cache the form for logged-in users, they should remember to manually clear the cache for that page after making any changes to the form on that page.

I'm going to close this for now, as I'm not seeing anything actionable that we can do here.

@raamdev raamdev closed this Nov 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment