WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugins.php

    r47198 r47808  
    4444            $result = activate_plugin( $plugin, self_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );
    4545            if ( is_wp_error( $result ) ) {
    46                 if ( 'unexpected_output' == $result->get_error_code() ) {
     46                if ( 'unexpected_output' === $result->get_error_code() ) {
    4747                    $redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s" );
    4848                    wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );
     
    6363            }
    6464
    65             if ( isset( $_GET['from'] ) && 'import' == $_GET['from'] ) {
     65            if ( isset( $_GET['from'] ) && 'import' === $_GET['from'] ) {
    6666                // Overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix.
    6767                wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) );
    68             } elseif ( isset( $_GET['from'] ) && 'press-this' == $_GET['from'] ) {
     68            } elseif ( isset( $_GET['from'] ) && 'press-this' === $_GET['from'] ) {
    6969                wp_redirect( self_admin_url( 'press-this.php' ) );
    7070            } else {
     
    293293                    $plugin_slug = dirname( $plugin );
    294294
    295                     if ( '.' == $plugin_slug ) {
     295                    if ( '.' === $plugin_slug ) {
    296296                        $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
    297297                        if ( $data ) {
     
    580580<?php elseif ( isset( $_GET['deactivate-multi'] ) ) : ?>
    581581    <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins deactivated.' ); ?></p></div>
    582 <?php elseif ( 'update-selected' == $action ) : ?>
     582<?php elseif ( 'update-selected' === $action ) : ?>
    583583    <div id="message" class="updated notice is-dismissible"><p><?php _e( 'All selected plugins are up to date.' ); ?></p></div>
    584584<?php elseif ( isset( $_GET['resume'] ) ) : ?>
Note: See TracChangeset for help on using the changeset viewer.