[wp-trac] [WordPress Trac] #51857: Add rollback for failed plugin/theme updates
WordPress Trac
noreply at wordpress.org
Sun Jun 26 12:35:45 UTC 2022
#51857: Add rollback for failed plugin/theme updates
-------------------------------------------------+-------------------------
Reporter: pbiron | Owner: pbiron
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.1
Component: Upgrade/Install | Version:
Severity: normal | Resolution:
Keywords: early has-testing-info needs-unit- | Focuses:
tests has-patch needs-dev-note needs-testing |
-------------------------------------------------+-------------------------
Comment (by SergeyBiryukov):
In [changeset:"53578" 53578]:
{{{
#!CommitTicketReference repository="" revision="53578"
Upgrade/Install: Add a conditional to facilitate testing of the Rollbacks
feature project.
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-
update-failure/ Rollback Update Failure feature project] creates a
temporary backup of plugins and themes before updating. This aims to make
the update process more reliable and ensure that if a plugin or theme
update fails, the previous version can be safely restored.
If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback
Update Failure plugin] is installed, `WP_Upgrader::install_package()` will
use the `move_dir()` function from there for better performance. Instead
of copying a directory from one location to another, it uses the
`rename()` PHP function to speed up the process, which is instrumental in
creating a temporary backup without a delay. If the renaming failed, it
falls back to `copy_dir()` WP function.
This conditional aims to facilitate broader testing of the feature. It is
temporary, until the plugin is merged into core.
Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf,
SergeyBiryukov.
Fixes #56057. See #51857, #54166.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51857#comment:263>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list