Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/js/_enqueues/wp/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ themes.view.Theme = wp.Backbone.View.extend({
// Renders active theme styles.
this.activeTheme();

this.$el.toggleClass( 'closed', !! ( this.model.get( 'closed' ) || this.model.get( 'is_suspended' ) ) );
this.$el.toggleClass( 'outdated', !! this.model.get( 'is_outdated' ) );
this.$el.toggleClass( 'security-issue', !! this.model.get( 'is_security' ) );

if ( this.model.get( 'displayAuthor' ) ) {
this.$el.addClass( 'display-author' );
}
Expand Down Expand Up @@ -708,6 +712,10 @@ themes.view.Details = wp.Backbone.View.extend({
this.$el.html( this.html( data ) );
// Renders active theme styles.
this.activeTheme();

this.$el.toggleClass( 'closed', !! ( this.model.get( 'closed' ) || this.model.get( 'is_suspended' ) ) );
this.$el.toggleClass( 'outdated', !! this.model.get( 'is_outdated' ) );
this.$el.toggleClass( 'security-issue', !! this.model.get( 'is_security' ) );
// Set up navigation events.
this.navigation();
// Checks screenshot size.
Expand Down
27 changes: 27 additions & 0 deletions src/wp-admin/css/list-tables.css
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,33 @@ ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
white-space: nowrap;
}

.plugins .plugin-status-badge {
display: inline-block;
font-size: 11px;
line-height: 1.4;
font-weight: 600;
padding: 1px 6px;
border-radius: 3px;
margin-left: 6px;
vertical-align: middle;
white-space: nowrap;
}

.plugins .plugin-status-badge-closed {
background-color: #d63638;
color: #fff;
}

.plugins .plugin-status-badge-outdated {
background-color: #dba617;
color: #1d2327;
}

[dir="rtl"] .plugins .plugin-status-badge {
margin-left: 0;
margin-right: 6px;
}

.plugins .plugin-title .dashicons,
.plugins .plugin-title img.plugin-icon,
.plugins .plugin-title img.updates-table-screenshot {
Expand Down
39 changes: 39 additions & 0 deletions src/wp-admin/css/themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,45 @@ body.js .theme-browser.search-loading {
background: #fff;
}

.theme-browser .theme .theme-status-badge {
display: inline-block;
font-size: 11px;
line-height: 1.4;
font-weight: 600;
padding: 1px 6px;
border-radius: 3px;
margin-left: 6px;
vertical-align: middle;
white-space: nowrap;
}

.theme-browser .theme .theme-status-badge-closed {
background-color: #d63638;
color: #fff;
}

.theme-browser .theme .theme-status-badge-outdated {
background-color: #dba617;
color: #1d2327;
}

[dir="rtl"] .theme-browser .theme .theme-status-badge {
margin-left: 0;
margin-right: 6px;
}

.theme-browser .theme.closed {
border-color: #d63638;
}

.theme-browser .theme.outdated {
border-color: #dba617;
}

.theme-browser .theme .theme-status-notice {
z-index: 10;
}

/* Activate and Customize buttons, shown on hover and focus */
.theme-browser .theme .theme-actions {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
Expand Down
44 changes: 42 additions & 2 deletions src/wp-admin/includes/class-wp-plugins-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1195,15 +1195,46 @@ public function single_row( $item ) {
$plugin_name = $plugin_data['Name'];
}

$is_plugin_closed = ! empty( $plugin_data['closed'] ) || 'closed' === ( $plugin_data['status'] ?? '' ) || 'disabled' === ( $plugin_data['status'] ?? '' );
$is_plugin_security = ! empty( $plugin_data['is_security'] ) || 'security-issue' === ( $plugin_data['reason'] ?? '' ) || 'security-issue' === ( $plugin_data['closed_reason'] ?? '' );
$is_plugin_outdated = ! empty( $plugin_data['is_outdated'] );

if ( ! $is_plugin_closed && ! $is_plugin_outdated ) {
$update_plugins_transient = get_site_transient( 'update_plugins' );
if ( is_object( $update_plugins_transient ) ) {
$transient_item = null;
if ( isset( $update_plugins_transient->response[ $plugin_file ] ) ) {
$transient_item = (object) $update_plugins_transient->response[ $plugin_file ];
} elseif ( isset( $update_plugins_transient->no_update[ $plugin_file ] ) ) {
$transient_item = (object) $update_plugins_transient->no_update[ $plugin_file ];
}
if ( $transient_item ) {
$is_plugin_closed = ! empty( $transient_item->closed ) || 'closed' === ( $transient_item->status ?? '' ) || 'disabled' === ( $transient_item->status ?? '' );
$is_plugin_security = ! empty( $transient_item->is_security ) || 'security-issue' === ( $transient_item->reason ?? '' ) || 'security-issue' === ( $transient_item->closed_reason ?? '' );
$is_plugin_outdated = ! empty( $transient_item->is_outdated );
}
}
}

if (
! empty( $totals['upgrade'] ) &&
! empty( $plugin_data['update'] ) ||
! $compatible_php ||
! $compatible_wp
! $compatible_wp ||
$is_plugin_closed ||
$is_plugin_outdated
) {
$class .= ' update';
}

if ( $is_plugin_closed ) {
$class .= ' closed';
}

if ( $is_plugin_outdated ) {
$class .= ' outdated';
}

$paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file );

if ( $paused ) {
Expand Down Expand Up @@ -1236,7 +1267,16 @@ public function single_row( $item ) {
echo "<td class='check-column'>$checkbox</td>";
break;
case 'name':
echo "<th scope='row' class='plugin-title column-primary' aria-label='" . esc_attr( $plugin_name ) . "'><strong>$plugin_name</strong>";
$badges = '';
if ( $is_plugin_closed ) {
$badge_text = $is_plugin_security ? __( 'Closed (Security)' ) : __( 'Closed' );
$badge_class = $is_plugin_security ? 'plugin-status-badge-closed plugin-status-badge-security' : 'plugin-status-badge-closed';
$badges .= ' <span class="plugin-status-badge ' . esc_attr( $badge_class ) . '" role="status"><span class="screen-reader-text">' . __( 'Plugin status:' ) . ' </span>' . esc_html( $badge_text ) . '</span>';
} elseif ( $is_plugin_outdated ) {
$badges .= ' <span class="plugin-status-badge plugin-status-badge-outdated" role="status"><span class="screen-reader-text">' . __( 'Plugin status:' ) . ' </span>' . __( 'Outdated' ) . '</span>';
}

echo "<th scope='row' class='plugin-title column-primary' aria-label='" . esc_attr( $plugin_name ) . "'><strong>$plugin_name</strong>$badges";
echo $this->row_actions( $actions, true );
echo '</th>';
break;
Expand Down
Loading
Loading