|
@@ 1159-1166 (lines=8) @@
|
| 1156 |
|
public static function get_rewind_data() { |
| 1157 |
|
$rewind_data = self::rewind_data(); |
| 1158 |
|
|
| 1159 |
|
if ( ! is_wp_error( $rewind_data ) ) { |
| 1160 |
|
return rest_ensure_response( array( |
| 1161 |
|
'code' => 'success', |
| 1162 |
|
'message' => esc_html__( 'Backup & Scan data correctly received.', 'jetpack' ), |
| 1163 |
|
'data' => wp_json_encode( $rewind_data ), |
| 1164 |
|
) |
| 1165 |
|
); |
| 1166 |
|
} |
| 1167 |
|
|
| 1168 |
|
if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) { |
| 1169 |
|
return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
|
@@ 1488-1495 (lines=8) @@
|
| 1485 |
|
public static function get_site_data() { |
| 1486 |
|
$site_data = self::site_data(); |
| 1487 |
|
|
| 1488 |
|
if ( ! is_wp_error( $site_data ) ) { |
| 1489 |
|
return rest_ensure_response( array( |
| 1490 |
|
'code' => 'success', |
| 1491 |
|
'message' => esc_html__( 'Site data correctly received.', 'jetpack' ), |
| 1492 |
|
'data' => json_encode( $site_data ), |
| 1493 |
|
) |
| 1494 |
|
); |
| 1495 |
|
} |
| 1496 |
|
if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) { |
| 1497 |
|
return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
| 1498 |
|
} |