• Resolved wlpdrpat

    (@wlpdrpat)


    Hi,

    I just updated WP to 4.6.1 and found a problem with several of my sites. To help investigate what those sites had in common I network activated the Network Plugin Auditor which has been my old reliable. Unfortunately, the list of sites provided by the various plugins was definitely incomplete.

    I then checked on the theme end and found the same issue – not all sites that are using a particular theme are displayed in the list generated.

    I am going to look at the coding to see if I can figure out was is broken and will let you know.

    At the moment your plugin is definitely broken.

    Pat

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wlpdrpat

    (@wlpdrpat)

    I was able to fix the problem by inverting the if condition priority on line 303 in “network-plugin-auditor.php” Essentially, the original code was only showing results from the first 100 sites. In my case was a significant problem. By making the following change it resolved the problem:

    Original Code Line 303 in network-plugin-auditor.php:

    if ( function_exists( 'get_sites' ) && function_exists( 'wp_is_large_network' ) ) {       
                // If wp_is_large_network() returns TRUE, get_sites() will return an empty array.
                // By default wp_is_large_network() returns TRUE if there are 10,000 or more sites in your network.
                // This can be filtered using the wp_is_large_network filter.
                if ( ! wp_is_large_network() ) {
                    $blog_list = get_sites();
                }
            }
           else if ( function_exists( 'wp_get_sites' ) && function_exists( 'wp_is_large_network' ) ) {
                // If wp_is_large_network() returns TRUE, wp_get_sites() will return an empty array.
                // By default wp_is_large_network() returns TRUE if there are 10,000 or more sites or users in your network.
                // This can be filtered using the wp_is_large_network filter.
                if ( ! wp_is_large_network( 'sites' ) ) {
                    $blog_list = wp_get_sites( $args );
                }
            }

    New Code:

    if ( function_exists( 'wp_get_sites' ) && function_exists( 'wp_is_large_network' ) ) {
                // If wp_is_large_network() returns TRUE, wp_get_sites() will return an empty array.
                // By default wp_is_large_network() returns TRUE if there are 10,000 or more sites or users in your network.
                // This can be filtered using the wp_is_large_network filter.
                if ( ! wp_is_large_network( 'sites' ) ) {
                    $blog_list = wp_get_sites( $args );
                }
           }
           else if ( function_exists( 'get_sites' ) && function_exists( 'wp_is_large_network' ) ) {       
                // If wp_is_large_network() returns TRUE, get_sites() will return an empty array.
                // By default wp_is_large_network() returns TRUE if there are 10,000 or more sites in your network.
                // This can be filtered using the wp_is_large_network filter.
                if ( ! wp_is_large_network() ) {
                    $blog_list = get_sites();
                }
            }
    Plugin Author Katherine Semel-Munson

    (@ksemel)

    Version 1.10.1 resolves this! Thanks @wlpdrpat!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not Showing All Sites Where Plugin or Theme is Active’ is closed to new replies.