Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#36395 closed defect (bug) (fixed)

Information in aria-label incorrect for reviews in plugin details

Reported by: tacoverdo's profile TacoVerdo Owned by: ocean90's profile ocean90
Milestone: 4.5 Priority: normal
Severity: minor Version: 4.6
Component: Plugins Keywords: has-patch commit i18n-change
Focuses: accessibility, administration Cc:

Description

Problem description
In the admin on the plugin install screen, you can open details for a plugin. If the plugin has reviews, they're shown in the details.
When shown, the type of review and the number of reviews for the type are shown. For example a plugin that has 1300 5-star reviews will show that information.

The text '5 stars' is linking to an overview page of all 5-star reviews. The link contains an aria-label -attribute that contains the same information, except that the number of reviews is incorrect as it always says '1'.

Cause
In https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/plugin-install.php#L588 the function number_format_i18n() is used in combination with the variable %2$d in the sprintf which expects a digit. Since number_format_i18n() returns a string, the variable will always be '1'.

Possible solution
By removing number_format_i18n() from https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/plugin-install.php#L590, $ratecount will be a digit again, as the sprintf() expects for %2$d , resulting in the correct number to be displayed.

Removing the formatting shouldn't negatively influence the way screenreaders read the number, so it shouldn't pose a problem. (Tested with OSX's Voice-Over)

Attachments (3)

36395.patch (1.4 KB) - added by ocean90 9 years ago.
ticket36395.png (104.4 KB) - added by TacoVerdo 9 years ago.
Example screenshots
ticket36395.diff (609 bytes) - added by TacoVerdo 9 years ago.

Download all attachments as: .zip

Change History (6)

@ocean90
9 years ago

#1 @ocean90
9 years ago

  • Component changed from Administration to Plugins
  • Focuses administration added
  • Keywords has-patch commit i18n-change added
  • Milestone changed from Awaiting Review to 4.5
  • Severity changed from normal to minor

@TacoVerdo
9 years ago

Example screenshots

#2 @SergeyBiryukov
9 years ago

Introduced in [36618]. 36395.patch looks good.

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

#3 @ocean90
9 years ago

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

In 37156:

Plugins: Use correct placeholder for the number of reviews.

number_format_i18n() returns a string, not an integer.

See #35111.
Fixes #36395.

Note: See TracTickets for help on using tickets.