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

WordPress Trac noreply at wordpress.org
Tue Nov 30 19:10:47 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                  |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"52289" 52289]:
 {{{
 #!CommitTicketReference repository="" revision="52289"
 Upgrade/Install: Make some adjustments to the `move_dir()` function:

 * Check for direct PHP flle access and only use `rename()` if true.
 * Check whether the destination directory was successfully created.
 * Clear the working directory so there is internal parity within the
 function between the results of a successful `rename()` and a fallback to
 `copy_dir()`.
 * Use `move_dir()` in `WP_Upgrader::move_to_temp_backup_dir()` and
 `::restore_temp_backup()`.

 Follow-up to [51815], [51898], [51899], [51902], [52192], [52284].

 Props afragen, peterwilsoncc, dd32, SergeyBiryukov.
 See #54166, #51857.
 }}}

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


More information about the wp-trac mailing list