Support » Plugin: Reviews Plus » Average Rating includes un-published review ratings when generating average

  • Resolved zach21uk

    (@zach21uk)


    When an un-registered user leaves a review, it goes into moderation. However, the average rating shortcode includes the score from that review in the average score.

    This is a bug because an unpublished review should be completely unpublished.

    The bug is probably in the ic_get_reviews_average function

    Is there a fix for this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Actually, I just found the bug in the plugin and fixed it, here is the fix:

    functions/functions.php line 227

    $args = array( 'type' => $comment_type, 'post_id' => $product_id );

    Change to:

    $args = array( 'type' => $comment_type, 'post_id' => $product_id, 'status' => 'approve' );

    Would appreciate if you could push this as part of your next plugin update.

    Plugin Contributor ndre

    (@ndre)

    Thank you for reporting this!

    It is included in the newest version.

    Thanks. If you feel like crediting me for the fix, my developer URL is https://codeable.io/developrs/zach-nicodemous/ 🙂

    Plugin Contributor ndre

    (@ndre)

    Sure, the credit was in the changelog. I hope you saw it 🙂

    Now we also added a link to your WordPress profile.

    Thank you again for your contribution!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Average Rating includes un-published review ratings when generating average’ is closed to new replies.