Plugins: Tweak the plugin icons added in [41695].

- Remove plugins icons from the plugin list table, as there were performance issues loading the icons when the site had lots of plugins.
- Depending on which icons the plugin has uploaded, prefer them in this order: `svg`, `128x128`, `256x256`.
- Improve the style of the fallback icon for plugins that don't have an icon defined.

Props Travel_girl, danieltj, afercia, karmatosed,hugobaeta, empireoflight, brentjett, melchoyce, pento.
Fixes #30186.


Built from https://develop.svn.wordpress.org/trunk@41755


git-svn-id: http://core.svn.wordpress.org/trunk@41589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2017-10-04 23:43:46 +00:00
parent 821004b1a6
commit 37aa531cd4
7 changed files with 24 additions and 34 deletions

View File

@ -1287,16 +1287,9 @@ ul.cat-checklist {
}
.wp-list-table.plugins .plugin-title,
.wp-list-table.plugins .theme-title {
white-space: nowrap;
}
.wp-list-table.plugins .theme-title {
padding-left: 12px;
}
.wp-list-table.plugins .plugin-title {
padding-left: 86px; /* 64 (icon width) + 10 (icon padding) + 12 (title padding) = 86 */
white-space: nowrap;
}
.plugins .plugin-title img,
@ -1308,7 +1301,11 @@ ul.cat-checklist {
}
.plugins .plugin-title .dashicons:before {
font-size: 64px;
padding: 2px;
background-color: #eee;
box-shadow: inset 0 0 10px rgba(160,165,170,.15);
font-size: 60px;
color: #B4B9BE;
}
#update-themes-table .plugin-title img,

File diff suppressed because one or more lines are too long

View File

@ -1287,16 +1287,9 @@ ul.cat-checklist {
}
.wp-list-table.plugins .plugin-title,
.wp-list-table.plugins .theme-title {
white-space: nowrap;
}
.wp-list-table.plugins .theme-title {
padding-right: 12px;
}
.wp-list-table.plugins .plugin-title {
padding-right: 86px; /* 64 (icon width) + 10 (icon padding) + 12 (title padding) = 86 */
white-space: nowrap;
}
.plugins .plugin-title img,
@ -1308,7 +1301,11 @@ ul.cat-checklist {
}
.plugins .plugin-title .dashicons:before {
font-size: 64px;
padding: 2px;
background-color: #eee;
box-shadow: inset 0 0 10px rgba(160,165,170,.15);
font-size: 60px;
color: #B4B9BE;
}
#update-themes-table .plugin-title img,

File diff suppressed because one or more lines are too long

View File

@ -751,17 +751,9 @@ class WP_Plugins_List_Table extends WP_List_Table {
echo "<th scope='row' class='check-column'>$checkbox</th>";
break;
case 'name':
$icon = '<span class="dashicons dashicons-admin-plugins"></span>';
if ( ! empty( $plugin_data['icons']['default'] ) ) {
$icon = '<img src="' . esc_url( $plugin_data['icons']['default'] ) . '" alt="" />';
}
?>
<td class="plugin-title column-primary">
<?php echo $icon; ?>
<strong><?php echo $plugin_name; ?></strong>
<?php echo $this->row_actions( $actions, true ); ?>
</td>
<?php
echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>";
echo $this->row_actions( $actions, true );
echo "</td>";
break;
case 'description':
$classes = 'column-description desc';

View File

@ -253,8 +253,12 @@ function list_plugin_updates() {
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
$icon = '<span class="dashicons dashicons-admin-plugins"></span>';
if ( ! empty( $plugin_data->update->icons['default'] ) ) {
$icon = '<img src="' . esc_url( $plugin_data->update->icons['default'] ) . '" alt="" />';
$preferred_icons = array( 'svg', '1x', '2x', 'default' );
foreach ( $preferred_icons as $preferred_icon ) {
if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
$icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />';
break;
}
}
// Get plugin compat for running version of WordPress.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41754';
$wp_version = '4.9-alpha-41755';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.