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

WordPress Trac noreply at wordpress.org
Thu May 4 02:35:14 UTC 2023


#51857: Add rollback for failed plugin/theme updates
-------------------------------------------------+-------------------------
 Reporter:  pbiron                               |       Owner:  pbiron
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.3
Component:  Upgrade/Install                      |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-testing-info has-patch needs-    |     Focuses:
  dev-note commit                                |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55720" 55720]:
 {{{
 #!CommitTicketReference repository="" revision="55720"
 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 backup kept in the temporary 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 `upgrade-temp-backup` directory is
 writable.
 * A check that there is enough disk space available to safely perform
 updates.

 To avoid confusion: The temporary 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.

 Follow-up to [55204], [55220].

 Props afragen, costdev, pbiron, azaozz, hellofromTonya, aristath,
 peterwilsoncc, TJNowell, bronsonquick, Clorith, dd32, poena,
 TimothyBlynJacobs, audrasjb, mikeschroder, a2hosting, KZeni, galbaras,
 richards1052, Boniu91, mai21, francina, TobiasBg, desrosj, noisysocks,
 johnbillion, dlh, chaion07, davidbaumwald, jrf, thisisyeasin,
 ignatggeorgiev, SergeyBiryukov.
 Fixes #51857.
 }}}

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


More information about the wp-trac mailing list