Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/pronamic/wp-pronamic-reviews-ratings/archive/refs/heads/develop.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Pronamic Reviews and Ratings
The Pronamic Reviews Ratings plugin for WordPress is a powerful, extendable reviews and ratings plugin.
Register Rating Type
<?php
function prefix_reviews_ratings_init() {
pronamic_register_rating_type( 'trustworthy', __( 'Trustworthy', 'text_domain' ) );
pronamic_register_rating_type( 'objective', __( 'Objective', 'text_domain' ) );
pronamic_register_rating_type( 'complete', __( 'Complete', 'text_domain' ) );
pronamic_register_rating_type( 'well_written', __( 'Well-written', 'text_domain' ) );
}
add_action( 'pronamic_reviews_ratings_init', 'prefix_reviews_ratings_init' );
Post Type Support
<?php
function prefix_reviews_ratings_init() {
add_post_type_support( 'page', 'pronamic_ratings' );
}
add_action( 'pronamic_reviews_ratings_init', 'prefix_reviews_ratings_init' );
Post Type Rating Types Support
<?php
function prefix_init() {
register_post_type( 'book', array(
'public' => true,
'label' => __( 'Books', 'text_domain' ),
'pronamic_rating_types' => array(
'trustworthy',
'objective',
'complete',
'well_written',
),
) );
register_post_type( 'magazine', array(
'public' => true,
'label' => __( 'Magazines', 'text_domain' ),
'pronamic_rating_types' => array(
'trustworthy',
'well_written',
),
) );
}
add_action( 'init', 'prefix_init' );
Reviews Ratings Scores
<?php
function prefix_pronamic_reviews_ratings_scores( $scores ) {
$scores = array( 10, 8, 6, 4, 2 );
return $scores;
}
add_filter( 'pronamic_reviews_ratings_scores', 'prefix_pronamic_reviews_ratings_scores' );
Query Loop block
Add the pronamic-reviews-for-post keyword as a search filter parameter to show reviews for the current post.
Metadata
All the rating values are stored as meta data with the WordPress metadata API.
_pronamic_rating_value_$name
_pronamic_rating_count_$name
Schema.org
- http://schema.org/reviews
- http://schema.org/Review
- http://schema.org/Rating
- http://schema.org/AggregateRating
Tools for testing Schema.org markup
- Google Structured Data Testing Tool
- Structured Data Linter
- Stack Overflow question - Tool for testing Schema.org markup
WooCommerce Reviews and Ratings solution
- https://github.com/woothemes/woocommerce/blob/v2.1.6/includes/class-wc-comments.php
- https://github.com/woothemes/woocommerce/blob/v2.1.6/templates/single-product-reviews.php#L52
Other WordPress Reviews and Ratings solutions
- Rating-Widget
- WP-PostRatings
- Multi Rating
- WordPress Comment Rating Plugin
- kk Star Ratings
- 10+ Useful WordPress Rating Plugins
- Adding Custom Fields In WordPress’ Comment Form