Ticket #43987: 43987v3.2.diff
File 43987v3.2.diff, 5.4 KB (added by , 8 months ago) |
---|
-
src/wp-admin/includes/plugin-install.php
diff --git src/wp-admin/includes/plugin-install.php src/wp-admin/includes/plugin-install.php index f765fb286e..fe397172ae 100644
if ( ! empty( $api->contributors ) ) { 785 785 break; 786 786 case 'update_available': 787 787 if ( $status['url'] ) { 788 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>'; 788 if ( $compatible_php ) { 789 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>'; 790 } else { 791 printf( 792 '<button type="button" class="button button-primary button-disabled right" disabled="disabled">%s</button>', 793 _x( 'Cannot Update', 'plugin' ) 794 ); 795 } 789 796 } 790 797 break; 791 798 case 'newer_installed': -
src/wp-admin/includes/update.php
diff --git src/wp-admin/includes/update.php src/wp-admin/includes/update.php index d8e1fe84d9..6d354d989d 100644
function wp_plugin_update_row( $file, $plugin_data ) { 401 401 $active_class = is_plugin_active( $file ) ? ' active' : ''; 402 402 } 403 403 404 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>'; 404 $compatible_php = ( empty( $response->requires_php ) || version_compare( substr( PHP_VERSION, 0, strlen( $response->requires_php ) ), $response->requires_php, '>=' ) ); 405 $notice_type = $compatible_php ? 'notice-warning' : 'notice-error'; 406 407 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>'; 405 408 406 409 if ( ! current_user_can( 'update_plugins' ) ) { 407 410 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */ … … function wp_plugin_update_row( $file, $plugin_data ) { 430 433 $response->new_version 431 434 ); 432 435 } else { 433 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */ 434 printf( 435 __( '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>.' ), 436 $plugin_name, 437 esc_url( $details_url ), 438 sprintf( 439 'class="thickbox open-plugin-details-modal" aria-label="%s"', 440 /* translators: 1: plugin name, 2: version number */ 441 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 442 ), 443 $response->new_version, 444 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ), 445 sprintf( 446 'class="update-link" aria-label="%s"', 447 /* translators: %s: plugin name */ 448 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) 449 ) 450 ); 436 if ( $compatible_php ) { 437 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */ 438 printf( 439 __( '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>.' ), 440 $plugin_name, 441 esc_url( $details_url ), 442 sprintf( 443 'class="thickbox open-plugin-details-modal" aria-label="%s"', 444 /* translators: 1: plugin name, 2: version number */ 445 esc_attr( sprintf ( __('View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 446 ), 447 $response->new_version, 448 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ), 449 sprintf( 450 'class="update-link" aria-label="%s"', 451 /* translators: %s: plugin name */ 452 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) 453 ) 454 ); 455 } else { 456 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number 5: Upgrading PHP page URL */ 457 printf( 458 __( '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 upgrading PHP</a>.' ), 459 $plugin_name, 460 esc_url( $details_url ), 461 sprintf( 462 'class="thickbox open-plugin-details-modal" aria-label="%s"', 463 /* translators: 1: plugin name, 2: version number */ 464 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 465 ), 466 $response->new_version, 467 esc_url( __('https://wordpress.org/support/upgrade-php/' ) ) 468 ); 469 } 451 470 } 452 471 453 472 /**