From 6709f8f0d2b3e5ec4687d2d880cb5a9951e3dcd7 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Mon, 7 Jul 2025 20:34:31 +0000 Subject: [PATCH] Pings/Trackbacks: Use HTTPS for services that now support it. This updates the default on new installations for rpc.pingomatic.com to use https while also upgrading existing sites that use rpc.pingomatic.com or rpc.twingly.com to use https for those two domains. Reviewed by audrasjb. Merges [60421] and [60422] to the 6.8 branch. Props sabernhardt, peterwilsoncc, jorbin, bhubbard, matt. Fixes #42007. Built from https://develop.svn.wordpress.org/branches/6.8@60428 git-svn-id: http://core.svn.wordpress.org/branches/6.8@59764 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 2 +- wp-admin/includes/upgrade.php | 41 +++++++++++++++++++++++++++++++++++ wp-includes/version.php | 4 ++-- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 011895f06c..6c15a4d99f 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -446,7 +446,7 @@ function populate_options( array $options = array() ) { 'moderation_keys' => '', 'active_plugins' => array(), 'category_base' => '', - 'ping_sites' => 'http://rpc.pingomatic.com/', + 'ping_sites' => 'https://rpc.pingomatic.com/', 'comment_max_links' => 2, 'gmt_offset' => $gmt_offset, diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 138d5d9bbb..684f1c92a3 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -881,6 +881,11 @@ function upgrade_all() { if ( $wp_current_db_version < 58975 ) { upgrade_670(); } + + if ( $wp_current_db_version < 60421 ) { + upgrade_682(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2439,6 +2444,42 @@ function upgrade_670() { wp_set_options_autoload( $options, false ); } } + +/** + * Executes changes made in WordPress 6.8.2. + * + * @ignore + * @since 6.8.2 + * + * @global int $wp_current_db_version The old (current) database version. + */ +function upgrade_682() { + global $wp_current_db_version; + + if ( $wp_current_db_version < 60421 ) { + // Upgrade Ping-O-Matic and Twingly to use HTTPS. + $ping_sites_value = get_option( 'ping_sites' ); + $ping_sites_value = explode( "\n", $ping_sites_value ); + $ping_sites_value = array_map( + function ( $url ) { + $url = trim( $url ); + $url = sanitize_url( $url ); + if ( + str_ends_with( trailingslashit( $url ), '://rpc.pingomatic.com/' ) + || str_ends_with( trailingslashit( $url ), '://rpc.twingly.com/' ) + ) { + $url = set_url_scheme( $url, 'https' ); + } + return $url; + }, + $ping_sites_value + ); + $ping_sites_value = array_filter( $ping_sites_value ); + $ping_sites_value = implode( "\n", $ping_sites_value ); + update_option( 'ping_sites', $ping_sites_value ); + } +} + /** * Executes network-level upgrade routines. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 9d5b4ba7d8..33b5dcf09f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,14 +16,14 @@ * * @global string $wp_version */ -$wp_version = '6.8.2-alpha-60427'; +$wp_version = '6.8.2-alpha-60428'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ -$wp_db_version = 58975; +$wp_db_version = 60421; /** * Holds the TinyMCE version.