wp-cli / extension-command

Manages plugins and themes, including installs, activations, and updates.
MIT License
90 stars 79 forks source link

Add `requires_php` to the `wp plugin list --update=available` output #428

Open dd32 opened 4 months ago

dd32 commented 4 months ago

The following command can be used to list out plugin updates:

wp plugin list --update=available

but it includes plugins which are incompatible with the current site, due to either the requires or requires_php field values.

It would be helpful to be able to add the following fields to the output if supported:

The update API appears to only return requires for no-update plugins and not the requires_php/tested/requires_plugins (this can be fixed) but expanding the data would be helpful.

It would additionally be useful to be able to filter plugins based on those fields, such as --update=available --canbeinstalled or something of the sort, for example, if a plugin requires PHP 8 but I'm running PHP 7.4 I don't want it included. I don't know how best to achieve that.