|
@@ 1149-1156 (lines=8) @@
|
| 1146 |
|
public static function get_rewind_data() { |
| 1147 |
|
$rewind_data = self::rewind_data(); |
| 1148 |
|
|
| 1149 |
|
if ( ! is_wp_error( $rewind_data ) ) { |
| 1150 |
|
return rest_ensure_response( array( |
| 1151 |
|
'code' => 'success', |
| 1152 |
|
'message' => esc_html__( 'Backup & Scan data correctly received.', 'jetpack' ), |
| 1153 |
|
'data' => wp_json_encode( $rewind_data ), |
| 1154 |
|
) |
| 1155 |
|
); |
| 1156 |
|
} |
| 1157 |
|
|
| 1158 |
|
if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) { |
| 1159 |
|
return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
|
@@ 1478-1485 (lines=8) @@
|
| 1475 |
|
public static function get_site_data() { |
| 1476 |
|
$site_data = self::site_data(); |
| 1477 |
|
|
| 1478 |
|
if ( ! is_wp_error( $site_data ) ) { |
| 1479 |
|
return rest_ensure_response( array( |
| 1480 |
|
'code' => 'success', |
| 1481 |
|
'message' => esc_html__( 'Site data correctly received.', 'jetpack' ), |
| 1482 |
|
'data' => json_encode( $site_data ), |
| 1483 |
|
) |
| 1484 |
|
); |
| 1485 |
|
} |
| 1486 |
|
if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) { |
| 1487 |
|
return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
| 1488 |
|
} |