Skip to content

[WIP] Update output log to show which plugin is being updated#493

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/update-output-logging-for-plugins
Closed

[WIP] Update output log to show which plugin is being updated#493
Copilot wants to merge 1 commit intomainfrom
copilot/update-output-logging-for-plugins

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>wp plugin update all doesnt display info which plugin is being updated</issue_title>
<issue_description>The output for all plugins updated is always this:

Unpacking the package...
Installing the plugin...
Removing the old version of the plugin...
Plugin updated successfully.
Success: Installed 1 of 1 plugins.

Would be much more helpful if it at least said once which plugin it is updating in a separate line first.</issue_description>

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

@danielbachhuber > Would be much more helpful if it at least said once which plugin it is updating in a separate line first.

I agree!</comment_new>
<comment_new>@danielbachhuber
I think it would still be nice to indicate the plugin in the log output, e.g.:

$ wp plugin update --all
Enabling Maintenance mode...
Updating akismet
Downloading update from https://downloads.wordpress.org/plugin/akismet.3.1.11.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Updating nginx-champuru
Downloading update from https://downloads.wordpress.org/plugin/nginx-champuru.3.2.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Disabling Maintenance mode...
````</body></comment_new>
<comment_new><author>@swissspidy</author><body>
We should be able to override those strings simply by extending `Plugin_Upgrader` and overriding the `upgrade_strings()` / `install_strings()` methods.</body></comment_new>
<comment_new><author>@danielbachhuber</author><body>
@baizmandesign Thanks for diving into it!

> The previous comments say that we need to extend Plugin_Upgrader and over-ride upgrade_strings() and install_strings(). It was also necessary for me to over-ride the entire run() method of the Plugin_Upgrader class located in [wp-admin/includes/class-wp-upgrader.php](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/includes/class-wp-upgrader.php). While this worked, it introduced quite a bit of redundant code. Is there an approach that doesn't require so much duplication (~220 lines)?

Oh wow, that's a lot of code. We don't want to fork core that substantially for something relatively inconsequential like this.

What made it necessary to override the entire `run()` method?</body></comment_new>
<comment_new><author>@danielbachhuber</author><body>
@baizmandesign It looks like this `before()` method is called roughly when we'd like it to:

https://github.com/WordPress/wordpress-develop/blob/ee5142efbca11450e7befd202d37eba4660173c1/src/wp-admin/includes/class-wp-upgrader.php#L812

We can render whatever output we'd like in our custom `UpgraderSkin`:

https://github.com/wp-cli/wp-cli/blob/52751b1d1f8bdf0b47d38942ec199c7840ee1d85/php/WP_CLI/UpgraderSkin.php#L13

If that doesn't work for whatever reason, we could instead render some output on this filter:

https://github.com/WordPress/wordpress-develop/blob/ee5142efbca11450e7befd202d37eba4660173c1/src/wp-admin/includes/class-wp-upgrader.php#L796

I think both of these would be better than forking `run()`.</body></comment_new>
<comment_new><author>@danielbachhuber</author><body>
> The "Name" field is the closest thing to the slug I could find. Here's what some sample output looks like when updating two plugins:

I think this could be fine. Can you share all of the data that's in the array?



> It seems to be the case that all of the status messages that appear during the upgrade process are stored in the `$strings` property of the `Plugin_Upgrader` object. The text I'm outputting only lives in the `before()` method of the `UpgraderSkin` object. Should we add this text to the `$strings` property?

I don't fully grok the implications of this. Can you explain further?</body></comment_new>
<comment_new><author>@BrianHenryIE</author><body>
There's a few options here.

1. Your existing WIP, https://github.com/wp-cli/wp-cli/compare/main...baizmandesign:wp-cli:feature/plugin-update-info-261, needs to check `isset( $this->plugin_info )` because that array doesn't seem to be available during a plain `wp plugin install plugin-slug`, and decode the special characters from the string
2. That array will, for .org plugins, have a `PluginURI` field where the slug can be found with `preg_match('/https:\/\/wordpress.org\/plugins\/(.*?)\//', $input_line, $output_array);`
3. Open a patch for Core to pass the [Plugin_Upgrader::bulk_upgrade() `$options`](https://github.com/WordPress/WordPress/blob/797fa55a03c24ec85a5f28c629f1eaf257d9010c/wp-admin/includes/class-plugin-upgrader.php#L380-L396) array to [WP_Upgrader_Skin::before()](https://github.com/WordPress/WordPress/blob/797fa55a03c24ec85a5f28c629f1ea...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes wp-cli/extension-command#261

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

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.

2 participants