You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documented url field cannot be use in wp plugin search command's --fields option #470
According to the latest documentation and wp help plugin search, the --fields option support the field url, which should be the "Plugin's URL on wordpress.org".
In reality, if I add "url" to the --fields option, it will always show "Error: Invalid field: url.":
Or maybe I'm also wrong and the error occurs because of our field validation: if one entry in the list doesn't have the required field but the others do, we still error.
There are many of fields on the API endpoint response that are not documented anywhere. Even a 6 years old comment is more updated than the official function description above it. This is a serious issue with usability. Some sort of JSON schema should be maintained along with the API so other tools may draw that information and document accordingly.
Where should I report this? Is there anyway I can contribute to the API maintenance to add this schema?
I know this is not an issue of wp-cli, but I don't seem to find any straightforward answer anywhere about this.
The file responsible for the API endpoint is this file (current version). Will take a look at the source code to see if I can get it to serve a schema json.
Actually I found a download_link field in the API that is quite useful for me.
One of the reason I want to see it is when I tried Fair PM, it is hard to know if the installation is successful or not. Checking the download_link made it clear to me that the plugin works.
@yookoala Turns out there was actually a bug in WP-CLI, as apparently the url field is something this command added on its own, but it didn't work with newer WP versions. #474 will fix that now.
Activity
swissspidy commentedon Nov 3, 2025
Hi there, thanks for your detailed report!
Looking at https://developer.wordpress.org/reference/functions/plugins_api/ and https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request, then there is indeed no
urlfield. Maybe it was there in the past & got removed. We should go through the list to remove the ones that aren't actually there.Or maybe I'm also wrong and the error occurs because of our field validation: if one entry in the list doesn't have the required field but the others do, we still error.
yookoala commentedon Nov 4, 2025
There are many of fields on the API endpoint response that are not documented anywhere. Even a 6 years old comment is more updated than the official function description above it. This is a serious issue with usability. Some sort of JSON schema should be maintained along with the API so other tools may draw that information and document accordingly.
Where should I report this? Is there anyway I can contribute to the API maintenance to add this schema?
I know this is not an issue of wp-cli, but I don't seem to find any straightforward answer anywhere about this.
swissspidy commentedon Nov 4, 2025
https://meta.trac.wordpress.org/ Would be the place to report that. Not sure how public that particular code base is though.
yookoala commentedon Nov 4, 2025
Opened a ticket here: https://meta.trac.wordpress.org/ticket/8124
Let's see what can be done there.
yookoala commentedon Nov 6, 2025
The file responsible for the API endpoint is this file (current version). Will take a look at the source code to see if I can get it to serve a schema json.
swissspidy commentedon Nov 6, 2025
Thanks! We can use that to update our documentation in the meantime.
yookoala commentedon Nov 6, 2025
Further read the code. It seems the route is only for Plugin Directory. Not the JSON API endpoint for plugin information.
swissspidy commentedon Nov 6, 2025
Just opened #474 now
yookoala commentedon Nov 6, 2025
Actually I found a
download_linkfield in the API that is quite useful for me.One of the reason I want to see it is when I tried Fair PM, it is hard to know if the installation is successful or not. Checking the download_link made it clear to me that the plugin works.
swissspidy commentedon Nov 6, 2025
Yeah that's the field we use for installing the plugins :)
swissspidy commentedon Nov 6, 2025
@yookoala Turns out there was actually a bug in WP-CLI, as apparently the
urlfield is something this command added on its own, but it didn't work with newer WP versions. #474 will fix that now.