[wp-trac] [WordPress Trac] #51857: Add rollback for failed plugin/theme updates

WordPress Trac noreply at wordpress.org
Thu Jan 21 02:03:20 UTC 2021


#51857: Add rollback for failed plugin/theme updates
-------------------------------------------------+-------------------------
 Reporter:  pbiron                               |       Owner:  pbiron
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.7
Component:  Upgrade/Install                      |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  testing early                                  |
-------------------------------------------------+-------------------------

Comment (by dd32):

 An alternative option would be to flip this around, and not add a rollback
 functionality into it, but rather install into a temporary directory
 first, and then remove existing/rename new into place.

 That would result in less downtime of the plugin not existing on the site,
 and also not delete the plugin from the site in the event of a failure to
 create the new files.

 eg:
  * Plugin update into `.hello-dolly.upgrade.1234`..
  * Once successful:
    * `hello-dolly` directory is deleted.
    * `move( '.hello-dolly.upgrade.1234', 'hello-dolly' );`
    * return true;
  * Upon failure:
    * Delete `.hello-dolly.upgrade.1234`
    * return false

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51857#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list