Opened 6 years ago
Last modified 5 years ago
#4253 accepted defect (bug)
Plugins API `query_plugins` produces wrong number of results
Reported by: | schlessera | Owned by: | tellyworth |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Plugin Directory | Keywords: | |
Cc: |
Description
The per_page
argument for the Plugins API query_plugins
action seems to return the wrong number of results in some cases.
So, if you limit the per_page
to 20, you only get 19 items back event though that there are more than 20 results available.
We are hitting this issue with the WP-CLI plugin search
command, which shows the exact count of elements returned. See https://github.com/wp-cli/extension-command/issues/156 for the related issue.
Change History (5)
#2
@
6 years ago
I think I'm okay with the API returning less than the paged amount of results as a whole, but reducing those cases is certainly worthwhile.
Currently none of the post statuses are marked as excluded from search, so doing that might help (patch not needed)
Looking at the ElasticSearch search & result though, it doesn't reference the post_status
field anywhere, but upon looking into it, the disabled plugin is showing as "post_status": "publish",
within Elastic Search, so it could just be an ingestion bug.
This appears to be because one of the results in that particular search query is a closed plugin. It shouldn't be appearing at all in the results, one would think.
The API filters it out thus creating the wrong count. Not sure why it comes back in the search results in the first place though.