[wp-trac] [WordPress Trac] #62043: Allow plugins and themes perform extra checks upon install/upgrade via filter
WordPress Trac
noreply at wordpress.org
Thu Sep 12 07:55:30 UTC 2024
#62043: Allow plugins and themes perform extra checks upon install/upgrade via
filter
------------------------------+-----------------------------
Reporter: LeonidasMilossis | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: trunk
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
Currently, if a plugin (or a theme) wants to perform custom checks upon
plugin install/upgrade, they need to either hook into the existing
`upgrader_source_selection` filter or extend the `Plugin_Upgrader` class,
which is suboptimal as it leads to code duplication and/or processes being
repeated on every install/upgrade.
Ideally, we can have a more specific filter for more granularity in the
process.
For example, say a plugin wants to check against a custom plugin header
(potentially added via the `extra_plugin_headers` filter). By having a
filter at the end of the `Plugin_Upgrader::check_package()` (or the
respective one from `Theme_Upgrader`), after all the core checks have been
passed, we can allow plugin authors to just add additional checks
depending on their needs.
That filter will allow plugins to hook into it and return a `WP_Error`
like the checks above it, to prevent installs/upgrade when a custom check
fails.
All that would be especially useful for plugin add-ons that require a
minimum installed version of their main plugin to be active before
installed/upgraded.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62043>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list