WordPress.org

Ready to get started?Download WordPress

Forums

Authors Widget
Alter authors query to improve slow lookup on blogs with many users. (3 posts)

  1. aaronerk
    Member
    Posted 2 years ago #

    For blogs with lots of users (10,000+), your queries to lookup authors and author post counts take a really long time. I'm not sure how backwards compatible the below code snippet is, but it dramatically speeds up the plugin if you can use it.

    $user_args = array(
    'fields' => array('ID', 'user_nicename'),
    'who' => 'authors'
    );
    $wp_user_search = new WP_User_Query($user_args);
    $authors = $wp_user_search->get_results();
    $author_ids = array();
    foreach($authors as $author) {
    $author_ids[] = $author->ID;
    }
    $author_count = count_many_users_posts($author_ids);

    http://wordpress.org/extend/plugins/authors/

  2. WebEndev
    Member
    Posted 1 year ago #

    Has this been resolved?

    I'm seeing some performance issues also.

  3. aaronerk
    Member
    Posted 1 year ago #

    No idea. My issue was solved by hacking at the DB query. Never looked to see if the plugin changed the way it does things.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic