Hello,
Actually, the plugin should not prevent or affect the use of varnish cache, however, I recommend you activate the option: “Activate Javascript Cache” in the settings page of the plugin (accessible through the menu option: “Settings/Calculated Fields Form”).
Could you send me the link to the webpage where the form is inserted, please?
Best regards.
Thread Starter
Chrissy
(@paperkawaii)
Hi, thanks for your reply 🙂
Ok, well I had that option ticked from the beginning but tried it with and without.
I have enabled the plugin again and you can view a form here.
I have been through and already deactivated all plugins and used a default theme and this plugin is the only one to effect the varnish cache.
However, it could be that the varnish ‘status’ is incorrect, I am not sure how to check it is working or not, I can only go by what the status message is, I uploaded a screenshot of what it says here. After deactivating the plugin, the error messages do not come up.
Hello @paperkawaii,
I guess the issue may be caused by the use of cookies. There are many plugins that clear the session variables, and has been a necessity emulate the session with transients and store the session id as a cookie.
Please, tries the following modification, and let me know if the modification solves the conflict.
1. Open the “/wp-content/plugins/calculated-fields-form/inc/cpcff_session.inc.php” file with the text editor of your choice.
2. Go to the piece of code:
if(!headers_sent())
and edit it as follows:
if(false && !headers_sent())
Best regards.
Thread Starter
Chrissy
(@paperkawaii)
Hey, I made the change however it did not help.
I also checked on a varnish cache checking website, and it’s definitely preventing the cache from working.
Thread Starter
Chrissy
(@paperkawaii)
Why set this topic as resolved? It is not…
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Honest question because as a moderator I get a different view than you get: can you unresolve your topic on the right sidebar?
Thread Starter
Chrissy
(@paperkawaii)
@jdembowski ah, sure I didn’t know I could do that…. yes it is not solved 🙂
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Cool! I wasn’t sure you could. 😉
Plugin and theme authors can do that but so can the person who opened the topic as you just found out.
Hello @paperkawaii,
Please, follow the steps below:
1. Open the “/wp-content/plugins/calculated-fields-form/inc/cpcff_session.inc.php” file with the text editor of your choice.
2. Go to the piece of code:
if( session_id() == "" ) @session_start();
and edit it as follows:
id(!is_admin()) return;
if( session_id() == "" ) @session_start();
Best regards.
I’m sorry, I’ve a typo in the code:
if(!is_admin()) return;
if( session_id() == "" ) @session_start();
Best regards.
Thread Starter
Chrissy
(@paperkawaii)
It’s working! That’s great, thanks!
Will these things be overwritten in future updates though?
Hello @paperkawaii,
In the free version of the plugin the session is not essential in the public forms, but for the other distributions (the Professional, Developer, and Platinum) the session variables are needed. So, we can include the modification in the free version of the plugin but not in the other distributions.
I’ll mark this topic as resolved.
Best regards.