WordPress.org

Making WordPress.org

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#4778 closed defect (fixed)

/plugins/info/1.2 failed to return all plugins

Reported by: shaharia.azam Owned by: dd32
Milestone: Priority: normal
Component: API Keywords:
Cc:

Description

When I access https://api.wordpress.org/plugins/info/1.2/?action=query_plugins it shows me the total number 61849. But if I actually traverse through all page, there are lots of index missing and in total it only returns 48k-49k plugin lists only.

GET https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[page]=1&&request[per_page]=250

{
    "page":1,
    "pages":248,
    "results":61849,
    "plugins": [plugin JSON]
}

So it's obvious that some plugins are being excluded or the total "results" value is wrong. So it's very inconsistent. Isn't it?

Change History (4)

#1 @Otto42
18 months ago

Yes, the actual number of plugins is 54858, at present. There are indeed many hidden, the actual number is in the 85k range.

Plugins that have been closed over time, plugins that have been submitted but not reviewed, plugins that have simply never been uploaded to the SVN after being reviewed, these all throw the numbers out of whack. There are plugin results which you will not be shown for a lot of reasons.

The numbers given by the API are not consistent, nor do they really need to be since the API isn't mean to be used to query the whole space of plugins, nor to pull all the data about all the plugins down from the system. Also, I thought that the paging was limited at 100 pages of plugins, actually, not 250, but that seems about right.

Version 0, edited 18 months ago by Otto42 (next)

#2 @dd32
18 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 9227:

Plugin Directory: API: Only query for 'publish'd plugins.

The Disabled and Closed post_status's are now public statuses, but are not intended to be available through the API, this inflates the number of plugins that the API claims to have, but can't actually return.

Fixes #4778.

#3 @dd32
18 months ago

The query API was retuning plugins with a status in [publish, closed, disabled] but the information endpoint only returned publish which caused some results to get stripped from the response.

The API response now looks like this:

GET https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[page]=1&&request[per_page]=250
{
  "info": {
    "page": 1,
    "pages": 195,
    "results": 48609
  },
  "plugins": [...]
}

Due to caching you'll probably see the 68k and higher page numbers in the API response for the next few hours until they naturally refresh.

#4 @shaharia.azam
18 months ago

Thanks everybody for participate in this ticket.

Note: See TracTickets for help on using tickets.