Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 494-506 (lines=13) @@
491
		}
492
493
		// No .test or .local domains.
494
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
495
			return new \WP_Error(
496
				'fail_domain_tld',
497
				sprintf(
498
					/* translators: %1$s is a domain name. */
499
					__(
500
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
501
						'jetpack'
502
					),
503
					$domain
504
				)
505
			);
506
		}
507
508
		// No WPCOM subdomains.
509
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 509-521 (lines=13) @@
506
		}
507
508
		// No WPCOM subdomains.
509
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
510
			return new \WP_Error(
511
				'fail_subdomain_wpcom',
512
				sprintf(
513
					/* translators: %1$s is a domain name. */
514
					__(
515
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
516
						'jetpack'
517
					),
518
					$domain
519
				)
520
			);
521
		}
522
523
		// If PHP was compiled without support for the Filter module (very edge case).
524
		if ( ! function_exists( 'filter_var' ) ) {