Skip to content

Icons: Test the registry sanitizer with a data provider - #83024

Merged
t-hamano merged 2 commits into
trunkfrom
update/icons-registry-sanitize-tests
Sep 17, 2026
Merged

t-hamano merged 2 commits into
trunkfrom
update/icons-registry-sanitize-tests

Conversation

@t-hamano

@t-hamano t-hamano commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What?

Extracted from #75550.

Improves the unit tests for the icon registry's SVG sanitizer.

Why?

How?

Testing Instructions

All unit tests should pass.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Porting the tests from the core PR and drafting this description; reviewed by me.

🤖 Generated with Claude Code

Mirror the tests from WordPress/wordpress-develop#13559: call `sanitize_icon_content` via reflection with a data provider instead of registering icons from both inline content and a file path. Replace the backport changelog entry for #12197 with one for #13559.

Co-Authored-By: Claude <noreply@anthropic.com>
@t-hamano t-hamano self-assigned this Sep 16, 2026
@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Icons Related to Icon registration API and Icon REST API labels Sep 16, 2026
@t-hamano
t-hamano marked this pull request as ready for review September 16, 2026 12:21
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@mcsf mcsf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on a cursory look at the code

@westonruter westonruter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…backport

Co-Authored-By: Claude <noreply@anthropic.com>
@t-hamano

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I've updated this PR accordingly based on the feedback from the core PR.

@github-actions

Copy link
Copy Markdown

🤖 PR meta 🤖

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 98fcf47 trunk % Change
timeToFirstByte 56.3 ms +7.02% -3.02% 58.9 ms +9.17% -6.2% -4.41%
largestContentfulPaint 92 ms +6.52% -4.35% 96 ms +6.25% -4.17% -4.17%
lcpMinusTtfb 34.7 ms +3.89% -3.46% 34.85 ms +19.37% -3.3% -0.43%
wpBeforeTemplate 28.05 ms +11.34% -2.64% 28.2 ms +20.74% -2.2% -0.53%
wpTemplate 24.08 ms +3.24% -2.95% 24.41 ms +4.92% -2.87% -1.35%
wpTotal 52.83 ms +6.97% -3.54% 55.29 ms +8.32% -6.62% -4.45%
wpMemoryUsage 7.53 MB +0% -0% 7.49 MB +0% -0% 0.47%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 98fcf47 trunk % Change
timeToFirstByte 47.1 ms +8.6% -1.91% 46.95 ms +5.86% -1.49% 0.32%
largestContentfulPaint 100 ms +6% -0% 100 ms +4% -0% 0%
lcpMinusTtfb 53.9 ms +2.88% -1.21% 53.65 ms +1.21% -1.12% 0.47%
wpBeforeTemplate 26.19 ms +6.87% -1.72% 26.04 ms +3.46% -1.38% 0.58%
wpTemplate 17.81 ms +3.59% -1.46% 17.76 ms +3.6% -0.73% 0.28%
wpTotal 44 ms +8.8% -1.93% 43.8 ms +6.05% -1.3% 0.46%
wpMemoryUsage 6.15 MB +0% -0% 6.11 MB +0% -0% 0.59%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 98fcf47 trunk % Change
mediaProcessingJpeg 399.29 ms +1.19% -1.09% 396.71 ms +0.98% -0.05% 0.65%
mediaProcessingAvif 6046.85 ms +0.29% -0.1% 6053.36 ms +0.03% -0.22% -0.11%
mediaProcessingJpegToAvif 4170.91 ms +0.22% -0.42% 4180.75 ms +0.33% -0.45% -0.24%

media-upload

Metric 98fcf47 trunk % Change
jpegUploadProcessing 1439.7 ms +2.49% -1.43% 1420.7 ms +0.88% -0.69% 1.34%
pngUploadProcessing 223.44 ms +3.24% -7.56% 205.17 ms +7.72% -2.14% 8.9%
largeJpegUploadProcessing 1417.12 ms +0.78% -0.44% 1404.84 ms +0.19% -0.57% 0.87%
multipleImageUploadProcessing 1639.26 ms +23.27% -3.55% 1555.36 ms +9.49% -0.22% 5.39%

post-editor

Metric 98fcf47 trunk % Change
serverResponse 378.75 ms +2.51% -3.33% 401.82 ms +3.09% -6.4% -5.74%
firstPaint 237.38 ms +23.08% -7.01% 201.76 ms +18.77% -12.62% 17.65%
domContentLoaded 929.8 ms +1.28% -0.48% 942.08 ms +1.26% -1.6% -1.3%
loaded 930.97 ms +1.27% -0.5% 943.18 ms +1.24% -1.6% -1.29%
firstContentfulPaint 393.4 ms +1.89% -2.62% 387.13 ms +3.4% -1.54% 1.62%
firstBlock 2689.67 ms +0.94% -1.05% 2689.86 ms +0.44% -1.69% -0.01%
type 18.27 ms +8.48% -4.27% 18.57 ms +6.52% -4.09% -1.62%
typeWithoutInspector 17.96 ms +7.07% -6.51% 18.03 ms +5.16% -4.71% -0.39%
typeWithTopToolbar 22.54 ms +2.26% -3.42% 23.5 ms +7.02% -5.28% -4.09%
typeContainer 8.5 ms +8.12% -7.18% 8.48 ms +4.95% -6.72% 0.24%
focus 69.21 ms +1.78% -5.45% 67.7 ms +4.36% -10.3% 2.23%
firstFocus 200.46 ms +0% -0% 179.44 ms +0% -0% 11.71%
selectAll 370.52 ms +10.55% -2.46% 365.53 ms +3.87% -0.49% 1.37%
listViewOpen 60.4 ms +10.41% -3.86% 63.16 ms +10.97% -8.53% -4.37%
inserterOpen 21.13 ms +10.36% -7.43% 23.22 ms +6.68% -12.88% -9%
inserterHover 2.79 ms +15.41% -17.56% 2.81 ms +12.81% -17.08% -0.71%
inserterSearch 7.28 ms +8.93% -4.26% 8.27 ms +5.08% -9.79% -11.97%
loadPatterns 591.24 ms +3% -3.75% 608.21 ms +4.35% -7.41% -2.79%
wpTotal 369.25 ms +2.51% -3.39% 391.81 ms +2.97% -6.45% -5.76%
wpMemoryUsage 13.07 MB +0% -0% 13.03 MB +0% -0% 0.28%
wpDbQueries 54 +0% -0% 54 +0% -0% 0%

site-editor

Metric 98fcf47 trunk % Change
serverResponse 335.01 ms +4.19% -3.46% 327.35 ms +4.81% -2.47% 2.34%
firstPaint 189.91 ms +81.84% -19.08% 187.35 ms +10.76% -14.2% 1.37%
domContentLoaded 824.69 ms +3.89% -1.14% 845.34 ms +1.84% -1.14% -2.44%
loaded 825.5 ms +3.89% -1.13% 846.14 ms +1.84% -1.14% -2.44%
firstContentfulPaint 345.15 ms +1.52% -4.31% 347.26 ms +0.61% -2.42% -0.61%
firstBlock 3029.83 ms +1.13% -2.39% 2984.45 ms +1.15% -1.35% 1.52%
type 16.44 ms +10.4% -6.08% 16.35 ms +4.89% -4.4% 0.55%
navigate 98.02 ms +9.35% -2.99% 102.24 ms +2.34% -2.24% -4.13%
loadPatterns 1036.98 ms +18.08% -9.43% 1153.96 ms +3.47% -18.37% -10.14%
loadPages 1066.89 ms +1.01% -1.23% 1087.96 ms +1.3% -0.59% -1.94%
wpTotal 326.85 ms +4.26% -4.02% 318.9 ms +4.92% -2.5% 2.49%
wpMemoryUsage 12.02 MB +0% -0% 11.97 MB +0% -0% 0.41%
wpDbQueries 44 +0% -2.27% 44 +0% -2.27% 0%

0638241 Run

@westonruter westonruter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-hamano
t-hamano merged commit 6db2012 into trunk Sep 17, 2026
76 of 77 checks passed
@t-hamano
t-hamano deleted the update/icons-registry-sanitize-tests branch September 17, 2026 07:49
@github-project-automation github-project-automation Bot moved this from 🔎 Needs Review to ✅ Done in WordPress 7.2 Editor Tasks Sep 17, 2026
@github-actions github-actions Bot added this to the Gutenberg 24.1 milestone Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Icons Related to Icon registration API and Icon REST API [Type] Code Quality Issues or PRs that relate to code quality

Projects

Development

Successfully merging this pull request may close these issues.

3 participants