WordPress.org

Making WordPress.org

Opened 7 weeks ago

Closed 7 weeks ago

Last modified 7 weeks 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
7 weeks 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.

Note that the 54k number I gave above includes plugins that were reviewed, approved, but then never uploaded and thus are not "live". Putting the difference from that at about 5k seems about correct to me. So the 48-49k plugins you found may indeed be correct.

Last edited 7 weeks ago by Otto42 (previous) (diff)

#2 @dd32
7 weeks 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
7 weeks 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
7 weeks ago

Thanks everybody for participate in this ticket.

Note: See TracTickets for help on using tickets.