Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 1071-1078 (lines=8) @@
1068
	public static function get_rewind_data() {
1069
		$rewind_data = self::rewind_data();
1070
1071
		if ( ! is_wp_error( $rewind_data ) ) {
1072
			return rest_ensure_response( array(
1073
					'code' => 'success',
1074
					'message' => esc_html__( 'Backup & Scan data correctly received.', 'jetpack' ),
1075
					'data' => wp_json_encode( $rewind_data ),
1076
				)
1077
			);
1078
		}
1079
1080
		if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) {
1081
			return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
@@ 1367-1374 (lines=8) @@
1364
	public static function get_site_data() {
1365
		$site_data = self::site_data();
1366
1367
		if ( ! is_wp_error( $site_data ) ) {
1368
			return rest_ensure_response( array(
1369
					'code' => 'success',
1370
					'message' => esc_html__( 'Site data correctly received.', 'jetpack' ),
1371
					'data' => json_encode( $site_data ),
1372
				)
1373
			);
1374
		}
1375
		if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) {
1376
			return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
1377
		}