Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 1099-1106 (lines=8) @@
1096
	public static function get_rewind_data() {
1097
		$rewind_data = self::rewind_data();
1098
1099
		if ( ! is_wp_error( $rewind_data ) ) {
1100
			return rest_ensure_response( array(
1101
					'code' => 'success',
1102
					'message' => esc_html__( 'Backup & Scan data correctly received.', 'jetpack' ),
1103
					'data' => wp_json_encode( $rewind_data ),
1104
				)
1105
			);
1106
		}
1107
1108
		if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) {
1109
			return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
@@ 1428-1435 (lines=8) @@
1425
	public static function get_site_data() {
1426
		$site_data = self::site_data();
1427
1428
		if ( ! is_wp_error( $site_data ) ) {
1429
			return rest_ensure_response( array(
1430
					'code' => 'success',
1431
					'message' => esc_html__( 'Site data correctly received.', 'jetpack' ),
1432
					'data' => json_encode( $site_data ),
1433
				)
1434
			);
1435
		}
1436
		if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) {
1437
			return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
1438
		}