Support » Fixing WordPress » [NSFW] Problem with a script running over and over

  • Hello
    My current host has said that my wordpress website [NSFW] http://www.smoochy.co.uk is using too much resource as a section of code seems to be running constantly and going through all the rows in my database, which is quite large.

    I have no idea if this is WP code, the theme or a plugin and as im not a developer im struggling to pinpoint what the code is doing and if it is essential?

    Is anyone able to give me any idea what the code might be doing or what it is linked to?

    # Time: 160312 15:08:52
    # User@Host: redoocec_wp004[redoocec_wp004] @ localhost []
    # Thread_id: 29 Schema: redoocec_wp004 Last_errno: 0 Killed: 0
    # Query_time: 4.274768 Lock_time: 0.000618 Rows_sent: 5 Rows_examined: 77865 Rows_affected: 0 Rows_read: 77865
    # Bytes_sent: 6968
    SET timestamp=1457816932;
    SELECT wp_posts.*, AVG( wp_commentmeta.meta_value ) as average_rating FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )
    LEFT OUTER JOIN wp_comments ON(wp_posts.ID = wp_comments.comment_post_ID)
    LEFT JOIN wp_commentmeta ON(wp_comments.comment_ID = wp_commentmeta.comment_id)
    WHERE 1=1 AND (
    ( wp_postmeta.meta_key = ‘_visibility’ AND CAST(wp_postmeta.meta_value AS CHAR) IN (‘visible’,’catalog’) )
    ) AND wp_posts.post_type = ‘product’ AND ((wp_posts.post_status = ‘publish’)) AND ( wp_commentmeta.meta_key = ‘rating’ OR wp_commentmeta.meta_key IS null ) GROUP BY wp_posts.ID ORDER BY average_rating DESC, wp_posts.post_date DESC LIMIT 0, 5;
    # Time: 160312 19:31:52
    # User@Host: redoocec_wp004[redoocec_wp004] @ localhost []
    # Thread_id: 950 Schema: redoocec_wp004 Last_errno: 0 Killed: 0
    # Query_time: 4.308637 Lock_time: 0.001131 Rows_sent: 5 Rows_examined: 77865 Rows_affected: 0 Rows_read: 77865
    # Bytes_sent: 6968
    SET timestamp=1457832712;
    SELECT wp_posts.*, AVG( wp_commentmeta.meta_value ) as average_rating FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )
    LEFT OUTER JOIN wp_comments ON(wp_posts.ID = wp_comments.comment_post_ID)
    LEFT JOIN wp_commentmeta ON(wp_comments.comment_ID = wp_commentmeta.comment_id)
    WHERE 1=1 AND (
    ( wp_postmeta.meta_key = ‘_visibility’ AND CAST(wp_postmeta.meta_value AS CHAR) IN (‘visible’,’catalog’) )
    ) AND wp_posts.post_type = ‘product’ AND ((wp_posts.post_status = ‘publish’)) AND ( wp_commentmeta.meta_key = ‘rating’ OR wp_commentmeta.meta_key IS null ) GROUP BY wp_posts.ID ORDER BY average_rating DESC, wp_posts.post_date DESC LIMIT 0, 5;

Viewing 4 replies - 1 through 4 (of 4 total)
  • @chickster25,

    It looks to be from a “ratings” type of plugin. Perhaps a plugin/theme that allows users to choose star ratings for a blog post, or, a Schema type of plugin that allows authors to rate their review of a product, etc.

    Users can rate a product, which is part of the theme, but I dont understand why it would be polling all the time and using up server resources?

    @chickster25,

    You have your answer then — probably poor coding from the theme author.

    ive checked with the theme owner, they have said its not their code but more likely a plugin linked with woocommerce?!!

    [ No bumping please. ]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[NSFW] Problem with a script running over and over’ is closed to new replies.