Merged in feature/280-dev-dev01 (pull request #21)
auto-patch 280-dev-dev01-2024-01-19T16_41_58 * auto-patch 280-dev-dev01-2024-01-19T16_41_58
This commit is contained in:
@@ -240,5 +240,4 @@ class Connection_Notice {
|
||||
echo '</p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -772,5 +772,4 @@ class Error_Handler {
|
||||
|
||||
$this->report_error( $error, false, true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -249,5 +249,4 @@ class Heartbeat {
|
||||
WP_CLI::line( sprintf( __( 'Last heartbeat sent at: %s', 'jetpack-connection' ), $last_date ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,13 +14,6 @@ use Automattic\Jetpack\Status;
|
||||
*/
|
||||
class Initial_State {
|
||||
|
||||
/**
|
||||
* Whether the initial state was already rendered
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private static $rendered = false;
|
||||
|
||||
/**
|
||||
* Get the initial state data.
|
||||
*
|
||||
@@ -52,11 +45,7 @@ class Initial_State {
|
||||
* @return string
|
||||
*/
|
||||
public static function render() {
|
||||
if ( self::$rendered ) {
|
||||
return null;
|
||||
}
|
||||
self::$rendered = true;
|
||||
return 'var JP_CONNECTION_INITIAL_STATE=JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( self::get_data() ) ) . '"));';
|
||||
return 'var JP_CONNECTION_INITIAL_STATE; typeof JP_CONNECTION_INITIAL_STATE === "object" || (JP_CONNECTION_INITIAL_STATE = JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( self::get_data() ) ) . '")));';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,9 +56,6 @@ class Initial_State {
|
||||
* @return void
|
||||
*/
|
||||
public static function render_script( $handle ) {
|
||||
if ( ! static::$rendered ) {
|
||||
wp_add_inline_script( $handle, static::render(), 'before' );
|
||||
}
|
||||
wp_add_inline_script( $handle, static::render(), 'before' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace Automattic\Jetpack\Connection;
|
||||
|
||||
use Automattic\Jetpack\A8c_Mc_Stats as A8c_Mc_Stats;
|
||||
use Automattic\Jetpack\A8c_Mc_Stats;
|
||||
use Automattic\Jetpack\Constants;
|
||||
use Automattic\Jetpack\Heartbeat;
|
||||
use Automattic\Jetpack\Roles;
|
||||
@@ -1916,6 +1916,7 @@ class Manager {
|
||||
'site_created' => $this->get_assumed_site_creation_date(),
|
||||
'allow_site_connection' => ! $this->has_connected_owner(),
|
||||
'calypso_env' => ( new Host() )->get_calypso_env(),
|
||||
'source' => ( new Host() )->get_source_query(),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -2139,7 +2140,6 @@ class Manager {
|
||||
'wordpress.com',
|
||||
'localhost',
|
||||
'localhost.localdomain',
|
||||
'127.0.0.1',
|
||||
'local.wordpress.test', // VVV pattern.
|
||||
'local.wordpress-trunk.test', // VVV pattern.
|
||||
'src.wordpress-develop.test', // VVV pattern.
|
||||
@@ -2195,6 +2195,24 @@ class Manager {
|
||||
return true;
|
||||
}
|
||||
|
||||
$domain = preg_replace( '#^https?://#', '', untrailingslashit( $domain ) );
|
||||
|
||||
if ( filter_var( $domain, FILTER_VALIDATE_IP )
|
||||
&& ! filter_var( $domain, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE )
|
||||
) {
|
||||
return new \WP_Error(
|
||||
'fail_ip_forbidden',
|
||||
sprintf(
|
||||
/* translators: %1$s is a domain name. */
|
||||
__(
|
||||
'IP address `%1$s` just failed is_usable_domain check as it is in the private network.',
|
||||
'jetpack-connection'
|
||||
),
|
||||
$domain
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2541,4 +2559,18 @@ class Manager {
|
||||
}
|
||||
return (int) $site_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Jetpack is ready for uninstall cleanup.
|
||||
*
|
||||
* @param string $current_plugin_slug The current plugin's slug.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_ready_for_cleanup( $current_plugin_slug ) {
|
||||
$active_plugins = get_option( Plugin_Storage::ACTIVE_PLUGINS_OPTION_NAME );
|
||||
|
||||
return empty( $active_plugins ) || ! is_array( $active_plugins )
|
||||
|| ( count( $active_plugins ) === 1 && array_key_exists( $current_plugin_slug, $active_plugins ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,5 +209,4 @@ class Nonce_Handler {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -108,5 +108,4 @@ class Package_Version_Tracker {
|
||||
set_transient( self::CACHED_FAILED_REQUEST_KEY, time(), self::CACHED_FAILED_REQUEST_EXPIRATION );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Automattic\Jetpack\Connection;
|
||||
*/
|
||||
class Package_Version {
|
||||
|
||||
const PACKAGE_VERSION = '1.57.0';
|
||||
const PACKAGE_VERSION = '1.60.1';
|
||||
|
||||
const PACKAGE_SLUG = 'connection';
|
||||
|
||||
|
||||
@@ -108,5 +108,4 @@ class Terms_Of_Service {
|
||||
protected function set_reject() {
|
||||
\Jetpack_Options::update_option( self::OPTION_NAME, false );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -73,5 +73,4 @@ class Tokens_Locks {
|
||||
add_filter( 'ai1wm_export', array( $this, 'aiowpm_set_lock' ), 180 );
|
||||
add_filter( 'ai1wm_export', array( $this, 'aiowpm_remove_lock' ), 250 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ class Urls {
|
||||
$option_key = self::HTTPS_CHECK_OPTION_PREFIX . $callable;
|
||||
|
||||
$parsed_url = wp_parse_url( $new_value );
|
||||
|
||||
if ( ! $parsed_url ) {
|
||||
return $new_value;
|
||||
}
|
||||
@@ -98,7 +99,12 @@ class Urls {
|
||||
} else {
|
||||
$scheme = '';
|
||||
}
|
||||
$scheme_history = get_option( $option_key, array() );
|
||||
$scheme_history = get_option( $option_key, array() );
|
||||
|
||||
if ( ! is_array( $scheme_history ) ) {
|
||||
$scheme_history = array();
|
||||
}
|
||||
|
||||
$scheme_history[] = $scheme;
|
||||
|
||||
// Limit length to self::HTTPS_CHECK_HISTORY.
|
||||
@@ -183,5 +189,4 @@ class Urls {
|
||||
public static function main_network_site_url() {
|
||||
return self::get_protocol_normalized_url( 'main_network_site_url', network_site_url() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class XMLRPC_Async_Call {
|
||||
public static function do_calls() {
|
||||
foreach ( self::$clients as $client_blog_id => $blog_clients ) {
|
||||
if ( $client_blog_id > 0 ) {
|
||||
$switch_success = switch_to_blog( $client_blog_id, true );
|
||||
$switch_success = switch_to_blog( $client_blog_id );
|
||||
|
||||
if ( ! $switch_success ) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user