Star Rating for Reviews is a simple WordPress plugin that inserts pretty rating stars based on the score you assign using intuitive, inline [rating:] tags. It can also calculate and output overall ratings for you based on all previous scores you have assigned, useful for reviews that have multiple categories or an album review where each track is assigned a score.
This plugin supports storing rating data into your WordPress database. These data can then be retrieved by functions provided to output a list of reviews, sortable by date, post title or rating scores. Random reviews function and single post function (to be used in WordPress loop) are also provided, see Usage section for detailed description of these functions.
Features
- uses simple, intuitive tags to generate kawaii inline rating stars for your posts
- supports versatile rating systems
- supports text only output for RSS
- automatically calculates and displays overall ratings, if desired
- supports storing rating scores automatically into database *
- supports outputting list of reviews sortable by date, post title or rating scores *
- supports widget-like, sortable table of reviews *
- supports custom star images
- supports custom prefixes and suffixes for your own CSS class
- supports globally forced star count for consistency
- uses as many stars as you want! **
- standards compliant: valid XHTML
* database writing has to be enabled via Options
** limited to 20 for practicality
Usage
Presentation
Data (for advanced users)
Presentation
Once installed, you can add rating stars to your posts by using [rating:] tags.





By default, this will be interpreted as 3.5/5, as shown in the rating stars generated. Default denominator can be changed via options detailed in the next section. Even though this tagging style is simple, it might not be future proof when someday you decided to change the default denominator to say 10 (for whatever reason). In this case 3.5 will be interpreted as 3.5/10, which is very different compared to 3.5/5. Once you start using this tagging style, make sure you are not going to change the default denominator in the future. :)




“3/4″ will generate a “3 out of 4 stars” rating and “2/8″ will generate “2 out of 8 stars” and so on. This will continue to work as long as the denominator is not larger than 20. Beyond that, the score will be normalized and display in the default 5 stars system, as shown in the next example.





The “Rating:” prefix you can see in all examples above is the default prefix, which you can remove easily to show just the stars or add in your own custom CSS class by changing some options. More information about this in the Options section.
Overall rating:
Automatically calculated overall rating based on previous scores can be inserted using the following tag style:





Similar to the first example, this overall rating will be represented in the default 5 star rating system. It is possible to force the overall rating to be outputted in different number of stars by using the following tag style:




The “Overall Rating:” is again, the default prefix, which can be changed via options. For more information, see Options.
Custom images:
First of all, the default star image used is taken from the excellent Silk icon set. These png icons support different background colours via png transparency. However, you can still use your own star images by replacing the 3 images included in the “star-rating” plugin folder, namely “star.png”, “halfstar.png” and “blankstar.png”. File extensions can be changed via options if desired.
For your information, “tiny-star.png”, “tiny-halfstar.png” and “tiny-blankstar.png” are only used by special functions that output list of reviews based on stored data in the database. Feel free to replace them with your own images as well if desired.
Text only output:
By default, this plugin will output text only ratings for your RSS feeds and use graphical output when someone is reading the post on your site. This is, in my opinion, the optimal choice since some RSS readers do not support images. However, if you like you can output images for your RSS feeds too, or oppositely, output text only ratings for both RSS and posts displayed on your site. Please refer to the Options section if you want to make these changes.
Data (for advanced users)
Database writing is turned off by default. In order to use these advanced features, you will need to manually turn it on by changing the option values, see Options for more details. If you are not interested in this feature, you should skip this section.
Custom fields
If database writing is turned on, this plugin will parse your document searching for rating tags and store the overall rating score into a custom field called “rating” when you edit or save your blog post. The name of the custom field can be changed via options to prevent conflict with other plugins. The reason why custom field is used instead of a new database table is the ease of implementation and the fact that most people write reviews occasionally. The downside of this is when uninstalling this plugin, you will need to manually remove those “rating” entries within the custom field table.
To check if this plugin is doing its job, once you turned on the database writing, go to edit one of your older posts which already used the rating tags (or simply insert the rating tags into any post if you’re new to this plugin) and choose “Save and Continue Editing”. Now, check the custom field near the bottom of the editing panel to see if a new “rating” field has been added. If it’s there, congrats, this plugin is working properly; if it’s not, you might have forgotten to turn on the database writing option, or the rating tag is invalid. Feel free to post your questions here (with detailed explanation) if you can’t get this to work.
Once you turned on this auto insert feature, you can still disable it for specific post by putting [rating:none] anywhere in your blog post, preferably at the bottom for tidyness.
Functions
4 different functions are provided in this plugin that allow you to output a list of reviews based on date, rating score, or randomly selected. These functions uses “rating” custom field data to retrieve and sort the reviews. You need to either turn on autometa (see Options) or manually put these rating in yourself.
1. sr_getreviews()
sr_getreviews($limit, $orderby, $order, $usestar, $prefix, $suffix)
$limit
- number of reviews to be returned
Acceptable value: any integer
Default value: 5
$orderby
- criterion used to sort the review
Acceptable value: “date”, “title”, “rating”
Default value: date
$order
- sort ascendingly or descendingly
Acceptable value: “ASC”, “DESC”
Default value: “DESC”
$usestar
- number of star to be used for rating
Acceptable value: any integer
Default value: 5
Note 1: put in “0″ to output rating in percentage i.e. numerically
Note 2: rating stars used are with tiny prefix (tiny-star.png, tiny-blankstar.png etc.), they are smaller than regular stars in blog post
$prefix
- prefix to be put before the code for each reviews
Acceptable value: any valid XHTML tags or plain text
Default value: “<li>”
$suffix
- suffix to be put after the code for each reviews
Acceptable value: any valid XHTML tags or plain text
Default value: “</li>”
<?php sr_getreviews(5,date,DESC,5); ?>
You can also output ratings in percentage format as illustrated below:
<?php sr_getreviews(5,date,DESC,0); ?>
2. sr_getrandom()
sr_getrandom($limit, $usestar, $prefix, $suffix)
See the explanation above for each parameter.
<?php sr_getrandom(5,5); ?>
3. sr_listreviews()
sr_listreviews($orderby, $order, $usestar, $date, $limit)
This outputs list of reviews in a widget-like, sortable table format. (implemented using the awesome tablesorter plugin for jQuery)
$date
- format of date to be used
Acceptable value: PHP date format
Default value: “M j, Y”
$limit
- number of reviews to be returned
Acceptable value: any integer
Default value: “0″
Note: “0″ limit implies no limit i.e. retrieve all available reviews
<?php sr_listreviews(date,DESC,5,"M j, Y",10); ?>
| Date | Title | Rating |
|---|---|---|
| Tips: Shift+Click to sort multiple columnsPowered by Star Rating for Reviews | ||
| 2008-07-04 Jul 4, 2008 | HIGH and MIGHTY COLOR - HOT LIMIT | 80 ![]() ![]() ![]() ![]() ![]() |
| 2008-07-02 Jul 2, 2008 | JYONGRI - Love Forever | 80 ![]() ![]() ![]() ![]() ![]() |
| 2008-06-25 Jun 25, 2008 | Kuu’s ‘Moon’ | 90 ![]() ![]() ![]() ![]() ![]() |
| 2008-05-27 May 27, 2008 | Someday / Boys ♥ Girls | 85 ![]() ![]() ![]() ![]() ![]() |
| 2008-05-25 May 25, 2008 | Ayu’s anniversary | 92.5 ![]() ![]() ![]() ![]() ![]() |
| 2008-05-25 May 25, 2008 | sifow’s last Love Spell | 76.7 ![]() ![]() ![]() ![]() ![]() |
| 2008-05-15 May 15, 2008 | Koda Kumi - WIND | 100 ![]() ![]() ![]() ![]() ![]() |
| 2008-05-06 May 6, 2008 | Mop Girl | 70 ![]() ![]() ![]() ![]() ![]() |
| 2008-05-02 May 2, 2008 | Perfume - GAME | 89.2 ![]() ![]() ![]() ![]() ![]() |
| 2008-03-17 Mar 17, 2008 | Perfume ~Complete Best~ | 71.7 ![]() ![]() ![]() ![]() ![]() |
4. sr_getsingle()
sr_getsingle($post_id, $usestar, $prefix, $suffix, $size)
This function is intended to be used within the WordPress Loop. You can put this within the loop to display rating score or stars in categories, tags, or main page for each posting. See examples: categories, tags, main page.
$post_id
- the ID of current post within the loop
Acceptable value: $post->ID
$prefix, $suffix
- prefix, suffix to be added before and after the ratings code returned
Acceptable value: any valid XHTML tags or plain text
Default value: ” (empty)
$size
- the size of stars, can be normal or tiny
Acceptable value: 0, 1 (0 for tiny stars, 1 for normal stars)
Default value: 0
For $usestar, see the sr_getreviews().
Customization
Starting from version 0.4, a default CSS is imported into the WordPress header, which I hope will work nicely with your blog theme. If not, feel free to open the CSS and edit it or disable the CSS import by setting $sr_mycss to 1, which will remove all the default styling for CSS classes associated with this plugin.
By default, ratings and reviews returned by listing functions are hardcoded with special CSS classes, namely “sr-review” for the review permalink and “sr-rating” for the ratings returned, which can be either numerical percentage or star images.
You might want to take a look at another plugin I’ve written called “MyCSS”, which allows you to attach and edit custom stylesheet that’s independent of the blog theme you’re using. This makes it convenient and easy to organize theme independent CSS classes such as those used in plugins, saving you the trouble of appending these classes into your theme’s core CSS everytime you change a theme.
Options
Hopefully this plugin will work as desired in an “out of the box” way so that you don’t need to change anything. However, several extra options are still provided for those of you who would like to have it your way. :)
Since this plugin is still in its early stage, setting options in the WordPress admin panel is not supported yet. For now, you will need to open up the php file using either your favourite text editor or WordPress built-in plugin editor to change some of the variables you can find near the top of the code.
$sr_limitstar: globally set star count, e.g. putting 5 will ALWAYS generate your score using the 5 star rating system, put 0 to disable this feature$sr_defaultstar: default denominator when not explicitly specified in your tags$sr_prefix: custom prefix for normal ratings$sr_allprefix: custom prefix for overall ratings$sr_suffix: custom suffix, leave blank unless you want to close html tags$sr_ext: file extensions for custom star images, e.g. gif, jpg, png$sr_usetext: text only output settings, accepted values are 0, 1 and 20: images for posts and feeds
1: images for posts, text for feeds
2: text for all$sr_mycss: using your own CSS? if yes, put in 1 to disable default CSS import$sr_cuttitle: shorten post title to specific amount of character, put 0 to disable title cut off
The following are advanced options, mainly to turn on the functionality of storing ratings into database as custom field values:
$sr_autometa: 0 to turn off database writing, 1 to turn it on, this feature is disabled by default (it’s stable, I’m just leaving the choice up to advanced users)$sr_metakey: meta key for custom field, change this if there’s conflict with other plugins
Installation
- Download and extract the “star-rating-for-reviews” folder
- Upload the “star-rating-for-reviews” folder to your WordPress plugin directory, usually “wp-content/plugins”
- Activate the plugin in your WordPress admin panel
Upgrade
- Deactivate the plugin in your WordPress admin panel
- Remove the “star-rating-for-reviews” folder in your WordPress plugin directory
- Follow the installation guide above
Download
Star Rating for Reviews plugin 0.4 for WordPress (30kb .zip)
.psd file for tiny-stars (15kb .zip)
|
* This plugin has been downloaded 4922 times since May 9, 2007 ( 3090 times since version 0.4 ) |
Support
If you have any questions, suggestions, or found any bugs in this plugin, feel free to post them in your comments. I’ll try my best to answer them but there’s no guarantee, so don’t be disappointed if you do not hear back from me promptly. :/ If you find this plugin useful and feel like donating some money for my effort, please use the PayPal button above, thanks! <3
History
0.4 [2007.11.02]
- Added: Sort reviews by title
- Added: sr_listreviews() function to output all reviews in a sortable table (good for dedicated review page)
- Added: Default CSS stylesheet (can be turned off via options)
- Added: Cut off long title when getting list of reviews for sidebar
- Changed: XHTML markup for list of reviews generated
- Changed: Tiny star images
- Fixed: Division by zero if overall tag is placed at the top of a post
- Misc: Cleaned up the code and fixed minor bugs
0.3.1 [2006.09.12]
- Fixed: Sorting bugs
0.3 [2006.08.08]
- Added: Support to store rating data into database
- Added: Functions to output list of reviews, sortable by date or by rating scores
- Added: Filter to parse excerpt
- Added: Skip tag parsing by using ` character (suggested by Denis)
0.2 [2006.07.28]
- Fixed: Path error
- Fixed: [strong] instead of [b] for W3C standards
- Fixed: RSS text output bug
0.1 [2006.07.08]
- Initial release




211 responses so far ↓
she
// Jul 11, 2006 at 1:21 pm
really good idea.
but one thing, for web standard, [b] should be [strong]. ^^;
Anyway thank you very much! and moreover i’m moved by contents of this blog.
she
// Jul 11, 2006 at 2:48 pm
oh! one more.. here also will helf for you using .png images. bye.
she
// Jul 11, 2006 at 4:22 pm
..^^;;; sorry.. once again..
i modified your file with png-transparency file on here as i have left above.
Here is modified file.
Modified Star Rating for Reviews plugin at Uncategorized
// Jul 11, 2006 at 6:02 pm
[...] Star Rating for Reviews plugin [...]
Star Rating for Reviews · WordPress插件中文站
// Jul 11, 2006 at 8:30 pm
[...] 简介: 在文章中插入评分系统,演示页 [...]
WordPress Plugins Feature: July | blogHelper
// Jul 16, 2006 at 1:28 pm
[...] Star Rating for Reviews [...]
Lorelle on WordPress » blogHelper Begins WordPress Plugins Reviews
// Jul 18, 2006 at 7:59 am
[...] As promimsed a few days ago, Ang Zhuu Ming of blogHelper has started a series highlighting and reviewing interesting WordPress Plugins. The first set includes some interesting examples of WordPress Plugins including Bls Feeds with Comments, Wordpress-PayPal membership plugin, List Peer Pages Plugin, Star Rating for Reviews, Redirection, and Super Categories Plugin/Hack. An interesting collection of WordPress Plugins. [...]
carballada.com » De reformas
// Jul 21, 2006 at 6:58 pm
[...] También he añadido unos bonitos marcadores que me permiten poner estrellitas a las validaciones, like this Rating: . Gracias channel-ai.com por el plugin star-rating y a sevennine.net por su starred-review que han servido de base para montar todo esto. [...]
eyn
// Jul 22, 2006 at 2:40 am
Hi there she, thank you very much for the suggestion and you are right about the [strong] vs. [b] part, I just realized [b] will eventually be deprecated in favour of [strong].
I still haven’t decided if I should include the png fix in this plugin since the plugin’s purpose isn’t really to fix png issues with IE. Also, I’m not sure if the “height” and “width” attributes are required for this ActiveX method to work, if it is then it will cripple the custom image support the plugin currently offers. Still, I take a look at your modified code and it looks pretty promising. I’ll think about it if more people start to complain about IE png issues. :)
Lastly, if png is really an issue, you can always open the png file in Photoshop and save it as gif instead, do remember to update the options (change $sr_ext to gif) as described in my plugin explanation.
punkprojekt.com» Blog Archive » 本站使用的Wordpress插件
// Jul 25, 2006 at 9:33 am
[...] Star Rating for Reviews 在日志中插入图形化评分系统,适合用来评定电影/唱片的优劣程度。 [...]
themarina
// Jul 28, 2006 at 7:24 pm
I followed your installation guidelines and put the following in my post: [ratings:1] and the result was “Rating:?????”.
Any ideas of what could be wrong?
eyn
// Jul 28, 2006 at 9:50 pm
Hi themarina, the error is due to a path bug that I missed, it will work for most people except those cases where your WordPress address is different from your blog address, which is your case I believe.
I already updated my plugin so you can give it a try and see if it works for you now. :)
Mike
// Jul 30, 2006 at 7:44 pm
This is a great plugin. Thanks for coding it!
Quick question: Is there a way to create a listing of all reviewed titles along with the ratings?
eyn
// Jul 30, 2006 at 9:09 pm
Mike, regarding your question, for now the answer is no. :( The plugin is built upon the idea of beautifying the presentation of your reviews instead of organizing them. From one of the trackbacks I discovered this plugin that might just do what you asked for, but since I haven’t tried this plugin myself I’m not sure how helpful it can be. Hope that helps! :)
Mike
// Jul 31, 2006 at 12:26 am
Thanks for the reply. Unfortunately, the plugin you mentioned doesn’t integrate with the writing of the review. More of a way to link to a review and rate it.
I am looking for a rating plugin that ties directly into writing the review (as your does) but with the ability to customize output (as the other plugin does).
themarina
// Jul 31, 2006 at 12:23 pm
Eyn, thanks so much for the quick response! The fix worked beautifully! Thanks again for the great plugin! :)
Diogo
// Aug 1, 2006 at 6:58 pm
Great plugin!
I will start using it on my reviews!
Thanks!
Ken
// Aug 2, 2006 at 10:13 pm
Hi there, I currently have a rating system but I am having difficulties for making it work the way I need to. I have a couple of quick question before I go and install and try it.
The first is can I use another set of images(the same as I am currently using, my guess would be yes but I figured I would ask anyway) and the 2nd question is : is it possible to add the rating to the category pages also, besides the actual post and/or under the post tiles in the sidbar.
Any help would be appreciated, thanks
eyn
// Aug 3, 2006 at 11:11 am
Ken, this plugin is a little different from the plugin you’re using right now, since it’s originally for blog author to beautify the presentation of each blog entries using inline tags, and it doesn’t write any data to the database such as storing review scores. For your case, I guess you would like users to rate a review (i.e. blog posting), and such functionality cannot be found in this plugin, and most likely won’t be added since it’s not my intention to do that. The current plugin you’re using is more likely going to do what you want.
So for your first question, yes, it supports custom star images, just put them in the plugin folder by replacing the old ones. For the 2nd question, no, it’s not possible for now, but it might be possible if I’m able to extend the functionality. Still, this plugin won’t read information written to database by another plugin as in your case, it will only read the data you put yourself as an blog author into the rating tags.
fyi, I’m trying to write a new version of this plugin that stores review score information by parsing the [rating:] tags used such that you can use a custom function to list out all reviews you’ve written to date and sort them chronically or by review scores. You can then put this list in your sidebar or made a seperate page for it.
Diogo
// Aug 3, 2006 at 11:25 am
It would be great to make this integration, storing the ratings ;-)
Hope seeing this …
Ken
// Aug 3, 2006 at 11:36 am
Thanks for the quick reply,
I do have the basic concept of your plugin “Admin’s score of this post/product/review”
What I was thinking of is more an integration of the two plugins to seem as one. “User rated with the current plugin and our rating with your plugin”.
It seems to be an easy integration so I think I will wait for the new version you are currently working on give it a try.
Thanks again and best of luck with the new version…
Ken
Gary Mardell
// Aug 6, 2006 at 10:28 am
Hey, is there any way to make the rating work in a excert? That would be really handy!
eyn
// Aug 6, 2006 at 2:31 pm
Gary, I don’t really get the question. Do you mean excerpt? Like the excerpt that is shown when browsing categories? Well, the new version that I already finished (but haven’t done the documentation) allows you to insert single post ratings in the WordPress loop, you might want to browse around this site to see if something like that is what you want to do. If not you might want to elaborate more see if I can add in such functionaliy for you. :)
Gary Mardell
// Aug 6, 2006 at 5:37 pm
yeah i did mean excerpt. As on my homepage i am only using the optional excerpt. I would like some way to show the rating with it. Currently is you type in [rating: 4] into the excerpt it will just show the text. I need it to show the images. By the sounds of it the new version will do this or something similar. If i may have a copy that would be great.
eyn
// Aug 8, 2006 at 11:45 pm
The new 0.3 version of Star Rating for Reviews plugin has been released. This time I added support for storing rating data into database and provided special functions that will output list of reviews sortable by date and rating scores. A random reviews function is also provided aiming to give more exposure to your older reviews. I tried my best to do the documentation and I hope it doesn’t look too complicated for those of you who would like use the review listing features.
Gary, not sure if you still needed my plugin but I added a filter to parse the excerpt as you requested.
Silk Willow
// Aug 27, 2006 at 11:01 am
I am very impressed with your blog. I got here looking for star ratings capability for my own blog and found your plugin. I am still trying to begin my migration from blogger to wordpress so it may be a while for me to be able to use your star ratings plug in. However I just want to commend you on the great design of your blog. I can only aspire to be able to design mine to the same standard. I review and do write ups for American reality tv and other interesting celebrities. However, I am a big fan of anything Japanese - particularly food, culture, design and movies. :) I am working with a business partner to get into merchandising and one of the lines we are working on is japanese inspired anime designs. Wish me luck! I will be visiting :).
Steven Waters
// Aug 31, 2006 at 5:12 pm
First of all thanks! I’m really excited to use this plugin. Quick question. For some reason the plugin is not working. I FTP’d the “star-rating” folder into the “wp-content/plugins”. I then activated the plugin but when I post comments it doesn’t post the rating, [ratings:1] Any idea on what is wrong?
http://www.skiersreview.com/?p=3#com
Steven Waters
// Aug 31, 2006 at 7:31 pm
I’m having trouble getting the plugin to work. I followed the install procedures but it is not working. Any suggestions?
eyn
// Sep 1, 2006 at 11:25 pm
Hi Steven, this plugin is not supposed to work with comments, but only your main blog entry. You will need to put the rating tags within your blog post for it to work. I don’t see a reason for making it to work with comments since most of your blog visitors are not going to know if you have installed this plugin, let alone knowing the tag syntax and how to use it etc.
So yeah, this plugin will not work in comments, but you can tweak this plugin by adding additional filters to make it working with comments or just anything else you can think of if you wished. :)
—
Hi Silk Willow, thanks for the compliment but the theme I’m using right now is not designed by me but Ben Gray, so credits go to him. ;) Good luck on your migration to WordPress and your business as well! :D Tell me when you are able to get this plugin working for your new WordPress blog!
John Marcotte
// Sep 12, 2006 at 1:44 pm
First of all, thank you for the plugin. It looks great on my Web site (http://www.badmouth.net/). I was looking for exactly this functionality.
But I am still having trouble with IE and transparancy. My stories display on two different-colored backgrounds, and GIF transparency looks horrible. Any advice on getting ie png compatibility? The solution posted earlier does not appear to work in the latest version of the plugin.
Tom Wright
// Sep 12, 2006 at 4:15 pm
Hi,
The plugin is great, thanks for your efforts.
I think I’ve found a bug though: The autometa option doesn’t commit a value to the database if the rating was 0.
I’m also struggling with sr_getreviews() but this is likely to be my ineptitude more than anything.
The reason I’m tinkering so much is because I’m making a widget-plugin that displays the top x-number of reviews. I’ll post back here when I’ve got it working. :)
Tom
eyn
// Sep 12, 2006 at 5:52 pm
Hi John, the best solution I’ve found to fix the png transparency problem is by using pngbehavior.htc. You can read more about this technique by visiting WebFX. However, the .htc file provided on that site will cause minor JavaScript error in IE, to fix that you can get the improved pngbehavior.htc here. I suggest you wrap the CSS code in IE conditional comment to prevent other browser from trying to interpret it, which also make your code or CSS more standard compliant. :)
—
Hi Tom, thanks for mentioning the bug, I realized that I used >0 instead of >=0 in my code, I’ll get that fixed in the next version. I’m not too sure what problem you’re having with sr_getreviews() but if you find any mistake in the code after playing around with it, please tell me so I can get them fixed. :) I’m looking forward to see if you can get the widget working. I didn’t use any widget in this blog myself or I would have taken them into consideration when writing this plugin.
—
I’m not too sure if I should include a few new features for the next version, maybe some of you here can give me some feedback on what you would like to see in the future.
First of all, I’ve added a “level” system to rating scores that will assign special CSS classes such as “sr-high”, “sr-midhigh”, “sr-low” etc. to the score displayed based on the score value (this feature is optional, just like $autometa, it can be turned off). This gives you the option of styling different rating scores, such as changing their colour or font size. You can see this new feature in action in this blog’s frontpage and also the archives (notice the colour difference between different score levels).
I’m also considering using a completely new database table instead of using meta fields to store rating data. This will probably make it easier for users to uninstall the plugin or simply nuke all the rating data stored and start afresh. Though for users that only do casual reviews, I think meta value still works more intuitively for them.
The last thing I’ll probably change in the next version is to enclose review and rating stars with <span> instead of <div> to make CSS styling more intuitive.
Tom Wright
// Sep 12, 2006 at 8:52 pm
The bit I’m having trouble with might be solved by a change in the database schema.
I’m not convinced that your SQL returns properly sorted results.
Here is my plugin: http://whaletattoo.com/starrating.php.txt (Even commented, you’re lucky, I don’t normally bother :p )
Here it is in action on my site: http://tra.whaletattoo.com It’s at the bottom of the sidebar until I can get the reviews to sort properly.
eyn
// Sep 13, 2006 at 1:51 am
Thanks for the details, you reminded me of a bug that I discovered and fixed quite some time ago. I didn’t put it up earlier as I originally plan to include the fix in version 0.4. Anyway, since you’re having trouble with this issue I updated this plugin to version 0.3a that addresses the problem you faced. It fixes a sorting bug by changing the meta value data type from text to integer. Sorry for the inconvenience!
Tom Wright
// Sep 13, 2006 at 9:17 am
Wow, thanks for the quick update.
This means I’m ready to release v0.5 of my Widget.
Find it here: http://tra.whaletattoo.com/site-design/top-rated-widget/
Would you consider linking to it?
matthijs
// Sep 18, 2006 at 2:30 pm
Hi eyn,
I’ve added some extra code to your plugin to allow you to make top lists for specific time periods:
function sr_getreviews($limit=5, $orderby='date', $order='DESC', $usestar=0, $prefix='', $suffix='', $startdate='1900-01-01', $enddate='2900-01-01', $sqlforstart='', $sqlforend='DATE_ADD(CURDATE(),INTERVAL 1 DAY) ') {And then the SQL becomes:
$sql = "SELECT id, post_title, meta_value";$sql .= " FROM $wpdb->postmeta, $wpdb->posts";
$sql .= " WHERE meta_key = '$sr_metakey'";
$sql .= " AND post_id = id";
if($sqlforstart) {
$sql .= " AND post_date > $sqlforstart ";
} else {
$sql .= " AND post_date > '$startdate' ";
};
if($sqlforend) {
$sql .= " AND post_date
Email Monitoring & Email Filtering Blog
// Sep 24, 2006 at 5:28 pm
Excellent WordPress 2.0 Plugin…
My thanks goes to the author of the Wordpress plugin.
Each plugin was needed to add the already rich features of WordPress 2.0 to hopefully give the end-user the features that they look for in any blog site.
The plugins used for my site are all stable …
Stewart
// Sep 24, 2006 at 5:54 pm
excellent plugin. works a treat and very stable with WP2.0.4. keep up the great work.
Rob
// Sep 25, 2006 at 1:19 pm
This is a great plugin! Best of the ratings plugins I’ve found (and I’ve tried them all, including Rate My Stuff).
One question regarding the database handling. I noticed that when I entered the max star number (I changed $sr_limitstar to 5), and after saving that the “rating” cell was updated from 5 to 100. It’s like it’s been re-normalized to a 100 point scale.
Why is that? Not that it matters so much, but I’m just curious.
btw, it would also be great to have a plugins options page. ;)
Musik-Kritik » Blog Archive » Neues
// Sep 27, 2006 at 1:23 pm
[...] Eigentlich würde ich ja auch gerne eine spezielle Chartsseite einrichten. Das Problem ist allerdings, dass die Rangfolgen automatisch durch das Plugin Star Rating for Reviews berechnet werden und innerhalb von Wordpress-Posts kein PHP ausgeführt wird, was eben notwendig wäre. [...]
eyn
// Sep 28, 2006 at 11:28 pm
Tom, I added a link to your widget in this page. ;)
matthijs, thanks for sharing the code. I haven’t tried them out myself, but if there’s demand for a feature like that I’ll consider adding this into the plugin code.
Stewart, thanks for the compliment, glad you enjoy this plugin! :D
Rob, thanks for the high regards as well! For your question, $sr_limitstar should not affect the rating data, it’s just a variable that affects the presentation. All rating data stored in the custom field is indeed normalized to 100, consider that as a percentage score for each of your reviews. Personally, I think it’s the most intuitive and convenient way of storing rating scores. Instead of outputting just stars, this plugin is also capable of outputting percentage scores, browse around this blog and you should see them in action.
Lastlly, plugin option page would be nice and I might have it implemented later on, but manual editing of the php document can also be considered as a skill test just to make sure plugin users know what they are doing. Overall, this plugin should work as intended “out of the box” for novice users but also highly customizable for advanced users who simply want more functions.
Rob
// Sep 30, 2006 at 5:49 pm
Ok, I just tried impementing the following into my theme’s single.php template:
<?php if (function_exists('sr_getsingle')) { ?><?php sr_getsingle($post_id,5,'','',1) ?>
<?php } ?>
I’ve got this code right above the <?php the_content, so the stars should be showing up above the review itself.
Go here for an example:
http://www.electrolund.com/2004/01/in-america/
You see nothing’s showing up. I know that the rating I gave that post is in the database correctly, because that post is showing up on my review page (and sidebar widget!) nicely:
http://www.electrolund.com/reviews/
I know I have the above code in The Loop correctly, even verified it from the WP codex. Any ideas why stars aren’t not showing up for my code edit?
eyn
// Sep 30, 2006 at 6:28 pm
Hi Rob, instead of using “$post_id” as the first argument, you should use “$post->ID” instead. Tell me if there’s any more problem, hopefully this works for you. :)
Rob
// Sep 30, 2006 at 7:02 pm
Ahh, I didn’t catch that in your instructions above. Yes, it works great! Ohhh, so pretty! ;) Dang, this plugin is great.
The only thing I’m not able to do through the extra database feature is do ratings for my “comparison reviews”. I used to write reviews of two movies, comparing them. I used star ratings for both films. I realize that this doesn’t really work logistically for the database because there’s only one post.
No matter, I’m just going to use the manual mode of the plugin to display them. I won’t be able to display all the reviews on my template review page, but I could maybe do some sort of category link instead.
Rob
// Oct 2, 2006 at 12:26 pm
Tom, I love your widget plugin! Any chance you can expand it to display a random block?
Eyn, any chance the variables in your functions could be accessed by the end user? For instance, if a reader could sort by date, rating, or title with a drop down or some such control… that would be cool. :)
TwiddleGeek » Blog Archive » Tools of the Trade
// Oct 2, 2006 at 12:27 pm
[...] Star Rating for Reviews - One of the simplest but most effective review plugins. [...]
Rirath
// Oct 3, 2006 at 4:19 am
Just wanted to apologize for the 404 trackback earlier from my site. I didn’t realize I had accidentally selected an unused category, creating a 404 when I changed it.
At any rate, this plugin has been exactly what I was looking for. Many thanks.
插件 » Blog Archive » Star Rating for Reviews
// Oct 13, 2006 at 3:44 am
[...] 简介: 在文章中插入评分系统,演示页 [...]
Kingyo-Hanabi92
// Oct 24, 2006 at 2:47 pm
Wow~!! This plugin is really cool!! I’m going to use it in my blog whenever I rate something~!! Eyn sure knows a lot of technical-stuff :D
Senz
// Nov 6, 2006 at 11:33 am
Hi Eyn, thanks so much for this plug-in, it was exactly what I was looking for. One thing I can’t figure out; how do I get my permalink headings to display the numerical percentage value?
Rob
// Nov 6, 2006 at 1:28 pm
Senz, from the above instruction for the function sr_getreviews():
eyn
// Nov 6, 2006 at 5:57 pm
Hi there Senz, I’m not too sure which permalink you’re referring to, if it’s the percentage in pink colour beside post title as you can see on the front page, then it’s the sr_getsingle() function that is used to produce that. It is intended to be used in the WordPress loop where you can assign post ID as part of the argument. If you take a look at your theme files, you might be able to find $post->ID somewhere in the main index or categories template. For K2, it will be within “theloop.php”. You probably need to do some trial error thing to get it working. ;)
Rob, your idea is great but I’m not sure if it is possible without over-complicating the current code. Maybe someone can code a widget that does just that by extending this plugin? It will probably be nice to have an AJAX interface for this as the Extended Live Archives, but I’m not sure how practical this will be. :p
the waiting room » Blog Archive » Yusuf Islam - Heaven/ Where True Love Goes
// Nov 10, 2006 at 11:53 am
[...] Trying out the new plug-in.I think it’s pretty catchy despite its flaws. The song I mean, not the plug-in. [...]
FunkWadCuintWhich » Movie Review-ish: Who Killed The Electric Car?
// Nov 29, 2006 at 2:14 pm
[...] I’m screwing around with the Star Rating for Reviews plugin which, if it makes me giggle, I’ll use to rate all my movie reviews and whatever else strikes me. Maybe I’ll start rating my own shit. Who knows? [...]
Benjamin Solah
// Dec 13, 2006 at 4:30 am
What an excellent plug-in. I’ve been looking for something like this for a long, long time to use in my reviews of horror novels and movies. Thank you so much for your work.
Marc
// Dec 28, 2006 at 7:48 am
Thanks for the update!
æ blogs | squozen » Blog Archive » Rating Things
// Dec 29, 2006 at 6:11 am
[...] Tonight I discovered channel-ai’s star ratings plugin, and have decided it’s time to start rating everything. Since ratings don’t mean much, all ratings will be out of some arbitrary number based on my whim. So, to sum up the evening: [...]
Christoph Voigt
// Jan 11, 2007 at 9:57 am
Great plugin! I’ve tried 5 other review-plugins but they’re all either too limited in administration, too complicated and/or with too many restrictions what you can do or not.
Your plugin leaves everything to the writer of the review but gives him the option to visualize his ratings. I especially love the [rating:overall] tag. Great work, again :)
b l o g . c h i g g i n s . c o m » Blog Archive » Rated (sta)R
// Jan 11, 2007 at 3:33 pm
[...] Get ready for the ratings folks, the plugin from Channel AI is installed and ready to pass its merciless judgment! [...]
Die Suche nach dem Heiligen Review-Plugin at bastelblog
// Jan 11, 2007 at 7:06 pm
[...] Star Rating von Yaosan Yeo [...]
Andrew Scott
// Jan 12, 2007 at 9:50 pm
Looks like a great plug-in. Have you considered supporting microformats, in particular the hReview microformat? This would allow blogs that use it to have their ratings automatically searched by Technorati.
eyn
// Jan 15, 2007 at 9:28 pm
Hi Andrew, nice suggestion there! I looked up a little about hReview and it seems to me that it will be hard to tweak this plugin into supporting the hReview microformat. :(
However, it is possible for this plugin to generate a hReview microformat at the bottom (or top) of your review entry using excerpt, post title and rating meta field etc. as data, but I’m not sure how useful that would be. I’m also thinking one could just “hide” the hReview microformat generated using CSS so that it won’t look out of place and search spider will still be able to index your review. Still, I don’t know how legal that would be.
If any of you have any suggestion about how hReview can be implemented using this plugin please post it here, I really don’t have a very good idea how this can be done at the moment.
Kyle Korleski
// Jan 17, 2007 at 4:06 am
Niice! Thanks for the plugin!
Rob
// Feb 5, 2007 at 12:58 pm
Anyone updated to WP2.1 yet? Just wondering if this plugin will work.
herrow.com » Blog Archive » Star Ratings for reviews
// Feb 5, 2007 at 9:56 pm
[...] Just installed a plugin Alex mentioned to me that gives you a star rating for reviews and the like, get it here! [...]
Salvatore
// Feb 11, 2007 at 12:30 am
Hi,
this is a marvellous plugin, but what if I want a getreviews only of a specific category?
I got dozens of different categories and it’s essential for me to order within that confusion.
eyn
// Feb 11, 2007 at 4:41 am
Rob, this site is running on WP 2.1 and thus this plugin should work. There’s some issues with WP 2.1 though, like the formatting now adds <p> to all line break within <div> tags which makes things break in certain areas, mainly due to CSS rules. fyi, this site currently does not validate due to this issue. Anyway, these minor problems shouldn’t affect the functionality of this plugin.
Salvatore, thanks for bringing up this excellent idea, I’ll definitely look into it and most likely I’ll add this functionality in my next plugin update. However, I’m rather busy lately with my studies so the update probably arrive anytime soon. :(