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

Possibility to check-updates for plugins, themes and languages #384

Open
MoBlockbuster opened this issue Nov 13, 2023 · 3 comments
Open

Comments

@MoBlockbuster
Copy link

MoBlockbuster commented Nov 13, 2023

I think it would be very helpful if there is a possibility to check if updates exist.
Thes feature is already implemented for the wp core:

https://developer.wordpress.org/cli/commands/core/check-update/

But there is no such a feature for plugins, themes and languagepacks.

Plugin parameter overview:

https://developer.wordpress.org/cli/commands/plugin/

Theme parameter overview:

https://developer.wordpress.org/cli/commands/theme/

Langauge parameter overview:

https://developer.wordpress.org/cli/commands/language/core/
https://developer.wordpress.org/cli/commands/language/plugin/
https://developer.wordpress.org/cli/commands/language/theme/

It would be also nice, if the check-update parameter provide returncodes.
Example:

wp plugin check-update -> no updates -> returncode = 0

wp core check-update -> update available -> returncode = 1

wp theme check-update -> unknown error -> returncode = 2

Thanks and Cheers

@danielbachhuber
Copy link
Member

Thanks for the suggestion, @MoBlockbuster !

I'm amenable to creating parity with wp core check-update. We'll want to follow its behavior, though:

$ wp core check-update
Success: WordPress is at the latest version.
$ echo $?
0
$ wp core check-update
+---------+-------------+-----------------------------------------------------------------------+
| version | update_type | package_url                                                           |
+---------+-------------+-----------------------------------------------------------------------+
| 6.1.4   | minor       | https://downloads.wordpress.org/release/wordpress-6.1.4-partial-0.zip |
| 6.4.1   | major       | https://downloads.wordpress.org/release/wordpress-6.4.1.zip           |
+---------+-------------+-----------------------------------------------------------------------+
$ echo $?
0

Notably, the return code is always 0, even when there are updates available.

@MoBlockbuster
Copy link
Author

Hi @danielbachhuber,
I assume the check-update parameter is a huge advance for the wp-cli community.

The returncodes are helpful for the check-condition to check if there is an update befor a real update run.
But I think we can parse the wp-cli output and define if an update is found or not.

Thanks for your support

@mrsdizzie
Copy link
Contributor

If you want to se if there are any plugin or theme updates (as in your example) this currently works and provides sort of similar information:

wp plugin list --update=available
wp theme list --update=available

I'm not familiar with languages but I think it works similarly:
wp language plugin list --all --update=available

I don't know if plugins can provide details on if something is a patch or major update since they all probably use different versioning.

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

No branches or pull requests

3 participants