Technically yes, however it’s not recommended for the following reasons.
- Site Reviews uses the WordPress wp_star_rating function which expects a maximum of 5 stars. It will not show empty stars for numbers above 5.
- Changing to 10 stars when you have existing 1-5 star reviews will mess up your rating counts. You would need to apply the change before you have any reviews.
- Once you have set it to 10 stars, you will not easily be able to revert to 5 stars.
- Changing the maximum rating number is not officially supported. So if you experience problems after changing to 10 stars you may have to figure it out yourself if the problem is related to the rating.
If you would like to go ahead with this change in spite of the warnings above, you may do so like this:
/**
* Changes the maximum rating to 10 stars
* @return int
*/
add_filter('site-reviews/const/MAX_RATING', function () {
return 10;
});
/**
* Changes the rating validation to allow 10 stars
* @param array $rules
* @return array
*/
add_filter('site-reviews/validation/rules', function ($rules) {
if (array_key_exists('rating', $rules)) {
$rules['rating'] = 'required|number|between:1,10';
}
return $rules;
});
/**
* Changes the summary bars labels for each of the 10 stars
* @param array $atts
* @param string $type
* @param string $partial
* @return array
*/
add_filter('site-reviews/shortcode/atts', function($atts, $type, $partial) {
if ('site-reviews-summary' === $partial) {
$atts['labels'] = '10 stars,9 stars,8 stars,7 stars,6 stars,5 stars,4 stars,3 stars,2 stars,1 star';
}
return $atts;
}, 10, 3);