Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#37052 closed defect (bug) (worksforme)

Plugin search result count API showing wrong

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

Description

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

E.g.

  • 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:

https://c1.staticflickr.com/8/7661/27438240832_d614bd5b54_z.jpg

After debugging, I found it comes from API.

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

Snippet:

$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'],
) );

Screenshot:
https://c7.staticflickr.com/8/7443/27502714646_bdc94f6562_z.jpg

Attachments (2)

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

Download all attachments as: .zip

Change History (9)

#1 @Mahesh901122
10 years ago

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

Tested on new WordPress setup too.

Refer screenshot:
https://c5.staticflickr.com/8/7698/27260619380_95343e619e_z.jpg

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


10 years ago

#3 @barryceelen
10 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'].

http://cobbledco.de/keep/trac37052.jpg

#4 @barryceelen
10 years ago

  • Keywords has-screenshots added

#5 @dd32
10 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/ in future.

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.

Last edited 10 years ago by dd32 (previous) (diff)

#6 @Mahesh901122
10 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
9 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.