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 /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/class.jetpack-gutenberg.php:1420
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/class.jetpack.php(632): require_once()
#1 /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/class.jetpack.php(425): Jetpack->__construct()
#2 /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/load-jetpack.php(74): Jetpack::init()
#3 /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/jetpack.php(217): require_once('/var/www/html/d...')
#4 /var/www/html/dportilho.com.br/web/wp-settings.php(526): include_once('/var/www/html/d...')
#5 /var/www/html/dportilho.com.br/web/wp-config.php(126): require_once('/var/www/html/d...')
#6 /var/www/html/dportilho.com.br/web/wp-load.php(50): require_once('/var/www/html/d...')
#7 /var/www/html/dportilho.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/d...')
#8 /var/www/html/dportilho.com.br/we in /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/class.jetpack-gutenberg.php on line 1420