• Resolved sirdanielone

    (@sirdanielone)


    hello. I have one site that makes all my sites to load slowly. I watched mysql log & saw there a lot of queries like this:

    SET timestamp=1430173629;
    SELECT DISTINCT wp_posts.*, (t1.meta_value+0.00) AS ratings_average, (t2.meta_value+0.00) AS ratings_users FROM wp_posts LEFT JOIN wp_postmeta AS t1 ON t1.post_id = wp_posts.ID LEFT JOIN wp_postmeta As t2 ON t1.post_id = t2.post_id WHERE t1.meta_key = ‘ratings_average’ AND t2.meta_key = ‘ratings_users’ AND wp_posts.post_password = ” AND wp_posts.post_date < ‘2015-04-28 03:27:06’ AND wp_posts.post_status = ‘publish’ AND 1=1 ORDER BY ratings_average DESC, ratings_users DESC LIMIT 10;
    # Time: 150428 0:27:10
    # User@Host: russian_dsvblog[russian_dsvblog] @ localhost []
    # Query_time: 11.259687 Lock_time: 0.000044 Rows_sent: 0 Rows_examined: 123989
    use russian_dsvblog;

    How to fix slow loading of the site. What to fix in plugin?

    https://wordpress.org/plugins/wp-postratings/

Viewing 1 replies (of 1 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Sorry there is no fix for that. I intend to use the WP_Query to get the highest rated post in the future.

    If you are technical enough, you can try this query to get the highest rated post instead.

    $highest_rated_posts = new WP_Query( array( 'meta_key' => 'ratings_average', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) );
    if ( $highest_rated_posts->have_posts() ) {
    	echo '<ul>';
    	while ( $highest_rated_posts->have_posts() ) {
    		$highest_rated_posts->the_post();
    		echo '<li>' . get_the_title() . '</li>';
    	}
    	echo '</ul>';
    }
    wp_reset_postdata();

    Alternatively you can try another plugin like Poll Daddy ratings.

Viewing 1 replies (of 1 total)

The topic ‘system load is slow with postratings’ is closed to new replies.