[wp-trac] [WordPress Trac] #61461: The pagination results in the Popular Plugins screen is broken

WordPress Trac noreply at wordpress.org
Thu Jul 11 15:05:19 UTC 2024


#61461: The  pagination results in the Popular Plugins screen is broken
--------------------------+------------------------------
 Reporter:  nithins53     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by berubenic):

 Looked into what is sent to the API and what is returned. What stands out
 to me is the page number in the info Array returned by the API. When the
 page number sent to the API is greater than 999, the `page` key in the
 `info` Array from the API response is always 999. I debugged this by
 logging the arguments sent to the API and its response in the `wordpress-
 develop/src/wp-admin/includes/class-wp-plugin-install-list-table.php`
 before and after line `242`

 {{{#!php

 error_log( print_r( $args, true ) );

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

 // log the API response
 error_log( print_r( $api->info, true ) );
 }}}

 The plugin results changed on page `1508` even though the returned page is
 `999` (plugin results not logged here to keep things shorter)

 {{{
 [11-Jul-2024 14:58:13 UTC] Array
 (
     [page] => 1519
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:58:13 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54667
 )

 [11-Jul-2024 14:59:46 UTC] Array
 (
     [page] => 1518
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:46 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:47 UTC] Array
 (
     [page] => 1517
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:47 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:48 UTC] Array
 (
     [page] => 1516
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:48 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:48 UTC] Array
 (
     [page] => 1515
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:48 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:49 UTC] Array
 (
     [page] => 1514
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:49 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:50 UTC] Array
 (
     [page] => 1513
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:50 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:50 UTC] Array
 (
     [page] => 1512
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:50 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:51 UTC] Array
 (
     [page] => 1511
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:51 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:52 UTC] Array
 (
     [page] => 1510
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:52 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:53 UTC] Array
 (
     [page] => 1509
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:53 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 14:59:53 UTC] Array
 (
     [page] => 1508
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 14:59:54 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )
 }}}

 Pages up to 999 work:

 {{{
 [11-Jul-2024 15:02:14 UTC] Array
 (
     [page] => 997
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 15:02:15 UTC] Array
 (
     [page] => 997
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 15:02:19 UTC] Array
 (
     [page] => 998
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 15:02:19 UTC] Array
 (
     [page] => 998
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 15:02:20 UTC] Array
 (
     [page] => 999
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 15:02:20 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )

 [11-Jul-2024 15:02:21 UTC] Array
 (
     [page] => 1000
     [per_page] => 36
     [locale] => en_US
     [browse] => popular
 )

 [11-Jul-2024 15:02:21 UTC] Array
 (
     [page] => 999
     [pages] => 1519
     [results] => 54669
 )
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61461#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list