SLOW QUERIES
-
Hi, we are experiencing really slow queries in regards to this plugin. Our developer suggested this code:
function count_reviews() /*removed cek0 if ( ‘product_review’ === $comment_type ) { // filter by product reviews $where = “WHERE n.comment_type NOT IN ( ‘cr_qna’ ) AND m.post_type = ‘product'”; } elseif ( ‘store_review’ === $comment_type ) { // filter by store reviews $where = “WHERE ( n.comment_type NOT IN ( ‘cr_qna’ ) AND n.comment_post_ID IN ( ” . $in_shop_page . ” ) )”; } else { // all reviews $where = “WHERE ( n.comment_type NOT IN ( ‘cr_qna’ ) AND (m.post_type = ‘product’ OR n.comment_post_ID IN ( ” . $in_shop_page . ” ) ) )”; }*/ /*added cek0*/ if ( ‘product_review’ === $comment_type && !is_array($in_shop_page) && $is_shop_page == 0) { // filter by product reviews $where = “WHERE n.comment_type <> ‘cr_qna’ AND m.post_type = ‘product'”; } elseif ( ‘store_review’ === $comment_type && is_array($in_shop_page)) { // filter by store reviews $where = “WHERE ( n.comment_type <> ‘cr_qna’ AND n.comment_post_ID IN ( ” . $in_shop_page . ” ) )”; } else { // all reviews if(is_array($in_shop_page)){ $where = “WHERE ( n.comment_type <> ‘cr_qna’ AND (m.post_type = ‘product’ OR n.comment_post_ID IN ( ” . $in_shop_page . ” ) ) )”; } else{ $where = “WHERE ( n.comment_type <> ‘cr_qna’ AND m.post_type = ‘product’)”; } }/*end cek0*/
Any ideas on if this is good to do? Suggestions?
The page I need help with: [log in to see the link]
- The topic ‘SLOW QUERIES’ is closed to new replies.