Ticket #43987: 43987.15.diff
| File 43987.15.diff, 7.6 KB (added by , 7 years ago) |
|---|
-
wp-admin/includes/class-wp-plugins-list-table.php
diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index a07945a973..f2e67f11c1 100644
a b class WP_Plugins_List_Table extends WP_List_Table { 773 773 774 774 } 775 775 776 $class = $is_active ? 'active' : 'inactive'; 777 $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] ); 778 if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ) ) ) { 776 $compatible_php = ( empty( $plugin_data['requires_php'] ) || version_compare( phpversion(), $plugin_data['requires_php'], '>=' ) ); 777 $class = $is_active ? 'active' : 'inactive'; 778 $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] ); 779 if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ) ) || ! $compatible_php ) { 779 780 $checkbox = ''; 780 781 } else { 781 782 /* translators: %s: plugin name */ -
wp-admin/includes/plugin-install.php
diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index f2607cb9ef..fa162c04fe 100644
a b function install_plugin_information() { 827 827 break; 828 828 case 'update_available': 829 829 if ( $status['url'] ) { 830 echo '<a data-slug="' . esc_attr( $api->slug ) . '" data-plugin="' . esc_attr( $status['file'] ) . '" id="plugin_update_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) . '</a>'; 830 if ( $compatible_php ) { 831 echo '<a data-slug="' . esc_attr( $api->slug ) . '" data-plugin="' . esc_attr( $status['file'] ) . '" id="plugin_update_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) . '</a>'; 832 } else { 833 printf( 834 '<button type="button" class="button button-primary button-disabled right" disabled="disabled">%s</button>', 835 _x( 'Cannot Update', 'plugin' ) 836 ); 837 } 831 838 } 832 839 break; 833 840 case 'newer_installed': -
wp-admin/includes/update.php
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 43db04b523..fb16b96d6e 100644
a b function wp_plugin_update_row( $file, $plugin_data ) { 400 400 $active_class = is_plugin_active( $file ) ? ' active' : ''; 401 401 } 402 402 403 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-warning notice-alt"><p>'; 403 $compatible_php = ( empty( $response->requires_php ) || version_compare( phpversion(), $response->requires_php, '>=' ) ); 404 $notice_type = $compatible_php ? 'notice-warning' : 'notice-error'; 405 406 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>'; 404 407 405 408 if ( ! current_user_can( 'update_plugins' ) ) { 406 409 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */ 407 410 printf( 408 411 __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ), 409 $plugin_name,412 esc_attr( $plugin_name ), 410 413 esc_url( $details_url ), 411 414 sprintf( 412 415 'class="thickbox open-plugin-details-modal" aria-label="%s"', 413 416 /* translators: 1: plugin name, 2: version number */ 414 417 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 415 418 ), 416 $response->new_version419 esc_attr( $response->new_version ) 417 420 ); 418 421 } elseif ( empty( $response->package ) ) { 419 422 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */ 420 423 printf( 421 424 __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ), 422 $plugin_name,425 esc_attr( $plugin_name ), 423 426 esc_url( $details_url ), 424 427 sprintf( 425 428 'class="thickbox open-plugin-details-modal" aria-label="%s"', 426 429 /* translators: 1: plugin name, 2: version number */ 427 430 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 428 431 ), 429 $response->new_version432 esc_attr( $response->new_version ) 430 433 ); 431 434 } else { 432 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */ 433 printf( 434 __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ), 435 $plugin_name, 436 esc_url( $details_url ), 437 sprintf( 438 'class="thickbox open-plugin-details-modal" aria-label="%s"', 439 /* translators: 1: plugin name, 2: version number */ 440 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 441 ), 442 $response->new_version, 443 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ), 444 sprintf( 445 'class="update-link" aria-label="%s"', 446 /* translators: %s: plugin name */ 447 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) 448 ) 449 ); 435 if ( $compatible_php ) { 436 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */ 437 printf( 438 __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ), 439 esc_attr( $plugin_name ), 440 esc_url( $details_url ), 441 sprintf( 442 'class="thickbox open-plugin-details-modal" aria-label="%s"', 443 /* translators: 1: plugin name, 2: version number */ 444 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 445 ), 446 esc_attr( $response->new_version ), 447 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ), 448 sprintf( 449 'class="update-link" aria-label="%s"', 450 /* translators: %s: plugin name */ 451 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) 452 ) 453 ); 454 } else { 455 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number 5: Update PHP page URL */ 456 printf( 457 __( 'There is a new version of %1$s available, but it doesn’t work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ), 458 esc_attr( $plugin_name ), 459 esc_url( $details_url ), 460 sprintf( 461 'class="thickbox open-plugin-details-modal" aria-label="%s"', 462 /* translators: 1: plugin name, 2: version number */ 463 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 464 ), 465 esc_attr( $response->new_version ), 466 esc_url( wp_get_update_php_url() ) 467 ); 468 wp_update_php_annotation( '<br><span class="description">', '</span>' ); 469 } 450 470 } 451 471 452 472 /**