Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a more accurate star rating. #670

Merged
merged 4 commits into from
Nov 25, 2024
Merged

Conversation

StevenDufresne
Copy link
Contributor

This PR removes rounding for display averages as discussed in WordPress/wporg-theme-directory#147 (comment) and WordPress/wordpress.org#408 (comment). This is particularly important for plugins as most plugins fall within the 4-5 star ranges and rounding makes it difficult to compare plugins by ratings.

Themes

Before After
Screenshot 2024-11-19 at 12 36 50 PM Screenshot 2024-11-19 at 12 37 06 PM
Screenshot 2024-11-19 at 12 36 39 PM Screenshot 2024-11-19 at 12 36 20 PM

Plugins

Before After
Screenshot 2024-11-19 at 12 37 44 PM Screenshot 2024-11-19 at 12 37 19 PM
Screenshot 2024-11-19 at 12 37 37 PM Screenshot 2024-11-19 at 12 37 26 PM

@ryelle
Copy link
Contributor

ryelle commented Nov 21, 2024

This does change the rounding of values so that a 3.8 used to render as 4 stars, but now renders as 3½, which also means that only plugins with a 5 will get the 5 stars.

Twenty Twenty-Four with a 3.8 rating:

Before After
Screenshot 2024-11-21 at 4 42 13 PM Screenshot 2024-11-21 at 4 42 16 PM

The card view also currently uses a rounded view (it still uses Template::get_star_rating), so as this is, the stars render differently:

Card view Single view
Screenshot 2024-11-21 at 4 46 13 PM Screenshot 2024-11-21 at 4 46 25 PM

@ryelle
Copy link
Contributor

ryelle commented Nov 21, 2024

The change in 43bb8a5 brings back the previous rounding code for the stars themselves, but calculates a separate unrounded display rating:

Screenshot 2024-11-21 at 4 56 43 PM

@StevenDufresne
Copy link
Contributor Author

Makes sense. Thanks for the help kelly.

@StevenDufresne StevenDufresne merged commit 82ed784 into trunk Nov 25, 2024
2 checks passed
@StevenDufresne StevenDufresne deleted the try/better-review-precision branch November 25, 2024 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants