Code Duplication    Length = 8-13 lines in 3 locations

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

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