Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1106-1113 (lines=8) @@
1103
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1104
				$entity
1105
			);
1106
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1107
			return new \WP_Error(
1108
				'jetpack_id',
1109
				/* translators: %s is an error message string */
1110
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1111
				$entity
1112
			);
1113
		}
1114
1115
		return $registration_response;
1116
	}
@@ 1821-1833 (lines=13) @@
1818
		}
1819
1820
		// No .test or .local domains.
1821
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1822
			return new \WP_Error(
1823
				'fail_domain_tld',
1824
				sprintf(
1825
					/* translators: %1$s is a domain name. */
1826
					__(
1827
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1828
						'jetpack'
1829
					),
1830
					$domain
1831
				)
1832
			);
1833
		}
1834
1835
		// No WPCOM subdomains.
1836
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1836-1848 (lines=13) @@
1833
		}
1834
1835
		// No WPCOM subdomains.
1836
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1837
			return new \WP_Error(
1838
				'fail_subdomain_wpcom',
1839
				sprintf(
1840
					/* translators: %1$s is a domain name. */
1841
					__(
1842
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1843
						'jetpack'
1844
					),
1845
					$domain
1846
				)
1847
			);
1848
		}
1849
1850
		// If PHP was compiled without support for the Filter module (very edge case).
1851
		if ( ! function_exists( 'filter_var' ) ) {