[wp-trac] [WordPress Trac] #58281: Rollback Auto-Update (Rollback part 3)

WordPress Trac noreply at wordpress.org
Wed May 10 02:31:58 UTC 2023


#58281: Rollback Auto-Update (Rollback part 3)
-------------------------+-------------------------------------------------
 Reporter:  afragen      |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:               |    Version:  trunk
  Upgrade/Install        |   Keywords:  has-patch dev-feedback needs-
 Severity:  normal       |  testing
  Focuses:               |
-------------------------+-------------------------------------------------
 This is Rollback part 3. It began with `move_dir()` in WP 6.2 for part 1.
 Part 2 was completed with #51857. This brings us to part 3.

 Part 3 is Rollback for auto-updates. When manually updating plugins if the
 plugin has a fatal error on reactivation, the plugin is prevented from
 reactivating. Unfortunately, during an auto-update, this reactivation
 check doesn't occur and the the next time the site runs users will see the
 WSOD.

 Rollback Auto-Update performs a similar re-activation check and if there
 is a fatal error it is captured in an error handler and the previously
 installed plugin is restored. If this occurs an email will be sent
 notifying the site admin of the failed update and rollback.

 After the rollback, the pending auto-updating for core and theme updates
 are restarted.

 This code is currently running for everyone who has the
 [https://wordpress.org/plugins/rollback-update-failure/| Rollback Update
 Failure] feature plugin installed.

 I personally have been testing this using a plugin that will fatal if the
 update occurs. The plugin is on my test site, active, and set to auto-
 update. I have been running like this since the beginning of the year.

 The PR is slightly different than the code in the feature plugin. Please
 test, run the feature plugin on your site, and review the code in the PR.
 Mostly give us your comments and feedback.

 props  @costdev and @pbiron for continuing code review, rubber ducking,
 and sanity checks.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58281>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list