Code Duplication    Length = 8-13 lines in 3 locations

packages/connection/src/class-manager.php 3 locations

@@ 1017-1024 (lines=8) @@
1014
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1015
				$entity
1016
			);
1017
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1018
			return new \WP_Error(
1019
				'jetpack_id',
1020
				/* translators: %s is an error message string */
1021
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1022
				$entity
1023
			);
1024
		}
1025
1026
		return $registration_response;
1027
	}
@@ 2053-2065 (lines=13) @@
2050
		}
2051
2052
		// No .test or .local domains.
2053
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
2054
			return new \WP_Error(
2055
				'fail_domain_tld',
2056
				sprintf(
2057
					/* translators: %1$s is a domain name. */
2058
					__(
2059
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
2060
						'jetpack'
2061
					),
2062
					$domain
2063
				)
2064
			);
2065
		}
2066
2067
		// No WPCOM subdomains.
2068
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 2068-2080 (lines=13) @@
2065
		}
2066
2067
		// No WPCOM subdomains.
2068
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
2069
			return new \WP_Error(
2070
				'fail_subdomain_wpcom',
2071
				sprintf(
2072
					/* translators: %1$s is a domain name. */
2073
					__(
2074
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
2075
						'jetpack'
2076
					),
2077
					$domain
2078
				)
2079
			);
2080
		}
2081
2082
		// If PHP was compiled without support for the Filter module (very edge case).
2083
		if ( ! function_exists( 'filter_var' ) ) {