plugin updates
This commit is contained in:
@@ -75,7 +75,7 @@ if ( ! function_exists( 'wp_install' ) ) :
|
||||
update_option( 'blog_public', $is_public );
|
||||
|
||||
// Freshness of site - in the future, this could get more specific about actions taken, perhaps.
|
||||
update_option( 'fresh_site', 1 );
|
||||
update_option( 'fresh_site', 1, false );
|
||||
|
||||
if ( $language ) {
|
||||
update_option( 'WPLANG', $language );
|
||||
@@ -278,7 +278,8 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
|
||||
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
|
||||
Commenter avatars come from <a href="%s">Gravatar</a>.'
|
||||
),
|
||||
esc_url( __( 'https://en.gravatar.com/' ) )
|
||||
/* translators: The localized Gravatar URL. */
|
||||
esc_url( __( 'https://gravatar.com/' ) )
|
||||
);
|
||||
$wpdb->insert(
|
||||
$wpdb->comments,
|
||||
@@ -459,7 +460,7 @@ Commenter avatars come from <a href="%s">Gravatar</a>.'
|
||||
* Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.)
|
||||
* TODO: Get previous_blog_id.
|
||||
*/
|
||||
if ( ! is_super_admin( $user_id ) && 1 != $user_id ) {
|
||||
if ( ! is_super_admin( $user_id ) && 1 !== $user_id ) {
|
||||
$wpdb->delete(
|
||||
$wpdb->usermeta,
|
||||
array(
|
||||
@@ -638,16 +639,16 @@ if ( ! function_exists( 'wp_upgrade' ) ) :
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @global int $wp_current_db_version The old (current) database version.
|
||||
* @global int $wp_db_version The new database version.
|
||||
* @global int $wp_current_db_version The old (current) database version.
|
||||
* @global int $wp_db_version The new database version.
|
||||
*/
|
||||
function wp_upgrade() {
|
||||
global $wp_current_db_version, $wp_db_version;
|
||||
|
||||
$wp_current_db_version = __get_option( 'db_version' );
|
||||
$wp_current_db_version = (int) __get_option( 'db_version' );
|
||||
|
||||
// We are up to date. Nothing to do.
|
||||
if ( $wp_db_version == $wp_current_db_version ) {
|
||||
if ( $wp_db_version === $wp_current_db_version ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -699,10 +700,10 @@ endif;
|
||||
function upgrade_all() {
|
||||
global $wp_current_db_version, $wp_db_version;
|
||||
|
||||
$wp_current_db_version = __get_option( 'db_version' );
|
||||
$wp_current_db_version = (int) __get_option( 'db_version' );
|
||||
|
||||
// We are up to date. Nothing to do.
|
||||
if ( $wp_db_version == $wp_current_db_version ) {
|
||||
if ( $wp_db_version === $wp_current_db_version ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -862,6 +863,9 @@ function upgrade_all() {
|
||||
upgrade_650();
|
||||
}
|
||||
|
||||
if ( $wp_current_db_version < 58975 ) {
|
||||
upgrade_670();
|
||||
}
|
||||
maybe_disable_link_manager();
|
||||
|
||||
maybe_disable_automattic_widgets();
|
||||
@@ -922,7 +926,7 @@ function upgrade_100() {
|
||||
foreach ( $allposts as $post ) {
|
||||
// Check to see if it's already been imported.
|
||||
$cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category ) );
|
||||
if ( ! $cat && 0 != $post->post_category ) { // If there's no result.
|
||||
if ( ! $cat && 0 !== (int) $post->post_category ) { // If there's no result.
|
||||
$wpdb->insert(
|
||||
$wpdb->post2cat,
|
||||
array(
|
||||
@@ -988,9 +992,9 @@ function upgrade_110() {
|
||||
|
||||
$time_difference = $all_options->time_difference;
|
||||
|
||||
$server_time = time() + gmdate( 'Z' );
|
||||
$weblogger_time = $server_time + $time_difference * HOUR_IN_SECONDS;
|
||||
$gmt_time = time();
|
||||
$server_time = time() + gmdate( 'Z' );
|
||||
$weblogger_time = $server_time + $time_difference * HOUR_IN_SECONDS;
|
||||
$gmt_time = time();
|
||||
|
||||
$diff_gmt_server = ( $gmt_time - $server_time ) / HOUR_IN_SECONDS;
|
||||
$diff_weblogger_server = ( $weblogger_time - $server_time ) / HOUR_IN_SECONDS;
|
||||
@@ -1095,7 +1099,7 @@ function upgrade_130() {
|
||||
// Some versions have multiple duplicate option_name rows with the same values.
|
||||
$options = $wpdb->get_results( "SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name" );
|
||||
foreach ( $options as $option ) {
|
||||
if ( 1 != $option->dupes ) { // Could this be done in the query?
|
||||
if ( $option->dupes > 1 ) { // Could this be done in the query?
|
||||
$limit = $option->dupes - 1;
|
||||
$dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) );
|
||||
if ( $dupe_ids ) {
|
||||
@@ -1445,7 +1449,7 @@ function upgrade_230() {
|
||||
$links = $wpdb->get_results( "SELECT link_id, link_category FROM $wpdb->links" );
|
||||
if ( ! empty( $links ) ) {
|
||||
foreach ( $links as $link ) {
|
||||
if ( 0 == $link->link_category ) {
|
||||
if ( 0 === (int) $link->link_category ) {
|
||||
continue;
|
||||
}
|
||||
if ( ! isset( $link_cat_id_map[ $link->link_category ] ) ) {
|
||||
@@ -1670,7 +1674,7 @@ function upgrade_290() {
|
||||
* Previously, setting depth to 1 would redundantly disable threading,
|
||||
* but now 2 is the minimum depth to avoid confusion.
|
||||
*/
|
||||
if ( get_option( 'thread_comments_depth' ) == '1' ) {
|
||||
if ( 1 === (int) get_option( 'thread_comments_depth' ) ) {
|
||||
update_option( 'thread_comments_depth', 2 );
|
||||
update_option( 'thread_comments', 0 );
|
||||
}
|
||||
@@ -1843,7 +1847,7 @@ function upgrade_340() {
|
||||
if ( 'yes' === $wpdb->get_var( "SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'" ) ) {
|
||||
$uninstall_plugins = get_option( 'uninstall_plugins' );
|
||||
delete_option( 'uninstall_plugins' );
|
||||
add_option( 'uninstall_plugins', $uninstall_plugins, null, 'no' );
|
||||
add_option( 'uninstall_plugins', $uninstall_plugins, null, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2339,7 +2343,7 @@ function upgrade_630() {
|
||||
$can_compress_scripts = get_option( 'can_compress_scripts', false );
|
||||
if ( false !== $can_compress_scripts ) {
|
||||
delete_option( 'can_compress_scripts' );
|
||||
add_option( 'can_compress_scripts', $can_compress_scripts, '', 'yes' );
|
||||
add_option( 'can_compress_scripts', $can_compress_scripts, '', true );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2392,11 +2396,40 @@ function upgrade_650() {
|
||||
)
|
||||
);
|
||||
|
||||
$autoload = array_fill_keys( $theme_mods_options, 'no' );
|
||||
$autoload = array_fill_keys( $theme_mods_options, false );
|
||||
wp_set_option_autoload_values( $autoload );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Executes changes made in WordPress 6.7.0.
|
||||
*
|
||||
* @ignore
|
||||
* @since 6.7.0
|
||||
*
|
||||
* @global int $wp_current_db_version The old (current) database version.
|
||||
*/
|
||||
function upgrade_670() {
|
||||
global $wp_current_db_version;
|
||||
|
||||
if ( $wp_current_db_version < 58975 ) {
|
||||
$options = array(
|
||||
'recently_activated',
|
||||
'_wp_suggested_policy_text_has_changed',
|
||||
'dashboard_widget_options',
|
||||
'ftp_credentials',
|
||||
'adminhash',
|
||||
'nav_menu_options',
|
||||
'wp_force_deactivated_plugins',
|
||||
'delete_blog_hash',
|
||||
'allowedthemes',
|
||||
'recovery_keys',
|
||||
'https_detection_errors',
|
||||
'fresh_site',
|
||||
);
|
||||
|
||||
wp_set_options_autoload( $options, false );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Executes network-level upgrade routines.
|
||||
*
|
||||
@@ -2518,7 +2551,7 @@ function upgrade_network() {
|
||||
$upgrade = false;
|
||||
$indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
|
||||
foreach ( $indexes as $index ) {
|
||||
if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 != $index->Sub_part ) {
|
||||
if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && '140' !== $index->Sub_part ) {
|
||||
$upgrade = true;
|
||||
break;
|
||||
}
|
||||
@@ -3088,7 +3121,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
|
||||
$fieldtype_base = strtok( $fieldtype_without_parentheses, ' ' );
|
||||
|
||||
// Is actual field type different from the field type in query?
|
||||
if ( $tablefield->Type != $fieldtype ) {
|
||||
if ( $tablefield->Type !== $fieldtype ) {
|
||||
$do_change = true;
|
||||
if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) {
|
||||
if ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) {
|
||||
@@ -3128,7 +3161,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
|
||||
// Get the default value from the array.
|
||||
if ( preg_match( "| DEFAULT '(.*?)'|i", $cfields[ $tablefield_field_lowercased ], $matches ) ) {
|
||||
$default_value = $matches[1];
|
||||
if ( $tablefield->Default != $default_value ) {
|
||||
if ( $tablefield->Default !== $default_value ) {
|
||||
// Add a query to change the column's default value
|
||||
$cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'";
|
||||
|
||||
@@ -3167,7 +3200,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
|
||||
'fieldname' => $tableindex->Column_name,
|
||||
'subpart' => $tableindex->Sub_part,
|
||||
);
|
||||
$index_ary[ $keyname ]['unique'] = ( 0 == $tableindex->Non_unique ) ? true : false;
|
||||
$index_ary[ $keyname ]['unique'] = ( '0' === $tableindex->Non_unique ) ? true : false;
|
||||
$index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;
|
||||
}
|
||||
|
||||
@@ -3519,7 +3552,7 @@ function make_site_theme() {
|
||||
|
||||
// Make the new site theme active.
|
||||
$current_template = __get_option( 'template' );
|
||||
if ( WP_DEFAULT_THEME == $current_template ) {
|
||||
if ( WP_DEFAULT_THEME === $current_template ) {
|
||||
update_option( 'template', $template );
|
||||
update_option( 'stylesheet', $template );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user