Support » Plugin: Network Plugin Auditor » Glitch in displaying active blogs for themes

Viewing 7 replies - 1 through 7 (of 7 total)
  • Good catch @iclysdale! I’ll add this to the list of patches I have for the next release. Thanks!

    Hi @iclysdale,

    The newest version should resolve this issue. Let me know if you still have trouble!

    – Kathy

    Thread Starter iclysdale

    (@iclysdale)

    Hi, Kathy:

    By default, wp_get_sites returns the first 100 sites, so any of my sites beyond that weren’t showing up.

    I’ve hacked it for now using a limit of 10,000 (the same as large sites) – it might be better to use a smaller limit and loop with offset values until none are returned – although maybe not since it would all end up in one array anyways and we’d have to do concatenation.

    Here’s my patch file.

    ian.

    --- a/wp-content/plugins/network-plugin-auditor/network-plugin-auditor.php
    +++ b/wp-content/plugins/network-plugin-auditor/network-plugin-auditor.php
    @@ -259,15 +259,17 @@ class NetworkPluginAuditor {
         function get_network_blog_list( ) {
             global $wpdb;
             $blog_list = array();
    +
    +        $args = array();
    +        $args['limit'] = 10000;
    
             if ( function_exists( 'wp_get_sites' ) && function_exists( 'wp_is_large
                 // If wp_is_large_network() returns TRUE, wp_get_sites() will retur
                 // By default wp_is_large_network() returns TRUE if there are 10,00
                 // This can be filtered using the wp_is_large_network filter.
                 if ( ! wp_is_large_network() ) {
    -                $blog_list = wp_get_sites();
    +                $blog_list = wp_get_sites($args);
                 }
    -
             } else {
                 // Fetch the list from the transient cache if available

    Nice solution, iclysdale, that worked for me.

    Yup, that fixed it for me too. I almost deleted a bunch of plugins that I thought weren’t being used.

    @iclysdale, another great catch! Thanks again!

    – Kathy

    @iclysdale the 1.8 release has this patch. Thanks again!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Glitch in displaying active blogs for themes’ is closed to new replies.