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:
-
Add a custom user metadata using
update_user_meta()
, name itposts_voted
. -
Add a custom post meta value using
update_post_meta()
. The string value will be the rating, for example,4.5
. Name itpost_rating
. -
Then add rating stars to your single.php using
wp_star_rating()
. -
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 thepost_rating
value. -
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?