Welcome to documentation for CBX Multi criteria Rating for WordPress. Here will show the basic and advance usages of this plugin
Quick Navigation
- Core plugin installation
- Install addons
- Configure- Create Basic Form
- Configure- Create Criterias
- Configure- Create Questions
- Configure- Make default form
- Shortcodes
- Widgets
- Manual Integration(For advanced user/programmers)
- Showing posts by avg rating using wordpress custom query(meta query)
- Google rich snippet
Core plugin installation
This plugin’s core version is free and can be install from
wordpress plugin directory
Plugins can be installed in different ways in wordpress. As WordPress codex has very well
documentation about this, we are recommending to read that
Install addons
Pro addons need to install manually. The way we provide the download zip either you will get all plugins in single zip file having name _all.zip at end or individual zip of each plugin. For the first way if all plugins are in one single folder cbratingsystem_all.zip then unzip it and you will find the core and addons. Now either zip individual plugin and upload from wordpress plugin upload manager or directly upload via ftp. Whatever the way you upload after install if you check via ftp to your wordpress plugin dir then it should look like this
Configure- Create Basic Form
If the core or addon plugins are created properly then in plugin listing page it will be shown as below and we are good to move forward to create rating form.
Multiple rating form can be created from the form manager and for each rating form the ratings and average are calculated separately. That means each rating form’s configuration is different and information related to any specific form is stored that way. See this below image about how to access different menus of the rating form
To create or edit a new form from admin panel go from left menu “Rating & Review” -> Add New Form
If you finishes the previous screenshots then a form’s basic information is updated, now it’s time to create criterias
Configure- Create Criterias
Click the criteria tab and you will see the default ones or previously saved one. In pro version you can create unlimited criteria set and criterias in each criteria sets
All text and input fields in criteria view is “click and edit”
Check below screenshot how the criteria should show in frontend
Configure- Create Questions
By default the rating form has a comment field (though it can be enable/disable), additionally custom question can be added and answers from frontend are logged with the form.
In free version only one question can be created, unlimited in pro version as well
Three types of question can be created text input, radio or checkbox. For radio or checkbox if need multiple option maximum 5 fields can be added
Configure- Make default form
If you have one form then it will be default form by default. But from the form listing view you can make any form default, If you don’t mention form id in different usages then default form should be used.
Shortcodes
Rating form has three ways to integrate , auto integration after or before post content or manually code integration or shortcode.
We will explain how to use shortcode for form integration and other shortcodes and their parameters.
Available shortcodes
- Show rating form [cbratingsystem]
- Show average value [cbratingavg]
- Show Top Rated posts [cbratingtopratedposts]
- Show Top Rated User [cbratingtoprateduser]
- Show Latest Reviews [cbratingreview]
Show rating form using shortcode: [cbratingsystem]
Example usages: [cbratingsystem form_id=”4″]
Possible params
param name | default value | possible values | note |
---|---|---|---|
form_id | default form id | any valid form id | try to use valid form id to be more specific |
post_id | default post id is taken from wordpress loop | any post id for which you want to show rating | As you can use any post id , means you can show rating form for one post in another post ! |
theme_key | as set default from plugin setting or ‘basic’ | basic, blueish, greenish, custom | if you use custom then you have to the required color from form’s theme setting |
showreview | 1 | 1,0 | show/hide review list with rating form |
Show average rating for one or multiple posts shortcode: [cbratingavg]
Example usages: [cbratingavg post_ids=”123, 445″ form_id=”4″]
Possible params
param name | default value | possible values | note |
---|---|---|---|
post_ids | post id from wordpress loop | any valid post id with comma | try to use valid post id to be more specific |
form_id | default form id | any valid form id | Double check post ids and form id to avoid unexpected results |
show_title | 0 | 1, 0 | shows post title yes/no |
show_form_id | 0 | 1,0 | show/hide review list with rating form |
show_text | 0 | 1,0 | show/hide textual presentation of rating values |
show_star | 1 | 1,0 | show/hide star presentation of rating values |
show_single | 0 | 1,0 | show only for single post or first post |
text_label | Rating: | Any text you want | change parameter and see how it looks |
Top Rated Users: [cbratingtoprateduser]
Example usages: [cbratingtoprateduser form_id=”form id here”]
Possible params
param name | default value | possible values | note |
---|---|---|---|
form_id | any valid form id | Double check form id, if no form id given then shows nothing | |
user_id | any valid user id, comma separate | If need to shows for specific users, skip if no need for specific user ids | |
day | 0 | 0 = all time, 1 = 1 day, 7 = 7 days | show top rated users for rating of certains days |
limit | 10 | any valid number | |
order | DESC | ASC, DESC | Asscending or descending order |
post_id | comma separated post id | any valid post id with comma | if need to show for some specific posts, skip if need for all posts with same form id, try to use valid post id to be more specific |
post_type | any post type , example – post, page, product etc | ||
post_filter | post_id, post_type | no filter, or filter by post_id or post_type, if you use post_type or post_id then you need to use post_filter to make it specific | |
firstorder | post_count | post_count, rating | show data order by post_count of any single user or avg rating of any user’s post |
Top Rated Posts: [cbratingtopratedposts]
Example usages: [cbratingtopratedposts post_type=”post”]
Possible params
param name | default value | possible values | note |
---|---|---|---|
form_id | any valid form id | Double check form id, if no form id given then shows nothing | |
day | 0 | 0 = all time, 1 = 1 day, 7 = 7 days | show top rated users for rating of certains days |
limit | 10 | any valid digit | |
order | DESC | ASC, DESC | Asscending or descending order |
post_type | any post type , example – post, page, product etc |
Show Latest Reviews: [cbratingreview ]
Example usages: [cbratingreview show_criteria=”1″]
Possible params
param name | default value | possible values | note |
---|---|---|---|
form_id | required | any valid form id | Double check form id, if no form id given then shows nothing, for multiple use comma |
post_id | any valid post id | Double check post id, use post_id when you need reviews for any specific post, for multiple use comma | |
user_id | any valid user id | Double check user id, use user_id when you need reviews from any specific user, for multiple use comma | |
post_type | required | any valid post type, exmaple post, page etc | Double check post_type, use post_type when you need reviews for any specific post type, for multiple use comma |
limit | 10 | any valid digit | |
order | DESC | ASC, DESC | Asscending or descending order |
order_by | created | created, post_id, post_title, post_type, user_id, avg, id | |
show_comment | 1 | 1 or 0 | 1 = yes, 0 = no |
show_criteria | 0 | 1 or 0 | 1 = yes, 0 = no |
show_post | 1 | 1 or 0 | 1 = yes, 0 = no |
Note: This shortcode doesn’t show custom question in review listing if even pro addon is enabled.
Widges
There Three widgets available
Go to widgets manager and add the following widget in your target sidebar
- Top Rated Posts (Does almost same thing as the shortcode [cbratingtopratedposts])
- Top Rated Users(Does almost same thing as the shortcode [cbratingtoprateduser] )
Manual Integrations(For developers)
In this section we will try to write how to add the rating form, shows top rated posts, top rated users or avg rating for any post for any form using direct php code in your theme
Add rating form directly in theme
Check this gist or check below
https://gist.github.com/manchumahara/0fb17bc4203a6f9c49c7
Show avg rating directly in theme
Check this gist or see below:
https://gist.github.com/manchumahara/83829ebb2017440d874c
Showing reviews for any form id and post id
Check this gist or see below:
https://gist.github.com/manchumahara/77da3f0da3c1b9932d3d
Showing top rated posts or user
To show top rated users or top rated post directly in theme or in 3rd party plugin try to check the code pattern used in file class.CBRatingSystemWidget.php
Showing top rated posts using wordpress custom meta query
As this plugin has multiple forms and a single post can be integrated with multiple form, it means avg rating for a post will be different for different form id
To make developers life easy we always keep a meta data in post (custom meta field)
Meta field name is ‘cbrating{form_id}’ -> replace the {form_id} with any dynamic form, exmaple cbrating1, cbrating2 and it’s value is avg rating for that form id
Check this gist or see below:
https://gist.github.com/manchumahara/dd1916e4c674d7c23286
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