Opened 6 weeks ago
Closed 7 hours ago
#63546 closed defect (bug) (fixed)
Fix unclosed li element in plugin-editor.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | General | Keywords: | has-patch has-test-info dev-feedback has-screenshots |
Focuses: | ui, accessibility | Cc: |
Description
Actual Behavior
In src/wp-admin/plugin-editor.php at line 287, there is an opening <li>
tag with role="treeitem" and other attributes, but it doesn't have any content directly inside it before the nested <ul>
element, and there's no closing </li>
tag.
Steps to Reproduce
- Navigate to src/wp-admin/plugin-editor.php
- Look at line 287 where there's an opening
<li>
tag. - Notice that there's no closing
</li>
tag for this element.
Expected Behavior
The <li>
element should either have content before the nested <ul>
or be properly closed with a </li>
tag after the nested <ul>
element. This would ensure proper HTML structure and accessibility compliance.
This issue is important to fix because:
- It creates an invalid HTML structure.
- It may cause accessibility issues since the ARIA roles are being used.
- It could potentially cause rendering inconsistencies across browsers.
Change History (6)
This ticket was mentioned in PR #8937 on WordPress/wordpress-develop by @dkarfa.
6 weeks ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
6 weeks ago
- Milestone changed from Awaiting Review to 6.9
- Owner set to joedolson
- Status changed from new to accepted
#3
@
5 weeks ago
- Keywords has-test-info added
Test Report
Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/8937.diff
Steps to Reproduce or Test
- Go to Admin Dashboard > Tools > Plugin Editor.
- Right-click in the browser or press CTRL + U on the keyboard. It will open the HTML source file of the webpage
- Press CTRL + F to find strings in the view source.
- Find "templateside" strings and locate the templateside div.
- 🐞 In the templateside div, see the two li (<li>) tags opened, but only one li tag (</li>) closed. It is a bug.
Expected Results
When testing a patch to validate it works as expected:
- ✅ The issue has been resolved. In the templateside div, the two li (<li>) tags should be opened and two li tag (</li>) should be closed.
When reproducing a bug:
- 🐞 Error condition occurs.
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.28
- Server: nginx/1.27.5
- Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
- Browser: Chrome 137.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.2
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Actual Results
When reproducing a bug/defect:
- 🐞 In the templateside div, see the two li (<li>) tags opened, but only one li tag (</li>) closed.
When testing the bugfix patch:
- ✅ Issue resolved with patch. In the templateside div, see the two li (<li>) tags opened and two li tags (</li>) closed.
#4
follow-up:
↓ 5
@
5 weeks ago
- Keywords dev-feedback has-screenshots added
Bug reproduction and Test Report
Description
✅ This report validates that the indicated patch works as expected.
Patch tested: Patch-8937.diff
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.28
- Server: nginx/1.27.5
- Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
- Browser: Firefox 139.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.2
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Actual Results
- Bug reproduction: Upon visiting view-source:http://localhost:8889/wp-admin/plugin-editor.php, there was no closing </li> tag for the line
<li role="treeitem" tabindex="-1" aria-expanded="true" aria-level="1" aria-posinset="1" aria-setsize="1">
Checkout the bug screenshot.
- ✅ Issue resolved with patch and </li> tag added for the above code. Checkout the after patch screenshot.
Additional Notes
Reproduction steps:
- Visit: http://localhost:8889/wp-admin/plugin-editor.php
- Right-click the page → Click “View Page Source” or use Ctrl+U.
- Find (ctrl+F) and search "treeitem" and you will find the bug as shown in above image.
===Screenshots
#5
in reply to:
↑ 4
@
3 weeks ago
Replying to sandeepdahiya:
Bug reproduction and Test Report
Description
✅ This report validates that the indicated patch works as expected.
Patch tested: Patch-8937.diff
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.28
- Server: nginx/1.27.5
- Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
- Browser: Firefox 139.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.2
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Actual Results
- Bug reproduction: Upon visiting view-source:http://localhost:8889/wp-admin/plugin-editor.php, there was no closing </li> tag for the line
<li role="treeitem" tabindex="-1" aria-expanded="true" aria-level="1" aria-posinset="1" aria-setsize="1">Checkout the bug screenshot.
- ✅ Issue resolved with patch and </li> tag added for the above code. Checkout the after patch screenshot.
Additional Notes
Reproduction steps:
- Visit: http://localhost:8889/wp-admin/plugin-editor.php
- Right-click the page → Click “View Page Source” or use Ctrl+U.
- Find (ctrl+F) and search "treeitem" and you will find the bug as shown in above image.
===Screenshots
The solution appears to be working, but it's also affecting other elements in the tree view structure. Please ensure that the <li> elements are properly closed and structured so that all nested items render correctly and maintain accessibility. It's important to verify that other tree items remain aligned and functional across the interface, especially since ARIA roles are involved and could impact assistive technologies.
This commit ensures that the list item element in the plugin file tree navigation is closed adequately with a </li> tag. The HTML structure in plugin-editor.php now correctly nests the tree structure with proper opening and closing tags.
This improves HTML validity and accessibility compliance for screen readers and other assistive technologies that rely on proper DOM structure, especially important for elements using ARIA roles like "treeitem" and "group".
Trac ticket: https://core.trac.wordpress.org/ticket/63546
Props dkarfa