Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 1194-1206 (lines=13) @@
1191
		}
1192
1193
		// No .test or .local domains.
1194
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1195
			return new \WP_Error(
1196
				'fail_domain_tld',
1197
				sprintf(
1198
					/* translators: %1$s is a domain name. */
1199
					__(
1200
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1201
						'jetpack'
1202
					),
1203
					$domain
1204
				)
1205
			);
1206
		}
1207
1208
		// No WPCOM subdomains.
1209
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1209-1221 (lines=13) @@
1206
		}
1207
1208
		// No WPCOM subdomains.
1209
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1210
			return new \WP_Error(
1211
				'fail_subdomain_wpcom',
1212
				sprintf(
1213
					/* translators: %1$s is a domain name. */
1214
					__(
1215
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1216
						'jetpack'
1217
					),
1218
					$domain
1219
				)
1220
			);
1221
		}
1222
1223
		// If PHP was compiled without support for the Filter module (very edge case).
1224
		if ( ! function_exists( 'filter_var' ) ) {