WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Post Ratings

Simple, developer-friendly, straightforward post rating plugin. Relies on post meta to store avg. rating / vote count.

How does this plugin log votes?

Basic check trough cookies, IP match against a limited transient-cached IP list, and user meta records (if registration-only ratings are enabled). If any of these checks fail the user is not allowed to rate.

How do I change the stars, CSS and the HTML generated by this plugin?

Simply create your own styles and drop them inside a file called post-ratings.css in your theme or child theme folder. Use the original styles as reference if you're doing minor changes.

If you want to change the HTML mark-up for the ratings create a "post-ratings-control.php" template within your theme folder. Check out the original template from this package for help on how to edit it.

How do I manually display the rating links where I want?

Either fill the custom filter field with your own action tag in the plugin settings, or use the [rate] shortcode. If you want to do this within template files, you can manually echo PostRatings()->getControl();

How do I manually get the most rated posts using PHP?

$posts = PostRatings()->getTopRated($arguments);

Possible arguments, and their defaults:

'post_type`    => 'post',
'number'       => 10,                   // max. number of posts to retrieve
'offset'       => 0,                    // offset from where to start
'sortby'       => 'bayesian_rating',    // bayesian_rating, rating or votes
'order'        => 'DESC',               // ASC or DESC
'date_limit'   => 0,                    // date limit in days

Return value is an array of post objects containing the usual post properties + 3 extra properties:

$post->votes                            // number of votes
$post->rating                           // average rating
$post->bayesian_rating                  // weighted rating

Example usage:

global $post;
$results = PostRatings()->getTopRated();

foreach($results as $post){
  setup_postdata($post); ?>

  // here is the usual loop
  <?php the_title(); ?> - <?php printf(_n('%d vote', '%d votes', $post->votes), $post->votes); ?>

  <?php
}

// restore original post
wp_reset_postdata();

Requires: 3.2 or higher
Compatible up to: 3.3.2
Last Updated: 2012-5-25
Downloads: 48,961

Ratings

4 stars
4 out of 5 stars

Support

1 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

50,2,1 0,1,0
0,1,0 0,1,0
100,1,1 100,1,1 50,10,5
100,1,1 100,2,2 50,2,1 100,1,1 100,1,1
50,2,1
100,2,2
86,7,6
67,3,2
57,7,4
0,1,0
0,1,0
100,1,1
100,3,3