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

WordPress Trac noreply at wordpress.org
Wed Sep 22 09:03:05 UTC 2021


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

Comment (by aristath):

 Replying to [comment:125 desrosj]:
 > Just wanted to report that this has been running without issue on my
 site since committing.

 That's great to hear, thank you for verifying!

 > One thing I did notice is that the `temp-backup` directory remains in
 `upgrade` after an update completes. When a Core auto-update happens, the
 `upgrades` directory is completely emptied. Should the plugin/theme
 process just clean up the `temp-backup` directory?

 The PR added an exception for the `temp-backup` folder so when an update
 runs, that folder does not get deleted (see
 https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-
 wp-upgrader.php?rev=51815#L337). This was done to ensure that in case
 multiple updates run at the same time, the backups won't get deleted
 before the update finishes running. This also decreases the effect of
 https://core.trac.wordpress.org/ticket/53705: The downloaded/to-be-
 installed files get deleted, but the backup remains and is restored on
 failure so there are no errors.

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


More information about the wp-trac mailing list