updated plugin Jetpack Protect version 4.0.0

This commit is contained in:
2025-04-29 21:19:56 +00:00
committed by Gitium
parent eb9181b250
commit ebd40ef928
265 changed files with 11864 additions and 3987 deletions

View File

@ -5,6 +5,58 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [5.0.10] - 2025-03-21
### Changed
- Internal updates.
## [5.0.9] - 2025-03-18
### Changed
- Internal updates.
## [5.0.8] - 2025-03-17
### Changed
- Internal updates.
## [5.0.7] - 2025-03-12
### Changed
- Internal updates.
## [5.0.6] - 2025-03-05
### Changed
- Internal updates.
## [5.0.5] - 2025-03-03
### Fixed
- Hosting provider checks: Avoid PHP warnings in local environments. [#41994]
## [5.0.4] - 2025-02-24
### Changed
- Host detection: Look for specific external hosting provider only when required. [#41890]
## [5.0.3] - 2025-02-03
### Fixed
- Code: Remove extra params on function calls. [#41263]
## [5.0.2] - 2025-01-20
### Changed
- Code: Use function-style exit() and die() with a default status code of 0. [#41167]
## [5.0.1] - 2024-11-25
### Changed
- Updated package dependencies. [#40258]
## [5.0.0] - 2024-11-14
### Removed
- General: Update minimum PHP version to 7.2. [#40147]
## [4.0.3] - 2024-11-04
### Added
- Enable test coverage. [#39961]
## [4.0.2] - 2024-09-23
### Changed
- Update dependencies.
## [4.0.1] - 2024-09-06
### Removed
- Removed usage of _deprecated_function when deprecating Status::is_onboarding [#39272]
@ -397,6 +449,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Packages: Introduce a status package
[5.0.10]: https://github.com/Automattic/jetpack-status/compare/v5.0.9...v5.0.10
[5.0.9]: https://github.com/Automattic/jetpack-status/compare/v5.0.8...v5.0.9
[5.0.8]: https://github.com/Automattic/jetpack-status/compare/v5.0.7...v5.0.8
[5.0.7]: https://github.com/Automattic/jetpack-status/compare/v5.0.6...v5.0.7
[5.0.6]: https://github.com/Automattic/jetpack-status/compare/v5.0.5...v5.0.6
[5.0.5]: https://github.com/Automattic/jetpack-status/compare/v5.0.4...v5.0.5
[5.0.4]: https://github.com/Automattic/jetpack-status/compare/v5.0.3...v5.0.4
[5.0.3]: https://github.com/Automattic/jetpack-status/compare/v5.0.2...v5.0.3
[5.0.2]: https://github.com/Automattic/jetpack-status/compare/v5.0.1...v5.0.2
[5.0.1]: https://github.com/Automattic/jetpack-status/compare/v5.0.0...v5.0.1
[5.0.0]: https://github.com/Automattic/jetpack-status/compare/v4.0.3...v5.0.0
[4.0.3]: https://github.com/Automattic/jetpack-status/compare/v4.0.2...v4.0.3
[4.0.2]: https://github.com/Automattic/jetpack-status/compare/v4.0.1...v4.0.2
[4.0.1]: https://github.com/Automattic/jetpack-status/compare/v4.0.0...v4.0.1
[4.0.0]: https://github.com/Automattic/jetpack-status/compare/v3.3.4...v4.0.0
[3.3.4]: https://github.com/Automattic/jetpack-status/compare/v3.3.3...v3.3.4

View File

@ -4,16 +4,17 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-constants": "^2.0.4"
"php": ">=7.2",
"automattic/jetpack-constants": "^3.0.5"
},
"require-dev": {
"brain/monkey": "2.6.1",
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "^4.2.6",
"brain/monkey": "^2.6.2",
"yoast/phpunit-polyfills": "^3.0.0",
"automattic/jetpack-changelogger": "^6.0.2",
"automattic/jetpack-connection": "@dev",
"automattic/jetpack-plans": "@dev",
"automattic/jetpack-ip": "^0.2.3"
"automattic/jetpack-ip": "^0.4.6",
"automattic/phpunit-select-config": "^1.0.1"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
@ -25,7 +26,10 @@
},
"scripts": {
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
"phpunit-select-config phpunit.#.xml.dist --colors=always"
],
"test-coverage": [
"php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\""
],
"test-php": [
"@composer phpunit"
@ -40,7 +44,7 @@
"link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "4.0.x-dev"
"dev-trunk": "5.0.x-dev"
},
"dependencies": {
"test-only": [

View File

@ -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 );
}

View File

@ -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;
}

View File

@ -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
*