Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#37052 closed defect (bug) (worksforme)

Plugin search result count API showing wrong

Reported by: Mahesh901122 Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: WordPress.org Site Keywords: has-screenshots
Focuses: administration Cc:


When we search the plugin then the plugin search count is showing wrong count.


  • Search found 1 plugin then it showing 2 items.
  • Search found 18 plugins then it showing 19 items.


I was be search plugin MG Post Contributor then it showing 2 items. Refer screenshot:


After debugging, I found it comes from API.

\wp-admin\includes\class-wp-plugin-install-list-table.php LINE - 208


$api = plugins_api( 'query_plugins', $args );

On line 226 we set total_items using $api->info['results']

$this->set_pagination_args( array(
	'total_items' => $api->info['results'],
	'per_page' => $args['per_page'],
) );


Attachments (2)

plugin-search-result.png (96.2 KB) - added by Mahesh901122 5 years ago.
debugging-the-issue.png (89.5 KB) - added by Mahesh901122 5 years ago.

Download all attachments as: .zip

Change History (9)

#1 @Mahesh901122
5 years ago

  • Keywords needs-patch added
  • Severity changed from normal to major

Tested on new WordPress setup too.

Refer screenshot:

This ticket was mentioned in Slack in #core by maheshwaghmare. View the logs.

5 years ago

#3 @barryceelen
5 years ago

I see the same behaviour, but not for every plugin.
Looking at the output of $api = plugins_api( 'query_plugins', $args ); it appears the API (sometimes?) returns the wrong value in $api->info['results'].


#4 @barryceelen
5 years ago

  • Keywords has-screenshots added

#5 @dd32
5 years ago

  • Component changed from Plugins to WordPress.org site
  • Focuses accessibility performance removed
  • Keywords needs-patch removed
  • Milestone changed from Awaiting Review to WordPress.org
  • Severity changed from major to trivial
  • Version 4.5.2 deleted

Problems with the API should be reported on https://meta.trac.wordpress.org/

This appears to be a bbPress 1.x issue as it's affecting the underlying BB_Query query, quite possibly due to the way the query is built, or maybe with the interaction with our current search application (Sphinx) or another custom query modifier we're running.

A new plugin directory is due to replace bbPress in the not-too-distant future which doesn't suffer from this issue. As the count is only affecting a trivial count, it's not an urgent fix and unless someone spots what's causing the issue will be fixed when the switch over occurs.

Version 0, edited 5 years ago by dd32 (next)

#6 @Mahesh901122
5 years ago

Thanks @barryceelen debugging the issue.

@dd32 I thought It's WordPress core issue . But, After debugging I found it come from API. But, At the time of reporting this issue I was miss the right Trac.

In future I'll add the issues in relative Trac. Thanks @dd32 for the detailed clarification.

#7 @ocean90
4 years ago

  • Milestone WordPress.org deleted
  • Resolution set to worksforme
  • Status changed from new to closed

The new plugin directory is live, closing as worksforme.

Note: See TracTickets for help on using tickets.