[wp-trac] [WordPress Trac] #60692: Plugin dependencies: Allow a mu-plugin to fulfil a dependency
WordPress Trac
noreply at wordpress.org
Wed May 22 00:02:31 UTC 2024
#60692: Plugin dependencies: Allow a mu-plugin to fulfil a dependency
-----------------------------+---------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.6
Component: Upgrade/Install | Version: 6.5
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses:
-----------------------------+---------------------
Comment (by knutsp):
Let a mu-plugin stay as any .php file that exists in the mu-plugins
folder, as now. Some recommedations is ok, like Plugin Name, Version
headers and so on. The rest is up to the developer and/or any with file
system access.
Make it simple. Create a `register_dependency_plugin_slug` function (or
any better name) to add a plugin slug to a global array, or a class
static, or a singleton object, array property, like the best of existing
register_something functions. Maybe make this array immutable after all
mu-plugins are loaded. In this way any, plugin author can add this, in
prepartion to support being a loaded as a mu-plugin. Loader files, that
load many individual plugins in subfolders, who does not register, allow
multiple calls, one slug string at per call.
This allows any properly coded plugin, with no hard coded assumptions on
where in the file systems it is loaded from, to work as a mu-plugin and
also act as a dependency for other plugins.
A new plugin file header may be added, to indicate mu-plugin support, like
network, but this is not essential
A mu-plugin declaring own dependencies should continue to be ignored, as
developer territory.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60692#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list