Opened 5 months ago
Last modified 5 months ago
#8060 new defect (bug)
Plugins missing when querying by author in Plugin Info API
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Component: | Plugin Directory | Keywords: | |
| Cc: |
Description
I'm experiencing an issue where some plugins that are listed under a particular author are not appearing in the Plugin API (query_plugins) when querying that same author.
For example, this API request: https://api.wordpress.org/plugins/info/1.2/?per_page=50&action=query_plugins&author=woocommerce
Returns a single page of results, containing 35 plugins.
However, I believe this query should also be listing the woocommerce-gateway-affirm plugin.
This API request shows that the author field on this plugin is set to woocommerce: https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&slug=woocommerce-gateway-affirm
I'm aware that outdated plugins that have not been updated for a while (10 years I think?) are excluded from the API results, but that does not apply to this plugin and there is no other obvious reason for the exclusion.
Change History (4)
#2
@
5 months ago
Thanks for the response, @mindctrl. It would make sense, I've spot-checked a few other plugins that do appear in the results for that request and 'woocommerce' is present in all of them.
Probably not a bug, then! Although it's curious that the plugin is listed on the web version of WooCommerce's profile (https://profiles.wordpress.org/woocommerce)
#3
@
5 months ago
@gazchap I noticed it was listed on their dot org profile. I tried to find a GitHub repo to report the problem with their readme.txt, but was unable to find it.
For the search issue specifically, I wonder if @dd32 might be able to provide some insight.
#4
@
5 months ago
- Component changed from API to Plugin Directory
This is indeed caused by the Contributors: line in the readme not containing the plugin author.
Elsewhere on WordPress.org we include plugins that are owned by the queried user, but in this particular search we're only looking at the contributors taxonomy:
WP_Query excerpt:
public 'tax_query' =>
object(WP_Tax_Query)[1305]
public 'queries' =>
array (size=1)
0 =>
array (size=2)
0 =>
array (size=5)
'taxonomy' => string 'plugin_contributors' (length=19)
'terms' =>
array (size=1)
0 => string 'woocommerce' (length=11)
'field' => string 'slug' (length=4)
'operator' => string 'IN' (length=2)
'include_children' => boolean true
'relation' => string 'OR' (length=2)
public 'relation' => string 'AND' (length=3)
protected 'table_aliases' =>
array (size=1)
0 => string 'wp_term_relationships' (length=28)
public 'queried_terms' =>
array (size=1)
'plugin_contributors' =>
array (size=2)
'terms' =>
array (size=1)
0 => string 'woocommerce' (length=11)
'field' => string 'slug' (length=4)
public 'primary_table' => string 'wp_posts' (length=15)
public 'primary_id_column' => string 'ID' (length=2)
WP_Query doesn't have a good way to do a post_author = 123 OR taxonomy has AUTHORNAME slug, so this is kinda hard to query purely as a union of two data-sources.
In [14396] I forced the primary owner of the plugin to always show as a contributor, instead of doing it at runtime like I did there, it should probably happen at plugin import time / author change time so that the taxonomy always has the plugin author listed.. which would then solve this problem.
Hi @gazchap, welcome to Trac and thanks for the report.
I wonder if this might be because the Affirm plugin readme.txt has an invalid value for "Contributors".
See https://wordpress.org/plugins/developers/readme-validator/?readme=https%3A%2F%2Fplugins.svn.wordpress.org%2Fwoocommerce-gateway-affirm%2Ftrunk%2Freadme.txt