Code Duplication    Length = 8-8 lines in 2 locations

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

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