Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 473-485 (lines=13) @@
470
		}
471
472
		// No .test or .local domains.
473
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
474
			return new \WP_Error(
475
				'fail_domain_tld',
476
				sprintf(
477
					/* translators: %1$s is a domain name. */
478
					__(
479
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
480
						'jetpack'
481
					),
482
					$domain
483
				)
484
			);
485
		}
486
487
		// No WPCOM subdomains.
488
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 488-500 (lines=13) @@
485
		}
486
487
		// No WPCOM subdomains.
488
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
489
			return new \WP_Error(
490
				'fail_subdomain_wpcom',
491
				sprintf(
492
					/* translators: %1$s is a domain name. */
493
					__(
494
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
495
						'jetpack'
496
					),
497
					$domain
498
				)
499
			);
500
		}
501
502
		// If PHP was compiled without support for the Filter module (very edge case).
503
		if ( ! function_exists( 'filter_var' ) ) {