szepeviktor / w3-total-cache-fixed

A community driven build of W3 Total Cache. The aim is to continuously incorporate fixes, improvements, and enhancements over the official WordPress release of W3 Total Cache.
https://github.com/szepeviktor/w3-total-cache-fixed/releases
MIT License
237 stars 47 forks source link

Make the transition to our code fully automatic #345

Open szepeviktor opened 7 years ago

szepeviktor commented 7 years ago

Hello!

I think with could help much more users providing the following:

See also https://github.com/szepeviktor/wordpress-plugin-construction/blob/master/mu-plugin-upload-from-url/plugin-upload-from-url.php

szepeviktor commented 7 years ago

The video is on me https://www.youtube.com/user/szepeviktor

szepeviktor commented 7 years ago

The readme would say: Download our auto updater (in a zip), upload the zip by Plugins / Add new / Upload plugin and Activate it, That is all The auto updater could be self-destroying.

amiga-500 commented 7 years ago

Currently the v0.9.4.x has an auto updater (integrates into the Plugin's page and notifies the user when an update from this github repository happens). From there, like other plugins, the user has the option to click the "Update Now" button or just ignore it. It also modifies the "View Update Details" page.

So, i could just port over the 0.9.4.x updater to v0.9.5.x which would be pretty quick..maybe an hour. But there'd be other questions before that happens (that is where it would take longer than an hour):

  1. v0.9.5.x would need to be folder rebranded internally (e.g. folder would be w3-total-cache-fixed instead of w3-total-cache, just like v0.9.4.x currently does, because if you dont then WP will constantly phone home (WP site) looking for an update off the official release and ignore our updater. I haven't checked if it would just check ours too...it might just be checking both. But rebranded would only have it check ours. Maybe having it check both might be fine? But then maybe if a user wanted only our "fixed" version then even if an official w3tc was released they wouldnt want that but would prefer our version after we synced with that new release. Anyway, would a folder name rebranding be ok? Converting here would take a bit since one has to be careful what is changed -- it isn't just a search/replace (some cases the folder name is built in parts).

  2. Should we strip the Dashboard's Premium Services panel and Spread the Word panel and modify the Support links which currently point to w3-edge and point it here, like v0.9.4.x does, since there are several changes that's happened that won't be relevant when they pay for w3-edge support?

Cheers Kimberly

szepeviktor commented 7 years ago

Currently the v0.9.4.x has an auto updater

I think I wasn't clear. Sorry. The first transition from upstream to our code is fully manual.

My idea is to have a tiny w3tc-fixed auto-downloader.

amiga-500 commented 7 years ago

Ahhh...thanks for the clarification! :+1:

danwie commented 7 years ago

I'm using 0.9.5.x. Is there a easy way to update from admin pages or do I need to uninstall/install as mentioned in the docs? I couldn't find the video mentioned above, could you please link it here?

szepeviktor commented 7 years ago

Hello @danwie !

I am the one who will produce a video after this automatic mechanism is ready.

Please see the New Feature label on this issue!

szepeviktor commented 7 years ago

@amiga-500 What are the steps for the upgrade procedure?

Will uninstalling official w3tc delete all related wp_options / custom tables?

Here is some help for the auto-upgrader: https://github.com/szepeviktor/wordpress-plugin-construction/blob/master/mu-plugin-upload-from-url/plugin-upload-from-url.php#L37

amiga-500 commented 7 years ago

Hi @szepeviktor ... when uninstalling the official w3tc:

  1. It keeps the disk-based master.php file where all user configs are stored.
  2. It also keeps the 13 entries it stores in _wpoptions, sans the _w3tc_extensionshooks row (so 12 remain). None of these files are important though (in terms of user configs).
  3. The _wp_w3tc_cdnqueue table that it creates when CDN is enabled and holds files waiting to upload does get removed when you deactivate the plugin. But again, this is not important since a new install will just queue up the files again.

Not sure if there are any other tables or options i might be missing. The ones above are the only ones i've ever come across.

As for installing v09.5.x its shown on the front page and the release page. One just has to deactivate their existing w3tc, delete it, then either use WP's "Upload" feature (admin page) or FTP. Of course, this is specficic to v0.95x. For v0.94x the install is different.

Cheers Kimberly :octocat:

szepeviktor commented 7 years ago

Thank you!

One just has to deactivate their existing w3tc, delete it, then either use WP's "Upload" feature (admin page) or FTP.

So this automatic plugin should

  1. check for w3tc plugin
  2. if found deactivate it
  3. if found delete it
  4. install our fork, see the my previous comment for the code example
  5. activate it
  6. and some functional checks
  7. deactivate itself
  8. delete itself
amiga-500 commented 7 years ago

^ Sounds about right!

The functional checks (assuming it can activate fine) might not be needed until we stumble upon something that we realize definitely needs to be checked. Right now i can't think of any -- was going to say php version but that's already covered.

Curious. When the automatic plugin is used and our fork is installed successfully, WP will still be phoning home to w3tc official (wp does a version check of all plugins every 12 hours). So when the official version does get updated the user will be seeing a "New Version Available" notification from the official (e.g. v0.9.5.3 comes out). When the user updates s/he will have the official v0.9.5.3 not our fork. So with that, your vision is that when we merge in the official release, again lets use v0.9.5.3 as an example, and port in some missed things (if any) that didn't make it into the official v0.9.5.3, then the user will get a new notification message (via our already installed automatic plugin) saying our fork has been updated (e.g. "w3tc fixed v0.9.5.3.1 is released") and then the user can proceed once again to use our still installed automatic plugin to replace the official release of v0.9.5.3 with our own. And the cycle can repeat itself forever.

Is that correct?

Thanks for the clarification. Interesting stuff.

szepeviktor commented 7 years ago

So when the official version does get updated the user will be seeing a "New Version Available" notification from the official (e.g. v0.9.5.3 comes out).

Yes. The only thing we can do is to display an admin notice saying -something like - Please consider reviewing the changelog of the next official release

DaBomby commented 6 years ago

Having this in a manner or method such that one can download a zip file and upload it through the plugins section of WordPress would be excellent! Additionally, if it could be listed in the official WordPress plugins site would be even better.