Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46693 closed defect (bug) (fixed)

Site Health: debug info prints out list items with no wrapping list

Reported by: afercia's profile afercia Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Site Health Keywords: site-health has-patch
Focuses: accessibility, coding-standards Cc:

Description

In the "Info" page, within the accordions, some debug info are printed out as list items.

However, these list items miss a wrapping <ul> element thus producing invalid markup. Also, the list semantics is absent and assistive technologies can't announce this markup as a list.

See https://core.trac.wordpress.org/browser/trunk/src/wp-admin/site-health-info.php?rev=45044&marks=140-146#L137

if ( is_array( $field['value'] ) ) {
	$values = '';
	foreach ( $field['value'] as $name => $value ) {
		$values .= sprintf(
			'<li>%s: %s</li>',
			esc_html( $name ),
			esc_html( $value )
		);
	}
}

Attachments (2)

46693.diff (755 bytes) - added by mukesh27 5 years ago.
Patch that wrap ul tag
46693.2.diff (767 bytes) - added by mukesh27 5 years ago.
Updated Patch as suggested by @chetan200891

Download all attachments as: .zip

Change History (8)

@mukesh27
5 years ago

Patch that wrap ul tag

#1 @mukesh27
5 years ago

  • Keywords has-patch added; needs-patch removed

#2 @chetan200891
5 years ago

@mukesh27 Thanks for patch. Can you add one space for first $values to fix PHPCS issue. Also I think we can now directly assign <ul> to $values. No need blank $values.

#3 @chetan200891
5 years ago

  • Keywords needs-refresh added; has-patch removed

@mukesh27
5 years ago

Updated Patch as suggested by @chetan200891

#4 @mukesh27
5 years ago

  • Keywords has-patch added; needs-refresh removed

#5 @SergeyBiryukov
5 years ago

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

In 45068:

Site Health: Add missing <ul> tags for lists on Site Info page.

Props mukesh27, chetan200891, afercia.
Fixes #46693.

#6 @spacedmonkey
5 years ago

  • Component changed from Administration to Site Health
Note: See TracTickets for help on using tickets.