Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in `wp-admin/includes/class-w…
Browse files Browse the repository at this point in the history
…p-plugins-list-table.php`.

See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@48968 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Sep 10, 2020
1 parent 54f62fc commit c0570b1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/wp-admin/includes/class-wp-plugins-list-table.php
Expand Up @@ -387,7 +387,7 @@ public function _order_callback( $plugin_a, $plugin_b ) {
$a = $plugin_a[ $orderby ];
$b = $plugin_b[ $orderby ];

if ( $a == $b ) {
if ( $a === $b ) {
return 0;
}

Expand Down Expand Up @@ -745,9 +745,11 @@ public function single_row( $item ) {
} elseif ( 'dropins' === $context ) {
$dropins = _get_dropins();
$plugin_name = $plugin_file;
if ( $plugin_file != $plugin_data['Name'] ) {

if ( $plugin_file !== $plugin_data['Name'] ) {
$plugin_name .= '<br/>' . $plugin_data['Name'];
}

if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant.
$is_active = true;
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
Expand All @@ -764,6 +766,7 @@ public function single_row( $item ) {
'<code>wp-config.php</code>'
) . '</p>';
}

if ( $plugin_data['Description'] ) {
$description .= '<p>' . $plugin_data['Description'] . '</p>';
}
Expand Down Expand Up @@ -947,6 +950,7 @@ public function single_row( $item ) {
$compatible_php = is_php_version_compatible( $requires_php );
$class = $is_active ? 'active' : 'inactive';
$checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] );

if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) {
$checkbox = '';
} else {
Expand All @@ -959,6 +963,7 @@ public function single_row( $item ) {
esc_attr( $plugin_file )
);
}

if ( 'dropins' !== $context ) {
$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
$plugin_name = $plugin_data['Name'];
Expand Down Expand Up @@ -1124,7 +1129,7 @@ public function single_row( $item ) {

$url = add_query_arg( $query_args, 'plugins.php' );

if ( 'unavailable' == $action ) {
if ( 'unavailable' === $action ) {
$html[] = '<span class="label">' . $text . '</span>';
} else {
$html[] = sprintf(
Expand Down

0 comments on commit c0570b1

Please sign in to comment.