A simple and elegant 5-star rating system for WordPress.
Ratingr allows your users to rate posts with a 5-star system. Everything is stored in your own WordPress database - no external services, no fees, no complications.
- ⭐ 5-star system: Intuitive and visual ratings
- 👥 Rating control: Prevents multiple ratings from the same user (by IP, cookie, or login)
- 📊 Statistics: View average rating and total votes
- 🎨 Customizable: Option to disable default CSS and use your own styles
- ⚡ Performance: Optimized system with statistics caching
- 🔒 Security: Protection against spam and multiple ratings
- 📱 Responsive: Works perfectly on desktop and mobile
- 🌐 Multisite: Compatible with WordPress networks
- 🔧 Easy integration: Use via template function or shortcode
- Log into your WordPress dashboard
- Go to Plugins > Add New
- Click Upload Plugin
- Select the plugin ZIP file
- Click Install Now then Activate
- Download the plugin
- Upload the
ratingrfolder to/wp-content/plugins/ - Activate the plugin from your WordPress dashboard
Method 1: Template Function
Add to your theme (usually in single.php or content.php):
<?php
if (function_exists('ratingr')) {
ratingr();
}
?>Method 2: Via Code
<?php
if (class_exists('ratingr_Rating')) {
echo ratingr_Rating::get_instance()->display_rating(get_the_ID());
}
?>- Go to Ratingr > Settings
- Configure available options:
- Disable Default CSS: Use your own custom styles
- Go to Ratingr
- See all posts with ratings
- Sort by average rating or total votes
- Click any post to view or edit
- WordPress 6.7 or newer
- PHP 7.4 or newer
- MySQL 5.6 or MariaDB 10.1 (or newer)
If you want to use your own styles:
- Go to Ratingr > Settings
- Check "Disable Default CSS"
- Add your own CSS to your theme
Available CSS classes:
.ratingr-rating- Main container.ratingr-stars-container- Stars container.ratingr-stars-foreground- Filled stars.ratingr-stars-background- Empty stars.ratingr-rating-info- Rating information.ratingr-already-rated- When user has already rated
Available filters:
// Modify JavaScript parameters
add_filter('ratingr_params', function($params) {
// Modify $params as needed
return $params;
});
// Control if user can rate
add_filter('ratingr_user_can_rate', function($can_rate, $post_id) {
// Your custom logic
return $can_rate;
}, 10, 2);
// Modify rating HTML
add_filter('ratingr_rating_html', function($html, $post_id, $stats) {
// Modify the HTML
return $html;
}, 10, 3);The plugin creates two tables:
wp_ratingr_ratings - Stores individual ratings
id- Unique rating IDpost_id- Post IDrating- Rating value (0-5)user_id- User ID (if logged in)ip_address- User IPcookie_id- Unique visitor cookiecreated_at- Creation dateupdated_at- Update date
wp_ratingr_stats - Statistics cache
post_id- Post IDaverage_rating- Average ratingtotal_votes- Total voteslast_updated- Last update
// Display rating component
ratingr();
// Get rating data
$data = ratingr_Rating::get_instance()->get_rating_data($post_id);
// Returns: array('average_rating' => float, 'total_votes' => int)
// Get average rating
$average = ratingr_Rating::get_instance()->get_average_rating($post_id);
// Get total votes
$votes = ratingr_Rating::get_instance()->get_total_votes($post_id);If you find this plugin useful, consider:
- ⭐ Starring the repository
- 🐛 Reporting bugs you find
- 💡 Suggesting improvements
- 🤝 Contributing code
- 📢 Sharing with others
Made with ❤️ by Butiá Labs and Manual do Usuário