-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix/update unzip rollbacks #1492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ed7968 to
8f4fbb8
Compare
6b7b338 to
fb471b3
Compare
429ed3a to
cac3e4a
Compare
aristath
added a commit
to aristath/rollback-update-failure
that referenced
this pull request
Aug 30, 2021
afragen
added a commit
to WordPress/rollback-update-failure
that referenced
this pull request
Aug 30, 2021
1385ad8 to
84521d7
Compare
Including translator comments.
Member
|
Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/51815. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch aims to improve the stability of plugin/theme updates, by adding the ability to "rollback" failed updates.
wp-content/upgrade/temp-backup/plugins/PLUGINNAMEorwp-content/upgrade/temp-backup/themes/THEMENAMEfolder. The reason we chose to move instead of zip, is because zipping/unzipping are very resources-intensive processes, and would increase the risk on low-end, shared hosts. Moving on the other hand is performed instantly and won't be a bottleneck.upgrade/temp-backupfolder gets restored to its original locationTo avoid confusion: The "temp-backup" folder will NOT be used to "roll-back" a plugin to a previous version after an update. This folder will simply contain a transient backup of the previous version of a plugins/themes getting updated, and as soon as the update process finishes, the folder will be empty.
Testing instructions:
wp-content/temp-backupfolder is not writable, there should be an error in the site-health screen.wp-content/upgrade/temp-backup/plugins/PLUGINNAMEfolder. The same should apply for themes. Since updates sometimes run fast and we may miss the folder creation during testing, you can addreturn true;as the 1st line inside theWP_Upgrader->delete_temp_backup()method. This will return early and skip deleting the backup on update-success.^ That is the main feature in this PR and what should be thoroughly tested: Update failures.
Trac ticket: https://core.trac.wordpress.org/ticket/51857
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.