Fixes #1003 Remove esc_html() when outputting data with HTML#1004
Fixes #1003 Remove esc_html() when outputting data with HTML#1004
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a UI display bug where HTML content was being escaped and shown as raw HTML text on the bulk optimization page. The fix removes esc_html() calls where the output intentionally contains safe HTML markup.
Key changes:
- Removed
esc_html()escaping from data fields that contain intentionally constructed HTML (counts, sizes, labels) - Added PHPCS ignore comments to suppress WordPress coding standard warnings for unescaped output
- Applied the same pattern consistently used throughout the codebase (30+ similar instances)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
views/part-bulk-optimization-table-row-folder-type.php |
Removed esc_html() from count-optimized, count-errors, optimized-size, and original-size fields that contain safe HTML spans and links constructed in AbstractBulk::format_context_data() |
views/input/selector.php |
Removed esc_html() from selector value displays and labels that contain SVG icons and formatted text from imagify_get_optimization_level_label() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@remyperona Thanks for the PR, the #1003 is fixed.
|
Description
Fixes #1003
The UI was displayed incorrectly on bulk optimization page showing raw HTML
Type of change
Detailed scenario
What was tested
Tested the output on the bulk optimization page, content is displayed as expected
How to test
Affected Features & Quality Assurance Scope
Technical description
Documentation
TBD
Mandatory Checklist
Code validation
Code style
Unticked items justification
No tests applicable for this change