Opened 11 years ago
Closed 10 years ago
#27754 closed enhancement (fixed)
Add ability to filter WP_Upgrader packages before upgrade
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Upgrade/Install | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Although #22378 adds a upgrader_pre_download
filter which allows for denying a package for an update, there are cases where we would need to filter the package options or even trigger the upgrader_pre_download
filter based on other arguments before that.
A good example would be changing the destination to a local file or an internal repository (like a CDN for plugins) for an internal network for bandwidth or speed purposes.
I'm adding a sample upgrader_package_options
filter right before extracting the options in the run()
function which is the central point and the last step in the stack for this after calling functions like install() or upgrade() have been fired from different places.
Attachments (5)
Change History (12)
#2
@
10 years ago
I refreshed the patch.
I'm personally interested in this update since without this filter, many functions hardwire clear_destination to false. This results in difficulties when users attempt to upgrade existing plugins or themes by supplying a zip file.
With this filter, more advanced install and upgrade features can be implemented without having to create custom implementations of the various upgrader classes just for the purpose of customizing these arguments.
#3
@
10 years ago
- Keywords commit added; needs-docs removed
- Milestone changed from Awaiting Review to 4.3
Looks like a useful filter that doesn't seem to be able to be handled elsewhere.
#6
@
10 years ago
The filter opens the possibility for plugins to do a lot of stuff they shouldn't, but plugins can already break things in amazing ways :) So it looks fine to me.
As for the use-case of using a local CDN for update packages, it feels like they would be better served by a caching proxy, but understand why that's not a ideal solution to many.
You'll also need hook documentation here.