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.

Xavin's Review Ratings

Adds a shortcode tag [xrr rating=4/5] that displays a rating in one of several formats. Intended for sites doing reviews.

Tag Options

Each of these can have their defaults changed on the settings page, or be changed in each tag. You can mix and match display styles and options in the same post/page.

rating

The rating attribute is required in every xrr tag unless there is an overall attribute. Both fractions and percentages are valid inputs. Any fraction is acceptable, the rating is converted to an intermediate format and then to the specified output format. Unless explicitly overridden with the max_stars attribute, the plugin assumes you want to use the denominator of the fraction as the number of stars, so 4/5 would display 5 stars, and 3/10 would display ten stars.

max_stars

The max_stars attribute sets the maximum number of stars the rating will be displayed with. You can set it implicitly by using rating with a fraction, or explicitly with the max_stars attribute.

For exaple, the following tag will display as seven stars even though the fraction used is out of 5: [xrr rating=4/5 max_stars=7]

display_as

The display_as attribute determines for the rating will be displayed. The four basic outputs are 'stars', 'percentage', 'fraction', and 'textstars', and they are pretty self explanatory. The basic outputs can also be combined with an underscore to display two or more at once, for example this tag will display the fraction and then the image stars: [xrr rating= 4.5/5 display_as=fraction_stars]

label

The label attribute sets the label in front of the rating display. Make sure to surround the value with quotes if it contains a space.

group

The group attribute sets what named group the rating is in. By default all ratings are in an xrr group. The only use for the group currently is for overall calculations. Note: This is entirely independent of the [xrrgroup] tag.

overall

The overall attribute has one valid value, 'true'. If set it will ignore any rating attribute in the tag and instead calculate the average of all the ratings on the post/page that have the same group.

imageset

The imageset attribute determines what set of star images to use. The imagesets are auto-detected, either in the plugin directory for the imagesets that come with the plugin, or in the wp-content/uploads/xavins-review-ratings/ directory for imagesets you add. All usable imagesets are detected and displayed on the settings page.

fraction_separator

The fraction_separator attribute determines the separator between the numerator and denominator when displaying ratings as a fraction. By default it is '/', although another common option would be ' of '.

max_fraction

The max_fraction attribute sets how far stars can be broken up, there are three valid values, none=1 half=2 quarter=4. If you set it to 1, all ratings will be calculated out of whole stars, and if you set it to 4 they will be calculated to quarter stars, etc.

The [xrrgroup] Tag

The [xrrgroup][/xrrgroup] tag is used to activate group rendering in the [xrr] tags it surrounds. Any attributes set in the [xrrgroup] will be used in the contained tags unless they have attributes of their own. By default it renders all the contained [xrr] tags in a table, but this can be changed by modifying the templates on the settings screen. Here is an example:

[xrrgroup][xrr rating=4/5 label="DVD:"][xrr rating=3/5 label="Movie:"][/xrrgroup]

There are some things to keep in mind. Don't put line breaks inside the [xrrgroup] tags, since WordPress doesn't properly recognize being inside a shortcode tag, and will insert <p> tags that will make your HTML invalid. Also, the [xrrgroup] tag is entirely independent of the group attribute in the [xrr] tag.

Requires: 2.5.1 or higher
Compatible up to: 3.0.5
Last Updated: 2010-4-11
Downloads: 22,645

Ratings

4 stars
4.2 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

100,3,3 100,5,5
67,3,2
100,1,1
100,1,1
0,1,0
100,2,2
100,4,4
100,2,2
100,1,1
100,2,2
100,1,1