Five Star Rating

This simple WordPress plug-in allows viewers to rate a post.

jQuery showMessage

This jQuery plug-in allows you to easily create a 'twitter-like' notification.

Web Tips

Sharing our knowledge of CFML & jQuery and many other web development tips.

Five Star Rating WordPress Plugin

97
By admin in : Plugin, Wordpress // Aug 25 2010

Two quick videos showing how to install, activate, configure and use this plugin are at the bottom.

Please check out the FAQ before you ask for support.

Thanks to some helpful critics and tips from users, we have taken our very first plugin and retooled it to be more flexible and easier to implement into your posts and pages.

If you used our previous plugin (Contestant Rating WordPress Plugin), you will be happy to learn that this new plugin is a great replacement.

  1. Use shortcode to display your  ratings. We have incorporated the use of shortcode into the plugin so you are no longer required to edit your template.
    Because it was our first plugin, we did not have the vision to incorporate this in the first iterations. We have done our homework and thanks to the help of other great WordPress users, we have created methods to display the Five Star Rating plugin, ‘Best of the Month’ and ‘Best of the Moment’ using a simple shortcode.
  2. You set the cookie.
    We did two bad things with the cookie in the first plugin. First we hardcoded it and second we set the expiration for one year in the future. Of course this worked for us, but we realize now that you might have other uses for the plugin. Therefore we have added the ability for you to set your own cookie expiration for as little as 1 minute to 12 hour to 365 days (or more if you like).
  3. Make it your own.
    We originally ported over an existing WordPress plugin and that plugin had more then one look. Unfortunately we did not have the vision to plan for using more then one look. Well not anymore! We have added the ability to theme this plugin as you see fit (more instructions on how to do this will follow). Currently there are two themes, but we have added the flexibility into the plugin to allow you to theme it as you like. It is as simple as adding an attribute to your short code…. like this:

    [five-star-rating star_type="abuse"]

  4. Help us keep improving.
    If you run into an issue, would like to request a feature or just want to tell us what a great plugin this is, be sure to post a note to us. Of course if you run into an issue, please don’t just say ‘It doesn’t work!’ or ‘This plugin sucks’ as 9 times out of 10 the plugin is working fine and as we intended, but the plugin is not being implemented correctly. We like criticism, but please make it constructive.

Here is the plugin in action. Rate this post!

389 votes Cast your vote now!
powered by Five Star Rating

Here are some stats for the month.

We have more work to do as far as documentation and such, but this was just so exciting, we had to get it out now. More will follow in the future.

Download the latest version now from wordpress.org

Installation option number one:
httpvh://www.youtube.com/watch?v=yQD-3Gwy2og

Installation option number two:
httpvh://www.youtube.com/watch?v=MBGhxegPm_M

video platform video management video solutions video player

About the Author

admin has written 23 articles for dingobytes.

Andrew Alba is a Software Engineer who recently relocated to Minneapolis-St Paul area after living in NW Minnesota for two decades. Andrew is currently employed with Internet Broadcasting Systems in St Paul, MN after spending almost five years with Interive Media Group in Fargo, ND. Andrew enjoys developing solutions using CFML, JavaScript, AJAX, PHP and anything else he can steal from the web.
  • Neil

    Hello, I’ve installed this plugin on two WordPress blogs and have been unable to get it to work on either one. I’ve placed the code [FSR_handler] in the post text as described but the rating system doesn’t appear in the post. Is there something I’m missing?

  • http://www.albawebstudio.com admin

    So sorry, my documentation did not get updated. Use [five-star-rating] instead of [FSR_handler]. I will update the documentation ASAP!

  • Neil

    Hi, thanks for the new code. I’ve tried it and I get the stars now, but the lower half of the text votes Cast Your Vote\ is missing.

  • http://www.albawebstudio.com admin

    There is a height setup on it with overflow hidden. You could try to just remove that from the plugins (in /assets/css/) folder. The style is FSR_stars. Just remove the ‘height: 15px;’ and try it (you will need to make that change in the .min.js file)

  • Robin

    Can I have more than one star block per page? I want to create a page with several links to different video clips and have people rate each clip.

  • http://www.albawebstudio.com admin

    No, not right now. That would be a great feature request. I would suggest adding request to forum (http://wordpress.org/tags/five-star-rating)

  • http://www.scopedin.com Mike

    Hi -

    This looks pretty good. I’m curious, though…do you find that a lot of people accidently vote because they don’t understand that clicking on a star automatically casts the vote? (I think I just did on your site!)

    I wonder if there’s value in adding an option that sets the star rating, then commits separately. Just an idea.

  • http://www.albawebstudio.com admin

    Thanks for the excellent question Mike!

    I also thought about this when going through the process. I weighed the pro’s and cons of each method and ultimately came up with this solution. And here is my reasoning (I am not saying it is the correct reasoning, just some insights on my decision).

    The alternate method that you describe requires two step instead of one to rate the post. Is it a real big deal? No, but I wanted this to be quick click of the star!

    The alternative method would require just a little bit more code.

    The alternative method, although far more unlikely, can still allow user to submit code accidently.

    I really appreciate the great question as it helps me try to understand what WordPress users might want. I believe that this might be an option that I can easily add to extend the plug-in in the future.

    Thanks again Mike!

  • http://www.scopedin.com Mike

    Hey, Andrew: good response; thanks.

    I am now getting an error whenever I mouse over the ratings (which appear in the form of radio buttons now):

    FSR_star_out is not defined.

    Did I botch the installation?

  • http://www.albawebstudio.com admin

    That is a javascript error and as soon as you posted it, I realized I gave you the wrong file :(

    So sorry about that. I will forward you the correct one in a bit. Again, I am sorry… I am just being sloppy today.

  • http://fxplained.com forex

    I’m looking for a “rate posts” plugin for my website. Your one doesn’t actually work for me on this site! I’m using Firefox.

  • http://www.albawebstudio.com admin

    Five Star Rating works in all browsers we have tested. Test it on our site in all your browsers. If it is not working on your site, you might not have implemented it correctly or have some other conflict with your template or other plugin.

  • Tadd

    So .. if I wanted to embed this into my template still …

    I run a site with 2500+ articles. I really don’t want to go through and add this to every page.

  • http://www.albawebstudio.com admin

    Great question Tadd!

    You can still add this to the template. You just need to use the following code in your template.

    <?php echo five_star_rating_func('star'); ?>

  • Tomas

    Hi Andrew,

    plugin looks great, but I can’t rate any post. I only see the stars. I have tried Chrome, FF and IE8. It doesn’t work even here on your site.

    Any idea why?

    Many Thanks.

  • http://www.hatculture.com Dave

    Hi,

    I would really like to start using the five star rating plugin but I cant seem to get it working. Ive installed it and the menu now appears so I can edit the cookie details so I done that. I wrote a post with the [five-star-rating] at the end but no stars appeared. What am I doing wrong?

  • http://new.crowdsurfer.net liam

    hi.
    I have this working on my wordpress. very simple to do =]

    One question, is it possible for a post author to set a rating of a post and have that displayed as stars but people cant vote. it just outputs the number of stars.

    I have a plugin that does this but i like the voting option also. so it can be ‘sites rating’ and ‘visitors rating’

    hope ive explained myself clearly

    Liam

  • Tomas

    Hi again,

    I realized that the problem was caused because my template didn’t load jQuery. So I put

    in my template header and suddenly it works!

    @Tadd, try to put this one in your template as the code from Andrew didn’t work for me.

    Hope it helps!

  • http://www.albawebstudio.com admin

    Not sure why it is not working Dave, do you have a link to a page with it?

  • http://www.albawebstudio.com admin

    I think I understand what you want. Try using [FSR_results] in your post.

  • newbie

    Hi and thanks for the plugin. Is there any possibility to translate the line CAST YOUR VOTE into some other language. Actually make it appear in some other language or in some other form such as VOTE NOW for exemple

  • http://www.hatculture.com Dave

    basically I was trying to put it on this post here http://hatculture.com/category/golf-caps but i cant get it working. I’m using the GoodTheme Lead theme and have watched the youtube vid and I’m doing exactly whats shown in the video.

  • http://www.albawebstudio.com admin

    Thanks for the link Dave. Really unsure why it is not working. If you switch the theme to the default WordPress or classic theme does it not work either? What other plug-ins are you running? Wondering if this is something with your theme or another plugin.

    Let me know if you have any luck with default theme or notice any conflict with another plug-in.

  • http://www.albawebstudio.com admin

    I have looked into it slightly. Need to learn to use WordPress translating (http://codex.wordpress.org/Translating_WordPress). Have some other options to look into as well.

  • John

    How do I change the icons and are there any size/resolution limits?

  • http://www.albawebstudio.com admin

    You need to simply add your images and change the CSS. Any size changes would need to be addressed in the CSS.

  • http://www.suctionseat.com arsie

    This plugin is so cool and I added this to my site http://www.suctionseat.com and planning to put it in my subdomain http://animania.suctionseat.com.

    however, I am planning to code this directly in the single.php, what will be the code to insert instead of using [five-star-rating] for each post?

    Thanks.

  • http://www.albawebstudio.com admin

    Thanks Arsie. The code was posted below;

    You can still add this to the template. You just need to use the following code in your template.

    <?php echo five_star_rating_func('star'); ?>

  • b10

    Hi, I’m having some problems with the plugin. I’ve placed the five star rating at the top of my posts. When I click a star to vote, not only is the star rating in that post recorded and highlighted, but so are all the other posts on the page, whether they have been voted on by me or not. Essentially, the display of the activated five-star-post rating is duplicated on every other post with the five-star-rating. A refresh of the page will reset the other posts to display their proper star rating / vote count. Is this a bug? I’m using Firefox + WP 3.0.1 + the latest five-star-rating. Thanks.

  • http://www.albawebstudio.com admin

    Are you asking “Can I have more than one star block per page?” No, not right now. That has been a feature request that we are investigating.

  • http://www.restaurantsinstratford.co.uk Dan

    Hi,

    Great plugin! I’ve got a problem, when you try to click the stars the vote isn’t recorded… what can the proble be? It’s on this page: http://www.restaurantsinstratford.co.uk/the-restaurants/ask/

    Cheers

  • http://www.albawebstudio.com admin

    Looking at the site, it looks like the plugin can not find the path to http://www.restaurantsinstratford.co.uk/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?p=13&fsr_stars=4&starType=star. Looking into it further, it appears that your plugin is insalled in http://www.restaurantsinstratford.co.uk/the-restaurants/wp-content/plugins/. The plugin uses WP_PLUGIN_URL on line 172 of the fsr.class.php file to build the url that AJAX uses to post the vote. This is not working correctly on yours (and we are not sure why).

    It appears that you have multiple installs of wordpress. One being http://www.restaurantsinstratford.co.uk/ and the other being http://www.restaurantsinstratford.co.uk/the-restaurants/.

  • http://www.restaurantsinstratford.co.uk Dan

    Hi thanks for the reply, i’ve had a look and i only have 1 install of wp on the domain. I’ve looked on the server and the plugin is installed on: http://www.restaurantsinstratford.co.uk/wp-content/plugins/five-star-rating/

    “the-restaurants” is the parent for the pages, could that be what is making it not work?

  • http://www.restaurantsinstratford.co.uk Dan

    Could i replace WP_PLUGIN_URL with ‘http://www.restaurantsinstratford.co.uk/wp-content/plugins/

    Cheers

  • http://www.albawebstudio.com admin

    You could replace that, but the problem that I saw was there was an error trying to locate http://www.restaurantsinstratford.co.uk/wp-content/plugins/five-star-rating/. I was able to locate http://www.restaurantsinstratford.co.uk/the-restaurants/wp-content/plugins/five-star-rating/ successfully, which led me to believe that the plugin was in a different install.

    You can test it yourself on your site.

    This is the correct path as per our conversation, but it does not work (404 error not found).
    http://www.restaurantsinstratford.co.uk/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?p=13&fsr_stars=3&starType=star

    This will work however.
    http://www.restaurantsinstratford.co.uk/the-restaurants/wp-content/plugins/five-star-rating/fsr-ajax-stars.php?p=13&fsr_stars=3&starType=star

    Any special redirects you have on the site? Hope that helps you determine the issue.

  • http://jorgedelcasar.es/ Jorge del Casar

    Hi!

    I’m using your plugin, but I want to put the rating in a list of posts (on the same page, of course). I saw the FAQs, then I implemented a solucion. If you want this, write me and I’ll send you the chage.

    Thanks for the plugin!

  • http://www.albawebstudio.com admin

    I have been toying with a few ideas. I would like to see what you have done. If you could send it to me, I would appreciate it. Send what you have to multiple-rating@dingobytes.com.

    Thank you much Jorge!

  • http://www.austinfun.info crispy

    Is there a way to keep the rating to the far left of the page? It seems to indent no matter where I place it.

  • http://www.albawebstudio.com admin

    You can customize it how ever you like with the CSS.

    Hint: The plugin is built in a container with class name of .FSR_container. You can change the margin from ‘margin: 1.5em auto;’ to something like ‘margin: 1.5em 0;’ in the CSS file.

  • http://www.austinfun.info crispy

    Thanks. I’ll start digging through the CSS for that class. I appreciate your help and I’ll keep an eye out for the premium version and/or make a donation when I can afford it. Thanks.

  • Timothy

    FSR works, but it only displays radio buttons. How can I get it to display stars instead of just 5 radio buttons?

    Thanks.

  • http://www.albawebstudio.com admin

    You have to make sure that the plugin is installed correctly. Sounds as if the css file is not loading correctly.

  • Timothy

    That makes sense. I do believe the plugin installed right as there are two css files in the css folder. Can you tell me how those css files are supposed to be referenced from the display page? Do I just reference them as normal css files in the tag of the page?

  • Timothy

    Ok, so I looked at how you did it at the top of this page and realized that I had forgotten to call the wp_head() function in my header… :/

    That fixed it… The stars do display vertically but I’m assuming that’s caused by a conflict with my css.

    Thanks for you patience!

  • Nick Porcaro

    This works nicely, but where can I see a summary of the ratings for each post/page?

    I can vote but then I don’t see the results anywhere.

    What I want is to be able to tally votes and then get a summary page

    - Nick

  • http://www.albawebstudio.com admin

    Thank you very much. See the ‘Other Notes’ section of the ReadMe.txt. I think that is what you are looking for.

  • alvin

    Hi,

    I’m wondering if there’s a way to use five star rating to sort and display posts from highest to lowest rating.

    thanks!

  • http://www.albawebstudio.com admin

    The data would be there, but there is nothing currently written. You would use the table [wp_]fsr_post where the ID would be the ID of the post. You could do the math with the other two columns to sort the data as you wish. Most votes, most points, highest average, etc. The other two tables are votes and points where votes is the amount of the times the post was voted on and points is the total amount of points applied to the post. Good luck.

  • http://RottenElf.com RottenElf

    I have installed the plugin correctly on a test domain, however, I seem to be having an issue. The plugin isn’t recording any votes. Also, I was under the impression that this plugin was supposed to “RATE” the posts based on a five star rating? Does it show the average rating within the star system or does it just show the number of votes?

    here is the url that I’m playing with this plugin on.

    http://newbizgenius.com

    Please help me with my questions and let me know where I screwed things up. Most people appear to be happy with this plugin, so I can only assume that I have caused the error myself.

    Thank you in advance

    RE

  • ems

    Wanted to know if there was a way to just have it be a cookie per computer and not ip address. Since if there are many people from a company that all have the same ip address they all each wont be able to vote since once 1 person does the vote it is shown as voted for all the others after that.

    Any ideas? Thanks