Changeset 45185
- Timestamp:
- 04/12/2019 11:55:19 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r45043 r45185 503 503 } 504 504 505 $wp_version = get_bloginfo( 'version' ); 506 507 $compatible_php = ( empty( $plugin['requires_php'] ) || version_compare( phpversion(), $plugin['requires_php'], '>=' ) ); 508 $tested_wp = ( empty( $plugin['tested'] ) || version_compare( $wp_version, $plugin['tested'], '<=' ) ); 509 $compatible_wp = ( empty( $plugin['requires'] ) || version_compare( $wp_version, $plugin['requires'], '>=' ) ); 505 $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null; 506 $requires_wp = isset( $plugin['requires'] ) ? $plugin['requires'] : null; 507 508 $compatible_php = is_php_version_compatible( $requires_php ); 509 $compatible_wp = is_wp_version_compatible( $requires_wp ); 510 $tested_wp = ( empty( $plugin['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin['tested'], '<=' ) ); 510 511 511 512 $action_links = array(); -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r45021 r45185 762 762 } 763 763 764 $compatible_php = ( empty( $plugin_data['requires_php'] ) || version_compare( phpversion(), $plugin_data['requires_php'], '>=' ) ); 764 $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null; 765 $compatible_php = is_php_version_compatible( $requires_php ); 765 766 $class = $is_active ? 'active' : 'inactive'; 766 767 $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] ); -
trunk/src/wp-admin/includes/plugin-install.php
r44937 r45185 755 755 <div id="section-holder" class="wrap"> 756 756 <?php 757 $wp_version = get_bloginfo( 'version' ); 758 759 $compatible_php = ( empty( $api->requires_php ) || version_compare( phpversion(), $api->requires_php, '>=' ) ); 760 $tested_wp = ( empty( $api->tested ) || version_compare( $wp_version, $api->tested, '<=' ) ); 761 $compatible_wp = ( empty( $api->requires ) || version_compare( $wp_version, $api->requires, '>=' ) ); 757 $requires_php = isset( $api->requires_php ) ? $api->requires_php : null; 758 $requires_wp = isset( $api->requires ) ? $api->requires : null; 759 760 $compatible_php = is_php_version_compatible( $requires_php ); 761 $compatible_wp = is_wp_version_compatible( $requires_wp ); 762 $tested_wp = ( empty( $api->tested ) || version_compare( get_bloginfo( 'version' ), $api->tested, '<=' ) ); 762 763 763 764 if ( ! $compatible_php ) { -
trunk/src/wp-admin/includes/plugin.php
r45116 r45185 1100 1100 } 1101 1101 1102 $plugin_data['wp_compatible'] = version_compare( get_bloginfo( 'version' ), $plugin_data['requires'], '>=');1103 $plugin_data['php_compatible'] = version_compare( phpversion(), $plugin_data['requires_php'], '>=');1102 $plugin_data['wp_compatible'] = is_wp_version_compatible( $plugin_data['requires'] ); 1103 $plugin_data['php_compatible'] = is_php_version_compatible( $plugin_data['requires_php'] ); 1104 1104 1105 1105 $plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) ); -
trunk/src/wp-admin/includes/update.php
r45117 r45185 401 401 } 402 402 403 $compatible_php = ( empty( $response->requires_php ) || version_compare( phpversion(), $response->requires_php, '>=' ) ); 403 $requires_php = isset( $response->requires_php ) ? $response->requires_php : null; 404 $compatible_php = is_php_version_compatible( $requires_php ); 404 405 $notice_type = $compatible_php ? 'notice-warning' : 'notice-error'; 405 406 -
trunk/src/wp-admin/update-core.php
r45184 r45185 296 296 } 297 297 298 $compatible_php = ( empty( $plugin_data->update->requires_php ) || version_compare( phpversion(), $plugin_data->update->requires_php, '>=' ) ); 298 $requires_php = isset( $plugin_data->update->requires_php ) ? $plugin_data->update->requires_php : null; 299 $compatible_php = is_php_version_compatible( $requires_php ); 299 300 300 301 if ( ! $compatible_php && current_user_can( 'update_php' ) ) { -
trunk/src/wp-includes/functions.php
r45177 r45185 3418 3418 <data> 3419 3419 <status>{$r['response']}</status> 3420 </data> 3420 </data> 3421 3421 </error> 3422 3422 … … 7122 7122 return $size; 7123 7123 } 7124 7125 /** 7126 * Checks compatibility with the current WordPress version. 7127 * 7128 * @since 5.2.0 7129 * 7130 * @param string $required Minimum required WordPress version. 7131 * @return bool True if required version is compatible or empty, false if not. 7132 */ 7133 function is_wp_version_compatible( $required ) { 7134 return empty( $required ) || version_compare( get_bloginfo( 'version' ), $required, '>=' ); 7135 } 7136 7137 /** 7138 * Checks compatibility with the current PHP version. 7139 * 7140 * @since 5.2.0 7141 * 7142 * @param string $required Minimum required PHP version. 7143 * @return bool True if required version is compatible or empty, false if not. 7144 */ 7145 function is_php_version_compatible( $required ) { 7146 return empty( $required ) || version_compare( phpversion(), $required, '>=' ); 7147 }
Note: See TracChangeset
for help on using the changeset viewer.