diff --git src/wp-admin/includes/class-wp-plugin-install-list-table.php src/wp-admin/includes/class-wp-plugin-install-list-table.php
index 94a8fde67e..c2445e8458 100644
|
|
|
class WP_Plugin_Install_List_Table extends WP_List_Table { |
| 504 | 504 | |
| 505 | 505 | $wp_version = get_bloginfo( 'version' ); |
| 506 | 506 | |
| 507 | | $compatible_php = ( empty( $plugin['requires_php'] ) || version_compare( substr( phpversion(), 0, strlen( $plugin['requires_php'] ) ), $plugin['requires_php'], '>=' ) ); |
| 508 | | $tested_wp = ( empty( $plugin['tested'] ) || version_compare( substr( $wp_version, 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '<=' ) ); |
| 509 | | $compatible_wp = ( empty( $plugin['requires'] ) || version_compare( substr( $wp_version, 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '>=' ) ); |
| | 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'], '>=' ) ); |
| 510 | 510 | |
| 511 | 511 | $action_links = array(); |
| 512 | 512 | |
diff --git src/wp-admin/includes/plugin-install.php src/wp-admin/includes/plugin-install.php
index 20aece0153..cc1c5f6621 100644
|
|
|
if ( ! empty( $api->contributors ) ) { |
| 756 | 756 | <?php |
| 757 | 757 | $wp_version = get_bloginfo( 'version' ); |
| 758 | 758 | |
| 759 | | $compatible_php = ( empty( $api->requires_php ) || version_compare( substr( phpversion(), 0, strlen( $api->requires_php ) ), $api->requires_php, '>=' ) ); |
| 760 | | $tested_wp = ( empty( $api->tested ) || version_compare( substr( $wp_version, 0, strlen( $api->tested ) ), $api->tested, '<=' ) ); |
| 761 | | $compatible_wp = ( empty( $api->requires ) || version_compare( substr( $wp_version, 0, strlen( $api->requires ) ), $api->requires, '>=' ) ); |
| | 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, '>=' ) ); |
| 762 | 762 | |
| 763 | 763 | if ( ! $compatible_php ) { |
| 764 | 764 | echo '<div class="notice notice-error notice-alt"><p>'; |
diff --git src/wp-admin/update-core.php src/wp-admin/update-core.php
index abc4f8418f..b1e97bd6fd 100644
|
|
|
function list_plugin_updates() { |
| 287 | 287 | $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version ); |
| 288 | 288 | } |
| 289 | 289 | } |
| | 290 | |
| | 291 | $compatible_php = ( empty( $plugin_data->update->requires_php ) || version_compare( phpversion(), $plugin_data->update->requires_php, '>=' ) ); |
| | 292 | |
| | 293 | if ( ! $compatible_php ) { |
| | 294 | $compat .= '<br>' . __( 'This update doesn’t work with your version of PHP.' ) . ' '; |
| | 295 | /* translators: %s: Updating PHP page URL */ |
| | 296 | $compat .= sprintf( |
| | 297 | __( '<a href="%s">Learn more about updating PHP.</a>' ), |
| | 298 | esc_url( __( 'https://wordpress.org/support/update-php/' ) ) |
| | 299 | ); |
| | 300 | } |
| | 301 | |
| 290 | 302 | // Get the upgrade notice for the new plugin version. |
| 291 | 303 | if ( isset( $plugin_data->update->upgrade_notice ) ) { |
| 292 | 304 | $upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice ); |
| … |
… |
function list_plugin_updates() { |
| 308 | 320 | ?> |
| 309 | 321 | <tr> |
| 310 | 322 | <td class="check-column"> |
| | 323 | <?php if ( $compatible_php ) : ?> |
| 311 | 324 | <input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $plugin_file ); ?>" /> |
| 312 | 325 | <label for="<?php echo $checkbox_id; ?>" class="screen-reader-text"> |
| 313 | 326 | <?php |
| 314 | | /* translators: %s: plugin name */ |
| 315 | | printf( |
| 316 | | __( 'Select %s' ), |
| 317 | | $plugin_data->Name |
| 318 | | ); |
| | 327 | /* translators: %s: plugin name */ |
| | 328 | printf( |
| | 329 | __( 'Select %s' ), |
| | 330 | esc_attr( $plugin_data->Name ) |
| | 331 | ); |
| 319 | 332 | ?> |
| 320 | 333 | </label> |
| 321 | | </td> |
| 322 | | <td class="plugin-title"><p> |
| 323 | | <?php echo $icon; ?> |
| 324 | | <strong><?php echo $plugin_data->Name; ?></strong> |
| 325 | | <?php |
| 326 | | /* translators: 1: plugin version, 2: new version */ |
| 327 | | printf( |
| 328 | | __( 'You have version %1$s installed. Update to %2$s.' ), |
| 329 | | $plugin_data->Version, |
| 330 | | $plugin_data->update->new_version |
| 331 | | ); |
| 332 | | echo ' ' . $details . $compat . $upgrade_notice; |
| | 334 | <?php endif; ?> |
| | 335 | </td> |
| | 336 | <td class="plugin-title"><p> |
| | 337 | <?php echo $icon; ?> |
| | 338 | <strong><?php echo esc_html( $plugin_data->Name ); ?></strong> |
| | 339 | <?php |
| | 340 | /* translators: 1: plugin version, 2: new version */ |
| | 341 | printf( |
| | 342 | __( 'You have version %1$s installed. Update to %2$s.' ), |
| | 343 | esc_attr( $plugin_data->Version ), |
| | 344 | esc_attr( $plugin_data->update->new_version ) |
| | 345 | ); |
| | 346 | echo ' ' . $details . $compat . $upgrade_notice; |
| 333 | 347 | ?> |
| 334 | 348 | </p></td> |
| 335 | 349 | </tr> |
| 336 | | <?php |
| | 350 | <?php |
| 337 | 351 | } |
| 338 | 352 | ?> |
| 339 | 353 | </tbody> |