• Hi!

    I have a little problem with the plugin. It seems that the results it shows are not in cache at all. I mean, every time someone visits my website, a quite long query is executed. Since I’m receiving a lot of visits last months I’m having troubles with my server, which could not process all the queries when I have some simultaneous visits.

    The query that is launched every time is long and a bit difficult to understand:

    SELECT wp_posts.ID, wp_posts.post_title, (
    SUM( wp_popularpostsdatacache.pageviews )
    ) AS 'pageviews'
    FROM wp_posts
    RIGHT JOIN wp_popularpostsdatacache ON wp_posts.ID = wp_popularpostsdatacache.id
    WHERE wp_posts.post_status = 'publish'
    AND wp_posts.post_password = ''
    AND wp_popularpostsdatacache.day = CURDATE( )
    AND wp_posts.post_type = 'post'
    AND wp_posts.ID NOT
    IN (
    
    SELECT object_id
    FROM wp_term_relationships AS r
    JOIN wp_term_taxonomy AS x ON x.term_taxonomy_id = r.term_taxonomy_id
    JOIN wp_terms AS t ON t.term_id = x.term_id
    WHERE x.taxonomy = 'category'
    AND object_id
    IN (
    
    SELECT object_id
    FROM wp_term_relationships AS r
    JOIN wp_term_taxonomy AS x ON x.term_taxonomy_id = r.term_taxonomy_id
    JOIN wp_terms AS t ON t.term_id = x.term_id
    WHERE x.taxonomy = 'category'
    AND t.term_id
    IN ( 4, 6, 11, 1070 )
    )
    )
    GROUP BY wp_posts.ID
    ORDER BY pageviews DESC
    LIMIT 10

    In my site, I’m showing three lists of most popuplar post with the following functions:

    Daily:

    <? wpp_get_mostpopular('order_by="views"&range="daily"&header=""&header_start=""&header_end=""&pages=0&stats_comments=0&cats_to_exclude="4,6,7,11,1070"&post_start="<li>"&post_end="</li>"&wpp_start="<ol>"&wpp_end="</ol>"&limit=10'); ?>

    Weekly:

    <?php wpp_get_mostpopular('order_by="views"&range="weekly"&header=""&header_start=""&header_end=""&pages=0&stats_comments=0&cats_to_exclude="4,6,7,11,1070"&post_start="<li>"&post_end="</li>"&wpp_start="<ol>"&wpp_end="</ol>"&limit=10'); ?>

    Monthly:

    <?php wpp_get_mostpopular('order_by="views"&range="monthly"&header=""&header_start=""&header_end=""&pages=0&stats_comments=0&cats_to_exclude="4,6,7,11,1070"&post_start="<li>"&post_end="</li>"&wpp_start="<ol>"&wpp_end="</ol>"&limit=10'); ?>

    Can anyone give me any advice about this? How could I cache this query? I’m already using W3 Total Cache plugin for the the general queries and more things but it seems that is not working well with this query.

    Any advice will be really appreciated. Thanks in advance and good work with this two awesome plugins! ??

    https://www.ads-software.com/extend/plugins/wordpress-popular-posts/

Viewing 4 replies - 1 through 4 (of 4 total)
  • that plugin is very bad on my large site. Lots of queries, i think it tries to catch results.

    So i dropped it, and used the functions that already exist in the wp.com stats plugin.

    What settings are you using? Can you paste them here using paste bin or submit a bug submission form from the support tab of the plugin?

    Thread Starter andreu

    (@andreu)

    Hi Frederick,

    Here is a link to my W3 Total Cache settings in Paste Bin: https://pastebin.com/4mPxtVt0

    Thanks!

    Have you checked database debug mode to see if you can identify the query in question? Also, there is a topic here somewhere (they are hard to search for), where users have overcome this concern before.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cache WordPress Popular Posts queries’ is closed to new replies.