BuddyDev

Search

[Resolved] Top Rated Media not correct

Tagged: 

  • Participant
    Level: Initiated
    Posts: 5
    Gav on #38572

    I have installed the media press rating plugin.
    Users are rating media, and I have added a widget to the sidebar to show the top 5 rated media (photos).
    Looking in the DB i can see which are the highest rated media, however these are not the top 5 displayed in the widget.
    I have cleared all caches and the Gallery page loads the sidebar and it still contains a selection of lesser rated media.
    The media displayed have all at some point been rate 5*. But, some have been rated 5* multiple times. I expected a function somewhere to total the count of ratings ie 5* + 5* =10* and is displayed with priority over an image only rated once, even if it was rated 5*.
    Any ideas how I can correct this behaviour? I would prefer to list the top 5 most highly rated photos.
    WP v5.7.1
    Buddypress v7.3.0
    Mediapress v1.5.1
    Mediapress rating v1.1.1
    Theme memberlite v4.5.2
    php 7.4.18

    Cheers

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 1796
    Ravi on #38574

    Hello Gav,

    Thank you for posting. Please look at the following resource showing how we calculating top rated medias

    https://github.com/mediapress/mpp-media-rating/blob/master/core/mpp-rating-functions.php#L184

    We just made a query with avg function to calculate the average rating for individual media.

    Do you want to list media order by no. of users rated?. Please let me know.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 5
    Gav on #38581

    Hi Ravi
    thanks for the reply.
    I think I understand why its giving the same five photos every time the page is loaded, I wonder if it might be better (to achieve what I want) to sum the ratings per media item, and display the top five of them.
    so an item may be rated 5,5,3,4,5, giving it a total of 22 from 5 ratings. another may be 5,5 5 total 15 from 3 ratings. The item with 22 should be displayed before the one with 15. In this scenario the first item has an average of 4.4 whereas the second, only rated 3 times has an average of 5 and would have priority over a more often rated item.

    hope that makes sense!
    can you help?
    cheers

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 1796
    Ravi on #38597

    Hello Gav,

    Thank you for the details. I have added support for showing Top Rated media by total rating count. Please upgrade to latest version and check.

    https://buddydev.com/plugins/mediapress-media-rating/

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 5
    Gav on #38599

    Hi Ravi
    thanks for the rapid support, exceptional for a free plugin!
    I have replaced all the files on the wp site with the new download.
    Cleared all the cache, selected top rated in the widget.
    The results are completely random.
    —————————————————————–
    Media Id Total Rating Expected Position Actual Position
    4906 10 4/5 or 6 1
    5569 10 4/5 or 6 2
    5572 0 0 5
    5727 25 2 Not Displayed
    5728 10 4/5 or 6 Not Displayed
    6026 0 0 3
    6029 0 0 4
    6044 10 4/5 or 6 Not Displayed
    6045 20 3 Not Displayed
    6283 35 1 Not Displayed
    —————————————————————–
    I cant see any correlation between upload date, uploader etc. (there are more results in the excel from the DB)

    Any ideas?
    Cheers
    Gav

  • Participant
    Level: Initiated
    Posts: 5
    Gav on #38600

    O0os!
    It works, I forgot to select any user and sitewide galleries!
    Thanks Ravi!

  • Participant
    Level: Initiated
    Posts: 5
    Gav on #38601

    PS… Is there a way to develop this to highest rated gallery using the SUM of all the media ratings per gallery?
    🙂
    Gav

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 1796
    Ravi on #38617

    Hello Gav,

    Thank you for the acknowledgment. The current version of the plugin schema does not allow us to show the Top Rated gallery. In a future update, We will consider this.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: resolved