a DNS entry, will return a hosting provider if one can be determined. Otherwise, will return 'unknown'. * Sourced from: fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Syvo%2Subfgvat%2Qcebivqre%2Sanzrfreiref.cuc-og * * @param string $domain The domain of the site to check. * @return string The hosting provider of 'unknown'. */ public function get_hosting_provider_by_nameserver( $domain ) { $known_nameservers = array( 'bluehost' => array( '.bluehost.com', ), 'dreamhost' => array( '.dreamhost.com', ), 'mediatemple' => array( '.mediatemple.net', ), 'xserver' => array( '.xserver.jp', ), 'namecheap' => array( '.namecheaphosting.com', ), 'hostmonster' => array( '.hostmonster.com', ), 'justhost' => array( '.justhost.com', ), 'digitalocean' => array( '.digitalocean.com', ), 'one' => array( '.one.com', ), 'hostpapa' => array( '.hostpapa.com', ), 'siteground' => array( '.sgcloud.net', '.sgedu.site', '.sgsrv1.com', '.sgvps.net', '.siteground.biz', '.siteground.net', '.siteground.eu', ), 'inmotion' => array( '.inmotionhosting.com', ), 'ionos' => array( '.ui-dns.org', '.ui-dns.de', '.ui-dns.biz', '.ui-dns.com', ), ); $dns_records = $this->get_nameserver_dns_records( $domain ); $dns_records = array_map( 'strtolower', $dns_records ); foreach ( $known_nameservers as $host => $ns_patterns ) { foreach ( $ns_patterns as $ns_pattern ) { foreach ( $dns_records as $record ) { if ( false !== strpos( $record, $ns_pattern ) ) { return $host; } } } } return 'unknown'; } /** * Returns a guess of the hosting provider for the current site based on various checks. * * @return string */ public function get_known_host_guess() { $host = Cache::get( 'host_guess' ); if ( null !== $host ) { return $host; } // First, let's check if we can recognize provider manually: switch ( true ) { case $this->is_woa_site(): $provider = 'woa'; break; case $this->is_atomic_platform(): $provider = 'atomic'; break; case $this->is_newspack_site(): $provider = 'newspack'; break; case $this->is_vip_site(): $provider = 'vip'; break; case $this->is_wpcom_simple(): case $this->is_wpcom_platform(): $provider = 'wpcom'; break; default: $provider = 'unknown'; break; } // Second, let's check if we can recognize provider by nameservers: $domain = isset( $_SERVER['SERVER_NAME'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : ''; if ( $provider === 'unknown' && ! empty( $domain ) ) { $provider = $this->get_hosting_provider_by_nameserver( $domain ); } Cache::set( 'host_guess', $provider ); return $provider; } /** * Add public-api.wordpress.com to the safe redirect allowed list - only added when someone allows API access. * * @since 3.0.2 Ported from Jetpack to the Status package. * * To be used with a filter of allowed domains for a redirect. * * @param array $domains Allowed WP.com Environments. * * @return array */ public static function allow_wpcom_public_api_domain( $domains ) { $domains[] = 'public-api.wordpress.com'; return $domains; } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Status\Host" not found in /htdocs/wp-content/plugins/jetpack/class.jetpack-gutenberg.php:1281 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/class.jetpack.php(711): require_once() #1 /htdocs/wp-content/plugins/jetpack/class.jetpack.php(499): Jetpack->__construct() #2 /htdocs/wp-content/plugins/jetpack/load-jetpack.php(74): Jetpack::init() #3 /htdocs/wp-content/plugins/jetpack/jetpack.php(219): require_once('/htdocs/wp-cont...') #4 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #5 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/jetpack/class.jetpack-gutenberg.php on line 1281