Make WordPress Core

Ticket #46599: 46599.2.diff

File 46599.2.diff, 4.3 KB (added by SergeyBiryukov, 6 years ago)
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

     
    504504
    505505                        $wp_version = get_bloginfo( 'version' );
    506506
    507                         $compatible_php = ( empty( $plugin['requires_php'] ) || version_compare( phpversion(), $plugin['requires_php'], '>=' ) );
     507                        $compatible_php = ( empty( $plugin['requires_php'] ) || wp_is_php_compatible( $plugin['requires_php'] );
    508508                        $tested_wp      = ( empty( $plugin['tested'] ) || version_compare( $wp_version, $plugin['tested'], '<=' ) );
    509                         $compatible_wp  = ( empty( $plugin['requires'] ) || version_compare( $wp_version, $plugin['requires'], '>=' ) );
     509                        $compatible_wp  = ( empty( $plugin['requires'] ) || wp_is_wp_compatible( $plugin['requires'] );
    510510
    511511                        $action_links = array();
    512512
  • src/wp-admin/includes/class-wp-plugins-list-table.php

     
    761761
    762762                }
    763763
    764                 $compatible_php = ( empty( $plugin_data['requires_php'] ) || version_compare( phpversion(), $plugin_data['requires_php'], '>=' ) );
     764                $compatible_php = ( empty( $plugin_data['requires_php'] ) || wp_is_php_compatible( $plugin_data['requires_php'] );
    765765                $class          = $is_active ? 'active' : 'inactive';
    766766                $checkbox_id    = 'checkbox_' . md5( $plugin_data['Name'] );
    767767                if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ) ) || ! $compatible_php ) {
  • src/wp-admin/includes/plugin-install.php

     
    756756        <?php
    757757        $wp_version = get_bloginfo( 'version' );
    758758
    759         $compatible_php = ( empty( $api->requires_php ) || version_compare( phpversion(), $api->requires_php, '>=' ) );
     759        $compatible_php = ( empty( $api->requires_php ) || wp_is_php_compatible( $api->requires_php );
    760760        $tested_wp      = ( empty( $api->tested ) || version_compare( $wp_version, $api->tested, '<=' ) );
    761         $compatible_wp  = ( empty( $api->requires ) || version_compare( $wp_version, $api->requires, '>=' ) );
     761        $compatible_wp  = ( empty( $api->requires ) || wp_is_wp_compatible( $api->requires );
    762762
    763763        if ( ! $compatible_php ) {
    764764                echo '<div class="notice notice-error notice-alt"><p>';
  • src/wp-admin/includes/update.php

     
    400400                        $active_class = is_plugin_active( $file ) ? ' active' : '';
    401401                }
    402402
    403                 $compatible_php = ( empty( $response->requires_php ) || version_compare( phpversion(), $response->requires_php, '>=' ) );
     403                $compatible_php = ( empty( $response->requires_php ) || wp_is_php_compatible( $response->requires_php ) );
    404404                $notice_type    = $compatible_php ? 'notice-warning' : 'notice-error';
    405405
    406406                echo '<tr class="plugin-update-tr' . $active_class . '" id="' . esc_attr( $response->slug . '-update' ) . '" data-slug="' . esc_attr( $response->slug ) . '" data-plugin="' . esc_attr( $file ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message notice inline ' . $notice_type . ' notice-alt"><p>';
  • src/wp-admin/update-core.php

     
    295295                        }
    296296                }
    297297
    298                 $compatible_php = ( empty( $plugin_data->update->requires_php ) || version_compare( phpversion(), $plugin_data->update->requires_php, '>=' ) );
     298                $compatible_php = ( empty( $plugin_data->update->requires_php ) || wp_is_php_compatible( $plugin_data->update->requires_php ) );
    299299
    300300                if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
    301301                        $compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';