diff --git src/wp-admin/includes/class-wp-plugins-list-table.php src/wp-admin/includes/class-wp-plugins-list-table.php
index 6e130f94b4..e8d6741acc 100644
|
|
|
class WP_Plugins_List_Table extends WP_List_Table { |
| 749 | 749 | $plugin_name = $plugin_data['Name']; |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | | if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) ) { |
| | 752 | |
| | 753 | $tested_php = ! empty($plugin_data['requires_php'] ); |
| | 754 | $compatible_php = ( ! $tested_php || version_compare( substr( PHP_VERSION, 0, strlen( $plugin_data['requires_php'] ) ), $plugin_data['requires_php'], '>=' ) ); |
| | 755 | $can_update = ! $tested_php || $compatible_php; |
| | 756 | |
| | 757 | if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) && $can_update ) { |
| 753 | 758 | $class .= ' update'; |
| 754 | 759 | } |
| 755 | 760 | |
| … |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
| 819 | 824 | ); |
| 820 | 825 | } |
| 821 | 826 | |
| | 827 | if ( ! $can_update ) { |
| | 828 | $plugin_meta[] = __( 'Incompatible with your version of PHP.' ) . ' ' . |
| | 829 | /* translators: Link to servehappy page */ |
| | 830 | sprintf( |
| | 831 | __( '%sLearn more about updating PHP.%s' ), |
| | 832 | '<a href="https://wordpress.org/support/upgrade-php/">', |
| | 833 | '</a>' |
| | 834 | ); |
| | 835 | } |
| | 836 | |
| 822 | 837 | /** |
| 823 | 838 | * Filters the array of row meta for each plugin in the Plugins list table. |
| 824 | 839 | * |
diff --git src/wp-admin/includes/update.php src/wp-admin/includes/update.php
index d8e1fe84d9..845df7f416 100644
|
|
|
function wp_plugin_update_row( $file, $plugin_data ) { |
| 376 | 376 | |
| 377 | 377 | $response = $current->response[ $file ]; |
| 378 | 378 | |
| | 379 | $tested_php = ! empty( $response->requires_php ); |
| | 380 | $compatible_php = ( ! $tested_php || version_compare( substr( PHP_VERSION, 0, strlen( $response->requires_php ) ), $response->requires_php, '>=' ) ); |
| | 381 | $can_update = ! $tested_php || $compatible_php; |
| | 382 | |
| | 383 | if ( ! $can_update ) { |
| | 384 | return false; |
| | 385 | } |
| | 386 | |
| 379 | 387 | $plugins_allowedtags = array( |
| 380 | 388 | 'a' => array( |
| 381 | 389 | 'href' => array(), |
diff --git src/wp-admin/update-core.php src/wp-admin/update-core.php
index 61527bfc82..9863a23637 100644
|
|
|
foreach ( (array) $plugins as $plugin_file => $plugin_data ) { |
| 287 | 287 | $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version ); |
| 288 | 288 | } |
| 289 | 289 | } |
| | 290 | |
| | 291 | $tested_php = ! empty( $plugin_data->update->requires_php ); |
| | 292 | $compatible_php = ( ! $tested_php || version_compare( substr( PHP_VERSION, 0, strlen( $plugin_data->update->requires_php ) ), $plugin_data->update->requires_php, '>=' ) ); |
| | 293 | $can_update = ! $tested_php || $compatible_php; |
| | 294 | |
| | 295 | if ( ! $can_update ) { |
| | 296 | $compat .= '<br>' . __( 'Incompatible with your version of PHP.' ) . ' '; |
| | 297 | /* translators: Link to servehappy page */ |
| | 298 | $compat .= sprintf( |
| | 299 | __( '%sLearn more about updating PHP.%s' ), |
| | 300 | '<a href="https://wordpress.org/support/upgrade-php/">', |
| | 301 | '</a>' |
| | 302 | ); |
| | 303 | } |
| | 304 | |
| 290 | 305 | // Get the upgrade notice for the new plugin version. |
| 291 | 306 | if ( isset( $plugin_data->update->upgrade_notice ) ) { |
| 292 | 307 | $upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice ); |
| … |
… |
foreach ( (array) $plugins as $plugin_file => $plugin_data ) { |
| 308 | 323 | ?> |
| 309 | 324 | <tr> |
| 310 | 325 | <td class="check-column"> |
| | 326 | <?php if ( $can_update ) : ?> |
| 311 | 327 | <input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $plugin_file ); ?>" /> |
| 312 | 328 | <label for="<?php echo $checkbox_id; ?>" class="screen-reader-text"> |
| 313 | 329 | <?php |
| … |
… |
foreach ( (array) $plugins as $plugin_file => $plugin_data ) { |
| 318 | 334 | ); |
| 319 | 335 | ?> |
| 320 | 336 | </label> |
| | 337 | <?php endif; ?> |
| 321 | 338 | </td> |
| 322 | 339 | <td class="plugin-title"><p> |
| 323 | 340 | <?php echo $icon; ?> |