Title: WordPress Review Plugin
Last modified: August 19, 2016

---

# WordPress Review Plugin

 *  [sunflyer](https://wordpress.org/support/users/sunflyer/)
 * (@sunflyer)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/)
 * Hi everyone!
 * I found this review plugin for wordpress, but the function to determine if the
   comment is positive or negative doesn’t work properly so I wanted to ask if someone
   here could help me fix it
 * The function first
 *     ```
       function sb_get_post_negative_positive_ratings($post_id,$type) {
   
           global $wpdb,$sb_ratings_table, $sb_ratings_cats_table, $comment_table,$sb_cat_global_table;
           $category_id = sb_getCategoryByPostId($post_id);
           $sql = "SELECT * FROM <code>&quot; . $sb_ratings_table . &quot;</code> "
                . "INNER JOIN <code>&quot; . $comment_table . &quot;</code> "
                . "ON (<code>&quot; . $sb_ratings_table . &quot;</code>.<code>comment_id</code> = <code>&quot; . $comment_table . &quot;</code>.<code>comment_ID</code>) "
                . "INNER JOIN <code>&quot; . $sb_ratings_cats_table . &quot;</code> "
                . "ON (<code>&quot; . $sb_ratings_table . &quot;</code>.<code>rating_cat_id</code> = <code>&quot; . $sb_ratings_cats_table . &quot;</code>.<code>id</code>) "
                . "INNER JOIN <code>&quot; . $sb_cat_global_table . &quot;</code> "
                . "ON (<code>&quot; . $sb_ratings_table . &quot;</code>.<code>rating_cat_id</code> = <code>&quot; . $sb_cat_global_table . &quot;</code>.<code>id</code>) "
                . "WHERE <code>&quot; . $comment_table . &quot;</code>.<code>comment_post_ID</code> = " . $post_id . " "
                . "AND <code>&quot; . $sb_cat_global_table . &quot;</code>.<code>wp_cat_id</code> = {$category_id} "
                . "ORDER BY <code>&quot; . $sb_ratings_table . &quot;</code>.<code>comment_id</code> ASC";
           $sql_result = $wpdb->get_results($sql,'ARRAY_A');
           if (is_null($sql_result)) {
               $sql_result = array();
           }
   
           $score = array();
           foreach ($sql_result as $data) {
               if (!isset($data['comment_id'])) {
                   $score[$data['comment_id']] = array();
               }
               $score[$data['comment_id']][] = array(
                                               'current' => ($data['rating_value'] / $data['scale_max']) * $data['weight'],
                                               'max'   => $data['weight']
                                                );
           }
   
           $negative = 0;
           $positive = 0;
           foreach ($score as $comment_id => $scores) {
   
               $allRatings = 0;
               $maxRatings = 0;
               $avgMax = 0;
               foreach ($scores as $d) {
                   $allRatings += $d['current'];
                   $maxRatings += $d['max'];
               }
               $avgMax = $maxRatings / (count($scores));
               if ($allRatings < $avgMax) {
                   $negative++;
               } else {
                   $positive++;
               }
           }
   
           if ($type == 'positive') {
               return $positive;
           } elseif($type == 'negative') {
               return $negative;
           }
   
           return 0;
       }
       ```
   
 * Here is the link to the review site
    [http://www.sourcebench.com/toolbox/sb_review-wordpress-review-plugin](http://www.sourcebench.com/toolbox/sb_review-wordpress-review-plugin)
 * I really need to make this work, but unfortunately my php skills are limited
 * Thanks for reading

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [dangrossman](https://wordpress.org/support/users/dangrossman/)
 * (@dangrossman)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/#post-716331)
 * Since this plugin is old and hasn’t been updated in very long, you might consider
   [WP Review Site](http://www.wpreviewsite.com) instead, by the author of the plugin
   SB based his on.
 *  [flick](https://wordpress.org/support/users/mosey/)
 * (@mosey)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/#post-716332)
 * Just to note that this new plugin requires payment.
 *  [review-plugin](https://wordpress.org/support/users/review-plugin/)
 * (@review-plugin)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/#post-716371)
 * There is a LOT better plugin than WP Review Site, it’s WF Review.
 * [ [link moderated]]
    Take a peek at WFReview’s features, TOTALLY blows WPReview
   out of the water.
 *  [jimkrugal](https://wordpress.org/support/users/jimkrugal/)
 * (@jimkrugal)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/#post-716378)
 * Well I jusf found a **25% discount coupon** for ReviewPluginForWordpress.com 
   at [link moderated]
 * The other really cool feature which I personally like is the importing of data
   from the local CSV files.
 *  [ellenafong](https://wordpress.org/support/users/ellenafong/)
 * (@ellenafong)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/#post-716385)
 * We use ratingpress from [ratingpress.com](http://ratingpress.com). We looked 
   at WPreview and WFReview but they’re both essentially the same code, and very
   limited. RatingPress had more features (it’s the only one we could consider for
   a commercial site) and it’s half the price of the others.
 * I think they also offer an Excel/CSV import tool…

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WordPress Review Plugin’ is closed to new replies.

## Tags

 * [review plugin](https://wordpress.org/support/topic-tag/review-plugin/)

 * 5 replies
 * 6 participants
 * Last reply from: [ellenafong](https://wordpress.org/support/users/ellenafong/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/wordpress-review-plugin-1/#post-716385)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
