Make WordPress Core

Opened 7 weeks ago

Closed 4 days ago

#65489 closed defect (bug) (fixed)

Icons: There are icon files that are not used in the icon registry

Reported by: wildworks Owned by: wildworks
Priority: normal Milestone: 7.1
Component: Build/Test Tools Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Follow-up to #64651

The icons published by the icon registry are determined by this manifest PHP file. This PHP file is copied from this manifest PHP file, which is auto-generated in the Gutenberg repository.

To avoid localizing unused icon labels, we filter all icons from the @wordpress/icons package and extract only the icons that are actually published into the manifest PHP file. Please refer to Gutenberg PR #75684 for details.

However, the Gutenberg sync process copies all SVG icons, adding a large number of icons to the core that are not used in the icon registry. This is not what was intended, so I believe we need to improve the synchronization process.

Change History (15)

This ticket was mentioned in PR #12223 on WordPress/wordpress-develop by @wildworks.


7 weeks ago
#1

  • Keywords has-patch added

The core icon registry (WP_Icons_Registry) only loads the icons listed in icon-library-manifest.php (88 icons), but the build copied every SVG from the @wordpress/icons library (331 files) into wp-includes/images/icon-library. This shipped 243 unused SVG files to core that are never served.

This has been the case since the icon library was introduced: the SVG copy used a *.svg glob, while only the manifest subset is exposed.

This PR:

  • Limits the copy:icon-library-images Grunt task to the SVGs referenced by the manifest, by parsing its filePath entries. It throws if the manifest is missing so the build fails loudly instead of silently copying nothing.
  • Removes the 243 unused SVG files already committed under wp-includes/images/icon-library, leaving only the 88 manifest-listed icons.

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: Investigating the manifest/SVG mismatch, implementing the Gruntfile change, and regenerating the icon set. All changes were reviewed and verified by me.

@desrosj commented on PR #12223:


7 weeks ago
#2

However, I think I'd like to try an approach similar to WordPress/gutenberg#76715 where SVG icons that are not marked "public": true do not get included in the Zip file at all.

I still need to add proper PR descriptions, but https://github.com/WordPress/gutenberg/pull/79338 is a rough idea of what this could look like being handled by WordPress/gutenberg.

#12224 is the PR for wordpress-develop demonstrating that it works.

@wildworks commented on PR #12223:


7 weeks ago
#3

I still need to add proper PR descriptions, but https://github.com/WordPress/gutenberg/pull/79338 is a rough idea of what this could look like being handled by WordPress/gutenberg.

Thank you, that approach seems better. Let's close this PR.

#4 @sachinrajcp123
7 weeks ago

Tested on Windows using the local wordpress-develop environment. Checked out PR #12223. Ran npm run build successfully. Verified that the icon library builds successfully (88 SVGs). Confirmed that icons render correctly in the block editor (including Social Icons and Navigation blocks). No missing icons or icon-related console errors were observed.

This ticket was mentioned in PR #12224 on WordPress/wordpress-develop by @desrosj.


7 weeks ago
#5

This is a PR solely for the purpose of testing https://github.com/WordPress/gutenberg/pull/79338, which aims to remove non-public icon files from the zip file built for this repository to consume.

Trac ticket: Core-65489.

## Use of AI Tools

AI assistance: No

#6 @desrosj
4 weeks ago

Just noting that once this is solved upstream, there is potential for the same issue as #65565 to occur.

#7 @desrosj
4 weeks ago

I've opened a request on the Make Systems site asking for the issue with files being deleted on the build server to be investigated prior to 7.1 RC1: https://make.wordpress.org/systems/2026/07/13/build-server-not-removing-files-from-core-svn-wordpress-org-when-it-should/

#8 @desrosj
4 weeks ago

  • Resolutionfixed
  • Status newclosed

The Systems team has fixed the issue on the build server and the missed changes were included in changeset 62042 attached to [62758].

I’ve verified that the state of the core.svn.w.org repository after 62042 is correct. All of the files that should be present are, and all of the files that should have been deleted are now gone.

I also confirmed that the 7.1-beta1 release is in the correct state.

I think that this can be considered resolved.

@desrosj commented on PR #12224:


4 weeks ago
#9

This is no longer needed as the upstream changes were merged.

#10 @courane01
3 weeks ago

Following up for 7.1: the pruned wp-includes/images/icon-library/*.svg files don't appear to have been added to $_old_files in update-core.php — current trunk has 0 icon-library entries there (the collaboration RTC files were added per #65325, the icons weren't). On a site that upgrades to 7.1 (vs fresh-installs), the removed icons remain and wp core verify-checksums reports ~243 "File should not exist" warnings. Verified on a real upgraded 7.1-beta install (331 icon files vs 88 on a clean install = 243, matching the warning count). Host/core-integrity scanners will flag these as "unknown core files" fleet-wide. Same class as the RTC fix — the icon paths just need adding to $_old_files.

#11 @wildworks
3 weeks ago

  • Resolution fixed
  • Status closedreopened

@courane01 Thanks for the report. I think the deleted icons should have been added to $_old_files in both commits r62738 and r62739. I'd like to address this before Beta4.

Last edited 2 weeks ago by wildworks (previous) (diff)

This ticket was mentioned in PR #12659 on WordPress/wordpress-develop by @wildworks.


2 weeks ago
#12

The icon library SVGs shipped in 7.0 under wp-includes/images/icon-library/ were removed during the 7.1 cycle as part of the Gutenberg package updates. Register the 243 removed files (including the renamed time-to-read.svg) in $_old_files so they are cleaned up when upgrading from 7.0 to 7.1.

Trac ticket: https://core.trac.wordpress.org/ticket/65489

## Use of AI Tools

Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.

#13 @wildworks
9 days ago

  • Owner set to wildworks
  • Status reopenedassigned

This ticket was mentioned in Slack in #core by adrianduffell. View the logs.


5 days ago

#15 @desrosj
4 days ago

  • Resolutionfixed
  • Status assignedclosed

In 63031:

Upgrade/Install: Add removed icon files to $_old_files.

This adds the icon files removed during the 7.1 release to the $_old_files list.

Follow up to [62738], [62739].

Props courane01, wiildworks.
Fixes #65489. See #65813.

Note: See TracTickets for help on using tickets.