• sluczak

    (@sluczak)


    Hello

    We have a problem with WProcket and CF7 form at https://www.x-gamer.com/sponsorship

    When WProcket is enabled, form messages are being refreshed just after hitting SUBMIT (you can try on empty form, there should be warning about empty fields). We tried to exclude this page from cache, but no luck. There is no such problem only, when we disable WProcket completly for the whole website (disabling JS/CSS minify/combine/defer and excluding subpage from cache does not help).

    The theme used on the page is Flatsome.

    I’ve written to WP Rocket support and I’ve got reply from them:

    “`We have checked the issue with our Level 2 team.

    The issue is likely happening in Contact Form 7 itself. Disabling all the functionality in WP Rocket doesn’t resolve the issue.

    The only change that affects the issue is changing WP_CACHE constant in the wp-config.php from false to true.

    Here is what we tested:

    deactivated WP Rocket plugin totally and set define( ‘WP_CACHE’, true );. The issue with the form remained.

    activated WP Rocket with all the optimization and set define( ‘WP_CACHE’, false );. The issue is resolved. This is the current state, so you can check this yourself.
    Our guess is CF7 is altering their behavior when a caching plugin is used, i.e. WP_CACHE constant is set to true. You will need to contact the CF7 support and address the issue with them.

    I left the WP_CACHE constant set to false, for you to check. This will prevent page caching in WP Rocket, but the optimization will still work.
    After checking the issue, you can simply deactivate and reactivate WP Rocket, so the constant will be back to true.`”

    Unfortunately the value in define (‘WP_CACHE’, false) changes to true after entering the dashboard in wordpress, so this solution doesn’t work.

    Do you have any ideas, how can we fix that?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • pca2014

    (@pca2014)

    The WP-Rocket has fixed the issue. The WP-Rocket fix can be replicated in other caching plugins by excluding the deferral of this JavaScript script.

    /wp-includes/js/dist/(.*).js

    But even with this fix in WP-Rocket or another caching program CF7 forms will fail after 24 hours due to the author’s use of nonces (security tokens). The only way to workaround the problem is to refresh your cache every 24-hours.

    I don’t consider this a solution, just a workaround due to the performance implications.

    Thread Starter sluczak

    (@sluczak)

    This issue is not related to WP Rocket. When WP Rocket is deactivated and uninstalled, but WP_CACHE constant is set to true in wp-config.php: define( ‘WP_CACHE’, true ); the contact form doesn’t work.

    pca2014

    (@pca2014)

    This issue is not related to WP Rocket. When WP Rocket is deactivated and uninstalled, but WP_CACHE constant is set to true in wp-config.php: define( ‘WP_CACHE’, true ); the contact form doesn’t work.

    You’re 100% correct. It isn not about WP-Rocket. I use WP-Rocket. I was simply explaining that WP-Rocket had a fix for this CF7 5.4 update problem, which affects any caching plugin that defers JAvaScript. Even if you correct this problem, you’ll still have to clear your cache every 24-hours because of the security “nonces”.

    Thread Starter sluczak

    (@sluczak)

    Your solution with JavaScript does not work.
    We talked to WProcket and they asked us to contact you again. They claim it is not at their end, but it is CF7 problem.
    So basically, is there anything we can do to solve the problem, instead of sending emails to you and WProcket and listening it is other party fault?

    • This reply was modified 4 years ago by sluczak.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CF7/WProcket form bug’ is closed to new replies.