| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | |
| 46 | 46 | // If Jetpack is currently connected, and is not in Safe Mode already, kick off a sync of the current |
| 47 | 47 | // functions/callables so that we can test if this site is in IDC. |
| 48 | 48 | if ( Jetpack::is_connection_ready() && ! Identity_Crisis::validate_sync_error_idc_option() && Actions::sync_allowed() ) { |
| 49 | - Actions::do_full_sync( array( 'functions' => true ) ); | |
| 49 | + Actions::do_full_sync( array( 'functions' => true ), 'provision' ); | |
| 50 | 50 | Actions::$sender->do_full_sync(); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if ( Identity_Crisis::validate_sync_error_idc_option() ) { |
| @@ -52,9 +52,9 @@ | ||
| 52 | 52 | |
| 53 | 53 | if ( Identity_Crisis::validate_sync_error_idc_option() ) { |
| 54 | 54 | return new WP_Error( |
| 55 | 55 | 'site_in_safe_mode', |
| 56 | - __( 'Can not provision a plan while in safe mode. See: https://jetpack.com/support/safe-mode/', 'jetpack' ) | |
| 56 | + __( 'Cannot provision a plan while in safe mode. See: https://jetpack.com/support/safe-mode/', 'jetpack' ) | |
| 57 | 57 | ); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if ( ! Jetpack::connection()->is_connected() || ( isset( $named_args['force_register'] ) && (int) $named_args['force_register'] ) ) { |
| @@ -134,20 +134,12 @@ | ||
| 134 | 134 | if ( isset( $named_args['plan'] ) && ! empty( $named_args['plan'] ) ) { |
| 135 | 135 | $request_body['plan'] = $named_args['plan']; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - if ( isset( $named_args['onboarding'] ) && ! empty( $named_args['onboarding'] ) ) { | |
| 139 | - $request_body['onboarding'] = (int) $named_args['onboarding']; | |
| 140 | - } | |
| 141 | - | |
| 142 | 138 | if ( isset( $named_args['force_connect'] ) && ! empty( $named_args['force_connect'] ) ) { |
| 143 | 139 | $request_body['force_connect'] = (int) $named_args['force_connect']; |
| 144 | 140 | } |
| 145 | 141 | |
| 146 | - if ( isset( $request_body['onboarding'] ) && (bool) $request_body['onboarding'] ) { | |
| 147 | - Jetpack::create_onboarding_token(); | |
| 148 | - } | |
| 149 | - | |
| 150 | 142 | return $request_body; |
| 151 | 143 | } |
| 152 | 144 | |
| 153 | 145 | /** |
| @@ -177,9 +169,9 @@ | ||
| 177 | 169 | 'Host' => 'public-api.wordpress.com', |
| 178 | 170 | ), |
| 179 | 171 | 'timeout' => 60, |
| 180 | 172 | 'method' => 'POST', |
| 181 | - 'body' => wp_json_encode( $request_body ), | |
| 173 | + 'body' => wp_json_encode( $request_body, JSON_UNESCAPED_SLASHES ), | |
| 182 | 174 | ); |
| 183 | 175 | |
| 184 | 176 | $blog_id = Jetpack_Options::get_option( 'id' ); |
| 185 | 177 | $url = esc_url_raw( |
| @@ -198,8 +190,9 @@ | ||
| 198 | 190 | if ( ! empty( $calypso_env ) ) { |
| 199 | 191 | $url = add_query_arg( array( 'calypso_env' => $calypso_env ), $url ); |
| 200 | 192 | } |
| 201 | 193 | |
| 194 | + // @phan-suppress-next-line PhanAccessMethodInternal -- Phan is correct, but the usage is intentional. | |
| 202 | 195 | $result = Client::_wp_remote_request( $url, $request ); |
| 203 | 196 | |
| 204 | 197 | if ( is_wp_error( $result ) ) { |
| 205 | 198 | return $result; |
| @@ -279,9 +272,10 @@ | ||
| 279 | 272 | 'method' => 'POST', |
| 280 | 273 | 'body' => '', |
| 281 | 274 | ); |
| 282 | 275 | |
| 283 | - $url = sprintf( '%s/rest/v1.3/jpphp/partner-keys/verify', self::get_api_host() ); | |
| 276 | + $url = sprintf( '%s/rest/v1.3/jpphp/partner-keys/verify', self::get_api_host() ); | |
| 277 | + // @phan-suppress-next-line PhanAccessMethodInternal -- Phan is correct, but the usage is intentional. | |
| 284 | 278 | $result = Client::_wp_remote_request( $url, $request ); |
| 285 | 279 | |
| 286 | 280 | if ( is_wp_error( $result ) ) { |
| 287 | 281 | return $result; |