Skip to content

Conversation

Copy link

Copilot AI commented Nov 8, 2025

Adds wp plugin check-update and wp theme check-update commands, providing parity with wp core check-update.

Implementation

Commands added:

  • wp plugin check-update [<plugin>...] [--all] [--fields=<fields>] [--format=<format>]
  • wp theme check-update [<theme>...] [--all] [--fields=<fields>] [--format=<format>]

Behavior:

  • Exit code 0 always (matches core check-update)
  • Success message when no updates available
  • Table output listing available updates (name, status, version, update_version)
  • Supports filtering by specific items or --all flag
  • Supports output formats: table, csv, json, yaml

Files modified:

  • src/Plugin_Command.php - Added check_update() method with @subcommand check-update annotation
  • src/Theme_Command.php - Added check_update() method with @subcommand check-update annotation
  • composer.json - Registered new commands

Tests:

  • features/plugin-check-update.feature - 7 scenarios
  • features/theme-check-update.feature - 7 scenarios

Example Usage

# Check for updates
$ wp plugin check-update
+-----------+--------+---------+----------------+
| name      | status | version | update_version |
+-----------+--------+---------+----------------+
| akismet   | active | 4.1.0   | 4.1.1          |
+-----------+--------+---------+----------------+

# No updates available
$ wp theme check-update
Success: All themes are up to date.

# Check specific items or all
$ wp plugin check-update akismet
$ wp theme check-update --all --format=json

Resolves #112

Original prompt

This section details on the original issue you should resolve

<issue_title>Possibility to check-updates for plugins, themes and languages</issue_title>
<issue_description>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

</issue_description>

Comments on the Issue (you are @copilot in this section)

@danielbachhuber 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.</comment_new>
<comment_new>@mrsdizzie
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.</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 8, 2025
Copilot AI and others added 2 commits November 8, 2025 16:24
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add possibility to check for updates on plugins, themes, and languages Add check-update commands for plugins and themes Nov 8, 2025
Copilot AI requested a review from swissspidy November 8, 2025 16:29
Copilot finished work on behalf of swissspidy November 8, 2025 16:29
@swissspidy
Copy link
Member

@copilot you're missing the @subcommand check-update annotation for the two new subcommand methods.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 9, 2025

@copilot you're missing the @subcommand check-update annotation for the two new subcommand methods.

Added the @subcommand check-update annotation to both methods in commit 0f4b688.

Copilot finished work on behalf of swissspidy November 9, 2025 11:31
@swissspidy swissspidy marked this pull request as ready for review November 10, 2025 15:38
@swissspidy swissspidy requested a review from a team as a code owner November 10, 2025 15:38
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Plugin_Command.php 96.66% 1 Missing ⚠️
src/Theme_Command.php 94.44% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy added this to the 2.3.0 milestone Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possibility to check-updates for plugins, themes and languages

2 participants