Edit File by line
/home/barbar84/www/wp-admin
File: upgrade.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Upgrade WordPress Page.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* We are upgrading WordPress.
[9] Fix | Delete
*
[10] Fix | Delete
* @since 1.5.1
[11] Fix | Delete
* @var bool
[12] Fix | Delete
*/
[13] Fix | Delete
define( 'WP_INSTALLING', true );
[14] Fix | Delete
[15] Fix | Delete
/** Load WordPress Bootstrap */
[16] Fix | Delete
require dirname( __DIR__ ) . '/wp-load.php';
[17] Fix | Delete
[18] Fix | Delete
nocache_headers();
[19] Fix | Delete
[20] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
[21] Fix | Delete
[22] Fix | Delete
delete_site_transient( 'update_core' );
[23] Fix | Delete
[24] Fix | Delete
if ( isset( $_GET['step'] ) ) {
[25] Fix | Delete
$step = $_GET['step'];
[26] Fix | Delete
} else {
[27] Fix | Delete
$step = 0;
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
// Do it. No output.
[31] Fix | Delete
if ( 'upgrade_db' === $step ) {
[32] Fix | Delete
wp_upgrade();
[33] Fix | Delete
die( '0' );
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* @global string $wp_version The WordPress version string.
[38] Fix | Delete
* @global string $required_php_version The required PHP version string.
[39] Fix | Delete
* @global string $required_mysql_version The required MySQL version string.
[40] Fix | Delete
*/
[41] Fix | Delete
global $wp_version, $required_php_version, $required_mysql_version;
[42] Fix | Delete
[43] Fix | Delete
$step = (int) $step;
[44] Fix | Delete
[45] Fix | Delete
$php_version = phpversion();
[46] Fix | Delete
$mysql_version = $wpdb->db_version();
[47] Fix | Delete
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
[48] Fix | Delete
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
[49] Fix | Delete
$mysql_compat = true;
[50] Fix | Delete
} else {
[51] Fix | Delete
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
[55] Fix | Delete
?>
[56] Fix | Delete
<!DOCTYPE html>
[57] Fix | Delete
<html <?php language_attributes(); ?>>
[58] Fix | Delete
<head>
[59] Fix | Delete
<meta name="viewport" content="width=device-width" />
[60] Fix | Delete
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
[61] Fix | Delete
<meta name="robots" content="noindex,nofollow" />
[62] Fix | Delete
<title><?php _e( 'WordPress &rsaquo; Update' ); ?></title>
[63] Fix | Delete
<?php wp_admin_css( 'install', true ); ?>
[64] Fix | Delete
</head>
[65] Fix | Delete
<body class="wp-core-ui">
[66] Fix | Delete
<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
[67] Fix | Delete
[68] Fix | Delete
<?php if ( (int) get_option( 'db_version' ) === $wp_db_version || ! is_blog_installed() ) : ?>
[69] Fix | Delete
[70] Fix | Delete
<h1><?php _e( 'No Update Required' ); ?></h1>
[71] Fix | Delete
<p><?php _e( 'Your WordPress database is already up to date!' ); ?></p>
[72] Fix | Delete
<p class="step"><a class="button button-large" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
[73] Fix | Delete
[74] Fix | Delete
<?php
[75] Fix | Delete
elseif ( ! $php_compat || ! $mysql_compat ) :
[76] Fix | Delete
$version_url = sprintf(
[77] Fix | Delete
/* translators: %s: WordPress version. */
[78] Fix | Delete
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
[79] Fix | Delete
sanitize_title( $wp_version )
[80] Fix | Delete
);
[81] Fix | Delete
[82] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[83] Fix | Delete
$php_update_message = '</p><p>' . sprintf(
[84] Fix | Delete
__( '<a href="%s">Learn more about updating PHP</a>.' ),
[85] Fix | Delete
esc_url( wp_get_update_php_url() )
[86] Fix | Delete
);
[87] Fix | Delete
[88] Fix | Delete
$annotation = wp_get_update_php_annotation();
[89] Fix | Delete
[90] Fix | Delete
if ( $annotation ) {
[91] Fix | Delete
$php_update_message .= '</p><p><em>' . $annotation . '</em>';
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
if ( ! $mysql_compat && ! $php_compat ) {
[95] Fix | Delete
$message = sprintf(
[96] Fix | Delete
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */
[97] Fix | Delete
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),
[98] Fix | Delete
$version_url,
[99] Fix | Delete
$wp_version,
[100] Fix | Delete
$required_php_version,
[101] Fix | Delete
$required_mysql_version,
[102] Fix | Delete
$php_version,
[103] Fix | Delete
$mysql_version
[104] Fix | Delete
) . $php_update_message;
[105] Fix | Delete
} elseif ( ! $php_compat ) {
[106] Fix | Delete
$message = sprintf(
[107] Fix | Delete
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */
[108] Fix | Delete
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ),
[109] Fix | Delete
$version_url,
[110] Fix | Delete
$wp_version,
[111] Fix | Delete
$required_php_version,
[112] Fix | Delete
$php_version
[113] Fix | Delete
) . $php_update_message;
[114] Fix | Delete
} elseif ( ! $mysql_compat ) {
[115] Fix | Delete
$message = sprintf(
[116] Fix | Delete
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */
[117] Fix | Delete
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ),
[118] Fix | Delete
$version_url,
[119] Fix | Delete
$wp_version,
[120] Fix | Delete
$required_mysql_version,
[121] Fix | Delete
$mysql_version
[122] Fix | Delete
);
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
echo '<p>' . $message . '</p>';
[126] Fix | Delete
?>
[127] Fix | Delete
<?php
[128] Fix | Delete
else :
[129] Fix | Delete
switch ( $step ) :
[130] Fix | Delete
case 0:
[131] Fix | Delete
$goback = wp_get_referer();
[132] Fix | Delete
if ( $goback ) {
[133] Fix | Delete
$goback = esc_url_raw( $goback );
[134] Fix | Delete
$goback = urlencode( $goback );
[135] Fix | Delete
}
[136] Fix | Delete
?>
[137] Fix | Delete
<h1><?php _e( 'Database Update Required' ); ?></h1>
[138] Fix | Delete
<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.' ); ?></p>
[139] Fix | Delete
<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>
[140] Fix | Delete
<p class="step"><a class="button button-large button-primary" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p>
[141] Fix | Delete
<?php
[142] Fix | Delete
break;
[143] Fix | Delete
case 1:
[144] Fix | Delete
wp_upgrade();
[145] Fix | Delete
[146] Fix | Delete
$backto = ! empty( $_GET['backto'] ) ? wp_unslash( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';
[147] Fix | Delete
$backto = esc_url( $backto );
[148] Fix | Delete
$backto = wp_validate_redirect( $backto, __get_option( 'home' ) . '/' );
[149] Fix | Delete
?>
[150] Fix | Delete
<h1><?php _e( 'Update Complete' ); ?></h1>
[151] Fix | Delete
<p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p>
[152] Fix | Delete
<p class="step"><a class="button button-large" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p>
[153] Fix | Delete
<?php
[154] Fix | Delete
break;
[155] Fix | Delete
endswitch;
[156] Fix | Delete
endif;
[157] Fix | Delete
?>
[158] Fix | Delete
</body>
[159] Fix | Delete
</html>
[160] Fix | Delete
[161] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function