• Hi ??

    The rating API is missing the ratings made by comments.

    When I go to example.com/wp-recipe-maker/v1/rating/recipe/123
    or
    WPRM_Rating_Database::get_ratings(['where' => 'recipe_id = ' . $recipe_id])

    it only returns the ratings that are not made by comments.

    I believe the problem is because the ratings left by comments are missing the wp_wprm_ratings.recipe_id value in the database.

    Update
    I also noticed that in WP-Admin under WP Recipe Maker->Manage->Recipes, the total number of Ratings is incorrect. It says “2 comments” + “9 votes”, when in reality it should be “2 comments” + “11 votes”… again, not counting the comment votes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    Comment ratings would not have the recipe_id set. They have a comment_id set.

    Does that recipe have a parent post on the Manage page? It’s the comments for that parent post only that get counted towards its rating.

    Thread Starter Timofey Drozhzhin

    (@drtimofey)

    To make sure we’re on the same page – so example.com/wp-json/wp-recipe-maker/v1/rating/recipe/123 is supposed to show the count of ratings Not made by comments?

    I.e. – If 10 ratings were set by clicking the stars, and 5 ratings were added through comments. The API would only return 10 ratings, correct?

    Plugin Author Brecht

    (@brechtvds)

    That’s right. We do not have an endpoint that combines the user and comment ratings yet.

    Thread Starter Timofey Drozhzhin

    (@drtimofey)

    Ok, gotcha! That makes sense. You can close the ticket ?? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Rating API is missing ratings by comments’ is closed to new replies.