Topic Ratings Plugin

Just added exact topic averages next to topic star ratings, controlled by the Plugins setting Show exact average rating


Added a note for admins if a topic has hidden ratings (if category or tags were changed).

Probably not, but it’s a good feature to add! Will have a look at this soon.

This plugin is now at v0.2.

Apart from the composer re-opening issue, which may be a Discourse bug, the plugin is now reliably working as described. To do list in first post reflects ongoing agenda.


Forgot to mention here, but the bug with the composer reopening should be fixed now if you update Discourse to include this commit.


Feature request from github:

My team is building a site called Science Commons where academics can discuss research papers. Each topic is about a single paper; the first post is a “wiki” that contains a summary of the paper. I would like to use your rating plug-in for Science Commons. But my concern is that when I turn on the rating tag, I am forced to give a rating on the first post. Is there a way such that no rating is required for the first post? I want to be an impartial admin who posts the paper and don’t want to give my own opinion about the paper.

I’ve thought of adding this previously and will add this as a setting in a few days time, after finishing the current batch of work on Quick Messages.


I’ve added a feature which covers the use case previously mentioned (i.e. omission of a rating from the first post in a ratings topic), and also lets any user remove a rating entirely from a previous post in a ratings topic. Complete removal of a previous rating allows the user to rate in another post on that topic if they so wish.


Is it possible to customize the “rating” tag to be any other existing tag of my selection?

Hey, that’s number ‘4’ on my list of to dos. As you’ve seen on the topics for my other plugins where you have posted I have a few ‘to dos’ on my plate at the moment, so it’ll be a little while before I add that. But I am happy to accept a PR in the meantime.


Hey I love this plugin. Thanks for the good work. How about showing the rating on hover over the stars in each topic / posts? For example can show 3.5 or 4.2 numbers based on average rating. I have the Show exact average rating setting turned on.

Sorry for the slow reply, I’ve been away.

Just to clarify, you are seeing the numerical average next to the topic rating right?

Could you show me a mockup or an example of what you have in mind? Cheers.

Yes, I see the average. That’s fine. What I have in mind is a like hover on small title popup showing the average on the main topics list view. In that screen you see a rating but on hover does not show the average. For example, a 3.5 rating is showing as 4 stars and on hover does not give out the average. I have to enter that topic to view the average. Understand it is not a big deal to have it as it is, just thought since we are accustomed to hovering over star ratings on many websites to see the average score, it may be a good feature to implement for habitual reasons.

1 Like

When the topic creator has chosen no rating for a topic, why don’t we suppress the need to either add a rating or uncheck the box for replies? We can just hide the ratings field for the replies right?

I’ve added exact averages to topic list items in the same format as in the topic title.

I didn’t do the Amazon-style hover (yet) because a hover element typically holds more content than just a single number (unless it’s a tooltip), and I’ll need to decide what else to include there first.

One option is to add the percentages for the different star options like Amazon does (see below).

Also, I had a brief look around at other popular sites using star ratings. It seems a majority display the number of ratings after the stars, with a minority showing the exact average. Not many show anything on hover.

Were there any other specific examples you had in mind?


Could you give a little more info for this scenario:

  1. Is the topic in a category with ratings turned on and/or has a ‘rating’ tag?

  2. Which ratings ‘field’ are we hiding?

Yes, the topic is in a category with ratings turned on. I will give you an example.

As a topic creator, I post a new topic under this category but uncheck ratings while posting it.

Now another user is replying to this topic without ratings (but under a category with ratings enabled)

The user has to now again either uncheck ratings while posting his reply or has to add a rating.

I wonder if we can (or should) suppress the need to add/uncheck a rating for replies to a topic which the owner of the topic has not set ratings to. I cannot think of any scenario where it may be needed to add a rating to a reply for an original topic without ratings.


I triied to install this plugin but seems like something is wrong, i can’t rate a topic and got this in error logs :slight_smile:

Error: Could not find module `discourse/helpers/register-unbound` imported from `discourse/plugins/discourse-ratings/discourse/initializers/ratings-edits`
    at o (
    at i (
    at n.state (
    at e (
    at requireModule (
    at Array.forEach (native)
    at window.Discourse.Ember.Application.extend.start (
1 Like

@repz I just updated this plugin to work with the latest Discourse code. Please try again. Thanks.


@angus working like a charm!

Thanks a lot :wink:


This is great! I’d like to use it with the Discourse WordPress plugin so that WooCommerce (a WordPress ecommerce plugin) product reviews can be written on Discourse. Does anyone have any ideas on what needs to be done to return the rating and average_rating fields with the information returned from wordpress.json?

I’ve got it working by returning the topic custom fields through the TopicViewWordpressSerializer and the post custom fields through the PostWordpressSerializer.