Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 753-765 (lines=13) @@
750
		}
751
752
		// No .test or .local domains.
753
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
754
			return new \WP_Error(
755
				'fail_domain_tld',
756
				sprintf(
757
					/* translators: %1$s is a domain name. */
758
					__(
759
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
760
						'jetpack'
761
					),
762
					$domain
763
				)
764
			);
765
		}
766
767
		// No WPCOM subdomains.
768
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 768-780 (lines=13) @@
765
		}
766
767
		// No WPCOM subdomains.
768
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
769
			return new \WP_Error(
770
				'fail_subdomain_wpcom',
771
				sprintf(
772
					/* translators: %1$s is a domain name. */
773
					__(
774
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
775
						'jetpack'
776
					),
777
					$domain
778
				)
779
			);
780
		}
781
782
		// If PHP was compiled without support for the Filter module (very edge case).
783
		if ( ! function_exists( 'filter_var' ) ) {