Title: Probably Good, but Does Screw Around with a Few Files
Last modified: February 13, 2026

---

# Probably Good, but Does Screw Around with a Few Files

 *  [kloddant](https://wordpress.org/support/users/kloddant/)
 * (@kloddant)
 * [1 month, 3 weeks ago](https://wordpress.org/support/topic/screws-around-with-files-in-version-control/)
 * 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](https://wordpress.org/support/users/kloddant/).

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

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 month, 3 weeks ago](https://wordpress.org/support/topic/screws-around-with-files-in-version-control/#post-18821440)
 * Hi [@kloddant](https://wordpress.org/support/users/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](https://wordpress.org/support/users/kloddant/)
 * (@kloddant)
 * [1 month, 3 weeks ago](https://wordpress.org/support/topic/screws-around-with-files-in-version-control/#post-18824680)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscrews-around-with-files-in-version-control%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this review.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [kloddant](https://wordpress.org/support/users/kloddant/)
 * Last activity: [1 month, 3 weeks ago](https://wordpress.org/support/topic/screws-around-with-files-in-version-control/#post-18824680)