Skip to content

Curate icons to essential set (73 icons) - #300

Merged
pfefferle merged 14 commits into
trunkfrom
curate-icons
Sep 26, 2026
Merged

pfefferle merged 14 commits into
trunkfrom
curate-icons

Conversation

@pfefferle

@pfefferle pfefferle commented Jan 3, 2026 •

Copy link
Copy Markdown
Member

The plugin shipped all 3,447 Simple Icons, but only a small part of them is useful for rel-me links. This PR reduces the set to 73 icons (66 from Simple Icons + 7 custom ones). I think we should get rid of the icons completely in the long run, so this is a first step.

Changes

  • Only copy a curated list of icons in the build script (static/js/simpleicons.js)
  • Remove the unused genericons-neue dependency and folder
  • Remove icons of services that are gone (Google+, Google Podcasts, GTalk, Pocket, Keybase, reading.am, indieweb.xyz, some Nostr clients) and icons that are not used for profile links (Slack, Zoom, Stripe, Bitcoin, …)
  • Remove the unused Genericons utility icons (cog, search, reply, …)
  • Map twitter.com to the x icon and remove the legacy twitter icon
  • Add the indieweb_icon_file_dirs filter, so themes and plugins can add their own icons, see the readme

Size

File Before After
SVG files 3,447 73
_simple-icons.scss 9,144 lines 201 lines
simple-icons.php 3,041 entries 66 entries
indieweb.css 121 KB 3 KB

The smaller CSS should also help with #306.

Test plan

  • Icons show up for common networks (mastodon, bluesky, github, x)
  • twitter.com links use the x icon
  • Unknown domains fall back to the website icon
  • npm run build builds the icons and the CSS

@pfefferle
pfefferle requested a review from dshanske January 3, 2026 18:17
@pfefferle pfefferle self-assigned this Jan 3, 2026
@pfefferle
pfefferle requested a review from Copilot January 3, 2026 18:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR dramatically reduces the icon library from 3,447 to 96 carefully selected icons, improving maintainability and reducing bundle size. The reduction targets essential social networks, developer platforms, and IndieWeb services while preserving legacy custom icons.

Key changes:

  • Implemented icon curation with curatedIcons and minimalIcons arrays in the build script
  • Automated SVG file management to copy only curated icons and remove outdated ones
  • Removed genericons-neue dependency and related files

Reviewed changes

Copilot reviewed 5 out of 3360 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
static/js/simpleicons.js Added icon curation logic, filtering mechanism, automated SVG file management, and improved PHP docblock generation
static/genericons-neue/genericons-license.md Removed entire file as part of genericons-neue dependency removal
static/css/indieweb-minimal.css Removed twitter color definition from minified CSS (no functional change to minified output)
sass/_simple-icons-min.scss Removed twitter icon color rule as it's now a custom icon
package.json Removed genericons-neue dev dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread static/js/simpleicons.js Resolved
Comment thread static/js/simpleicons.js Resolved
Comment thread static/js/simpleicons.js Resolved
@dshanske

dshanske commented Jan 3, 2026

Copy link
Copy Markdown
Member

I have to look at this. I think the 96 work.. but we need an easy way for users to add.

@pfefferle

Copy link
Copy Markdown
Member Author

Aren't they added by domain mapping?

@dshanske

dshanske commented Jan 3, 2026

Copy link
Copy Markdown
Member

Aren't they added by domain mapping?

No, that's how it figured out what icon.. but we removed a lot of icons...so we need a way for people to add icons and colors easily.

@pfefferle

Copy link
Copy Markdown
Member Author

You mean for icons we possibly removed?

@dshanske

dshanske commented Jan 3, 2026

Copy link
Copy Markdown
Member

You mean for icons we possibly removed?

Yes. That's what has been stalling me... maybe the solution is to just tell people how to request specific icons be added and take on that debt. Same as for the Syndication Links plugin where I would match this as its the same code. Alternatively some sort of dynamic downloader.

- Reduce SVG icons from 3,447 to 96 (76 from Simple Icons + 20 custom)
- Update build script to filter and copy only curated icons
- Remove unused genericons-neue dependency and folder
- Keep legacy icons (twitter, nostr, googlepodcasts) as custom icons

Icon categories included:
- Social networks (mastodon, bluesky, twitter, facebook, etc.)
- Fediverse (activitypub, pixelfed, peertube, lemmy, etc.)
- Developer platforms (github, gitlab, codeberg, etc.)
- Media/content (spotify, youtube, substack, etc.)
- Custom utility icons (website, mail, book, etc.)
@pfefferle

Copy link
Copy Markdown
Member Author

@dshanske what about pointing the users to this repo to report the need of new icons? lets keep things simple for now and improve over time!?

@dshanske

dshanske commented Jan 4, 2026

Copy link
Copy Markdown
Member

That's what I was thinking for now.

@dshanske

dshanske commented Jan 5, 2026

Copy link
Copy Markdown
Member

This looks good. But I think I need to add the changes from https://github.com/dshanske/syndication-links/blob/trunk/includes/class-syn-link-domain-icon-map.php which I wrote concurrently. In there, I added a search directory functionality that could be edited. I think that would address my comment about adding in addition to the issue opening.

@pfefferle
pfefferle requested a review from a team August 6, 2026 09:48
@pfefferle

Copy link
Copy Markdown
Member Author

Merged trunk, the conflict was only package.json, and ported the search directories in 543432d.

get_icon_file_dirs() now returns a filterable list of directories (indieweb_icon_file_dirs) and the lookup walks them in order, so a directory added to the front can also replace a bundled icon. I took the two other filters from your version as well: pre_indieweb_icon_svg to return the markup without a file, and indieweb_icon_title for a readable title.

One thing it does not solve: the colors come from the generated _simple-icons.scss, so an added icon has no color of its own and just uses the color of the surrounding text. Not sure yet if that is worth a filter too.

I also added a FAQ entry in the readme that points people here to request an icon, so both ways are documented.

@pfefferle

Copy link
Copy Markdown
Member Author

I added support for the new Icons API of WordPress 7.1 in b3d6cb3. The bundled icons (and the ones from the indieweb_icon_file_dirs directories) are registered as the indieweb collection on init, so they show up in the editor's Icon Library. Domain_Icon_Map now renders everything through wp_get_icon() and checks the registry instead of the file system, so icons that are registered with wp_register_icon( 'indieweb/...' ) are used for the domain matching too.

For older WordPress versions there is a shim in includes/compat.php that provides wp_register_icon(), wp_get_icon() and friends, backed by a minimal registry that behaves like the core one. The plugin code itself is written against the API only, the shim does all the backporting. On 7.1 the shim tests are skipped, I ran the suite against 6.8 locally where all of them pass, and the 6.2 job in the CI matrix covers the shim as well.

Two side effects: core sanitizes the icons and strips <title> tags but keeps their text, so the build script removes the titles now (and I did it once by hand for the custom icons). And I had to clean up nostr.svg, its inline <style> would have rendered as a black square in the Icon Library.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 3448 changed files in this pull request and generated no new comments.

@pfefferle

Copy link
Copy Markdown
Member Author

@dshanske I would really love to have your view on that one!

@dshanske

Copy link
Copy Markdown
Member

I need to do some real world testing, but the implementation reading the code looks completely solid to me.

@dshanske dshanske 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.

looks good to me on visual code review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Stale mappings reference unshipped googleplus and googlehangouts icons.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread static/js/simpleicons.js Resolved
@pfefferle pfefferle changed the title Curate icons to essential set (~96 icons) Curate icons to essential set (73 icons) Sep 26, 2026
@pfefferle
pfefferle merged commit b6fa39b into trunk Sep 26, 2026
7 checks passed
@pfefferle pfefferle mentioned this pull request Sep 26, 2026
1 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants