Making WordPress.org

Opened 7 years ago

Closed 7 years ago

#3265 closed defect (bug) (fixed)

Serve auto-generated plugin icons via URL

Reported by: dd32's profile dd32 Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

Currently the plugins auto-generated icons are passed around as base64'd data uri SVG's and output directly onto pages, and passed back directly to be displayed inline by clients.
For example, the Debug Bar plugin has this in it's source:

<style>#plugin-icon-debug-bar { background-image: url('data:image/svg+xml;base64,....

With WordPress 4.9 displaying plugin icons in the update list, plugins which only have the auto-generated icon are not shown as the data wasn't available to the update API (as it's generated on every request where needed).

It'd be far simpler if these were available through a cached-SVG request, for example:
https://s.w.org/plugins/generated-plugin-icon?name=$plugin&color=$color
which would allow embedding into plugins pages, as well as being served as a fallback SVG in the APIs.

Change History (12)

#1 @obenland
7 years ago

Good idea

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.


7 years ago

#3 @Otto42
7 years ago

  • Owner set to Otto42
  • Status changed from new to accepted

Agreed, I'll take a look at it.

#4 @dd32
7 years ago

  • Owner changed from Otto42 to dd32

#5 @dd32
7 years ago

In 7045:

Plugin Direcyory: Add a route (/plugins/$slug/geopattern-icon/$color) to serve a plugins default geopattern icon.
This will be served via the CDN and implemented in a further commit.

See #3265.

#6 @dd32
7 years ago

In 7046:

Plugin Directory: GeoPattern icons: Send caching headers with the SVGs.

See #3265.

#7 @dd32
7 years ago

In 7047:

Plugin Directory: Geopattern icons: Change the path the files are available at to /plugins/geopattern-icon/$slug.$color.svg to aid in debugging.

See #3265.

#8 @dd32
7 years ago

In 7048:

Plugin Directory: Use geopattern icons from a CDN svg rather than using data URI's inline on the page.

See #3265.

#9 @dd32
7 years ago

That takes care of https://WordPress.org/plugins/ and the plugins/info api endpoint.

Still remaining is fixing up the plugins/update-check api to use the new svg.
In doing so, we should probably update it to insert a column in the update_source table for assets which contains the banners/icons rather than rebuilding it in the API.

#10 @dd32
7 years ago

In 7072:

Plugin Directory: Use geopattern icon assets in the plugins/update-check API response.

This change populates the update_source table which the update-check API uses, another change is needed to the update check itself to pull them through.
Additionally a bin script to trigger an update for a single row (or all) is included.

See #3265.

#11 @dd32
7 years ago

In 7075:

Plugin Directory: API Updater: Lessen how much data is stored for plugin assets.

  • default is only needed for icons, banners don't need it.
  • default is now only used for icons 'geopattern' default icons.

See #3265.

#12 @dd32
7 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

The plugins/update-check/ API has been updated to use this now.

Note: See TracTickets for help on using tickets.