Ticket #43987: 43987v3.5.diff
File 43987v3.5.diff, 6.6 KB (added by , 5 years 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 20aece0153..02c0c01801 100644
if ( ! empty( $api->contributors ) ) { 820 820 break; 821 821 case 'update_available': 822 822 if ( $status['url'] ) { 823 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>'; 823 if ( $compatible_php ) { 824 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>'; 825 } else { 826 printf( 827 '<button type="button" class="button button-primary button-disabled right" disabled="disabled">%s</button>', 828 _x( 'Cannot Update', 'plugin' ) 829 ); 830 } 824 831 } 825 832 break; 826 833 case 'newer_installed': -
src/wp-admin/includes/update.php
diff --git src/wp-admin/includes/update.php src/wp-admin/includes/update.php index 171aa84c52..f9b10f77f6 100644
function wp_plugin_update_row( $file, $plugin_data ) { 402 402 $active_class = is_plugin_active( $file ) ? ' active' : ''; 403 403 } 404 404 405 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>'; 405 $compatible_php = ( empty( $response->requires_php ) || version_compare( substr( PHP_VERSION, 0, strlen( $response->requires_php ) ), $response->requires_php, '>=' ) ); 406 $notice_type = $compatible_php ? 'notice-warning' : 'notice-error'; 407 408 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>'; 406 409 407 410 if ( ! current_user_can( 'update_plugins' ) ) { 408 411 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */ 409 412 printf( 410 413 __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ), 411 $plugin_name,414 esc_attr( $plugin_name ), 412 415 esc_url( $details_url ), 413 416 sprintf( 414 417 'class="thickbox open-plugin-details-modal" aria-label="%s"', 415 418 /* translators: 1: plugin name, 2: version number */ 416 419 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 417 420 ), 418 $response->new_version421 esc_attr( $response->new_version ) 419 422 ); 420 423 } elseif ( empty( $response->package ) ) { 421 424 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */ 422 425 printf( 423 426 __( '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>' ), 424 $plugin_name,427 esc_attr( $plugin_name ), 425 428 esc_url( $details_url ), 426 429 sprintf( 427 430 'class="thickbox open-plugin-details-modal" aria-label="%s"', 428 431 /* translators: 1: plugin name, 2: version number */ 429 432 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 430 433 ), 431 $response->new_version434 esc_attr( $response->new_version ) 432 435 ); 433 436 } else { 434 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */ 435 printf( 436 __( '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>.' ), 437 $plugin_name, 438 esc_url( $details_url ), 439 sprintf( 440 'class="thickbox open-plugin-details-modal" aria-label="%s"', 441 /* translators: 1: plugin name, 2: version number */ 442 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 443 ), 444 $response->new_version, 445 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ), 446 sprintf( 447 'class="update-link" aria-label="%s"', 448 /* translators: %s: plugin name */ 449 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) 450 ) 451 ); 437 if ( $compatible_php ) { 438 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */ 439 printf( 440 __( '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>.' ), 441 esc_attr( $plugin_name ), 442 esc_url( $details_url ), 443 sprintf( 444 'class="thickbox open-plugin-details-modal" aria-label="%s"', 445 /* translators: 1: plugin name, 2: version number */ 446 esc_attr( sprintf ( __('View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 447 ), 448 esc_attr( $response->new_version ), 449 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ), 450 sprintf( 451 'class="update-link" aria-label="%s"', 452 /* translators: %s: plugin name */ 453 esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) ) 454 ) 455 ); 456 } else { 457 /* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number 5: Updating PHP page URL */ 458 printf( 459 __( '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>.' ), 460 esc_attr( $plugin_name ), 461 esc_url( $details_url ), 462 sprintf( 463 'class="thickbox open-plugin-details-modal" aria-label="%s"', 464 /* translators: 1: plugin name, 2: version number */ 465 esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) ) 466 ), 467 esc_attr( $response->new_version ), 468 esc_url( __('https://wordpress.org/support/update-php/' ) ) 469 ); 470 } 452 471 } 453 472 454 473 /**