Review plugin with rating of post [closed]

I want rating system like on wordpress’s official site.

Every user while making review can rate post (2)
and the total rating is displayed near the post (1).

Looks pretty simple but all plugins which I found by now
either show only total rating or allow to rate comments of users or to
do whatever else but not these.

Any help is appreciated because I got lost in plugins and think of writing by myself this functionality from scratch.

enter image description here

1 Answer
1

While there are a lot of plugins that adds rating type of stars, I would suggest that you code your own. Mainly because most of these are very feature rich with things you will not need.

This is a relatively simple process:

  1. Add a custom user metadata using update_user_meta(), name it posts_voted.

  2. Add a custom post meta value using update_post_meta(). The string value will be the rating, for example, 4.5. Name it post_rating.

  3. Then add rating stars to your single.php using wp_star_rating().

  4. When user selects their rating, you should update the user’s post_voted value and store the post’s ID in the array, and then you should use their choice of rating and add a simple algorithm for the post_rating value.

  5. Finally, on loading the page, do a check if the user’s posts_voted contains the ID of the post; if it does, disable the voting for this user.

Doesn’t this sound a lot better than adding a random plugin that contains tons of unnecessary features?

Leave a Comment