Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1013-1020 (lines=8) @@
1010
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1011
				$entity
1012
			);
1013
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1014
			return new \WP_Error(
1015
				'jetpack_id',
1016
				/* translators: %s is an error message string */
1017
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1018
				$entity
1019
			);
1020
		}
1021
1022
		return $registration_response;
1023
	}
@@ 2006-2018 (lines=13) @@
2003
		}
2004
2005
		// No .test or .local domains.
2006
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
2007
			return new \WP_Error(
2008
				'fail_domain_tld',
2009
				sprintf(
2010
					/* translators: %1$s is a domain name. */
2011
					__(
2012
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
2013
						'jetpack'
2014
					),
2015
					$domain
2016
				)
2017
			);
2018
		}
2019
2020
		// No WPCOM subdomains.
2021
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 2021-2033 (lines=13) @@
2018
		}
2019
2020
		// No WPCOM subdomains.
2021
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
2022
			return new \WP_Error(
2023
				'fail_subdomain_wpcom',
2024
				sprintf(
2025
					/* translators: %1$s is a domain name. */
2026
					__(
2027
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
2028
						'jetpack'
2029
					),
2030
					$domain
2031
				)
2032
			);
2033
		}
2034
2035
		// If PHP was compiled without support for the Filter module (very edge case).
2036
		if ( ! function_exists( 'filter_var' ) ) {