Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1137-1144 (lines=8) @@
1134
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1135
				$entity
1136
			);
1137
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1138
			return new \WP_Error(
1139
				'jetpack_id',
1140
				/* translators: %s is an error message string */
1141
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1142
				$entity
1143
			);
1144
		}
1145
1146
		return $registration_response;
1147
	}
@@ 1853-1865 (lines=13) @@
1850
		}
1851
1852
		// No .test or .local domains.
1853
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1854
			return new \WP_Error(
1855
				'fail_domain_tld',
1856
				sprintf(
1857
					/* translators: %1$s is a domain name. */
1858
					__(
1859
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1860
						'jetpack'
1861
					),
1862
					$domain
1863
				)
1864
			);
1865
		}
1866
1867
		// No WPCOM subdomains.
1868
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1868-1880 (lines=13) @@
1865
		}
1866
1867
		// No WPCOM subdomains.
1868
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1869
			return new \WP_Error(
1870
				'fail_subdomain_wpcom',
1871
				sprintf(
1872
					/* translators: %1$s is a domain name. */
1873
					__(
1874
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1875
						'jetpack'
1876
					),
1877
					$domain
1878
				)
1879
			);
1880
		}
1881
1882
		// If PHP was compiled without support for the Filter module (very edge case).
1883
		if ( ! function_exists( 'filter_var' ) ) {