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

WordPress Trac noreply at wordpress.org
Wed Sep 15 18:39:23 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 SergeyBiryukov):

 In [changeset:"51815" 51815]:
 {{{
 #!CommitTicketReference repository="" revision="51815"
 Upgrade/Install: Create a temporary backup of plugins and themes before
 updating.

 This aims to make the update process more reliable and ensures that if a
 plugin or theme update fails, the previous version can be safely restored.

 * When updating a plugin or theme, the old version is moved to a temporary
 backup directory:
  * `wp-content/upgrade/temp-backup/plugins/[plugin-slug]` for plugins
  * `wp-content/upgrade/temp-backup/themes/[theme-slug]` for themes.

 * If the update fails, then the temporary backup kept in the `upgrade
 /temp-backup` directory is restored to its original location.
 * If the update succeeds, the temporary backup is deleted.

 To further help troubleshoot plugin and theme updates, two new checks were
 added to the Site Health screen:
 * A check to make sure that the `temp-backup` directory is writable.
 * A check that there is enough disk space available to safely perform
 updates.

 To avoid confusion: The `temp-backup` directory will NOT be used to "roll
 back" a plugin to a previous version after a completed update. This
 directory will simply contain a transient backup of the previous version
 of a plugin or theme being updated, and as soon as the update process
 finishes, the directory will be empty.

 Props aristath, afragen, pbiron, dd32, poena, TimothyBlynJacobs, audrasjb,
 mikeschroder, a2hosting, hellofromTonya, KZeni, galbaras, richards1052,
 Boniu91, mai21, francina, SergeyBiryukov.
 See #51857.
 }}}

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


More information about the wp-trac mailing list