Skip to content

Icons: Skip sanitizing the core icons - #85083

Merged
t-hamano merged 5 commits into
trunkfrom
icons-skip-kses-bundled
Oct 27, 2026
Merged

t-hamano merged 5 commits into
trunkfrom
icons-skip-kses-bundled

Conversation

@fushar

@fushar fushar commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What?

Skips the wp_kses() sanitization of the core icons bundled with the plugin, in packages/icons/src/library.

Core backport: WordPress/wordpress-develop#14492

Why?

WordPress/wordpress-develop#12270 renders the admin bar and admin menu icons with wp_get_icon(), so every wp-admin page now loads about 20 icons through the registry. Measurements on that PR show about +3.5 ms of server time per wp-admin page, and most of the icon cost is wp_kses().

The core icons ship with the plugin and are as trusted as its PHP files, so sanitizing them does not really protect anything.

How?

WP_Icons_Registry_Gutenberg::get_content() skips sanitize_icon_content() when the icon file is inside the core icon library.

Testing Instructions

npm run test:unit:php:base -- --filter WP_Test_Icons_Registry_Gutenberg

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: code generation, with my supervision.

@fushar fushar added [Type] Performance Related to performance efforts [Feature] Icons Related to Icon registration API and Icon REST API labels Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

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: fushar <fushar@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 14eeb44 trunk % Change
timeToFirstByte 42.8 ms +15.54% -2.45% 45.6 ms +11.07% -4.5% -6.14%
largestContentfulPaint 76 ms +5.26% -2.63% 78 ms +5.13% -7.69% -2.56%
lcpMinusTtfb 30.4 ms +13.16% -6.91% 29 ms +6.9% -2.59% 4.83%
wpBeforeTemplate 22.54 ms +24.53% -2.22% 23.91 ms +14.39% -5.52% -5.73%
wpTemplate 16.97 ms +2.83% -5.36% 17.43 ms +6.88% -4.25% -2.64%
wpTotal 39.38 ms +16.28% -2.56% 42.26 ms +9.35% -5.13% -6.81%
wpMemoryUsage 7.70 MB +0% -0% 7.67 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 14eeb44 trunk % Change
timeToFirstByte 33.15 ms +8.6% -2.56% 36.8 ms +3.94% -3.53% -9.92%
largestContentfulPaint 74 ms +2.7% -2.7% 80 ms +5% -0% -7.5%
lcpMinusTtfb 40 ms +3.63% -1.25% 44.75 ms +2.35% -3.46% -10.61%
wpBeforeTemplate 20.08 ms +8.27% -1.05% 19.9 ms +4.22% -1.36% 0.9%
wpTemplate 10.1 ms +2.97% -1.09% 13.25 ms +5.43% -4% -23.77%
wpTotal 30.48 ms +8.99% -2.23% 34.03 ms +3.59% -3.61% -10.43%
wpMemoryUsage 6.28 MB +0% -0% 6.36 MB +0% -0% -1.22%
wpDbQueries 9 +0% -0% 13 +0% -0% -30.77%

media-processing

Metric 14eeb44 trunk % Change
mediaProcessingJpeg 326.52 ms +1.83% -0.77% 327.99 ms +2.02% -1.12% -0.45%
mediaProcessingAvif 4847.45 ms +0.32% -0.24% 4841.1 ms +0.28% -0.29% 0.13%
mediaProcessingJpegToAvif 3386.19 ms +0.79% -0.42% 3366.02 ms +0.35% -0.15% 0.6%

media-upload

Metric 14eeb44 trunk % Change
jpegUploadProcessing 1413.2 ms +2.66% -28.87% 1412.78 ms +1.46% -23.83% 0.03%
pngUploadProcessing 200.61 ms +6.52% -1.6% 195.93 ms +29.52% -3.32% 2.39%
largeJpegUploadProcessing 1418.64 ms +1.37% -1.28% 1416.5 ms +0.66% -24.8% 0.15%
multipleImageUploadProcessing 1469.19 ms +2.42% -0.65% 1496.29 ms +1.02% -0.14% -1.81%

post-editor

Metric 14eeb44 trunk % Change
serverResponse 517.35 ms +3.81% -1.6% 501.16 ms +7.19% -3.9% 3.23%
firstPaint 325.8 ms +52.94% -24.7% 507.3 ms +1.58% -36.21% -35.78%
domContentLoaded 876.78 ms +3.56% -2.84% 862.2 ms +1.3% -1.67% 1.69%
loaded 877.84 ms +3.54% -2.85% 863.18 ms +1.32% -1.65% 1.7%
firstContentfulPaint 513.86 ms +6.71% -3.52% 508.12 ms +1.41% -0.53% 1.13%
firstBlock 2993.32 ms +1.83% -1.14% 2951.72 ms +1.67% -0.25% 1.41%
type 15.81 ms +6.7% -1.71% 16.25 ms +1.72% -4.25% -2.71%
typeWithoutInspector 16.04 ms +10.47% -2.87% 16.56 ms +8.39% -1.87% -3.14%
typeWithTopToolbar 21.16 ms +1.61% -6.19% 22.69 ms +7.05% -8.86% -6.74%
typeContainer 8.36 ms +8.49% -4.55% 7.49 ms +17.36% -8.01% 11.62%
focus 119.43 ms +2.99% -10.55% 112.1 ms +8.07% -4.35% 6.54%
firstFocus 224.06 ms +0% -0% 231.73 ms +0% -0% -3.31%
selectAll 474.69 ms +2.59% -1.1% 480.84 ms +0.12% -5.29% -1.28%
listViewOpen 75.4 ms +11.78% -3.16% 76.52 ms +6.6% -7.54% -1.46%
inserterOpen 43.31 ms +1.32% -13.62% 41.49 ms +4.43% -2.19% 4.39%
inserterHover 10.5 ms +9.71% -8.67% 11.13 ms +9.16% -8.98% -5.66%
inserterSearch 8.8 ms +4.09% -16.02% 8.45 ms +5.21% -11.72% 4.14%
loadPatterns 610.65 ms +6.05% -4.1% 597.94 ms +10.15% -2.46% 2.13%
wpTotal 505.89 ms +4.07% -1.19% 492.06 ms +6.89% -4.01% 2.81%
wpMemoryUsage 14.75 MB +0% -0% 14.71 MB +0% -0% 0.24%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric 14eeb44 trunk % Change
serverResponse 479.12 ms +5.67% -1.29% 499.66 ms +4.97% -5.21% -4.11%
firstPaint 270.42 ms +2.75% -13.55% 251.61 ms +4.5% -9.03% 7.48%
domContentLoaded 888.32 ms +2.54% -0.89% 899.98 ms +0.27% -2.44% -1.3%
loaded 889.52 ms +2.53% -0.89% 901.11 ms +0.26% -2.44% -1.29%
firstContentfulPaint 494.33 ms +4.27% -2.14% 498.47 ms +2.6% -9.52% -0.83%
firstBlock 4210.92 ms +0.64% -0.93% 4158.84 ms +0.61% -0.35% 1.25%
type 17.39 ms +3.39% -5.92% 17.94 ms +6.47% -2.68% -3.07%
navigate 126.81 ms +3.75% -2.12% 120.69 ms +5.86% -0.99% 5.07%
loadPatterns 1158.17 ms +21.47% -7.05% 1195.14 ms +12.19% -3.02% -3.09%
loadPages 993.39 ms +0.53% -2.17% 976.26 ms +3.46% -1.46% 1.75%
wpTotal 469.15 ms +5.81% -1.32% 489.68 ms +5.04% -5.21% -4.19%
wpMemoryUsage 12.77 MB +0% -0% 12.73 MB +0% -0% 0.24%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

e629bd9 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Should insert content using the global inserter in /test/e2e/specs/widgets/editing-widgets.spec.js, passed after 1 failed attempt.

Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 1,
+   "offset": 1,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21
should be immediately saved on indentation in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one<!-- wp:list -->
+ <li>ne<!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
  <li></li>
  <!-- /wp:list-item --></ul>
  <!-- /wp:list --></li>
  <!-- /wp:list-item --></ul>

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:694:52
should create paragraph on Enter in quote block in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('option', { name: 'List', exact: true })

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:751:67
should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49
should indent and outdent level 1 in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:775:3
should indent and outdent level 2 in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:933:3
should leave the rest of the list intact when merging into an empty list item in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  0
+ Received  + 13

@@ -5,27 +5,40 @@
          "attributes": Object {
            "content": "1",
          },
          "innerBlocks": Array [
            Object {
+             "attributes": Object {
+               "ordered": false,
+               "values": "",
+             },
              "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "a",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
                },
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
            },
          ],
+         "name": "core/list-item",
+       },
+       Object {
+         "attributes": Object {
+           "content": "",
+         },
+         "innerBlocks": Array [],
          "name": "core/list-item",
        },
      ],
      "name": "core/list",
    },
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:3118:38
should replace selected non-breaking spaces from the toolbar in /test/e2e/specs/editor/various/rich-text.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
      "attributes": Object {
-       "content": "one two three",
+       "content": "ne two three",
      },
      "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/rich-text.spec.js:1050:41
should select by dragging into separator in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 0

  Array [
    1,
-   2,
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:2181:5
should select by dragging in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
TimeoutError: locator.hover: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block: Paragraph' }).first()
    - locator resolved to <p role="document" data-empty="false" aria-multiline="true" aria-readonly="false" data-title="Paragraph" contenteditable="true" data-type="core/paragraph" aria-label="Block: Paragraph" data-wp-block-attribute-key="content" id="block-9431be39-776a-49b4-83c3-c2901cb34a17" data-block="9431be39-776a-49b4-83c3-c2901cb34a17" class="block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-paragraph rich-text">1</p>
  - attempting hover action
    2 × waiting for element to be visible and stable
      - element is visible and stable
      - scrolling into view if needed
      - done scrolling
      - <button id="_r_1p_" type="button" tabindex="-1" aria-label="Link" aria-pressed="false" aria-haspopup="true" aria-expanded="false" data-toolbar-item="true" class="components-button components-toolbar-button is-compact has-icon">…</button> from <div tabindex="-1" data-wp-c16t="true" data-wp-component="Popover" class="components-popover block-editor-block-popover block-editor-block-list__block-popover is-positioned is-unstyled">…</div> subtree intercepts pointer events
    - retrying hover action
    - waiting 20ms
    2 × waiting for element to be visible and stable
      - element is visible and stable
      - scrolling into view if needed
      - done scrolling
      - <button id="_r_1p_" type="button" tabindex="-1" aria-label="Link" aria-pressed="false" aria-haspopup="true" aria-expanded="false" data-toolbar-item="true" class="components-button components-toolbar-button is-compact has-icon">…</button> from <div tabindex="-1" data-wp-c16t="true" data-wp-component="Popover" class="components-popover block-editor-block-popover block-editor-block-list__block-popover is-positioned is-unstyled">…</div> subtree intercepts pointer events
    - retrying hover action
      - waiting 100ms
    17 × waiting for element to be visible and stable
       - element is visible and stable
       - scrolling into view if needed
       - done scrolling
       - <button id="_r_1p_" type="button" tabindex="-1" aria-label="Link" aria-pressed="false" aria-haspopup="true" aria-expanded="false" data-toolbar-item="true" class="components-button components-toolbar-button is-compact has-icon">…</button> from <div tabindex="-1" data-wp-c16t="true" data-wp-component="Popover" class="components-popover block-editor-block-popover block-editor-block-list__block-popover is-positioned is-unstyled">…</div> subtree intercepts pointer events
     - retrying hover action
       - waiting 500ms

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:524:20
should split into two with paragraph and merge lists in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one</li>
+ <li>e</li>
  <!-- /wp:list-item -->

  <!-- wp:list-item -->
  <li></li>
  <!-- /wp:list-item -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:502:52
should update the URL from the last navigation if only varies in the URL fragment in /test/e2e/specs/interactivity/router-navigate.spec.ts, passed after 1 failed attempt.
Error: expect(locator).toHaveText(expected) failed

Locator:  getByTestId('title')
Expected: "Link 1"
Received: "Main"
Timeout:  5000ms

Call log:
  - Expect "toHaveText" getByTestId('title') with timeout 5000ms
  - waiting for getByTestId('title')
    14 × locator resolved to <h2 data-testid="title">Main</h2>
       - unexpected value "Main"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigate.spec.ts:160:25

e629bd9 Run

The core icons bundled with the plugin are trusted, and sanitizing them with
wp_kses() is the main cost of rendering them.
@fushar
fushar force-pushed the icons-skip-kses-bundled branch from f01a194 to f6c20f8 Compare October 19, 2026 11:08
@fushar
fushar marked this pull request as ready for review October 19, 2026 11:30
@fushar
fushar requested a review from spacedmonkey as a code owner October 19, 2026 11:30
@fushar
fushar requested review from mcsf and t-hamano October 19, 2026 11:30
@github-project-automation github-project-automation Bot moved this to 🔎 Needs Review in WordPress 7.2 Editor Tasks Oct 23, 2026

@t-hamano t-hamano 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.

Thanks for the PR! This is essentially a performance improvement that speeds up loading the core SVG icons, and it doesn't introduce any new APIs, so it would be nice to get it into the 7.2 release.

Overall, it looks good. I left two comments on the core PR:

As a side note, the core icons are already guaranteed to be safe by a unit test. If any harmful code were ever introduced into a core icon, this test would fail:

/**
* Should preserve every element and attribute of a library icon.
*
* @dataProvider data_library_icons
* @covers WP_Icons_Registry_Gutenberg::sanitize_icon_content
*
* @param string $file_path Absolute path to the library SVG file.
*/
public function test_sanitize_icon_content_preserves_library_icons( string $file_path ) {
$content = file_get_contents( $file_path );
$this->assertEqualHTML( $content, $this->sanitize_icon_content( $content ) );
}

claude and others added 4 commits October 27, 2026 10:11
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

@t-hamano t-hamano 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.

I have applied all the feedback from the core PR here as well.

@t-hamano t-hamano added Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Oct 27, 2026
@t-hamano
t-hamano merged commit b0c354a into trunk Oct 27, 2026
98 checks passed
@t-hamano
t-hamano deleted the icons-skip-kses-bundled branch October 27, 2026 11:01
@github-project-automation github-project-automation Bot moved this from 🔎 Needs Review to ✅ Done in WordPress 7.2 Editor Tasks Oct 27, 2026
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 27, 2026
@github-actions github-actions Bot removed the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 27, 2026
gutenbergplugin pushed a commit that referenced this pull request Oct 27, 2026
* Icons: Skip sanitizing the core icons

The core icons bundled with the plugin are trusted, and sanitizing them with
wp_kses() is the main cost of rendering them.

* Icons: Make is_core_icon_file() private

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

* Icons: Cache the core icon library directory in a private property

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

* Icons: Test the sanitization of non-core icon files separately

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

---------

Co-authored-by: fushar <fushar@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
@github-actions github-actions Bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Oct 27, 2026
@github-actions

Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 1d7c9c5

Mamaduka pushed a commit that referenced this pull request Oct 28, 2026
* Icons: Skip sanitizing the core icons

The core icons bundled with the plugin are trusted, and sanitizing them with
wp_kses() is the main cost of rendering them.

* Icons: Make is_core_icon_file() private

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

* Icons: Cache the core icon library directory in a private property

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

* Icons: Test the sanitization of non-core icon files separately

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

---------

Co-authored-by: fushar <fushar@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
@Mamaduka Mamaduka removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Oct 28, 2026
Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
* Icons: Skip sanitizing the core icons

The core icons bundled with the plugin are trusted, and sanitizing them with
wp_kses() is the main cost of rendering them.

* Icons: Make is_core_icon_file() private

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

* Icons: Cache the core icon library directory in a private property

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

* Icons: Test the sanitization of non-core icon files separately

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URvdh6RpJUzi7Yz7qYJ

---------

Co-authored-by: fushar <fushar@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Icons Related to Icon registration API and Icon REST API [Type] Performance Related to performance efforts

Projects

Development

Successfully merging this pull request may close these issues.

4 participants