• This plugin is probably good overall, but it does screw around with the wp-config.php and .htaccess files. When I activated it, it added define(‘WP_CACHE’, true); to the top of my wp-config file and removed the logic I had in the file that disabled WP_CACHE on localhost and dev. I couldn’t figure out how to use it but also keep caching disabled in staging environments. This plugin needs to not modify files that it did not create, and it needs to have its own dedicated constants that can optionally be manually (not automatically) added to the wp-config to adjust its behavior instead of sharing the native WP_CACHE constant with WordPress.

    • This topic was modified 1 month, 3 weeks ago by kloddant.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hi @kloddant,

    Thank you for the candid feedback — we really appreciate you taking the time to share this.

    You’re absolutely right that W3 Total Cache adds define('WP_CACHE', true); and updates .htaccess during activation. This behavior exists because WordPress page caching relies on the core WP_CACHE constant and early bootstrap loading to function correctly
    Any plugin that provides full page caching must use the native WordPress WP_CACHE constant because WordPress only enables early cache loading when this constant is set. This isn’t specific to W3 Total Cache — it’s how WordPress core page caching works.

    As a workaround there is an option to prevent automatic file changes by making wp-config.php and .htaccess read-only before activating the plugin. This allows W3TC to run without modifying tracked files, while you keep full control of constants and rules inside version control.

    Is this something you could find as the best approach in this case?

    Thanks!

    Thread Starter kloddant

    (@kloddant)

    Hello, thanks for the reply! What you are saying makes sense. I could make these files read-only, and perhaps that is what I will do, but I’d rather not introduce another environment configuration dependency if I could avoid it. Would it be possible for you guys to modify the plugin so that it only checks the WP_CACHE variable at plugin activation, rather than on each pageload? And/or perhaps just use a warning message to tell the user to modify this constant themselves, rather than directly having the plugin modify it? If the plugin only modified the constant upon activation, then all I would need to do would be to activate the plugin and revert the changes to the wp-config file it makes.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this review.