Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1281-1288 (lines=8) @@
1278
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1279
				$entity
1280
			);
1281
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1282
			return new \WP_Error(
1283
				'jetpack_id',
1284
				/* translators: %s is an error message string */
1285
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1286
				$entity
1287
			);
1288
		}
1289
1290
		return $registration_response;
1291
	}
@@ 1997-2009 (lines=13) @@
1994
		}
1995
1996
		// No .test or .local domains.
1997
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1998
			return new \WP_Error(
1999
				'fail_domain_tld',
2000
				sprintf(
2001
					/* translators: %1$s is a domain name. */
2002
					__(
2003
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
2004
						'jetpack'
2005
					),
2006
					$domain
2007
				)
2008
			);
2009
		}
2010
2011
		// No WPCOM subdomains.
2012
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 2012-2024 (lines=13) @@
2009
		}
2010
2011
		// No WPCOM subdomains.
2012
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
2013
			return new \WP_Error(
2014
				'fail_subdomain_wpcom',
2015
				sprintf(
2016
					/* translators: %1$s is a domain name. */
2017
					__(
2018
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
2019
						'jetpack'
2020
					),
2021
					$domain
2022
				)
2023
			);
2024
		}
2025
2026
		// If PHP was compiled without support for the Filter module (very edge case).
2027
		if ( ! function_exists( 'filter_var' ) ) {