Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1009-1016 (lines=8) @@
1006
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1007
				$entity
1008
			);
1009
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1010
			return new \WP_Error(
1011
				'jetpack_id',
1012
				/* translators: %s is an error message string */
1013
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1014
				$entity
1015
			);
1016
		}
1017
1018
		return $registration_response;
1019
	}
@@ 1932-1944 (lines=13) @@
1929
		}
1930
1931
		// No .test or .local domains.
1932
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1933
			return new \WP_Error(
1934
				'fail_domain_tld',
1935
				sprintf(
1936
					/* translators: %1$s is a domain name. */
1937
					__(
1938
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1939
						'jetpack'
1940
					),
1941
					$domain
1942
				)
1943
			);
1944
		}
1945
1946
		// No WPCOM subdomains.
1947
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1947-1959 (lines=13) @@
1944
		}
1945
1946
		// No WPCOM subdomains.
1947
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1948
			return new \WP_Error(
1949
				'fail_subdomain_wpcom',
1950
				sprintf(
1951
					/* translators: %1$s is a domain name. */
1952
					__(
1953
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1954
						'jetpack'
1955
					),
1956
					$domain
1957
				)
1958
			);
1959
		}
1960
1961
		// If PHP was compiled without support for the Filter module (very edge case).
1962
		if ( ! function_exists( 'filter_var' ) ) {