This article presents details documentation for CBX Multi Criteria Rating & Review for WordPress.
If you are looking for old Multi Criteria Rating plugin’s documentation , it is here . We have a migration guide to migrate from old Multi Criteria rating plugin to this new Multi Criteria rating plugin
If you are looking for Pro Addon or Comment Addon and MyCred Addons and their details for CBX Multi Criteria Rating & Review for WordPress please check the below three articles.
- CBX Multi Criteria Rating & Review for WordPress Pro Addon
- Comment for CBX Multi Criteria Rating & Review for WordPress
- myCred for CBX Multi Criteria Rating & Review for WordPress
This documentation is for the Core plugin and Pro addon. Comment and myCred addon documentation is in their product details page.
Download and Installations:
Download & Install Core Plugin:
To download the free core plugin of CBX Multi Criteria Rating & Review for WordPress please go to wordpress
plugin dir
Plugin from wordpress plugin directory can be installed in different ways, wordpress codex has very good tutorial about this, so we are skipping this part. Or wpbeginner has a step by step guide.
Install any Pro Addons:
Please check the addon section from the product page
After purchase any pro or free addon you will get zip package.
This zip package you need to install manually, wordpress code has very good tutorial about this.
Activate and Configuration:
After installing the plugin, please activate from plugin listing page or installation screen. If the plugin is activate there will be a menu in left panel admin menu called “CBX MC Reviews”
Create Pages:
Next step is to create 3 pages for 1. Frontend User dashboard, 2. Single review details/permalink page, 3. Frontend Review Edit page. Here page 1 and 3 is related with frontend user dashboard and 2 is needed if we want to create single review details page, that means we want to create permalink for every single review. So, go to pages from admin panel and start creating pages and insert specific shortcodes.
1. Frontend User dashboard – Shortcode [cbxmcratingreview_userdashboard]
2. Single review details/permalink page – Shortcode [cbxmcratingreview_singlereview]
3. Frontend Review Edit page – Shortcode [cbxmcratingreview_editreview]
Settings: Pages & Tools
After creating the above 3 pages the first thing need to do is go to setting page of the plugin and check & set
Pages & Tool. See
screenshot. In Pages & Tool tab select the 3 pages created as specific for frontend dashboard, review details and review edit and save setting once. Now all setting tabs step by step once to understand the settings.
Enable Auto Integration
Auto integration helps for quick start. Go to Setting->General Tab and choose “Post Type Support” and save once. Then in same tab check “Enable Auto Integration” , set “Yes” and choose “Auto Integration for Post Type”. Please note that unless any post types is set in “Post Type Support” field “Auto Integration for Post Type” will not show any post types. The rest 3 fields “Show on Single”, “Show on Home/Frontpage”, “Show on Archives” are related with auto integration. Enable/disable those selection as need. Check
screenshot here
Shortcodes & Relevant Functions
1. Rating Form Shortcode [cbxmcratingreview_reviewform]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
form_id | default form id | any form id |
post_id | current post id | any post id |
This functionality can be achieved using custom function call also anywhere in theme.
<code> global $post; $form_id = ''; //put form id here $post_id = intval($post->ID); if ( function_exists( 'cbxmcratingreview_reviewformRender' ) ) { echo cbxmcratingreview_reviewformRender( $form_id, $post_id ); } </code>
2. Average Rating Shortcode [cbxmcratingreview_postavgrating]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
form_id | default form id | any rating form id id |
post_id | current post id | any post id |
details | 0 | 0 or 1 , if 1 then shorts avg rating per criteria(Added in V1.0.3) |
This functionality can be achieved using custom function call also anywhere in theme.
<code> global $post; $form_id = ''; //put form id here $post_id = intval($post->ID); if ( function_exists( 'cbxmcratingreview_postAvgRatingRender' ) ) { echo cbxmcratingreview_postAvgRatingRender( $form_id , $post_id ); } </code>
3. Post Reviews Listing [cbxmcratingreview_postreviews]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
form_id | default form id | any form id |
post_id | current post id | any post id |
orderby | id , Here id is actually review id | id, total_count, post_id |
order | DESC | DESC, ASC |
score | 1,2,3,4,5 | |
perpage | 10 or as set ins global setting | any numeric value |
show_filter | 1 or as set ins global setting | 1 or 0 |
show_more | 1 | 1 or 0 |
This functionality can be achieved using custom function call also anywhere in theme.
<code> //variable names can be useful to understand what is what and also check shortcode params to understand $output = ''; if ( $show_filter ) { if ( function_exists( 'cbxmcratingreview_postReviewsFilterRender' ) ) { $output .= cbxmcratingreview_postReviewsFilterRender( $form_id, $post_id, $perpage, 1, $score, $orderby, $order ); } } if ( function_exists( 'cbxmcratingreview_postReviewsRender' ) ) { $output .= cbxmcratingreview_postReviewsRender( $form_id, $post_id, $perpage, 1, $score, $orderby, $order, $show_more ); } echo $output; </code>
4. Single Review [cbxmcratingreview_singlereview]. Shortcode details are below:
This functionality can be achieved using custom function call also anywhere in theme.
param name | default value | possible values |
---|---|---|
review_id | 0 | any review id |
<code> $single_review_html = ''; $review_id = 0; //put any review id here if ( function_exists( 'cbxmcratingreview_singleReviewRender' ) ) { //we can keep a way to get the review id from url $review_id = isset( $_GET['review_id'] ) ? intval( $_GET['review_id'] ) : $review_id; if ( $review_id > 0 ) { $post_review = cbxmcratingreview_singleReview( $review_id ); $post_id = intval($post_review['post_id']); $post_title = get_the_title($post_id); $post_link = get_permalink($post_id); $single_review_html .= '<p>'.esc_html__('Reviewed', 'cbxmcratingreview').' : <a target="_blank" href="'.esc_url($post_link).'" rel="noopener noreferrer">'.esc_attr($post_title).'</a></p>'; $single_review_html .= '<ul class="cbxmcratingreview_review_list_items">'; $single_review_html .= '<li id="cbxmcratingreview_review_list_item_' . intval( $review_id ) . '" class="' . apply_filters( 'cbxmcratingreview_review_list_item_class', 'cbxmcratingreview_review_list_item' ) . '">'; $single_review_html .= cbxmcratingreview_singleReviewRender( $post_review ); $single_review_html .= '</li>'; $single_review_html .= '</ul>'; } else { $single_review_html .= '<div class="alert alert-danger" role="alert">' . esc_html__( 'Sorry, review not found or unpublished', 'cbxmcratingreview' ) . '</div>'; } } echo $single_review_html; </code>
5. Single Review Edit [cbxmcratingreview_editreview]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
review_id | 0 | any review id |
This functionality can be achieved using custom function call also anywhere in theme.
<code> $single_review_edit_html = ''; $review_id = 0; //put review id here if ( function_exists( 'cbxmcratingreview_singleReviewEditRender' ) ) { if ( $review_id == 0 ) { //now take from url $review_id = isset( $_GET['review_id'] ) ? intval( $_GET['review_id'] ) : 0; } if ( $review_id > 0 ) { $single_review_edit_html = cbxmcratingreview_singleReviewEditRender( $review_id ); } else { $single_review_edit_html .= '<div class="alert alert-danger" role="alert">' . esc_html__( 'Sorry, review not found', 'cbxmcratingreview' ) . '</div>'; } } echo $single_review_edit_html; </code>
6. Most Rated Posts [cbxmcratingreviewmrposts]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
form_id | default form id | any form id |
type | post | any post type like post, page, product etc |
orderby | avg_rating | avg_rating, total_count, post_id |
order | DESC | DESC, ASC |
scope | shortcode | any string or single word, better skip this param to use default |
limit | 10 | any numeric value |
This functionality can be achieved using custom function call also anywhere in theme.
<code> //variable names can be useful to understand what is what and also check shortcode params to understand cbxmcratingreview_AddJsCss(); $data_posts = cbxmcratingreview_most_rated_posts( $form_id, $limit, $orderby, $order, $type ); //variable name $data_posts is important for template files // Display the most rated post link ob_start(); include (cbxmcratingreview_locate_template('widgets/most_rated_posts.php')); $content = ob_get_contents(); ob_end_clean(); echo $content; </code>
7. Latest Ratings [cbxmcratingreviewlratings]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
form_id | default form id | any form id |
orderby | id , here id is review id | id, score, post_id |
order | DESC | DESC, ASC |
scope | shortcode | any string or single word, better skip this param to use default |
limit | 10 | any numeric value |
This functionality can be achieved using custom function call also anywhere in theme.
<code> //variable names can be useful to understand what is what and also check shortcode params to understand cbxmcratingreview_AddJsCss(); $data_posts = cbxmcratingreview_lastest_ratings($form_id, $limit, $orderby, $order, $type ); //variable name $data_posts is important for template files // Display the most rated post link ob_start(); include (cbxmcratingreview_locate_template('widgets/lastest_ratings.php')); $content = ob_get_contents(); ob_end_clean(); echo $content; </code>
8. Frontend user dashboard [cbxmcratingreview_userdashboard]. Shortcode details are below:
param name | default value | possible values |
---|---|---|
form_id | any form id if need to display reviews from any specific form | |
orderby | id , here id is review id | id, post_id, post_type, score, status |
order | DESC | DESC, ASC |
perpage | 20 | any numeric value |
Widgets
1. Most rated post widget which does same as shortcode [cbxmcratingreviewmrposts]
2. Latest ratings widget which works same as shortcode [cbxmcratingreviewlratings]
3. WooCommerce rating filter widget as alternative(Pro addon)
Custom Functions
Most static method and functions are included in
1. cbxmcratingreview\includes\class-cbxmcratingreview-functions.php – easy to call functions(please don’t be confused for having the word ‘class’ in file name, this file includes all functions)
2. cbxmcratingreview\includes\class-cbxmcratingreview-helper.php – This helper class is used almost everywhere and for technical reason if you need any custom function please check this class. We will add more in this doc more specific.
Google rich snippet
This plugins adds the proper syntax for adding google rich snippet for aggregated reviews and regular review listing but the theme must have the rich snippet support.
Example
https://gist.github.com/manchumahara/62e59f2f3827e61fcda123c4f249d517
Templating System
Most frontend views supports template files. By default plugin’s template/theme files loaded from core plugin’s templates folder wp-content/plugins/cbxmcratingreview/templates
To override any file from theme please create a folder named cbxmcratingreview
in your theme or child theme folder. then copy any file from core plugin’s templates folder to that folder in theme/child theme, please keep the same name and same folder structure. All addon follows same template system and from addon plugin’s templates folder you can copy any file and put in the theme/child theme’s cbxmcratingreview
folder
Last modified: May 30, 2020