[wp-trac] [WordPress Trac] #36395: Information in aria-label incorrect for reviews in plugin details
WordPress Trac
noreply at wordpress.org
Fri Apr 1 12:31:31 UTC 2016
#36395: Information in aria-label incorrect for reviews in plugin details
----------------------------+-----------------------------
Reporter: TacoVerdo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: trunk
Severity: normal | Keywords:
Focuses: accessibility |
----------------------------+-----------------------------
'''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)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36395>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list