[wp-trac] [WordPress Trac] #52381: Add filter for results of `WP_Upgrader::install_package()` (was: Add filter for results of `copy_dir()` in WP_Upgrader)
WordPress Trac
noreply at wordpress.org
Wed Jan 27 16:17:41 UTC 2021
#52381: Add filter for results of `WP_Upgrader::install_package()`
-----------------------------+-----------------------
Reporter: afragen | Owner: afragen
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.7
Component: Upgrade/Install | Version:
Severity: normal | Resolution:
Keywords: has-patch early | Focuses:
-----------------------------+-----------------------
Changes (by afragen):
* owner: (none) => afragen
* status: new => assigned
Old description:
> Adding a filter to the result of `copy_dir()` in
> `WP_Upgrader::install_package()` allows for the capture and usage of
> error data resulting from the `copy_dir()` function.
>
> The proposed filter additionally allows for a potential plugin/theme
> rollback in the event of an update failure due to `copy_dir()`. A
> rollback feature for plugin/theme update failures was originally proposed
> in #51857.
>
> A feature plugin [https://github.com/afragen/rollback-update-failure
> Rollback Update Failure] is available for testing utilizing this filter.
New description:
Adding a filter to the result of `install_package()` in
`WP_Upgrader::install_package()` allows for the capture and usage of error
data resulting from the `install_package()` function.
The proposed filter additionally allows for a potential plugin/theme
rollback in the event of an update failure due to `copy_dir()`, but more
generally a failure during `install_package()`. A rollback feature for
plugin/theme update failures was originally proposed in #51857.
A feature plugin [https://github.com/afragen/rollback-update-failure
Rollback Update Failure] is available for testing utilizing this filter.
--
Comment:
Moved filter to more general `upgrader_install_complete` after the
`install_package()` process.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52381#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list