Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 966-973 (lines=8) @@
963
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
964
				$entity
965
			);
966
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
967
			return new \WP_Error(
968
				'jetpack_id',
969
				/* translators: %s is an error message string */
970
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
971
				$entity
972
			);
973
		}
974
975
		return $registration_response;
976
	}
@@ 1873-1885 (lines=13) @@
1870
		}
1871
1872
		// No .test or .local domains.
1873
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1874
			return new \WP_Error(
1875
				'fail_domain_tld',
1876
				sprintf(
1877
					/* translators: %1$s is a domain name. */
1878
					__(
1879
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1880
						'jetpack'
1881
					),
1882
					$domain
1883
				)
1884
			);
1885
		}
1886
1887
		// No WPCOM subdomains.
1888
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1888-1900 (lines=13) @@
1885
		}
1886
1887
		// No WPCOM subdomains.
1888
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1889
			return new \WP_Error(
1890
				'fail_subdomain_wpcom',
1891
				sprintf(
1892
					/* translators: %1$s is a domain name. */
1893
					__(
1894
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1895
						'jetpack'
1896
					),
1897
					$domain
1898
				)
1899
			);
1900
		}
1901
1902
		// If PHP was compiled without support for the Filter module (very edge case).
1903
		if ( ! function_exists( 'filter_var' ) ) {