bluehost / endurance-page-cache

Other
24 stars 11 forks source link

Automatically disable Endurance caches when another caching plugin is installed? #27

Open mimicplay opened 7 years ago

mimicplay commented 7 years ago

I just installed WP Rocket, a premium caching plugin, on a website yesterday (ils-automation.com). While troubleshooting after the install, I discovered these Endurance page & browser cache plugins. I didn't even know these had been installed by BlueHost onto my WordPress site until I realized caching wasn't working as it is supposed to with WP Rocket.

Anyhow, I see Endurance has added some code to my htaccess file, and it appears to be "overpowering" the htaccess code that WP Rocket adds. I have some questions about how to handle this:

  1. The WP Rocket support rep, Lucy, told me that she's spoken with you before about Endurance, and that Endurance is supposed to automatically disable its caches when it detects another caching plugin. This doesn't seem to have occurred. Endurance Page Cache is "disabled" in WP plugins admin (I have the option to Enable it), but Endurance Browser Cache is "enabled" and there's no disable option. If these plugins are supposed to auto-disable themselves, they did not successfully remove Endurance's htaccess code, which is causing some issues. Are both Endurance caches "auto-disabling when another caching plugin is activated" working as intended, or is this a bug? Or was this auto-disable feature removed? How can I disable Endurance Browser Cache to make sure it's not conflicting with WP Rocket?

Note that I don't think something is completely disabled since in my WP Admin top bar, I see a Caching drop-down menu with options to "Purge All" and "Cache Settings." Cache Settings takes me to my General Settings page, on which there are no cache setting options at all.

  1. Since I would prefer to use WP Rocket instead of Endurance, how can I safely disable and remove Endurance Cache plugin stuff? Would it be best to submit a support ticket with BlueHost and have their team handle it? Can I just remove Endurance's code from my htaccess file and re-save (if so, what code should be removed to make sure I delete everything)? Do I need to delete the "mu-plugins" folder, or just the files inside of it (endurance-page-cache.php and endurance-browser-cache.php)?

If you need to see my htaccess file, please let me know and I can email it to you.

MikeHansenMe commented 7 years ago

Hey @mimicplay it sounds like you have an older version of the plugins. I will jump into the account, take a look at the versions to see if there is a bug here that needs to be addressed and get them fully disabled for you. Thanks!

mimicplay commented 7 years ago

@MikeHansenMe Wow thank you for the insanely fast response! Endurance Browser Cache is listed as 0.4. Endurance Page Cache is listed as 0.9 (info through my WP Admin Plugins screen).

MikeHansenMe commented 7 years ago

Current version is 1.1. I removed the browser cache plugin as it was merged into the page cache plugin. There is indeed a bug with the nav item showing when the plugin is disabled. I will get that into the next release, thanks for letting me know.

Everything should be good to go now. Let me know if you have any additional questions. I am happy to help.

mimicplay commented 7 years ago

Thanks! I just have the remaining question about the htaccess file. The conflicting code that I think was inserted by Endurance is as follows The Expires stuff especially needs to go away as WP Rocket is setting those values in its own plugin (so I've now got duplicate Expires values in htaccess). Can all the code below be safely deleted by me?

` ExpiresActive On ExpiresByType image/jpg "access plus 6 hours" ExpiresByType image/jpeg "access plus 6 hours" ExpiresByType image/gif "access plus 6 hours" ExpiresByType image/png "access plus 6 hours" ExpiresByType text/css "access plus 6 hours" ExpiresByType application/pdf "access plus 1 week" ExpiresByType text/javascript "access plus 6 hours" ExpiresByType text/html "access plus 10 minutes" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 3 hours" Options -Indexes Header set X-Endurance-Cache-Level "2"

RewriteEngine On RewriteBase / RewriteRule ^/wp-content/endurance-page-cache/ - [L] RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP_COOKIE} !(wordpress_test_cookie|comment_author|wp\-postpass|wordpress_logged_in|wptouch_switch_toggle|wp_woocommerce_session_) [NC] RewriteCond %{DOCUMENT_ROOT}/wp-content/endurance-page-cache/$1/_index.html -f RewriteRule ^(.*)$ /wp-content/endurance-page-cache/$1/_index.html [L] ` Sorry that I'm not 100% sure how to get line breaks to happen in this Github comment section!! Here's a screenshot that's a little cleaner to read: ![image](https://user-images.githubusercontent.com/31252864/29586599-e544a1d2-8750-11e7-94e4-4046c15d3120.png)
MikeHansenMe commented 7 years ago

That was from the plugin when it was active. I just resaved your permalinks, which regenerated the htaccess file and it removed those lines.

mimicplay commented 7 years ago

@MikeHansenMe Thank you so much - that fixed it! If you're ever in northern WI, I owe you a beer for your help today :) Cheers!

Oh, I will let Lucy at WP Rocket know that you helped me out with this, and what you needed to do to fix it.

laurentzahnd commented 7 years ago

Aloha @MikeHansenMe, I have the same issue, I'm using W3 Total cache and I'd like to remove Endurance Page Cache 1.1 and Browser cache 0.4 because it's constantly messing up my CSS and updating my website is a nightmare. I don't know how it got in my plugins because I'm not even a bluehost customer?! I'm not a coder and need your assistance please.

sovrinbloc commented 6 years ago

I found a working solution:

I tried migrating my site 3 different ways and it continued to give me 500 errors due to .htaccess corruption. What would happen is i would migrate it, it would work, but then whenever I would save settings, it would re-corrupt everything.

I was about to give up migrating until I figured it out. First, when I migrated my site, once it was up and running, I made a working copy of the .htaccess file. Just in case something went awry I could just revert back and didnt have to migrate everything AGAIN.

(WARNING: FROM THIS POINT FORWARD DO NOT TRY TO SAVE SETTINGS OR RELOAD YOUR PAGE UNTIL AFTER YOU COMPLETE THE REST OF THE TUTORIAL) Next, I went into wp-content/mu-plugins (for me this is where the Endurance cache plugin is stored, since it isn't displayed in the regular plugins). I moved all of the files (endurance-page-cache.php, endurance-php-edge.php) to endurance-page-cache.php.old endurance-php-edge.php.old.

Next, I created two blank files endurance-page-cache.php, and endurance-php-edge.php inside that very same directory. THAT way, whatever is trying to enable and call those files to display, when it calls them, it will be blank, and nothing is then called, and therefore nothing breaks!. That is the solution.

So if you are using SSH or Linux, my commands looked like following.

(navigate to the mu-plugins directory inside wp-content) cd /var/www/html/wp-content/mu-plugins/

(copy old files) mv endurance-php-edge.php endurance-php-edge.php.old mv endurance-page-cache.php endurance-page-cache.php.old

touch endurance-php-edge.php touch endurance-page-cache.php

DONE

cyric118 commented 6 years ago

@sovrinbloc I created an account here just to login and say thank you. This damn Endurance plugin has had me banging my head against the wall for three days now. Your solution was so simple, I can't believe I didn't think of doing it myself. So far, it looks like it worked as perfectly as I could hope. Thank you!