Code Duplication    Length = 8-8 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 753-760 (lines=8) @@
750
	public static function get_rewind_data() {
751
		$rewind_data = self::rewind_data();
752
753
		if ( ! is_wp_error( $rewind_data ) ) {
754
			return rest_ensure_response( array(
755
					'code' => 'success',
756
					'message' => esc_html__( 'Rewind data correctly received.', 'jetpack' ),
757
					'data' => wp_json_encode( $rewind_data ),
758
				)
759
			);
760
		}
761
762
		if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) {
763
			return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
@@ 1052-1059 (lines=8) @@
1049
	public static function get_site_data() {
1050
		$site_data = self::site_data();
1051
1052
		if ( ! is_wp_error( $site_data ) ) {
1053
			return rest_ensure_response( array(
1054
					'code' => 'success',
1055
					'message' => esc_html__( 'Site data correctly received.', 'jetpack' ),
1056
					'data' => json_encode( $site_data ),
1057
				)
1058
			);
1059
		}
1060
		if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) {
1061
			return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
1062
		}