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

WordPress Trac noreply at wordpress.org
Wed Jan 20 06:10:05 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 SergeyBiryukov):

 Thanks for the patch!

 It looks like there are some concerns about performance implications of
 building (and then potentially unpacking) a zip file with the current
 plugin version, especially for large plugins. Instead of building a zip
 file, could we rename the plugin directory to something reasonably unique
 like `plugin-slug.__rollback__`, and then delete it on successful update,
 or rename back on failure? I think that would not require any additional
 resources. Creating a zip file might save some disk space, but if the
 space is already low enough for that to make a difference, then it seems
 like updates on that site would start failing anyway sooner rather than
 later.

 Personally, I would like the code for plugin/theme upgraders to be as
 close to core as possible. At a glance, it looks like
 `Core_Upgrader::upgrade()` has a lot more than
 `Plugin_Upgrader::upgrade()` or `Theme_Upgrader::upgrade()`, so perhaps
 unifying these methods and documenting the differences would be a good
 first step. I would prefer to adapt the core upgrader for plugins and
 themes as appropriate, and not create a completely different
 implementation.

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


More information about the wp-trac mailing list