Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 336-348 (lines=13) @@
333
		}
334
335
		// No .test or .local domains.
336
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
337
			return new \WP_Error(
338
				'fail_domain_tld',
339
				sprintf(
340
					/* translators: %1$s is a domain name. */
341
					__(
342
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
343
						'jetpack'
344
					),
345
					$domain
346
				)
347
			);
348
		}
349
350
		// No WPCOM subdomains.
351
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 351-363 (lines=13) @@
348
		}
349
350
		// No WPCOM subdomains.
351
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
352
			return new \WP_Error(
353
				'fail_subdomain_wpcom',
354
				sprintf(
355
					/* translators: %1$s is a domain name. */
356
					__(
357
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
358
						'jetpack'
359
					),
360
					$domain
361
				)
362
			);
363
		}
364
365
		// If PHP was compiled without support for the Filter module (very edge case).
366
		if ( ! function_exists( 'filter_var' ) ) {