updated plugin Jetpack Protect
version 2.1.0
This commit is contained in:
@ -5,6 +5,17 @@ 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).
|
||||
|
||||
## [0.2.2] - 2024-03-19
|
||||
### Fixed
|
||||
- Handle upgrades from plugins embedding version 0.2.0 of the package. [#36440]
|
||||
|
||||
## [0.2.1] - 2024-03-14
|
||||
### Added
|
||||
- Increasing backup version for new endpoint [#35649]
|
||||
|
||||
### Fixed
|
||||
- Write helper script to ABSPATH by default, just like we did before [#35508]
|
||||
|
||||
## [0.2.0] - 2024-01-18
|
||||
### Changed
|
||||
- The package now requires PHP >= 7.0. [#34192]
|
||||
@ -48,6 +59,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
[0.2.2]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.2.1...v0.2.2
|
||||
[0.2.1]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.2.0...v0.2.1
|
||||
[0.2.0]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.6...v0.2.0
|
||||
[0.1.6]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.5...v0.1.6
|
||||
[0.1.5]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.4...v0.1.5
|
||||
|
@ -23,10 +23,10 @@ if ( function_exists( 'add_filter' ) ) {
|
||||
}
|
||||
|
||||
// Clean up expired Jetpack Helper Scripts from a scheduled event.
|
||||
$add_action( 'jetpack_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0001\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
|
||||
$add_action( 'jetpack_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0003\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
|
||||
|
||||
// Register REST routes.
|
||||
$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0001\\REST_Controller', 'register_rest_routes' ) );
|
||||
$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0003\\REST_Controller', 'register_rest_routes' ) );
|
||||
|
||||
// Set up package version hook.
|
||||
$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Transport_Helper\\V0001\\Package_Version::send_package_version_to_tracker' );
|
||||
$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Transport_Helper\\Package_Version::send_package_version_to_tracker' );
|
||||
|
@ -5,12 +5,12 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"php": ">=7.0",
|
||||
"automattic/jetpack-backup-helper-script-manager": "^0.2.0",
|
||||
"automattic/jetpack-connection": "^2.2.0"
|
||||
"automattic/jetpack-backup-helper-script-manager": "^0.2.3",
|
||||
"automattic/jetpack-connection": "^2.4.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.1.0",
|
||||
"automattic/jetpack-changelogger": "^4.0.5",
|
||||
"automattic/jetpack-changelogger": "^4.1.1",
|
||||
"automattic/wordbless": "dev-master"
|
||||
},
|
||||
"suggest": {
|
||||
|
@ -0,0 +1,25 @@
|
||||
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
|
||||
/**
|
||||
* The Package_Version class's compatibility shim.
|
||||
*
|
||||
* @package automattic/jetpack-transport-helper
|
||||
*/
|
||||
|
||||
// Do *not* update the "V0001" namespace version on changes.
|
||||
namespace Automattic\Jetpack\Transport_Helper\V0001;
|
||||
|
||||
/**
|
||||
* Package_Version proxy class to accommodate upgrades from plugin version 2.4.
|
||||
*
|
||||
* Backup plugin version 2.4 had a versioned class defined
|
||||
* ("Automattic\Jetpack\Transport_Helper\V0001\Package_Version"), so the "jetpack_package_versions" filter will try to
|
||||
* look for the class with this namespace + name in the newer plugin's code.
|
||||
*/
|
||||
class Package_Version {
|
||||
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
|
||||
public static function send_package_version_to_tracker( $package_versions ) {
|
||||
return \Automattic\Jetpack\Transport_Helper\Package_Version::send_package_version_to_tracker(
|
||||
$package_versions
|
||||
);
|
||||
}
|
||||
}
|
@ -5,18 +5,18 @@
|
||||
* @package automattic/jetpack-transport-helper
|
||||
*/
|
||||
|
||||
// After changing this file, consider increasing the version number ("VXXX") in all the files using this namespace, in
|
||||
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
|
||||
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
|
||||
// are installed, or in some other cases).
|
||||
namespace Automattic\Jetpack\Transport_Helper\V0001;
|
||||
namespace Automattic\Jetpack\Transport_Helper;
|
||||
|
||||
/**
|
||||
* The Package_Version class.
|
||||
*
|
||||
* Does *not* use namespaced versioning ("VXXXX") because send_package_version_to_tracker() is used as a
|
||||
* "jetpack_package_versions" filter, and said filter gets run during a plugin upgrade, so it always expects to
|
||||
* find the "Package_Version" class with the same namespace, name, and interface.
|
||||
*/
|
||||
class Package_Version {
|
||||
|
||||
const PACKAGE_VERSION = '0.2.0';
|
||||
const PACKAGE_VERSION = '0.2.2';
|
||||
|
||||
const PACKAGE_SLUG = 'transport-helper';
|
||||
|
||||
@ -29,6 +29,13 @@ class Package_Version {
|
||||
*/
|
||||
public static function send_package_version_to_tracker( $package_versions ) {
|
||||
$package_versions[ self::PACKAGE_SLUG ] = self::PACKAGE_VERSION;
|
||||
|
||||
return $package_versions;
|
||||
}
|
||||
}
|
||||
|
||||
// For compatibility with plugins that had a broken version of the package, this file needs to define the "V0001"-namespaced class
|
||||
// because this filename is what the old plugins' autoloader will be loading. So load the file that defines that class now.
|
||||
if ( ! class_exists( \Automattic\Jetpack\Transport_Helper\V0001\Package_Version::class, false ) ) {
|
||||
require __DIR__ . '/class-package-version-compat.php';
|
||||
}
|
||||
|
@ -10,9 +10,9 @@
|
||||
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
|
||||
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
|
||||
// are installed, or in some other cases).
|
||||
namespace Automattic\Jetpack\Transport_Helper\V0001;
|
||||
namespace Automattic\Jetpack\Transport_Helper\V0003;
|
||||
|
||||
use Automattic\Jetpack\Backup\V0001\Helper_Script_Manager;
|
||||
use Automattic\Jetpack\Backup\V0003\Helper_Script_Manager;
|
||||
use Automattic\Jetpack\Connection\Rest_Authentication;
|
||||
use WP_Error;
|
||||
use WP_REST_Request;
|
||||
|
Reference in New Issue
Block a user