Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 1862-1874 (lines=13) @@
1859
		}
1860
1861
		// No .test or .local domains.
1862
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1863
			return new \WP_Error(
1864
				'fail_domain_tld',
1865
				sprintf(
1866
					/* translators: %1$s is a domain name. */
1867
					__(
1868
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1869
						'jetpack'
1870
					),
1871
					$domain
1872
				)
1873
			);
1874
		}
1875
1876
		// No WPCOM subdomains.
1877
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1877-1889 (lines=13) @@
1874
		}
1875
1876
		// No WPCOM subdomains.
1877
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1878
			return new \WP_Error(
1879
				'fail_subdomain_wpcom',
1880
				sprintf(
1881
					/* translators: %1$s is a domain name. */
1882
					__(
1883
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1884
						'jetpack'
1885
					),
1886
					$domain
1887
				)
1888
			);
1889
		}
1890
1891
		// If PHP was compiled without support for the Filter module (very edge case).
1892
		if ( ! function_exists( 'filter_var' ) ) {