Support » Plugin: Site Reviews » Assign review to multiple categories

  • Resolved r6123603680


    Reviews can no longer be assigned to multiple categories. Your changelog says this was done on purpose for nebulous “performance reasons”. WHY??

    As a developer myself, I am thankful for the continuous plugin maintenance but breaking existing functionality is something you do only in very extreme cases and this is not one of them. It doesn’t take a huge amount of “performance” to save multiple categories, and it doesn’t make any more “performance” to pull reviews from one category vs another.

    This was a simple, valuable feature. When I chose the plugin, it was one of the requirements so it’s not nice to just yank it from under us.

    Please bring it back.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gemini Labs



    Site Reviews only allows you to assign reviews to one category and/or one page/product/etc., this is a change that was introduced in v4.0, however (since version 3 which introduced internal caching of rating summaries) it was always intended to be this way.

    And yes, the reason for this is performance…for your website:

    Site Reviews allows you to include multiple shortcodes on a page each with their own options. When you have thousands of reviews which are assigned to multiple categories and pages, calculating the total rating count summary for all these reviews can be resource intensive on your server as it involves fairly complex database queries to perform (without introducing a dedicated database table). This is why Site Reviews maintains an internal count of your review ratings to speed up the process. However, allowing more than one category introduces too many variables to the mix, and this added complexity is unnecessary in 99% of use-cases.

    Generally, it is more appropriate to assign reviews to a page (i.e. a property page, a product, a service). However, sometimes these things do not have their own page (i.e. A page that displays multiple services instead of giving each service its own page), and this is why categories were introduced to allow assigning reviews to a category which represents an individual service or item.

    When a review is assigned to a post_id, that post will contain a meta_value which stores a running count of the ratings of all reviews that have been assigned to it. The same goes for a category. When you assign a review to both a post_id and a category, the summary will not be able to use the stored counts and will instead calculate the summary when the page is loaded. This is why it is recommended to assign to only one or the other.

    For example:

    Uses the cached rating counts:

    [site_reviews_summary assigned_to=post_id]
    [site_reviews_summary category=houses]

    Does not use the cached rating counts; queries the database instead:

    [site_reviews_summary assigned_to=post_id category=houses]

    How are you using the categories? Can you explain why it is necessary for you to assign multiple categories? Would it make more sense to assign your reviews to a specific page, perhaps along with a category? (although it is still always recommended to assign to one or the other)

    The next major version of Site Reviews will most likely introduce a dedicated pivot table to the database to track the rating counts across multiple post_ids and term_taxonomy_ids. This will allow Site Reviews to manage rating summaries for reviews that have been assigned to multiple posts and categories without having to perform server-intensive database queries that involve multiple (!) table joins while at the same time dealing with cases of thousands of reviews.

    • This reply was modified 1 year, 6 months ago by Gemini Labs.
    • This reply was modified 1 year, 6 months ago by Gemini Labs.
    • This reply was modified 1 year, 6 months ago by Jan Dembowski.
    Thread Starter r6123603680


    Thank you so much for a detailed and helpful response. The “assigned_to” tag will probably solve my use case just as well as assigning to multiple categories.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Assign review to multiple categories’ is closed to new replies.