Skip to content

Show plugin icons#249

Merged
AllTerrainDeveloper merged 3 commits into
trunkfrom
show-plugin-icons
May 19, 2026
Merged

Show plugin icons#249
AllTerrainDeveloper merged 3 commits into
trunkfrom
show-plugin-icons

Conversation

@AllTerrainDeveloper

@AllTerrainDeveloper AllTerrainDeveloper commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Support for missing images in the plugins list (gifs, and fallback to local files)

Open WordPress Playground Preview

@AllTerrainDeveloper

Copy link
Copy Markdown
Collaborator Author

@claude can you review this? AND I let you fix if those are easy fixes

@claude

claude Bot commented May 19, 2026

Copy link
Copy Markdown

Claude finished @AllTerrainDeveloper's task in 3m 24s —— View job


PR Review: Show plugin icons

  • Gather context — reading changed files
  • Review PHP changes (includes/plugins-window/rest-fields.php)
  • Review TypeScript changes (src/plugins-window/icon-fallback.ts)
  • Review docs changes
  • Review tests
  • Apply easy fixes (3 applied — pushed to branch)
  • Final summary

Review summary

Overall: High-quality PR. The local-icon-probe logic is clean, the fallback chain extension is well-tested, and docs are updated alongside the code. Three issues were found and fixed in commit 03ce298.


Bugs fixed

1. Broken anchor link in docs/hooks-reference.md:2112

The desktop_mode_icon_url table row linked to the new filter with an unfilled placeholder in the URL fragment:

- …since-0xy))…
+ …since-086))…

2. Stale fallback-chain description in docs/hooks-reference.md:2064 and includes/plugins-window/rest-fields.php:399

This PR adds GIF variants to the JS fallback chain (icon-fallback.ts clearly walks SVG → 256 PNG → 256 GIF → 128 PNG → 128 GIF), but both the hooks-reference doc and the PHP docblock still listed the old three-step chain:

- The JS card walks a candidate chain (SVG → 256 PNG → 128 PNG) on `<img>` error
+ The JS card walks a candidate chain (SVG → 256 PNG → 256 GIF → 128 PNG → 128 GIF) on `<img>` error

Notes (no action needed)

  • WP_ORG_ASSET_RE has /i flag — case-insensitive match on icon.svg is harmless in practice (wp.org URLs are always lowercase). Low risk.
  • Error listener is never removed — if an <img> element were ever recycled/reused with a fresh src, the closure's index would resume from where it left off rather than restarting from 0. Not an issue with the current renderer's usage pattern, but worth keeping in mind if that ever changes.
  • Local probe doesn't include GIF candidates — intentional; GIF in a plugin's own folder is not a real-world convention. The GIF variants are only needed for the wp.org CDN fallback chain, which is exactly where they live in icon-fallback.ts.
  • Test coverage is thorough — both the PHP suite (pluginsWindowRegistration.php) and the new vitest suite (plugins-window-icon-fallback.test.ts) cover the important edge cases: folder vs. textdomain resolution, local-file preference, candidate filter hook, single-file plugin short-circuit, full GIF chain walk, and onExhausted semantics.
    | Branch: show-plugin-icons

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

…n chain descriptions

- Replace placeholder `since-0xy` anchor with `since-086` in hooks-reference.md table row
- Update fallback chain descriptions from `SVG → 256 PNG → 128 PNG` to
  `SVG → 256 PNG → 256 GIF → 128 PNG → 128 GIF` in both hooks-reference.md
  and the rest-fields.php docblock — matching the actual icon-fallback.ts implementation

Co-authored-by: Daniel López Sánchez (prismiwi2015) <AllTerrainDeveloper@users.noreply.github.com>
@AllTerrainDeveloper AllTerrainDeveloper merged commit 1a8abe5 into trunk May 19, 2026
5 checks passed
@AllTerrainDeveloper AllTerrainDeveloper deleted the show-plugin-icons branch May 19, 2026 13:42
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.

1 participant