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

WordPress Trac noreply at wordpress.org
Fri Aug 20 18:22:29 UTC 2021


#51857: Add rollback for failed plugin/theme updates
----------------------------------------------+----------------------------
 Reporter:  pbiron                            |       Owner:  pbiron
     Type:  enhancement                       |      Status:  reopened
 Priority:  normal                            |   Milestone:  Future
                                              |  Release
Component:  Upgrade/Install                   |     Version:
 Severity:  normal                            |  Resolution:
 Keywords:  early has-patch has-testing-info  |     Focuses:
----------------------------------------------+----------------------------

Comment (by mai21):

 Replying to [comment:98 mikeschroder]:
 > I surfaced this at GDDY for more feedback and testing by appropriate
 folks.
 >
 > Haven't done deep testing, but did an initial review of
 [https://github.com/WordPress/wordpress-develop/pull/1492/ PR 1492].
 >
 > These look like great changes + checks to improve the reliability of the
 updater.
 >
 > Thank you!!

 Checked the following on [https://github.com/WordPress/wordpress-
 develop/pull/1492]:
 - If the wp-content/temp-backup folder is not writable, there should be an
 error in the site-health screen.**(pass)**
 - When updating a plugin, you should be able to see the old plugin in the
 wp-content/upgrade/temp-backup/plugins/PLUGINNAME folder. The same should
 apply for themes. Since updates sometimes run fast and we may miss the
 folder creation during testing, you can add return true; as the 1st line
 inside the WP_Upgrader->delete_temp_backup() method. This will return
 early and skip deleting the backup on update-success. **(pass)**
 - If the server has less than 20MB available, there should be an error in
 the site-health screen that updates may fail. If the server has less than
 100MB, it should be noticed that disk space is running low. => Any ideas
 on how to control server size while using [https://localwp.com/]?
 **(blocked)**
 - For the failed update I tried the following:** (Inprogress)**
 1- add {{{return true;}}}
  as the 1st line inside the {{{WP_Upgrader->delete_temp_backup()}}}

 2- upgrade theme
 3- turn off the internet
 4- notice the upgrade folder
 5- turn on the network after awhile
 ===> update failed and the theme was never added to the upgrade folder in
 the 1st place which I think is fine unless if backup shall be there while
 processing then will be deleted /or restored in case of success /failure



 **Finally having 2 questions:**

 1- How to do the needed prequest of server size?
 2- What is exactly expected with failure of upgrade regarding backup file?
 is it ever added to the upgrade folder?

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


More information about the wp-trac mailing list