[wp-trac] [WordPress Trac] #37052: Plugin search result count API showing wrong

WordPress Trac noreply at wordpress.org
Wed Jun 8 08:04:06 UTC 2016


#37052: Plugin search result count API showing wrong
-------------------------------------------------+-------------------------
 Reporter:  Mahesh901122                         |      Owner:
     Type:  defect (bug)                         |     Status:  new
 Priority:  normal                               |  Milestone:  Awaiting
Component:  Plugins                              |  Review
 Severity:  normal                               |    Version:  4.5.2
  Focuses:  accessibility, administration,       |   Keywords:
  performance                                    |
-------------------------------------------------+-------------------------
 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:

 [[Image(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:
 [[Image(https://c7.staticflickr.com/8/7443/27502714646_bdc94f6562_z.jpg)]]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37052>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list