Closed up1512001 closed 9 months ago
OK so there are a couple of reasons why the tests are not currently working.
First, this PR right now only allows these two new args to be passed, but does not actually change the code to do anything with those args. Support for theme
item types needs to be added in these two places:
I just addressed this in 895e6ad5e406c9ca7b5de3933af5cd53147d1029
Second, and most importantly, the WordPress.org API by default does not actually return information about available versions for themes.
Here's the API response for Hello Dolly: https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=hello-dolly
Here's the API response for Twenty Twelve: https://api.wordpress.org/themes/info/1.2/?action=theme_information&request%5Blocale%5D=en_US&request%5Bslug%5D=twentytwelve
See how there's no versions
field.
To address this, we first need to add support for fetching additional fields. After those code modifications, this PR will work as expected.
See https://github.com/wp-cli/wp-cli/pull/5893 for where I add this support.
Hi @swissspidy @danielbachhuber may I know any update regarding https://github.com/wp-cli/wp-cli/pull/5893 PR and when can I expect feedback for my PR?
This PR is already in good shape. Once https://github.com/wp-cli/wp-cli/pull/5893 is merged, this PR only requires a dependency update and then it should be good to go.
I just pinged the other committers on https://github.com/wp-cli/wp-cli/pull/5893 to review it.
Hey @swissspidy I just checked the new theme update logic as I understand instead of getting info from style.css we will now fetch from the theme archive for its info am I right? Thanks for updating it.
Not sure what you mean, this doesn't really change how themes are looked up or anything.
The one thing I noticed while testing this patch is that filter_item_list()
stored themes with their full directory path as the key. However, plugins are only stored with their slug. This caused problems when filtering the theme transient, as it turns out that didn't really work before, because we were using the full directory path and not the theme slug. That's why there are these changes to use get_stylesheet()
instead of get_stylesheet_directory()
for example.
Another interesting find was that the theme update transient is a list of arrays, whereas for plugins it's a list of objects apparently. So the PR now also caters for that.
As you can see, all existing tests are still passing and the new tests helped uncover these flaws.
Hey, @danielbachhuber as https://github.com/wp-cli/wp-cli/pull/5893 this PR is merged can you please update this PR status? Thank You.
Fixes https://github.com/wp-cli/extension-command/issues/394
Added missing CLI option for
--minor
and--patch
intowp theme update
command list.Output Before Adding CLI Options for
--minor
&--patch
Output After Adding CLI Options for
--minor
&--patch