Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change 'autoload' option values in various files #6417

Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
if ( get_option( 'db_upgraded' ) ) {

flush_rewrite_rules();
update_option( 'db_upgraded', false );
update_option( 'db_upgraded', false, 'on' );

/**
* Fires on the next page load after a successful DB upgrade.
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function wp_ajax_wp_compression_test() {
if ( is_multisite() ) {
update_site_option( 'can_compress_scripts', 0 );
} else {
update_option( 'can_compress_scripts', 0, 'yes' );
update_option( 'can_compress_scripts', 0, 'on' );
}
wp_die( 0 );
}
Expand Down Expand Up @@ -231,15 +231,15 @@ function wp_ajax_wp_compression_test() {
if ( is_multisite() ) {
update_site_option( 'can_compress_scripts', 0 );
} else {
update_option( 'can_compress_scripts', 0, 'yes' );
update_option( 'can_compress_scripts', 0, 'on' );
}
} elseif ( 'yes' === $_GET['test'] ) {
check_ajax_referer( 'update_can_compress_scripts' );
// Use `update_option()` on single site to mark the option for autoloading.
if ( is_multisite() ) {
update_site_option( 'can_compress_scripts', 1 );
} else {
update_option( 'can_compress_scripts', 1, 'yes' );
update_option( 'can_compress_scripts', 1, 'on' );
}
}
}
Expand Down Expand Up @@ -2483,7 +2483,7 @@ function wp_ajax_delete_inactive_widgets() {
$id_base = implode( '-', $pieces );
$widget = get_option( 'widget_' . $id_base );
unset( $widget[ $multi_number ] );
update_option( 'widget_' . $id_base, $widget );
update_option( 'widget_' . $id_base, $widget, 'off' );
unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] );
}

Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-plugin-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function upgrade( $plugin, $args = array() ) {

if ( isset( $past_failure_emails[ $plugin ] ) ) {
unset( $past_failure_emails[ $plugin ] );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails, 'off' );
}

return true;
Expand Down Expand Up @@ -444,7 +444,7 @@ public function bulk_upgrade( $plugins, $args = array() ) {
unset( $past_failure_emails[ $plugin ] );
}

update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails, 'off' );

return $results;
}
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-theme-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@

if ( isset( $past_failure_emails[ $theme ] ) ) {
unset( $past_failure_emails[ $theme ] );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails. 'off' );

Check failure on line 362 in src/wp-admin/includes/class-theme-upgrader.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Concat operator must be surrounded by a single space
}

return true;
Expand Down Expand Up @@ -545,7 +545,7 @@
unset( $past_failure_emails[ $theme ] );
}

update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails. 'off' );

Check failure on line 548 in src/wp-admin/includes/class-theme-upgrader.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Concat operator must be surrounded by a single space

return $results;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-automatic-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_
$result = wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );

if ( $result ) {
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails, 'off' );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-plugins-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function prepare_items() {
if ( $screen->in_admin( 'network' ) ) {
update_site_option( 'recently_activated', $recently_activated );
} else {
update_option( 'recently_activated', $recently_activated );
update_option( 'recently_activated', $recently_activated, 'off' );
}

$plugin_info = get_site_transient( 'update_plugins' );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-privacy-policy-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function text_change_check() {

// Cache the result for use before `admin_init` (see above).
if ( $cached !== $state ) {
update_option( '_wp_suggested_policy_text_has_changed', $state );
update_option( '_wp_suggested_policy_text_has_changed', $state, 'off' );
}

return 'changed' === $state;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ public static function create_lock( $lock_name, $release_timeout = null ) {
$lock_option = $lock_name . '.lock';

// Try to lock.
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_option, time() ) );
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'off') /* LOCK */", $lock_option, time() ) );

if ( ! $lock_result ) {
$lock_result = get_option( $lock_option );
Expand All @@ -1038,7 +1038,7 @@ public static function create_lock( $lock_name, $release_timeout = null ) {
}

// Update the lock, as by this point we've definitely got a lock, just need to fire the actions.
update_option( $lock_option, time() );
update_option( $lock_option, time(), 'off' );

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@
}
}

update_option( 'dashboard_widget_options', $widget_options );
update_option( 'dashboard_widget_options', $widget_options. 'off' );

Check failure on line 1290 in src/wp-admin/includes/dashboard.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Concat operator must be surrounded by a single space

$locale = get_user_locale();
$cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
);

if ( ! wp_installing() ) {
update_option( 'ftp_credentials', $stored_credentials );
update_option( 'ftp_credentials', $stored_credentials, 'off' );
}

return $credentials;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function update_recently_edited( $file ) {
$oldfiles[] = $file;
}

update_option( 'recently_edited', $oldfiles );
update_option( 'recently_edited', $oldfiles, 'off' );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/nav-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selecte
wp_get_nav_menus( array( 'fields' => 'ids' ) )
);

update_option( 'nav_menu_options', $nav_menu_option );
update_option( 'nav_menu_options', $nav_menu_option, 'off' );

wp_defer_term_counting( false );

Expand Down
14 changes: 7 additions & 7 deletions src/wp-admin/includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
$current = get_option( 'active_plugins', array() );
$current[] = $plugin;
sort( $current );
update_option( 'active_plugins', $current );
update_option( 'active_plugins', $current, 'off' );
}

if ( ! $silent ) {
Expand Down Expand Up @@ -844,7 +844,7 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
}

if ( $do_blog ) {
update_option( 'active_plugins', $current );
update_option( 'active_plugins', $current, 'off' );
}
if ( $do_network ) {
update_site_option( 'active_sitewide_plugins', $network_current );
Expand Down Expand Up @@ -1072,7 +1072,7 @@ function validate_active_plugins() {
$plugins = get_option( 'active_plugins', array() );
// Validate vartype: array.
if ( ! is_array( $plugins ) ) {
update_option( 'active_plugins', array() );
update_option( 'active_plugins', array(), 'off' );
$plugins = array();
}

Expand Down Expand Up @@ -1306,7 +1306,7 @@ function uninstall_plugin( $plugin ) {
if ( file_exists( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {
if ( isset( $uninstallable_plugins[ $file ] ) ) {
unset( $uninstallable_plugins[ $file ] );
update_option( 'uninstall_plugins', $uninstallable_plugins );
update_option( 'uninstall_plugins', $uninstallable_plugins, 'off' );
}
unset( $uninstallable_plugins );

Expand All @@ -1321,7 +1321,7 @@ function uninstall_plugin( $plugin ) {
if ( isset( $uninstallable_plugins[ $file ] ) ) {
$callable = $uninstallable_plugins[ $file ];
unset( $uninstallable_plugins[ $file ] );
update_option( 'uninstall_plugins', $uninstallable_plugins );
update_option( 'uninstall_plugins', $uninstallable_plugins, 'off' );
unset( $uninstallable_plugins );

wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );
Expand Down Expand Up @@ -2612,7 +2612,7 @@ function deactivated_plugins_notice() {

if ( false === $blog_deactivated_plugins ) {
// Option not in database, add an empty array to avoid extra DB queries on subsequent loads.
update_option( 'wp_force_deactivated_plugins', array() );
update_option( 'wp_force_deactivated_plugins', array(), 'off' );
}

if ( is_multisite() ) {
Expand Down Expand Up @@ -2666,7 +2666,7 @@ function deactivated_plugins_notice() {
}

// Empty the options.
update_option( 'wp_force_deactivated_plugins', array() );
update_option( 'wp_force_deactivated_plugins', array(), 'off' );
if ( is_multisite() ) {
update_site_option( 'wp_force_deactivated_plugins', array() );
}
Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@ function populate_options( array $options = array() ) {
}

if ( in_array( $option, $fat_options, true ) ) {
$autoload = 'no';
$autoload = 'off';
} else {
$autoload = 'yes';
$autoload = 'on';
}

if ( ! empty( $insert ) ) {
Expand All @@ -614,7 +614,7 @@ function populate_options( array $options = array() ) {

// In case it is set, but blank, update "home".
if ( ! __get_option( 'home' ) ) {
update_option( 'home', $guessurl );
update_option( 'home', $guessurl, 'on' );
}

// Delete unused options.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ function _upgrade_core_deactivate_incompatible_plugins() {
} else {
$deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() );
$deactivated_plugins = array_merge( $deactivated_plugins, $deactivated_gutenberg );
update_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
update_option( 'wp_force_deactivated_plugins', $deactivated_plugins, 'off' );
}
deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
}
Expand Down
Loading
Loading