Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 968-975 (lines=8) @@
965
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
966
				$entity
967
			);
968
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
969
			return new \WP_Error(
970
				'jetpack_id',
971
				/* translators: %s is an error message string */
972
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
973
				$entity
974
			);
975
		}
976
977
		return $registration_response;
978
	}
@@ 1864-1876 (lines=13) @@
1861
		}
1862
1863
		// No .test or .local domains.
1864
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1865
			return new \WP_Error(
1866
				'fail_domain_tld',
1867
				sprintf(
1868
					/* translators: %1$s is a domain name. */
1869
					__(
1870
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1871
						'jetpack'
1872
					),
1873
					$domain
1874
				)
1875
			);
1876
		}
1877
1878
		// No WPCOM subdomains.
1879
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1879-1891 (lines=13) @@
1876
		}
1877
1878
		// No WPCOM subdomains.
1879
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1880
			return new \WP_Error(
1881
				'fail_subdomain_wpcom',
1882
				sprintf(
1883
					/* translators: %1$s is a domain name. */
1884
					__(
1885
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1886
						'jetpack'
1887
					),
1888
					$domain
1889
				)
1890
			);
1891
		}
1892
1893
		// If PHP was compiled without support for the Filter module (very edge case).
1894
		if ( ! function_exists( 'filter_var' ) ) {