Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I did some debugging, and changing get_sticky_query to the following seems to cause it to work properly – how tax_query was changed seems to have changed a little. This will search for posts with the requested category, that also are marked category sticky.

    private function get_sticky_query( $category ) {

    return new WP_Query(
    array(
    ‘fields’ => ‘ids’,
    ‘post_type’ => ‘post’,
    ‘posts_per_page’ => ‘1’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘category’,
    ‘field’ => ‘term_id’, ‘terms’ => array($category->cat_ID),
    ),
    ),
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘category_sticky_post’,
    ‘value’ => $category->cat_ID,
    )
    )
    )
    );

    }

    For what it’s worth, I did some debugging and in my environment at least, what’s happening is that the code returning the user-agent for the user-agent checking isn’t returning it.

    I commented out the following code in includes/submission.php to check for a valid user agent, and everything works again:

    /*
    $user_agent = (string) $this->get_meta( ‘user_agent’ );

    if ( strlen( $user_agent ) < 2 ) {
    $spam = true;
    }

    */

    Devs, I’m hoping this helps fix it in the next release?

    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

Viewing 3 replies - 1 through 3 (of 3 total)