Code Duplication    Length = 5-16 lines in 2 locations

_inc/lib/debugger/class-jetpack-cxn-tests.php 1 location

@@ 283-287 (lines=5) @@
280
		);
281
		remove_filter( 'http_request_timeout', array( 'Jetpack_Cxn_Tests', 'increase_timeout' ) );
282
283
		if ( is_wp_error( $response ) ) {
284
			/* translators: %1$s is the error code, %2$s is the error message */
285
			$message = sprintf( __( 'Connection test failed (#%1$s: %2$s)', 'jetpack' ), $response->get_error_code(), $response->get_error_message() );
286
			return self::failing_test( $name, $message );
287
		}
288
289
		$body = wp_remote_retrieve_body( $response );
290
		if ( ! $body ) {

class.jetpack.php 1 location

@@ 4130-4145 (lines=16) @@
4127
					self::log( 'register' );
4128
					self::maybe_set_version_option();
4129
					$registered = self::try_registration();
4130
					if ( is_wp_error( $registered ) ) {
4131
						$error = $registered->get_error_code();
4132
						self::state( 'error', $error );
4133
						self::state( 'error', $registered->get_error_message() );
4134
4135
						/**
4136
						 * Jetpack registration Error.
4137
						 *
4138
						 * @since 7.5.0
4139
						 *
4140
						 * @param string|int $error The error code.
4141
						 * @param \WP_Error $registered The error object.
4142
						 */
4143
						do_action( 'jetpack_connection_register_fail', $error, $registered );
4144
						break;
4145
					}
4146
4147
					$from     = isset( $_GET['from'] ) ? $_GET['from'] : false;
4148
					$redirect = isset( $_GET['redirect'] ) ? $_GET['redirect'] : false;