|
@@ 684-691 (lines=8) @@
|
| 681 |
|
public static function get_rewind_data() { |
| 682 |
|
$rewind_data = self::rewind_data(); |
| 683 |
|
|
| 684 |
|
if ( ! is_wp_error( $rewind_data ) ) { |
| 685 |
|
return rest_ensure_response( array( |
| 686 |
|
'code' => 'success', |
| 687 |
|
'message' => esc_html__( 'Rewind data correctly received.', 'jetpack' ), |
| 688 |
|
'data' => wp_json_encode( $rewind_data ), |
| 689 |
|
) |
| 690 |
|
); |
| 691 |
|
} |
| 692 |
|
|
| 693 |
|
if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) { |
| 694 |
|
return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
|
@@ 902-909 (lines=8) @@
|
| 899 |
|
public static function get_site_data() { |
| 900 |
|
$site_data = self::site_data(); |
| 901 |
|
|
| 902 |
|
if ( ! is_wp_error( $site_data ) ) { |
| 903 |
|
return rest_ensure_response( array( |
| 904 |
|
'code' => 'success', |
| 905 |
|
'message' => esc_html__( 'Site data correctly received.', 'jetpack' ), |
| 906 |
|
'data' => json_encode( $site_data ), |
| 907 |
|
) |
| 908 |
|
); |
| 909 |
|
} |
| 910 |
|
if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) { |
| 911 |
|
return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) ); |
| 912 |
|
} |