Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 1387-1394 (lines=8) @@
1384
	public static function get_site_data() {
1385
		$site_data = self::site_data();
1386
1387
		if ( ! is_wp_error( $site_data ) ) {
1388
			return rest_ensure_response( array(
1389
					'code' => 'success',
1390
					'message' => esc_html__( 'Site data correctly received.', 'jetpack' ),
1391
					'data' => json_encode( $site_data ),
1392
				)
1393
			);
1394
		}
1395
		if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) {
1396
			return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
1397
		}
@@ 1065-1072 (lines=8) @@
1062
	public static function get_rewind_data() {
1063
		$rewind_data = self::rewind_data();
1064
1065
		if ( ! is_wp_error( $rewind_data ) ) {
1066
			return rest_ensure_response( array(
1067
					'code' => 'success',
1068
					'message' => esc_html__( 'Backup & Scan data correctly received.', 'jetpack' ),
1069
					'data' => wp_json_encode( $rewind_data ),
1070
				)
1071
			);
1072
		}
1073
1074
		if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) {
1075
			return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );