Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Dependencies Support #407

Open
Luc45 opened this issue Feb 17, 2024 · 5 comments
Open

Plugin Dependencies Support #407

Luc45 opened this issue Feb 17, 2024 · 5 comments

Comments

@Luc45
Copy link

Luc45 commented Feb 17, 2024

Feature Request

WordPress 6.5 adds the Plugin Dependencies capability. It would be useful if plugin install had a --with-dependencies flag to also install the dependencies of the plugin being installed.

@swissspidy
Copy link
Member

Generally speaking, we need to test with the new plugin dependencies feature and see if and what to change. If the plugin‘s API provides this information easily, then I could see such a flag being useful for sure.

@Luc45
Copy link
Author

Luc45 commented Feb 19, 2024

I haven't looked at how WP Core does it, but it should probably be surfaced on the API already to render it on the wp-admin?plugins.php page

@swissspidy
Copy link
Member

swissspidy commented Feb 19, 2024

Right. This is surfaced in the API via the requires_plugins field which contains an array of slugs.

Example: https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=wpsso-wc-metadata&fields=versions

So should be available for us too 👍

Edit:

for already installed plugins we might be able to use the WP_Plugin_Dependencies class

@swissspidy
Copy link
Member

One use case I just stumbled upon:

Provide an easy way to install all dependencies of a plugin.

e.g. if I have plugin X installed (not necessarily activated) that depends on Y and Z, I want an easy way to install Y and Z, without having to activate X.

@swissspidy swissspidy changed the title Are there any plans to add --with-dependencies or similar to plugin install? Apr 4, 2024
@swissspidy
Copy link
Member

Listing dependencies in wp plugin get <slug> would also be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment