class.jetpack-plan.php 1 location
|
@@ 35-37 (lines=3) @@
|
| 32 |
|
*/ |
| 33 |
|
public static function update_from_sites_response( $response ) { |
| 34 |
|
// Bail if there was an error or malformed response. |
| 35 |
|
if ( is_wp_error( $response ) || ! is_array( $response ) || ! isset( $response['body'] ) ) { |
| 36 |
|
return false; |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
$body = wp_remote_retrieve_body( $response ); |
| 40 |
|
if ( is_wp_error( $body ) ) { |
packages/abtest/src/Abtest.php 1 location
|
@@ 73-75 (lines=3) @@
|
| 70 |
|
$response = $this->request_variation( $test_name ); |
| 71 |
|
|
| 72 |
|
// Bail if there was an error or malformed response. |
| 73 |
|
if ( is_wp_error( $response ) || ! is_array( $response ) || ! isset( $response['body'] ) ) { |
| 74 |
|
return new Error( 'failed_to_fetch_data', 'Unable to fetch the requested data.' ); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
// Decode the results. |
| 78 |
|
$results = json_decode( $response['body'], true ); |