WordPress-Simple-History
WordPress-Simple-History copied to clipboard
Show plugin icons when plugin is updated or installed
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 );
Not sure how it would look however.
Mockups:
@bonny Second or third mockup looks nice.
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.