Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 966-973 (lines=8) @@
963
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
964
				$entity
965
			);
966
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
967
			return new \WP_Error(
968
				'jetpack_id',
969
				/* translators: %s is an error message string */
970
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
971
				$entity
972
			);
973
		}
974
975
		return $registration_response;
976
	}
@@ 1688-1700 (lines=13) @@
1685
		}
1686
1687
		// No .test or .local domains.
1688
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1689
			return new \WP_Error(
1690
				'fail_domain_tld',
1691
				sprintf(
1692
					/* translators: %1$s is a domain name. */
1693
					__(
1694
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1695
						'jetpack'
1696
					),
1697
					$domain
1698
				)
1699
			);
1700
		}
1701
1702
		// No WPCOM subdomains.
1703
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1703-1715 (lines=13) @@
1700
		}
1701
1702
		// No WPCOM subdomains.
1703
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1704
			return new \WP_Error(
1705
				'fail_subdomain_wpcom',
1706
				sprintf(
1707
					/* translators: %1$s is a domain name. */
1708
					__(
1709
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1710
						'jetpack'
1711
					),
1712
					$domain
1713
				)
1714
			);
1715
		}
1716
1717
		// If PHP was compiled without support for the Filter module (very edge case).
1718
		if ( ! function_exists( 'filter_var' ) ) {