WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 2 years ago

#2468 closed defect (fixed)

plugin rating: web vs backend discrepancies

Reported by: agm65 Owned by: dd32
Milestone: Plugin Directory v3.0 Priority: normal
Component: Plugin Directory Keywords: has-screenshots has-patch commit
Cc:

Description

web site wordpress.org/plugins and backend are using two different ordering directions.
this may induce in error

Website
https://diegobetto.com/tmp/web_rating.png

Backend
https://diegobetto.com/tmp/backend_rating.png

Attachments (1)

meta-2468.patch (2.1 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
2 years ago

Hi @agm65, welcome to WordPress Meta Trac! Thanks for the report.

Good catch, I guess the ordering in WordPress admin should be changed to follow the directory (it's the same in both current and new directory), because it's more intuitive to have 5 stars at the top.

Could you create a ticket on WordPress Core Trac for that?

#2 @agm65
2 years ago

Hi @SergeyBiryukov,

sure, thanks

#3 @SergeyBiryukov
2 years ago

Looks like the API might be the problem here, it returns inconsistent ordering in different cases, see the discussion in #WP39769.

#4 @SergeyBiryukov
2 years ago

  • Keywords has-patch commit added; ui-feedback ux-feedback removed
  • Milestone set to Plugin Directory v3.0

WordPress trunk is currently using the new plugin directory API to test it (per @samuelsidler on Slack), and I've traced the issue to the API endpoints there.

It's not an issue in the directory itself, because the Ratings widget uses a hardcoded range( 5, 1 ) in the foreach() loop, instead of using the actual order as returned by the API.

meta-2468.patch contains a patch and a unit test assertion.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#5 @dd32
2 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 4900:

Plugin Directory: API: Sort the ratings API response from 5..1 for compatibility with WordPress.

Props SergeyBiryukov.
Fixes #2468.

Note: See TracTickets for help on using tickets.