WordPress-Simple-History icon indicating copy to clipboard operation
WordPress-Simple-History copied to clipboard

Show plugin icons when plugin is updated or installed

Open bonny opened this issue 3 years ago • 2 comments

It's possible to get the icon via WP API, like the code below from https://github.com/Freemius/wordpress-sdk/issues/67. Could be a nice addition to the log.

$payload = array(
    'action' => 'plugin_information',
    'request' => serialize( (object) array(
        'slug' => 'page-builder-sandwich',
        'fields' => array(
            'tags' => false,
            'icons' => true,
            'sections' => false,
            'description' => false,
            'tested' => false,
            'requires' => false,
            'rating' => false,
            'downloaded' => false,
            'downloadlink' => false,
            'last_updated' => false,
            'homepage' => false,
            'tags' => false,
            'compatibility' => false,
            'ratings' => false,
            'added' => false,
            'donate_link' => false,
        ),
    ) ),
);
$body = wp_remote_post( 'http://api.wordpress.org/plugins/info/1.0/', array( 'body' => $payload ) );

var_dump( unserialize( $body['body'] )->icons );

bonny avatar Sep 02 '20 19:09 bonny

Not sure how it would look however.

Mockups: image

image

image

bonny avatar Sep 02 '20 19:09 bonny

@bonny Second or third mockup looks nice.

claytoncollie avatar Sep 04 '20 14:09 claytoncollie

Related discussion: https://meta.trac.wordpress.org/ticket/3213

They mention it's not polite to hotlink to the icons, so we would need to fetch the icons and store them locally. Where + for how long?

Also found out that icon is available using API https://api.wordpress.org/plugins/info/1.0/simple-history.json?fields=icons

"icons": {
  "1x": "https://ps.w.org/simple-history/assets/icon.svg?rev=2807098",
  "svg": "https://ps.w.org/simple-history/assets/icon.svg?rev=2807098"
},

They link to the SVN server and that's not something we want to link to either.

Closing this now since it sound cumbersome to do this atm.

bonny avatar Jun 27 '23 09:06 bonny