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 | Owned by: | 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)
Example screenshots