|
@@ 1339-1346 (lines=8) @@
|
| 1336 |
|
public static function get_site_data() { |
| 1337 |
|
$site_data = self::site_data(); |
| 1338 |
|
|
| 1339 |
|
if ( ! is_wp_error( $site_data ) ) { |
| 1340 |
|
return rest_ensure_response( array( |
| 1341 |
|
'code' => 'success', |
| 1342 |
|
'message' => esc_html__( 'Site data correctly received.', 'jetpack' ), |
| 1343 |
|
'data' => json_encode( $site_data ), |
| 1344 |
|
) |
| 1345 |
|
); |
| 1346 |
|
} |
| 1347 |
|
if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) { |
| 1348 |
|
return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
| 1349 |
|
} |
|
@@ 1043-1050 (lines=8) @@
|
| 1040 |
|
public static function get_rewind_data() { |
| 1041 |
|
$rewind_data = self::rewind_data(); |
| 1042 |
|
|
| 1043 |
|
if ( ! is_wp_error( $rewind_data ) ) { |
| 1044 |
|
return rest_ensure_response( array( |
| 1045 |
|
'code' => 'success', |
| 1046 |
|
'message' => esc_html__( 'Backup & Scan data correctly received.', 'jetpack' ), |
| 1047 |
|
'data' => wp_json_encode( $rewind_data ), |
| 1048 |
|
) |
| 1049 |
|
); |
| 1050 |
|
} |
| 1051 |
|
|
| 1052 |
|
if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) { |
| 1053 |
|
return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |