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

WordPress Trac noreply at wordpress.org
Sun Nov 14 19:39:45 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-testing-info needs-unit-   |     Focuses:
  tests needs-testing has-patch                  |
-------------------------------------------------+-------------------------
Changes (by pbiron):

 * keywords:  early has-testing-info needs-unit-tests needs-testing needs-
     patch => early has-testing-info needs-unit-tests needs-testing has-
     patch


Comment:

 Replying to [comment:155 johnbillion]:
 > There are some problems with the `delete_temp_updater_backups` cron
 event added in [51815]. It's getting scheduled multiple times and its
 action is not present when the event runs.

 Thanx @johnbillion.  I confirmed that the problems you reported are real.

 [attachment:"51857-cron-fix.diff"] addresses them. However, instead of
 adding the action in `wp-includes/default-filters.php`, I added it in `wp-
 includes/update.php` and also move the
 `WP_Upgrader::delete_all_temp_backups()` method to a standalone
 `wp_delete_all_temp_backups()` function in `wp-includes/update.php`, to
 avoid having to change that method to be static and doing a `require_once
 ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';` on every request.

 I'm not 100% sure on that new function name.  As a standalone function
 maybe it should be `wp_delete_all_update_temp_backups()`???  Opinions?

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


More information about the wp-trac mailing list