@@ 231-235 (lines=5) @@ | ||
228 | Jetpack_Client::WPCOM_JSON_API_VERSION |
|
229 | ); |
|
230 | ||
231 | if ( is_wp_error( $response ) ) { |
|
232 | /* translators: %1$s is the error code, %2$s is the error message */ |
|
233 | $message = sprintf( __( 'Connection test failed (#%1$s: %2$s)', 'jetpack' ), $response->get_error_code(), $response->get_error_message() ); |
|
234 | return self::failing_test( $name, $message ); |
|
235 | } |
|
236 | ||
237 | $body = wp_remote_retrieve_body( $response ); |
|
238 | if ( ! $body ) { |
@@ 133-136 (lines=4) @@ | ||
130 | Jetpack_Client::WPCOM_JSON_API_VERSION |
|
131 | ); |
|
132 | ||
133 | if ( is_wp_error( $response ) ) { |
|
134 | /* translators: %1$s is the error code, %2$s is the error message */ |
|
135 | WP_CLI::error( sprintf( __( 'Failed to test connection (#%1$s: %2$s)', 'jetpack' ), $response->get_error_code(), $response->get_error_message() ) ); |
|
136 | } |
|
137 | ||
138 | $body = wp_remote_retrieve_body( $response ); |
|
139 | if ( ! $body ) { |
|
@@ 1188-1196 (lines=9) @@ | ||
1185 | $named_args['base_api_path'] |
|
1186 | ); |
|
1187 | ||
1188 | if ( is_wp_error( $response ) ) { |
|
1189 | WP_CLI::error( sprintf( |
|
1190 | /* translators: %1$s is an endpoint route (ex. /sites/123456), %2$d is an error code, %3$s is an error message. */ |
|
1191 | __( 'Request to %1$s returned an error: (%2$d) %3$s.', 'jetpack' ), |
|
1192 | $resource_url, |
|
1193 | $response->get_error_code(), |
|
1194 | $response->get_error_message() |
|
1195 | ) ); |
|
1196 | } |
|
1197 | ||
1198 | if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { |
|
1199 | WP_CLI::error( sprintf( |