After ratings have been calculated, they are effectively cached in a custom database tabled “
The plugin also stores a copy of ratings in a couple of post meta fields since v5.0.2 however the implementation of the plugin does rely on these fields.
- “mrp_rating_result_<rating_form_id>” where <rating_form_id> is the rating_form id e.g. “mrp_rating_result_1”. This holds an array of rating result data.
- “mrp_rating_result_<rating_form_id>_star_rating” where <rating_form_id> is the rating_form id e.g. “mrp_rating_result_1_star_rating”. This stores an overall star rating value.
This also makes it easy to sort posts in a WP Query.
$q = new WP_Query( array( 'orderby' => array( 'mrp_rating_result_1_star_rating' => 'ASC' ) ) );