updated plugin Jetpack Protect
version 4.0.0
This commit is contained in:
@ -147,6 +147,10 @@ class Host {
|
||||
}
|
||||
|
||||
$dns_records = dns_get_record( $domain, DNS_NS ); // Fetches the DNS records of type NS (Name Server)
|
||||
if ( false === $dns_records ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$nameservers = array();
|
||||
foreach ( $dns_records as $record ) {
|
||||
if ( isset( $record['target'] ) ) {
|
||||
@ -235,9 +239,13 @@ class Host {
|
||||
/**
|
||||
* Returns a guess of the hosting provider for the current site based on various checks.
|
||||
*
|
||||
* @since 5.0.4 Added $guess parameter.
|
||||
*
|
||||
* @param bool $guess Whether to guess the hosting provider.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_known_host_guess() {
|
||||
public function get_known_host_guess( $guess = true ) {
|
||||
$host = Cache::get( 'host_guess' );
|
||||
|
||||
if ( null !== $host ) {
|
||||
@ -267,9 +275,10 @@ class Host {
|
||||
break;
|
||||
}
|
||||
|
||||
// Second, let's check if we can recognize provider by nameservers:
|
||||
// Second, let's check if we can recognize provider by nameservers.
|
||||
// Only do this if we're asked to guess.
|
||||
$domain = isset( $_SERVER['SERVER_NAME'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : '';
|
||||
if ( $provider === 'unknown' && ! empty( $domain ) ) {
|
||||
if ( $provider === 'unknown' && ! empty( $domain ) && $guess ) {
|
||||
$provider = $this->get_hosting_provider_by_nameserver( $domain );
|
||||
}
|
||||
|
||||
|
@ -444,7 +444,7 @@ class Modules {
|
||||
if ( $deactivated ) {
|
||||
$state->state( 'deactivated_plugins', implode( ',', $deactivated ) );
|
||||
wp_safe_redirect( add_query_arg( 'jetpack_restate', 1 ) );
|
||||
exit;
|
||||
exit( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -485,7 +485,7 @@ class Modules {
|
||||
wp_safe_redirect( ( new Paths() )->admin_url( 'page=jetpack' ) );
|
||||
}
|
||||
if ( $exit ) {
|
||||
exit;
|
||||
exit( 0 );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -45,8 +45,7 @@ class Status {
|
||||
/**
|
||||
* Filters Jetpack's offline mode.
|
||||
*
|
||||
* @see https://jetpack.com/support/development-mode/
|
||||
* @todo Update documentation ^^.
|
||||
* @see https://jetpack.com/support/offline-mode/
|
||||
*
|
||||
* @since 1.3.0
|
||||
*
|
||||
|
Reference in New Issue
Block a user