: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$updates_howto = '<p>' . __( '<strong>WordPress</strong> — Updating your WordPress installation is a simple one-click procedure: just <strong>click on the “Update now” button</strong> when you are notified that a new version is available.' ) . ' ' . __( 'In most cases, WordPress will automatically apply maintenance and security updates in the background for you.' ) . '</p>';
$updates_howto .= '<p>' . __( '<strong>Themes and Plugins</strong> — To update individual themes or plugins from this screen, use the checkboxes to make your selection, then <strong>click on the appropriate “Update” button</strong>. To update all of your themes or plugins at once, you can check the box at the top of the section to select all before clicking the update button.' ) . '</p>';
if ( 'en_US' !== get_locale() ) {
$updates_howto .= '<p>' . __( '<strong>Translations</strong> — The files translating WordPress into your language are updated for you whenever any other updates occur. But if these files are out of date, you can <strong>click the “Update Translations”</strong> button.' ) . '</p>';
get_current_screen()->add_help_tab(
'title' => __( 'How to Update' ),
'content' => $updates_howto,
$help_sidebar_autoupdates = '';
if ( ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) || ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) ) {
$help_tab_autoupdates = '<p>' . __( 'Auto-updates can be enabled or disabled for WordPress major versions and for each individual theme or plugin. Themes or plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>';
$help_tab_autoupdates .= '<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>';
get_current_screen()->add_help_tab(
'id' => 'plugins-themes-auto-updates',
'title' => __( 'Auto-updates' ),
'content' => $help_tab_autoupdates,
$help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>';
$help_sidebar_rollback = '';
if ( current_user_can( 'update_themes' ) || current_user_can( 'update_plugins' ) ) {
$rollback_help = '<p>' . __( 'This feature will create a temporary backup of a plugin or theme before it is upgraded. This backup is used to restore the plugin or theme back to its previous state if there is an error during the update process.' ) . '</p>';
$rollback_help .= '<p>' . __( 'On systems with fewer resources, this may lead to server timeouts or resource limits being reached. If you encounter an issue during the update process, please create a support forum topic and reference <strong>Rollback</strong> in the issue title.' ) . '</p>';
get_current_screen()->add_help_tab(
'id' => 'rollback-plugins-themes',
'title' => __( 'Restore Plugin or Theme' ),
'content' => $rollback_help,
$help_sidebar_rollback = '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/wordpress/common-errors/">Common Errors</a>' ) . '</p>';
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/dashboard-updates-screen/">Documentation on Updating WordPress</a>' ) . '</p>' .
$help_sidebar_autoupdates .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' .
if ( 'upgrade-core' === $action ) {
// Force an update check when requested.
$force_check = ! empty( $_GET['force-check'] );
wp_version_check( array(), $force_check );
require_once ABSPATH . 'wp-admin/admin-header.php';
<h1><?php _e( 'WordPress Updates' ); ?></h1>
<p><?php _e( 'Updates may take several minutes to complete. If there is no feedback after 5 minutes, or if there are errors please refer to the Help section above.' ); ?></p>
if ( 'themes' === $upgrade_error ) {
$theme_updates = get_theme_updates();
if ( ! empty( $theme_updates ) ) {
__( 'Please select one or more themes to update.' ),
'additional_classes' => array( 'error' ),
$plugin_updates = get_plugin_updates();
if ( ! empty( $plugin_updates ) ) {
__( 'Please select one or more plugins to update.' ),
'additional_classes' => array( 'error' ),
$last_update_check = false;
$current = get_site_transient( 'update_core' );
if ( $current && isset( $current->last_checked ) ) {
$last_update_check = $current->last_checked + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
echo '<h2 class="wp-current-version">';
/* translators: Current version of WordPress. */
printf( __( 'Current version: %s' ), get_bloginfo( 'version' ) );
echo '<p class="update-last-checked">';
/* translators: 1: Date, 2: Time. */
__( 'Last checked on %1$s at %2$s.' ),
/* translators: Last update date format. See https://www.php.net/manual/datetime.format.php */
date_i18n( __( 'F j, Y' ), $last_update_check ),
/* translators: Last update time format. See https://www.php.net/manual/datetime.format.php */
date_i18n( __( 'g:i a T' ), $last_update_check )
echo ' <a href="' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '">' . __( 'Check again.' ) . '</a>';
if ( current_user_can( 'update_core' ) ) {
core_auto_updates_settings();
if ( current_user_can( 'update_plugins' ) ) {
if ( current_user_can( 'update_themes' ) ) {
if ( current_user_can( 'update_languages' ) ) {
list_translation_updates();
* Fires after the core, plugin, and theme update tables.
do_action( 'core_upgrade_preamble' );
'totals' => wp_get_update_data(),
require_once ABSPATH . 'wp-admin/admin-footer.php';
} elseif ( 'do-core-upgrade' === $action || 'do-core-reinstall' === $action ) {
if ( ! current_user_can( 'update_core' ) ) {
wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer( 'upgrade-core' );
// Do the (un)dismiss actions before headers, so that they can redirect.
if ( isset( $_POST['dismiss'] ) ) {
do_dismiss_core_update();
} elseif ( isset( $_POST['undismiss'] ) ) {
do_undismiss_core_update();
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( 'do-core-reinstall' === $action ) {
if ( isset( $_POST['upgrade'] ) ) {
do_core_upgrade( $reinstall );
'totals' => wp_get_update_data(),
require_once ABSPATH . 'wp-admin/admin-footer.php';
} elseif ( 'do-plugin-upgrade' === $action ) {
if ( ! current_user_can( 'update_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer( 'upgrade-core' );
if ( isset( $_GET['plugins'] ) ) {
$plugins = explode( ',', $_GET['plugins'] );
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) $_POST['checked'];
wp_redirect( admin_url( 'update-core.php' ) );
$url = 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) );
$url = wp_nonce_url( $url, 'bulk-update-plugins' );
// Used in the HTML title tag.
$title = __( 'Update Plugins' );
require_once ABSPATH . 'wp-admin/admin-header.php';
<h1><?php _e( 'Update Plugins' ); ?></h1>
<iframe src="<?php echo $url; ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php esc_attr_e( 'Update progress' ); ?>"></iframe>
'totals' => wp_get_update_data(),
require_once ABSPATH . 'wp-admin/admin-footer.php';
} elseif ( 'do-theme-upgrade' === $action ) {
if ( ! current_user_can( 'update_themes' ) ) {
wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer( 'upgrade-core' );
if ( isset( $_GET['themes'] ) ) {
$themes = explode( ',', $_GET['themes'] );
} elseif ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
wp_redirect( admin_url( 'update-core.php' ) );
$url = 'update.php?action=update-selected-themes&themes=' . urlencode( implode( ',', $themes ) );
$url = wp_nonce_url( $url, 'bulk-update-themes' );
// Used in the HTML title tag.
$title = __( 'Update Themes' );
require_once ABSPATH . 'wp-admin/admin-header.php';
<h1><?php _e( 'Update Themes' ); ?></h1>
<iframe src="<?php echo $url; ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php esc_attr_e( 'Update progress' ); ?>"></iframe>
'totals' => wp_get_update_data(),
require_once ABSPATH . 'wp-admin/admin-footer.php';
} elseif ( 'do-translation-upgrade' === $action ) {
if ( ! current_user_can( 'update_languages' ) ) {
wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
check_admin_referer( 'upgrade-translations' );
require_once ABSPATH . 'wp-admin/admin-header.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$url = 'update-core.php?action=do-translation-upgrade';
$nonce = 'upgrade-translations';
$title = __( 'Update Translations' );
$upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) );
$result = $upgrader->bulk_upgrade();
'totals' => wp_get_update_data(),
require_once ABSPATH . 'wp-admin/admin-footer.php';
} elseif ( 'core-major-auto-updates-settings' === $action ) {
if ( ! current_user_can( 'update_core' ) ) {
wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
$redirect_url = self_admin_url( 'update-core.php' );
if ( isset( $_GET['value'] ) ) {
check_admin_referer( 'core-major-auto-updates-nonce' );
if ( 'enable' === $_GET['value'] ) {
update_site_option( 'auto_update_core_major', 'enabled' );
$redirect_url = add_query_arg( 'core-major-auto-updates-saved', 'enabled', $redirect_url );
} elseif ( 'disable' === $_GET['value'] ) {
update_site_option( 'auto_update_core_major', 'disabled' );
$redirect_url = add_query_arg( 'core-major-auto-updates-saved', 'disabled', $redirect_url );
wp_redirect( $redirect_url );
* Fires for each custom update action on the WordPress Updates screen.
* The dynamic portion of the hook name, `$action`, refers to the
* passed update action. The hook fires in lieu of all available
* default update actions.
do_action( "update-core-custom_{$action}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores