Co-authors author list bug

There is a bug inside Co Authors and Co Authors Plus plugin, coauthors_wp_list_authors function, where co authors without their own posts doesn’t get links to their posts: http://wordpress.org/support/topic/275644

The bug is inside this sql statement:

$author_count = array();
 $sql = "SELECT DISTINCT
 p1.post_author,
 (COUNT(ID)+(SELECT COUNT(*)
 FROM $wpdb->posts p2, $wpdb->postmeta pm
 WHERE p2.ID = pm.post_id
 AND pm.meta_key = '_coauthor'
 AND pm.meta_value = p1.post_author)
 ) AS count
 FROM $wpdb->posts p1
 WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . "
 GROUP BY post_author";

Continue reading “Co-authors author list bug”