updated plugin Jetpack Protect
version 1.2.0
This commit is contained in:
parent
6f8f73e860
commit
35a7ea2e06
@ -5,6 +5,19 @@ 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).
|
||||
|
||||
## 1.2.1-alpha - unreleased
|
||||
|
||||
This is an alpha version! The changes listed here are not final.
|
||||
|
||||
## 1.2.0 - 2023-01-16
|
||||
### Added
|
||||
- Add web application firewall (WAF) features [#27528]
|
||||
- Add progress bar to site scannnig screen [#27171]
|
||||
|
||||
### Fixed
|
||||
- Poll for scan status while scanner is provisioning [#28275]
|
||||
- Bug fixes
|
||||
|
||||
## 1.1.2 - 2022-11-30
|
||||
### Changed
|
||||
- changed description and author [#27618]
|
||||
|
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '79aba5c67c65c2093d2d');
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'e640beb5bef26d89962f');
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -11,3 +11,25 @@
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/**
|
||||
* React Router DOM v6.2.2
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* React Router v6.2.2
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,21 +5,23 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"automattic/jetpack-assets": "^1.17.27",
|
||||
"automattic/jetpack-admin-ui": "^0.2.13",
|
||||
"automattic/jetpack-autoloader": "^2.11.12",
|
||||
"automattic/jetpack-composer-plugin": "^1.1.6",
|
||||
"automattic/jetpack-assets": "^1.17.28",
|
||||
"automattic/jetpack-admin-ui": "^0.2.14",
|
||||
"automattic/jetpack-autoloader": "^2.11.13",
|
||||
"automattic/jetpack-composer-plugin": "^1.1.7",
|
||||
"automattic/jetpack-config": "^1.11.1",
|
||||
"automattic/jetpack-identity-crisis": "^0.8.32",
|
||||
"automattic/jetpack-my-jetpack": "^2.5.1",
|
||||
"automattic/jetpack-plugins-installer": "^0.2.1",
|
||||
"automattic/jetpack-sync": "^1.44.0",
|
||||
"automattic/jetpack-transport-helper": "^0.1.1",
|
||||
"automattic/jetpack-plans": "^0.2.7"
|
||||
"automattic/jetpack-identity-crisis": "^0.8.33",
|
||||
"automattic/jetpack-my-jetpack": "^2.6.0",
|
||||
"automattic/jetpack-plugins-installer": "^0.2.2",
|
||||
"automattic/jetpack-sync": "^1.44.1",
|
||||
"automattic/jetpack-transport-helper": "^0.1.2",
|
||||
"automattic/jetpack-plans": "^0.2.8",
|
||||
"automattic/jetpack-waf": "^0.8.1",
|
||||
"automattic/jetpack-status": "^1.15.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/wordbless": "0.4.0"
|
||||
},
|
||||
"autoload": {
|
||||
@ -72,6 +74,6 @@
|
||||
"automattic/jetpack-autoloader": true,
|
||||
"automattic/jetpack-composer-plugin": true
|
||||
},
|
||||
"autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2"
|
||||
"autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0"
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Plugin Name: Jetpack Protect
|
||||
* Plugin URI: https://wordpress.org/plugins/jetpack-protect
|
||||
* Description: Security tools that keep your site safe and sound, from posts to plugins.
|
||||
* Version: 1.1.2
|
||||
* Version: 1.2.0
|
||||
* Author: Automattic - Jetpack Security team
|
||||
* Author URI: https://jetpack.com/protect/
|
||||
* License: GPLv2 or later
|
||||
@ -33,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define( 'JETPACK_PROTECT_VERSION', '1.1.2' );
|
||||
define( 'JETPACK_PROTECT_VERSION', '1.2.0' );
|
||||
define( 'JETPACK_PROTECT_DIR', plugin_dir_path( __FILE__ ) );
|
||||
define( 'JETPACK_PROTECT_ROOT_FILE', __FILE__ );
|
||||
define( 'JETPACK_PROTECT_ROOT_FILE_RELATIVE_PATH', plugin_basename( __FILE__ ) );
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.4.17] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.4.16] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -103,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Creates the MC Stats package
|
||||
|
||||
[1.4.17]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.16...v1.4.17
|
||||
[1.4.16]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.15...v1.4.16
|
||||
[1.4.15]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.14...v1.4.15
|
||||
[1.4.14]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.13...v1.4.14
|
||||
|
@ -5,8 +5,8 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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.14] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [0.2.13] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -80,6 +84,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
- Fixing menu visibility issues.
|
||||
|
||||
[0.2.14]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.13...0.2.14
|
||||
[0.2.13]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.12...0.2.13
|
||||
[0.2.12]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.11...0.2.12
|
||||
[0.2.11]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.10...0.2.11
|
||||
|
@ -5,8 +5,8 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/wordbless": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -13,7 +13,7 @@ namespace Automattic\Jetpack\Admin_UI;
|
||||
*/
|
||||
class Admin_Menu {
|
||||
|
||||
const PACKAGE_VERSION = '0.2.13';
|
||||
const PACKAGE_VERSION = '0.2.14';
|
||||
|
||||
/**
|
||||
* Whether this class has been initialized
|
||||
|
@ -5,6 +5,11 @@ 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).
|
||||
|
||||
## [1.17.28] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
- Updated package dependencies. [#27696]
|
||||
|
||||
## [1.17.27] - 2022-11-28
|
||||
### Changed
|
||||
- Updated package dependencies. [#27576]
|
||||
@ -284,6 +289,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Statically access asset tools
|
||||
|
||||
[1.17.28]: https://github.com/Automattic/jetpack-assets/compare/v1.17.27...v1.17.28
|
||||
[1.17.27]: https://github.com/Automattic/jetpack-assets/compare/v1.17.26...v1.17.27
|
||||
[1.17.26]: https://github.com/Automattic/jetpack-assets/compare/v1.17.25...v1.17.26
|
||||
[1.17.25]: https://github.com/Automattic/jetpack-assets/compare/v1.17.24...v1.17.25
|
||||
|
@ -4,12 +4,12 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-constants": "^1.6.19"
|
||||
"automattic/jetpack-constants": "^1.6.20"
|
||||
},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.47.1] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27696]
|
||||
|
||||
## [1.47.0] - 2022-11-30
|
||||
### Added
|
||||
- Added full response logging for failed Sync data requests. [#27644]
|
||||
@ -729,6 +733,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Separate the connection library into its own package.
|
||||
|
||||
[1.47.1]: https://github.com/Automattic/jetpack-connection/compare/v1.47.0...v1.47.1
|
||||
[1.47.0]: https://github.com/Automattic/jetpack-connection/compare/v1.46.4...v1.47.0
|
||||
[1.46.4]: https://github.com/Automattic/jetpack-connection/compare/v1.46.3...v1.46.4
|
||||
[1.46.3]: https://github.com/Automattic/jetpack-connection/compare/v1.46.2...v1.46.3
|
||||
|
@ -4,18 +4,18 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-a8c-mc-stats": "^1.4.16",
|
||||
"automattic/jetpack-admin-ui": "^0.2.13",
|
||||
"automattic/jetpack-constants": "^1.6.19",
|
||||
"automattic/jetpack-roles": "^1.4.18",
|
||||
"automattic/jetpack-status": "^1.15.1",
|
||||
"automattic/jetpack-redirect": "^1.7.20"
|
||||
"automattic/jetpack-a8c-mc-stats": "^1.4.17",
|
||||
"automattic/jetpack-admin-ui": "^0.2.14",
|
||||
"automattic/jetpack-constants": "^1.6.20",
|
||||
"automattic/jetpack-roles": "^1.4.19",
|
||||
"automattic/jetpack-status": "^1.15.2",
|
||||
"automattic/jetpack-redirect": "^1.7.21"
|
||||
},
|
||||
"require-dev": {
|
||||
"automattic/wordbless": "@dev",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"brain/monkey": "2.6.1",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -12,7 +12,7 @@ namespace Automattic\Jetpack\Connection;
|
||||
*/
|
||||
class Package_Version {
|
||||
|
||||
const PACKAGE_VERSION = '1.47.0';
|
||||
const PACKAGE_VERSION = '1.47.1';
|
||||
|
||||
const PACKAGE_SLUG = 'connection';
|
||||
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.6.20] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.6.19] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -138,6 +142,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Packages: Finish the constants package
|
||||
|
||||
[1.6.20]: https://github.com/Automattic/jetpack-constants/compare/v1.6.19...v1.6.20
|
||||
[1.6.19]: https://github.com/Automattic/jetpack-constants/compare/v1.6.18...v1.6.19
|
||||
[1.6.18]: https://github.com/Automattic/jetpack-constants/compare/v1.6.17...v1.6.18
|
||||
[1.6.17]: https://github.com/Automattic/jetpack-constants/compare/v1.6.16...v1.6.17
|
||||
|
@ -6,8 +6,8 @@
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.4.22] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.4.21] - 2022-11-22
|
||||
### Added
|
||||
- Add a guard in `functions.php` against being loaded twice from different copies of the package. [#27475]
|
||||
@ -139,6 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Moving jetpack_is_mobile into a package
|
||||
|
||||
[1.4.22]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.21...v1.4.22
|
||||
[1.4.21]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.20...v1.4.21
|
||||
[1.4.20]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.19...v1.4.20
|
||||
[1.4.19]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.18...v1.4.19
|
||||
|
@ -5,8 +5,8 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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.8.33] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [0.8.32] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -304,6 +308,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Updated package dependencies.
|
||||
- Use Connection/Urls for home_url and site_url functions migrated from Sync.
|
||||
|
||||
[0.8.33]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.32...v0.8.33
|
||||
[0.8.32]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.31...v0.8.32
|
||||
[0.8.31]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.30...v0.8.31
|
||||
[0.8.30]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.29...v0.8.30
|
||||
|
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '1621ca28578f7d06fec7');
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '9a46a33179a7b5b5ae30');
|
||||
|
File diff suppressed because one or more lines are too long
@ -4,15 +4,15 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-connection": "^1.46.4",
|
||||
"automattic/jetpack-constants": "^1.6.19",
|
||||
"automattic/jetpack-status": "^1.15.1",
|
||||
"automattic/jetpack-logo": "^1.5.19",
|
||||
"automattic/jetpack-assets": "^1.17.26"
|
||||
"automattic/jetpack-connection": "^1.47.1",
|
||||
"automattic/jetpack-constants": "^1.6.20",
|
||||
"automattic/jetpack-status": "^1.15.2",
|
||||
"automattic/jetpack-logo": "^1.5.20",
|
||||
"automattic/jetpack-assets": "^1.17.28"
|
||||
},
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/wordbless": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -28,7 +28,7 @@ class Identity_Crisis {
|
||||
/**
|
||||
* Package Version
|
||||
*/
|
||||
const PACKAGE_VERSION = '0.8.32';
|
||||
const PACKAGE_VERSION = '0.8.33';
|
||||
|
||||
/**
|
||||
* Instance of the object.
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [2.2.35] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27696]
|
||||
|
||||
## [2.2.34] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -510,6 +514,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Update Jetpack to use new JITM package
|
||||
|
||||
[2.2.35]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.34...v2.2.35
|
||||
[2.2.34]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.33...v2.2.34
|
||||
[2.2.33]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.32...v2.2.33
|
||||
[2.2.32]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.31...v2.2.32
|
||||
|
@ -4,19 +4,19 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-a8c-mc-stats": "^1.4.16",
|
||||
"automattic/jetpack-assets": "^1.17.26",
|
||||
"automattic/jetpack-connection": "^1.46.4",
|
||||
"automattic/jetpack-device-detection": "^1.4.21",
|
||||
"automattic/jetpack-logo": "^1.5.19",
|
||||
"automattic/jetpack-partner": "^1.7.20",
|
||||
"automattic/jetpack-redirect": "^1.7.20",
|
||||
"automattic/jetpack-status": "^1.15.1"
|
||||
"automattic/jetpack-a8c-mc-stats": "^1.4.17",
|
||||
"automattic/jetpack-assets": "^1.17.28",
|
||||
"automattic/jetpack-connection": "^1.47.1",
|
||||
"automattic/jetpack-device-detection": "^1.4.22",
|
||||
"automattic/jetpack-logo": "^1.5.20",
|
||||
"automattic/jetpack-partner": "^1.7.21",
|
||||
"automattic/jetpack-redirect": "^1.7.21",
|
||||
"automattic/jetpack-status": "^1.15.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -20,7 +20,7 @@ use Automattic\Jetpack\Status;
|
||||
*/
|
||||
class JITM {
|
||||
|
||||
const PACKAGE_VERSION = '2.2.34';
|
||||
const PACKAGE_VERSION = '2.2.35';
|
||||
|
||||
/**
|
||||
* The configuration method that is called from the jetpack-config package.
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.7.13] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.7.12] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -222,6 +226,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Licensing: Add support for Jetpack licenses
|
||||
|
||||
[1.7.13]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.12...v1.7.13
|
||||
[1.7.12]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.11...v1.7.12
|
||||
[1.7.11]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.10...v1.7.11
|
||||
[1.7.10]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.9...v1.7.10
|
||||
|
@ -4,12 +4,12 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-connection": "^1.46.4"
|
||||
"automattic/jetpack-connection": "^1.47.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"automattic/wordbless": "@dev",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.5.20] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.5.19] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -134,6 +138,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Packages: Add a basic Jetpack Logo package
|
||||
|
||||
[1.5.20]: https://github.com/Automattic/jetpack-logo/compare/v1.5.19...v1.5.20
|
||||
[1.5.19]: https://github.com/Automattic/jetpack-logo/compare/v1.5.18...v1.5.19
|
||||
[1.5.18]: https://github.com/Automattic/jetpack-logo/compare/v1.5.17...v1.5.18
|
||||
[1.5.17]: https://github.com/Automattic/jetpack-logo/compare/v1.5.16...v1.5.17
|
||||
|
@ -5,8 +5,8 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,16 @@ 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).
|
||||
|
||||
## [2.6.0] - 2022-12-05
|
||||
### Changed
|
||||
- Improve design of the error notice. [#27340]
|
||||
- Updated package dependencies. [#27340]
|
||||
|
||||
## [2.5.2] - 2022-12-02
|
||||
### Changed
|
||||
- My Jetpack: Requires connection only if needed [#27615]
|
||||
- Updated package dependencies. [#27697]
|
||||
|
||||
## [2.5.1] - 2022-11-30
|
||||
|
||||
## [2.5.0] - 2022-11-28
|
||||
@ -680,6 +690,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
- Created package
|
||||
|
||||
[2.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.2...2.6.0
|
||||
[2.5.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.1...2.5.2
|
||||
[2.5.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.0...2.5.1
|
||||
[2.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.4.1...2.5.0
|
||||
[2.4.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.4.0...2.4.1
|
||||
|
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '2eead7d064827ada273f');
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '813aee29e3796bd68b53');
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,18 +4,18 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-admin-ui": "^0.2.13",
|
||||
"automattic/jetpack-assets": "^1.17.27",
|
||||
"automattic/jetpack-connection": "^1.47.0",
|
||||
"automattic/jetpack-jitm": "^2.2.34",
|
||||
"automattic/jetpack-licensing": "^1.7.12",
|
||||
"automattic/jetpack-plugins-installer": "^0.2.1",
|
||||
"automattic/jetpack-redirect": "^1.7.20",
|
||||
"automattic/jetpack-constants": "^1.6.19"
|
||||
"automattic/jetpack-admin-ui": "^0.2.14",
|
||||
"automattic/jetpack-assets": "^1.17.28",
|
||||
"automattic/jetpack-connection": "^1.47.1",
|
||||
"automattic/jetpack-jitm": "^2.2.35",
|
||||
"automattic/jetpack-licensing": "^1.7.13",
|
||||
"automattic/jetpack-plugins-installer": "^0.2.2",
|
||||
"automattic/jetpack-redirect": "^1.7.21",
|
||||
"automattic/jetpack-constants": "^1.6.20"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/wordbless": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
@ -65,7 +65,7 @@
|
||||
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-trunk": "2.5.x-dev"
|
||||
"dev-trunk": "2.6.x-dev"
|
||||
},
|
||||
"version-constants": {
|
||||
"::PACKAGE_VERSION": "src/class-initializer.php"
|
||||
|
@ -30,7 +30,7 @@ class Initializer {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const PACKAGE_VERSION = '2.5.1';
|
||||
const PACKAGE_VERSION = '2.6.0';
|
||||
|
||||
/**
|
||||
* Initialize My Jetpack
|
||||
|
@ -35,21 +35,36 @@ class Wpcom_Products {
|
||||
* @return Object|WP_Error
|
||||
*/
|
||||
private static function get_products_from_wpcom() {
|
||||
|
||||
$blog_id = \Jetpack_Options::get_option( 'id' );
|
||||
$endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() );
|
||||
|
||||
$wpcom_request = Client::wpcom_json_api_request_as_blog(
|
||||
$endpoint,
|
||||
'1.1',
|
||||
array(
|
||||
'method' => 'GET',
|
||||
'headers' => array(
|
||||
'X-Forwarded-For' => ( new Visitor() )->get_ip( true ),
|
||||
),
|
||||
)
|
||||
$blog_id = \Jetpack_Options::get_option( 'id' );
|
||||
$ip = ( new Visitor() )->get_ip( true );
|
||||
$headers = array(
|
||||
'X-Forwarded-For' => $ip,
|
||||
);
|
||||
|
||||
// If has a blog id, use connected endpoint.
|
||||
|
||||
if ( $blog_id ) {
|
||||
$endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() );
|
||||
|
||||
$wpcom_request = Client::wpcom_json_api_request_as_blog(
|
||||
$endpoint,
|
||||
'1.1',
|
||||
array(
|
||||
'method' => 'GET',
|
||||
'headers' => $headers,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$endpoint = 'https://public-api.wordpress.com/rest/v1.1/products?locale=' . get_user_locale() . '&type=jetpack';
|
||||
|
||||
$wpcom_request = wp_remote_get(
|
||||
esc_url_raw( $endpoint ),
|
||||
array(
|
||||
'headers' => $headers,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$response_code = wp_remote_retrieve_response_code( $wpcom_request );
|
||||
|
||||
if ( 200 === $response_code ) {
|
||||
|
@ -99,7 +99,7 @@ class Videopress extends Hybrid_Product {
|
||||
return array(
|
||||
_x( '1TB of storage', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( 'Built into WordPress editor', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( 'Ad-free and brandable player', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( 'Ad-free and customizable player', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( 'Unlimited users', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
|
||||
);
|
||||
}
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.7.21] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.7.20] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -204,6 +208,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Add partner subsidiary id to upgrade URLs.
|
||||
|
||||
[1.7.21]: https://github.com/Automattic/jetpack-partner/compare/v1.7.20...v1.7.21
|
||||
[1.7.20]: https://github.com/Automattic/jetpack-partner/compare/v1.7.19...v1.7.20
|
||||
[1.7.19]: https://github.com/Automattic/jetpack-partner/compare/v1.7.18...v1.7.19
|
||||
[1.7.18]: https://github.com/Automattic/jetpack-partner/compare/v1.7.17...v1.7.18
|
||||
|
@ -4,13 +4,13 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-connection": "^1.46.4",
|
||||
"automattic/jetpack-status": "^1.15.1"
|
||||
"automattic/jetpack-connection": "^1.47.1",
|
||||
"automattic/jetpack-status": "^1.15.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/wordbless": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -5,6 +5,10 @@ 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.9] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [0.2.8] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -84,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in.
|
||||
|
||||
[0.2.9]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.8...v0.2.9
|
||||
[0.2.8]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.7...v0.2.8
|
||||
[0.2.7]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.6...v0.2.7
|
||||
[0.2.6]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.5...v0.2.6
|
||||
|
@ -5,9 +5,9 @@
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/wordbless": "@dev",
|
||||
"yoast/phpunit-polyfills": "1.0.3"
|
||||
"yoast/phpunit-polyfills": "1.0.4"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [0.2.1] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -40,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
- Fix method logic
|
||||
|
||||
[0.2.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.1...v0.2.2
|
||||
[0.2.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.0...v0.2.1
|
||||
[0.2.0]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.4...v0.2.0
|
||||
[0.1.4]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.3...v0.1.4
|
||||
|
@ -4,11 +4,11 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-a8c-mc-stats": "^1.4.16"
|
||||
"automattic/jetpack-a8c-mc-stats": "^1.4.17"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.7.21] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.7.20] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -160,6 +164,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Create Jetpack Redirect package
|
||||
|
||||
[1.7.21]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.20...v1.7.21
|
||||
[1.7.20]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.19...v1.7.20
|
||||
[1.7.19]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.18...v1.7.19
|
||||
[1.7.18]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.17...v1.7.18
|
||||
|
@ -4,12 +4,12 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-status": "^1.15.1"
|
||||
"automattic/jetpack-status": "^1.15.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,14 @@ 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).
|
||||
|
||||
## [1.4.20] - 2022-12-19
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [1.4.19] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.4.18] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -127,6 +135,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Jetpack DNA: Introduce a Roles package
|
||||
|
||||
[1.4.20]: https://github.com/Automattic/jetpack-roles/compare/v1.4.19...v1.4.20
|
||||
[1.4.19]: https://github.com/Automattic/jetpack-roles/compare/v1.4.18...v1.4.19
|
||||
[1.4.18]: https://github.com/Automattic/jetpack-roles/compare/v1.4.17...v1.4.18
|
||||
[1.4.17]: https://github.com/Automattic/jetpack-roles/compare/v1.4.16...v1.4.17
|
||||
[1.4.16]: https://github.com/Automattic/jetpack-roles/compare/v1.4.15...v1.4.16
|
||||
|
@ -6,8 +6,8 @@
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.3"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.15.2] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.15.1] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -216,6 +220,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Packages: Introduce a status package
|
||||
|
||||
[1.15.2]: https://github.com/Automattic/jetpack-status/compare/v1.15.1...v1.15.2
|
||||
[1.15.1]: https://github.com/Automattic/jetpack-status/compare/v1.15.0...v1.15.1
|
||||
[1.15.0]: https://github.com/Automattic/jetpack-status/compare/v1.14.3...v1.15.0
|
||||
[1.14.3]: https://github.com/Automattic/jetpack-status/compare/v1.14.2...v1.14.3
|
||||
|
@ -4,12 +4,12 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-constants": "^1.6.19"
|
||||
"automattic/jetpack-constants": "^1.6.20"
|
||||
},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -5,6 +5,10 @@ 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).
|
||||
|
||||
## [1.44.1] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [1.44.0] - 2022-11-30
|
||||
### Added
|
||||
- Added full response logging for failed Sync data requests. [#27644]
|
||||
@ -776,6 +780,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Packages: Move sync to a classmapped package
|
||||
|
||||
[1.44.1]: https://github.com/Automattic/jetpack-sync/compare/v1.44.0...v1.44.1
|
||||
[1.44.0]: https://github.com/Automattic/jetpack-sync/compare/v1.43.2...v1.44.0
|
||||
[1.43.2]: https://github.com/Automattic/jetpack-sync/compare/v1.43.1...v1.43.2
|
||||
[1.43.1]: https://github.com/Automattic/jetpack-sync/compare/v1.43.0...v1.43.1
|
||||
|
@ -4,16 +4,16 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-connection": "^1.47.0",
|
||||
"automattic/jetpack-constants": "^1.6.19",
|
||||
"automattic/jetpack-identity-crisis": "^0.8.32",
|
||||
"automattic/jetpack-password-checker": "^0.2.8",
|
||||
"automattic/jetpack-roles": "^1.4.18",
|
||||
"automattic/jetpack-status": "^1.15.1"
|
||||
"automattic/jetpack-connection": "^1.47.1",
|
||||
"automattic/jetpack-constants": "^1.6.20",
|
||||
"automattic/jetpack-identity-crisis": "^0.8.33",
|
||||
"automattic/jetpack-password-checker": "^0.2.9",
|
||||
"automattic/jetpack-roles": "^1.4.19",
|
||||
"automattic/jetpack-status": "^1.15.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/wordbless": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -12,7 +12,7 @@ namespace Automattic\Jetpack\Sync;
|
||||
*/
|
||||
class Package_Version {
|
||||
|
||||
const PACKAGE_VERSION = '1.44.0';
|
||||
const PACKAGE_VERSION = '1.44.1';
|
||||
|
||||
const PACKAGE_SLUG = 'sync';
|
||||
|
||||
|
@ -5,6 +5,10 @@ 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.1.2] - 2022-12-05
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [0.1.1] - 2022-11-30
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -17,4 +21,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
[0.1.2]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.1...v0.1.2
|
||||
[0.1.1]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.0...v0.1.1
|
||||
|
@ -4,11 +4,11 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-connection": "^1.47.0"
|
||||
"automattic/jetpack-connection": "^1.47.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/wordbless": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -12,7 +12,7 @@ namespace Automattic\Jetpack\Transport_Helper;
|
||||
*/
|
||||
class Package_Version {
|
||||
|
||||
const PACKAGE_VERSION = '0.1.1';
|
||||
const PACKAGE_VERSION = '0.1.2';
|
||||
|
||||
const PACKAGE_SLUG = 'transport-helper';
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
rules/
|
@ -0,0 +1,155 @@
|
||||
# Changelog
|
||||
|
||||
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.8.1] - 2023-01-07
|
||||
### Changed
|
||||
- Change directory location that stores firewall rules. [#28049]
|
||||
|
||||
## [0.8.0] - 2022-12-27
|
||||
### Added
|
||||
- Add file existance checks before requiring rule files in the WAF. [#28050]
|
||||
- Disable Jetpack Firewall on unsupported environments. [#27939]
|
||||
|
||||
## [0.7.2] - 2022-12-19
|
||||
### Fixed
|
||||
- Fix the initialization of the firewall. [#27846]
|
||||
|
||||
## [0.7.1] - 2022-12-06
|
||||
### Changed
|
||||
- html_entity_decode filter now decodes single-quotes too, and uses a Unicode Replacement Character instead of returning empty string on invalid characters. [#27753]
|
||||
|
||||
## [0.7.0] - 2022-12-05
|
||||
### Added
|
||||
- Prepare package for use in the Jetpack Protect standalone plugin. [#27528]
|
||||
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
### Removed
|
||||
- Remove has_rules_access plan check in favor of external alternatives [#27600]
|
||||
|
||||
## [0.6.10] - 2022-11-28
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
|
||||
## [0.6.9] - 2022-11-01
|
||||
### Fixed
|
||||
- Fix bug for cron event not generating IP rules. [#27215]
|
||||
|
||||
## [0.6.8] - 2022-10-27
|
||||
### Fixed
|
||||
- Fixes several invalid action callbacks. [#27106]
|
||||
|
||||
## [0.6.7] - 2022-09-20
|
||||
### Changed
|
||||
- Changing how we load and run the package to avoid actions.php [#24730]
|
||||
|
||||
## [0.6.6] - 2022-09-08
|
||||
### Fixed
|
||||
- Fixed exception namespace. [#25663]
|
||||
|
||||
## [0.6.5] - 2022-07-26
|
||||
### Changed
|
||||
- Updated package dependencies. [#25158]
|
||||
|
||||
## [0.6.4] - 2022-07-12
|
||||
### Fixed
|
||||
- Correct namespacing error. [#24993]
|
||||
|
||||
## [0.6.3] - 2022-06-21
|
||||
### Changed
|
||||
- Renaming master to trunk. [#24661]
|
||||
|
||||
## [0.6.2] - 2022-06-06
|
||||
### Fixed
|
||||
- Fix the hook we're using for run.php.
|
||||
|
||||
## [0.6.1] - 2022-06-02
|
||||
### Removed
|
||||
- Disable the WAF module on Atomic
|
||||
|
||||
## [0.6.0] - 2022-05-18
|
||||
### Added
|
||||
- Add checks for a killswitch define [#24247]
|
||||
- Added endpoint to update rules on demand [#24327]
|
||||
- handle share data option to decide if we should write to log file [#24218]
|
||||
|
||||
### Fixed
|
||||
- Allow the rules API to return 401 responses without throwing an exception. [#24153]
|
||||
- fix bootstrap generation in cases file.php is not required yet [#24153]
|
||||
|
||||
## [0.5.1] - 2022-05-04
|
||||
### Added
|
||||
- Added a check to only run the firewall when the Jetpack module is enabled, a method to provide the bootstrap.php path, and a REST API endpoint to provide the firewall settings. [#23769]
|
||||
- Connected the WAF UI to actually updating the IP block and allow lists when saving the settings. [#24124]
|
||||
|
||||
### Fixed
|
||||
- Fixed database logging [#24070]
|
||||
- Fixed issue where code for the waf package was executed if the module was disabled [#24217]
|
||||
- Fixed writing rules php files if the API request for getting up-to-date rules failes so that the internal functionality is kept in tact. [#24181]
|
||||
- We now sanitize the output generated by blocked requests, and only report the rule ID in the header response. [#24058]
|
||||
|
||||
## [0.5.0] - 2022-04-26
|
||||
### Added
|
||||
- added cron to update rules
|
||||
- Added WAF IP allow list and block list functionality.
|
||||
|
||||
### Changed
|
||||
- Added comment to ignore failing phpcs check
|
||||
- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput`
|
||||
- Updated package dependencies.
|
||||
|
||||
## [0.4.0] - 2022-04-19
|
||||
### Added
|
||||
- added logs when a request is blocked
|
||||
- Generating rules now fetches them from the API. Also adds a few CLI commands.
|
||||
|
||||
## [0.3.0] - 2022-04-12
|
||||
### Added
|
||||
- Added hooks for generating the rules.php file, and improved functionality and class names.
|
||||
|
||||
## [0.2.0] - 2022-04-06
|
||||
### Added
|
||||
- Added Jetpack WAF standalone mode.
|
||||
|
||||
### Fixed
|
||||
- Fix normalizing nested array targets, like with query strings.
|
||||
|
||||
## [0.1.1] - 2022-03-29
|
||||
### Fixed
|
||||
- Fixed instance of normalizeHeaderName that wasn't renamed; fixed header parsing; removed unused compiler file.
|
||||
|
||||
## 0.1.0 - 2022-02-16
|
||||
### Added
|
||||
- Added executing the WAF as part of the Jetpack plugin.
|
||||
- Added Initial version
|
||||
|
||||
### Changed
|
||||
- Core: do not ship .phpcs.dir.xml in production builds.
|
||||
|
||||
[0.8.1]: https://github.com/Automattic/jetpack-waf/compare/v0.8.0...v0.8.1
|
||||
[0.8.0]: https://github.com/Automattic/jetpack-waf/compare/v0.7.2...v0.8.0
|
||||
[0.7.2]: https://github.com/Automattic/jetpack-waf/compare/v0.7.1...v0.7.2
|
||||
[0.7.1]: https://github.com/Automattic/jetpack-waf/compare/v0.7.0...v0.7.1
|
||||
[0.7.0]: https://github.com/Automattic/jetpack-waf/compare/v0.6.10...v0.7.0
|
||||
[0.6.10]: https://github.com/Automattic/jetpack-waf/compare/v0.6.9...v0.6.10
|
||||
[0.6.9]: https://github.com/Automattic/jetpack-waf/compare/v0.6.8...v0.6.9
|
||||
[0.6.8]: https://github.com/Automattic/jetpack-waf/compare/v0.6.7...v0.6.8
|
||||
[0.6.7]: https://github.com/Automattic/jetpack-waf/compare/v0.6.6...v0.6.7
|
||||
[0.6.6]: https://github.com/Automattic/jetpack-waf/compare/v0.6.5...v0.6.6
|
||||
[0.6.5]: https://github.com/Automattic/jetpack-waf/compare/v0.6.4...v0.6.5
|
||||
[0.6.4]: https://github.com/Automattic/jetpack-waf/compare/v0.6.3...v0.6.4
|
||||
[0.6.3]: https://github.com/Automattic/jetpack-waf/compare/v0.6.2...v0.6.3
|
||||
[0.6.2]: https://github.com/Automattic/jetpack-waf/compare/v0.6.1...v0.6.2
|
||||
[0.6.1]: https://github.com/Automattic/jetpack-waf/compare/v0.6.0...v0.6.1
|
||||
[0.6.0]: https://github.com/Automattic/jetpack-waf/compare/v0.5.1...v0.6.0
|
||||
[0.5.1]: https://github.com/Automattic/jetpack-waf/compare/v0.5.0...v0.5.1
|
||||
[0.5.0]: https://github.com/Automattic/jetpack-waf/compare/v0.4.0...v0.5.0
|
||||
[0.4.0]: https://github.com/Automattic/jetpack-waf/compare/v0.3.0...v0.4.0
|
||||
[0.3.0]: https://github.com/Automattic/jetpack-waf/compare/v0.2.0...v0.3.0
|
||||
[0.2.0]: https://github.com/Automattic/jetpack-waf/compare/v0.1.1...v0.2.0
|
||||
[0.1.1]: https://github.com/Automattic/jetpack-waf/compare/v0.1.0...v0.1.1
|
@ -0,0 +1,357 @@
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
===================================
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
@ -0,0 +1,38 @@
|
||||
# Security Policy
|
||||
|
||||
Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/).
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure.
|
||||
|
||||
**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.**
|
||||
|
||||
Our most critical targets are:
|
||||
|
||||
* Jetpack and the Jetpack composer packages (all within this repo)
|
||||
* Jetpack.com -- the primary marketing site.
|
||||
* cloud.jetpack.com -- a management site.
|
||||
* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites.
|
||||
|
||||
For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic).
|
||||
|
||||
_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._
|
||||
|
||||
## Guidelines
|
||||
|
||||
We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines:
|
||||
|
||||
* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines).
|
||||
* Pen-testing Production:
|
||||
* Please **setup a local environment** instead whenever possible. Most of our code is open source (see above).
|
||||
* If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC.
|
||||
* **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels.
|
||||
* To be eligible for a bounty, all of these guidelines must be followed.
|
||||
* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability.
|
||||
|
||||
We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties.
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Registers the CLI functionality.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
if ( defined( 'WP_CLI' ) && \WP_CLI ) {
|
||||
\WP_CLI::add_command( 'jetpack-waf', CLI::class );
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "automattic/jetpack-waf",
|
||||
"description": "Tools to assist with the Jetpack Web Application Firewall",
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"wikimedia/aho-corasick": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.3.1-alpha"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"cli.php"
|
||||
],
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"phpunit": [
|
||||
"./vendor/phpunit/phpunit/phpunit --colors=always"
|
||||
],
|
||||
"test-coverage": [
|
||||
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/clover.xml\""
|
||||
],
|
||||
"test-coverage-html": [
|
||||
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-html ./coverage"
|
||||
],
|
||||
"test-php": [
|
||||
"@composer phpunit"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"extra": {
|
||||
"autotagger": true,
|
||||
"mirror-repo": "Automattic/jetpack-waf",
|
||||
"textdomain": "jetpack-waf",
|
||||
"changelogger": {
|
||||
"link-template": "https://github.com/Automattic/jetpack-waf/compare/v${old}...v${new}"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-trunk": "0.8.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Class used to manage backwards-compatibility of the package.
|
||||
*
|
||||
* @since 0.8.0
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
/**
|
||||
* Defines methods for ensuring backwards compatibility.
|
||||
*/
|
||||
class Waf_Compatibility {
|
||||
|
||||
/**
|
||||
* Add compatibilty hooks
|
||||
*
|
||||
* @since 0.8.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function add_compatibility_hooks() {
|
||||
add_filter( 'default_option_' . Waf_Initializer::NEEDS_UPDATE_OPTION_NAME, __CLASS__ . '::default_option_waf_needs_update', 10, 3 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a default value for sites that installed the WAF
|
||||
* before the NEEDS_UPDATE_OPTION_NAME option was added.
|
||||
*
|
||||
* @since 0.8.0
|
||||
*
|
||||
* @param mixed $default The default value to return if the option does not exist in the database.
|
||||
* @param string $option Option name.
|
||||
* @param bool $passed_default Was get_option() passed a default value.
|
||||
*
|
||||
* @return mixed The default value to return if the option does not exist in the database.
|
||||
*/
|
||||
public static function default_option_waf_needs_update( $default, $option, $passed_default ) {
|
||||
// Allow get_option() to override this default value
|
||||
if ( $passed_default ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
// If the option hasn't been added yet, the WAF needs to be updated.
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* Class use to register REST API endpoints used by the WAF
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
use Automattic\Jetpack\Connection\REST_Connector;
|
||||
use WP_Error;
|
||||
use WP_REST_Server;
|
||||
|
||||
/**
|
||||
* Defines our endponts.
|
||||
*/
|
||||
class REST_Controller {
|
||||
/**
|
||||
* Register REST API endpoints.
|
||||
*/
|
||||
public static function register_rest_routes() {
|
||||
register_rest_route(
|
||||
'jetpack/v4',
|
||||
'/waf',
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => __CLASS__ . '::waf',
|
||||
'permission_callback' => __CLASS__ . '::waf_permissions_callback',
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
'jetpack/v4',
|
||||
'/waf',
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => __CLASS__ . '::update_waf',
|
||||
'permission_callback' => __CLASS__ . '::waf_permissions_callback',
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
'jetpack/v4',
|
||||
'/waf/update-rules',
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => __CLASS__ . '::update_rules',
|
||||
'permission_callback' => __CLASS__ . '::waf_permissions_callback',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update rules endpoint
|
||||
*/
|
||||
public static function update_rules() {
|
||||
$success = true;
|
||||
$message = 'Rules updated succesfully';
|
||||
|
||||
try {
|
||||
Waf_Runner::generate_rules();
|
||||
} catch ( \Exception $e ) {
|
||||
$success = false;
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
return rest_ensure_response(
|
||||
array(
|
||||
'success' => $success,
|
||||
'message' => $message,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* WAF Endpoint
|
||||
*/
|
||||
public static function waf() {
|
||||
return rest_ensure_response( Waf_Runner::get_config() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update WAF Endpoint
|
||||
*
|
||||
* @param WP_REST_Request $request The API request.
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public static function update_waf( $request ) {
|
||||
// IP Lists Enabled
|
||||
if ( isset( $request[ Waf_Runner::IP_LISTS_ENABLED_OPTION_NAME ] ) ) {
|
||||
update_option( Waf_Runner::IP_LISTS_ENABLED_OPTION_NAME, (bool) $request->get_param( Waf_Runner::IP_LISTS_ENABLED_OPTION_NAME ) );
|
||||
}
|
||||
|
||||
// IP Block List
|
||||
if ( isset( $request[ Waf_Runner::IP_BLOCK_LIST_OPTION_NAME ] ) ) {
|
||||
update_option( Waf_Runner::IP_BLOCK_LIST_OPTION_NAME, $request[ Waf_Runner::IP_BLOCK_LIST_OPTION_NAME ] );
|
||||
}
|
||||
|
||||
// IP Allow List
|
||||
if ( isset( $request[ Waf_Runner::IP_ALLOW_LIST_OPTION_NAME ] ) ) {
|
||||
update_option( Waf_Runner::IP_ALLOW_LIST_OPTION_NAME, $request[ Waf_Runner::IP_ALLOW_LIST_OPTION_NAME ] );
|
||||
}
|
||||
|
||||
// Share Data
|
||||
if ( isset( $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ) ) {
|
||||
update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, (bool) $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] );
|
||||
}
|
||||
|
||||
Waf_Runner::update_waf();
|
||||
|
||||
return self::waf();
|
||||
}
|
||||
|
||||
/**
|
||||
* WAF Endpoint Permissions Callback
|
||||
*
|
||||
* @return bool|WP_Error True if user can view the Jetpack admin page.
|
||||
*/
|
||||
public static function waf_permissions_callback() {
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return new WP_Error(
|
||||
'invalid_user_permission_manage_options',
|
||||
REST_Connector::get_user_permissions_error_msg(),
|
||||
array( 'status' => rest_authorization_required_code() )
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
<?php
|
||||
/**
|
||||
* CLI handler for Jetpack Waf.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
use \WP_CLI;
|
||||
use \WP_CLI_Command;
|
||||
|
||||
/**
|
||||
* Just a few sample commands to learn how WP-CLI works
|
||||
*/
|
||||
class CLI extends WP_CLI_Command {
|
||||
/**
|
||||
* View or set the current mode of the WAF.
|
||||
* ## OPTIONS
|
||||
*
|
||||
* [<mode>]
|
||||
* : The new mode to be set.
|
||||
* ---
|
||||
* options:
|
||||
* - silent
|
||||
* - normal
|
||||
* ---
|
||||
*
|
||||
* @param array $args Arguments passed to CLI.
|
||||
* @return void|null
|
||||
* @throws WP_CLI\ExitException If there is an error switching the mode.
|
||||
*/
|
||||
public function mode( $args ) {
|
||||
if ( count( $args ) > 1 ) {
|
||||
|
||||
return WP_CLI::error( __( 'Only one mode may be specified.', 'jetpack-waf' ) );
|
||||
}
|
||||
if ( count( $args ) === 1 ) {
|
||||
if ( ! Waf_Runner::is_allowed_mode( $args[0] ) ) {
|
||||
|
||||
return WP_CLI::error(
|
||||
sprintf(
|
||||
/* translators: %1$s is the mode that was actually found. Also note that the expected "silent" and "normal" are hard-coded strings and must therefore stay the same in any translation. */
|
||||
__( 'Invalid mode: %1$s. Expected "silent" or "normal".', 'jetpack-waf' ),
|
||||
$args[0]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
update_option( Waf_Runner::MODE_OPTION_NAME, $args[0] );
|
||||
|
||||
try {
|
||||
( new Waf_Standalone_Bootstrap() )->generate();
|
||||
} catch ( \Exception $e ) {
|
||||
WP_CLI::warning(
|
||||
sprintf(
|
||||
/* translators: %1$s is the unexpected error message. */
|
||||
__( 'Unable to generate waf bootstrap - standalone mode may not work properly: %1$s', 'jetpack-waf' ),
|
||||
$e->getMessage()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return WP_CLI::success(
|
||||
sprintf(
|
||||
/* translators: %1$s is the name of the mode that was just switched to. */
|
||||
__( 'Jetpack WAF mode switched to "%1$s".', 'jetpack-waf' ),
|
||||
get_option( Waf_Runner::MODE_OPTION_NAME )
|
||||
)
|
||||
);
|
||||
}
|
||||
WP_CLI::line(
|
||||
sprintf(
|
||||
/* translators: %1$s is the name of the mode that the waf is currently running in. */
|
||||
__( 'Jetpack WAF is running in "%1$s" mode.', 'jetpack-waf' ),
|
||||
get_option( Waf_Runner::MODE_OPTION_NAME )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the WAF to run.
|
||||
* ## OPTIONS
|
||||
*
|
||||
* [<mode>]
|
||||
* : The new mode to be set.
|
||||
* ---
|
||||
* options:
|
||||
* - silent
|
||||
* - normal
|
||||
* ---
|
||||
*
|
||||
* @param array $args Arguments passed to CLI.
|
||||
* @return void|null
|
||||
* @throws WP_CLI\ExitException If there is an error switching the mode.
|
||||
*/
|
||||
public function setup( $args ) {
|
||||
// Let is_allowed_mode know we are running from the CLI
|
||||
define( 'WAF_CLI_MODE', $args[0] );
|
||||
|
||||
// Set the mode and generate the bootstrap
|
||||
$this->mode( array( $args[0] ) );
|
||||
|
||||
try {
|
||||
// Add relevant options and generate the rules.php file
|
||||
Waf_Runner::activate();
|
||||
} catch ( \Exception $e ) {
|
||||
|
||||
return WP_CLI::error(
|
||||
sprintf(
|
||||
/* translators: %1$s is the unexpected error message. */
|
||||
__( 'Jetpack WAF rules file failed to generate: %1$s', 'jetpack-waf' ),
|
||||
$e->getMessage()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return WP_CLI::success( __( 'Jetpack WAF has successfully been setup.', 'jetpack-waf' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the WAF options.
|
||||
*
|
||||
* @return void|null
|
||||
* @throws WP_CLI\ExitException If deactivating has failures.
|
||||
*/
|
||||
public function teardown() {
|
||||
try {
|
||||
Waf_Runner::deactivate();
|
||||
} catch ( \Exception $e ) {
|
||||
WP_CLI::error( __( 'Jetpack WAF failed to fully deactivate.', 'jetpack-waf' ) );
|
||||
}
|
||||
|
||||
return WP_CLI::success( __( 'Jetpack WAF has been deactivated.', 'jetpack-waf' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the rules.php file with latest rules for the WAF.
|
||||
*
|
||||
* @return void|null
|
||||
* @throws WP_CLI\ExitException If there is an error switching the mode.
|
||||
*/
|
||||
public function generate_rules() {
|
||||
try {
|
||||
Waf_Runner::generate_rules();
|
||||
} catch ( \Exception $e ) {
|
||||
|
||||
return WP_CLI::error(
|
||||
sprintf(
|
||||
/* translators: %1$s is the unexpected error message. */
|
||||
__( 'Jetpack WAF rules file failed to generate: %1$s', 'jetpack-waf' ),
|
||||
$e->getMessage()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return WP_CLI::success(
|
||||
sprintf(
|
||||
/* translators: %1$s is the name of the mode that was just switched to. */
|
||||
__( 'Jetpack WAF rules successfully created to: "%1$s".', 'jetpack-waf' ),
|
||||
Waf_Runner::get_waf_file_path( Waf_Runner::RULES_FILE )
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Class use to define the constants used by the WAF
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
use Automattic\Jetpack\Status\Host;
|
||||
|
||||
/**
|
||||
* Defines our constants.
|
||||
*/
|
||||
class Waf_Constants {
|
||||
/**
|
||||
* Initializes the constants required for generating the bootstrap, if they have not been initialized yet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function initialize_constants() {
|
||||
if ( ! defined( 'JETPACK_WAF_DIR' ) ) {
|
||||
define( 'JETPACK_WAF_DIR', trailingslashit( WP_CONTENT_DIR ) . 'jetpack-waf' );
|
||||
}
|
||||
if ( ! defined( 'JETPACK_WAF_WPCONFIG' ) ) {
|
||||
define( 'JETPACK_WAF_WPCONFIG', trailingslashit( WP_CONTENT_DIR ) . '../wp-config.php' );
|
||||
}
|
||||
if ( ! defined( 'DISABLE_JETPACK_WAF' ) ) {
|
||||
$is_wpcom = defined( 'IS_WPCOM' ) && IS_WPCOM;
|
||||
$is_atomic = ( new Host() )->is_atomic_platform();
|
||||
define( 'DISABLE_JETPACK_WAF', $is_wpcom || $is_atomic );
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/**
|
||||
* Class use to initialize the WAF module.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
/**
|
||||
* Initializes the module
|
||||
*/
|
||||
class Waf_Initializer {
|
||||
|
||||
/**
|
||||
* Option for storing whether or not the WAF files are potentially out of date.
|
||||
*
|
||||
* @var string NEEDS_UPDATE_OPTION_NAME
|
||||
*/
|
||||
const NEEDS_UPDATE_OPTION_NAME = 'jetpack_waf_needs_update';
|
||||
|
||||
/**
|
||||
* Initializes the configurations needed for the waf module.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function init() {
|
||||
// Do not run in unsupported environments
|
||||
add_action( 'jetpack_get_available_modules', __CLASS__ . '::remove_module_on_unsupported_environments' );
|
||||
if ( ! Waf_Runner::is_supported_environment() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the WAF after installing or upgrading a relevant Jetpack plugin
|
||||
add_action( 'upgrader_process_complete', __CLASS__ . '::update_waf_after_plugin_upgrade', 10, 2 );
|
||||
add_action( 'admin_init', __CLASS__ . '::check_for_waf_update' );
|
||||
|
||||
// Activation/Deactivation hooks
|
||||
add_action( 'jetpack_activate_module_waf', __CLASS__ . '::on_activation' );
|
||||
add_action( 'jetpack_deactivate_module_waf', __CLASS__ . '::on_deactivation' );
|
||||
|
||||
// Ensure backwards compatibility
|
||||
Waf_Compatibility::add_compatibility_hooks();
|
||||
|
||||
// Run the WAF
|
||||
Waf_Runner::initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* On module activation set up waf mode
|
||||
*/
|
||||
public static function on_activation() {
|
||||
update_option( Waf_Runner::MODE_OPTION_NAME, 'normal' );
|
||||
Waf_Runner::activate();
|
||||
( new Waf_Standalone_Bootstrap() )->generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* On module deactivation, unset waf mode
|
||||
*/
|
||||
public static function on_deactivation() {
|
||||
Waf_Runner::deactivate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the WAF after upgrader process is complete.
|
||||
*
|
||||
* @param WP_Upgrader $upgrader WP_Upgrader instance. In other contexts this might be a Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
|
||||
* @param array $hook_extra Array of bulk item update data.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function update_waf_after_plugin_upgrade( $upgrader, $hook_extra ) {
|
||||
$jetpack_text_domains_with_waf = array( 'jetpack', 'jetpack-protect' );
|
||||
$jetpack_plugins_with_waf = array( 'jetpack/jetpack.php', 'jetpack-protect/jetpack-protect.php' );
|
||||
|
||||
// Only run on upgrades affecting plugins
|
||||
if ( 'plugin' !== $hook_extra['type'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only run on updates and installations
|
||||
if ( 'update' !== $hook_extra['action'] && 'install' !== $hook_extra['action'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only run when Jetpack plugins were affected
|
||||
if ( 'update' === $hook_extra['action'] &&
|
||||
! empty( $hook_extra['plugins'] ) &&
|
||||
empty( array_intersect( $jetpack_plugins_with_waf, $hook_extra['plugins'] ) )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if ( 'install' === $hook_extra['action'] &&
|
||||
! empty( $upgrader->new_plugin_data['TextDomain'] ) &&
|
||||
empty( in_array( $upgrader->new_plugin_data['TextDomain'], $jetpack_text_domains_with_waf, true ) )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_option( self::NEEDS_UPDATE_OPTION_NAME, 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for WAF update
|
||||
*
|
||||
* Updates the WAF when the "needs update" option is enabled.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function check_for_waf_update() {
|
||||
if ( get_option( self::NEEDS_UPDATE_OPTION_NAME ) ) {
|
||||
Waf_Runner::define_mode();
|
||||
if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Waf_Runner::generate_ip_rules();
|
||||
Waf_Runner::generate_rules();
|
||||
( new Waf_Standalone_Bootstrap() )->generate();
|
||||
|
||||
update_option( self::NEEDS_UPDATE_OPTION_NAME, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the WAF module when on an supported platform.
|
||||
*
|
||||
* @param array $modules Filterable value for `jetpack_get_available_modules`.
|
||||
*
|
||||
* @return array Array of module slugs.
|
||||
*/
|
||||
public static function remove_module_on_unsupported_environments( $modules ) {
|
||||
if ( ! Waf_Runner::is_supported_environment() ) {
|
||||
// WAF should never be available on unsupported platforms.
|
||||
unset( $modules['waf'] );
|
||||
}
|
||||
|
||||
return $modules;
|
||||
}
|
||||
}
|
@ -0,0 +1,286 @@
|
||||
<?php
|
||||
/**
|
||||
* Rule compiler for Jetpack Waf.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
/**
|
||||
* Waf_Operators class
|
||||
*/
|
||||
class Waf_Operators {
|
||||
/**
|
||||
* Returns true if the test string is found at the beginning of the input.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param string $test Test.
|
||||
* @return string|false
|
||||
*/
|
||||
public function begins_with( $input, $test ) {
|
||||
if ( '' === $input && '' === $test ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return substr( $input, 0, strlen( $test ) ) === $test
|
||||
? $test
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the test string is found anywhere in the input.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param string $test Test.
|
||||
* @return string|false
|
||||
*/
|
||||
public function contains( $input, $test ) {
|
||||
if ( empty( $input ) || empty( $test ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return strpos( $input, $test ) !== false
|
||||
? $test
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the test string with word boundaries is found anywhere in the input.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param string $test Test.
|
||||
* @return string|false
|
||||
*/
|
||||
public function contains_word( $input, $test ) {
|
||||
return ( $input === $test || 1 === preg_match( '/\b' . preg_quote( $test, '/' ) . '\b/Ds', $input ) )
|
||||
? $test
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the test string is found at the end of the input.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param string $test Test.
|
||||
* @return string|false
|
||||
*/
|
||||
public function ends_with( $input, $test ) {
|
||||
return ( '' === $test || substr( $input, -1 * strlen( $test ) ) === $test )
|
||||
? $test
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the input value is equal to the test value.
|
||||
* If either value cannot be converted to an int it will be treated as 0.
|
||||
*
|
||||
* @param mixed $input Input.
|
||||
* @param mixed $test Test.
|
||||
* @return int|false
|
||||
*/
|
||||
public function eq( $input, $test ) {
|
||||
return intval( $input ) === intval( $test )
|
||||
? $input
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the input value is greater than or equal to the test value.
|
||||
* If either value cannot be converted to an int it will be treated as 0.
|
||||
*
|
||||
* @param mixed $input Input.
|
||||
* @param mixed $test Test.
|
||||
* @return int|false
|
||||
*/
|
||||
public function ge( $input, $test ) {
|
||||
return intval( $input ) >= intval( $test )
|
||||
? $input
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the input value is greater than the test value.
|
||||
* If either value cannot be converted to an int it will be treated as 0.
|
||||
*
|
||||
* @param mixed $input Input.
|
||||
* @param mixed $test Test.
|
||||
* @return int|false
|
||||
*/
|
||||
public function gt( $input, $test ) {
|
||||
return intval( $input ) > intval( $test )
|
||||
? $input
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the input value is less than or equal to the test value.
|
||||
* If either value cannot be converted to an int it will be treated as 0.
|
||||
*
|
||||
* @param mixed $input Input.
|
||||
* @param mixed $test Test.
|
||||
* @return int|false
|
||||
*/
|
||||
public function le( $input, $test ) {
|
||||
return intval( $input ) <= intval( $test )
|
||||
? $input
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the input value is less than the test value.
|
||||
* If either value cannot be converted to an int it will be treated as 0.
|
||||
*
|
||||
* @param mixed $input Input.
|
||||
* @param mixed $test Test.
|
||||
* @return int|false
|
||||
*/
|
||||
public function lt( $input, $test ) {
|
||||
return intval( $input ) < intval( $test )
|
||||
? $input
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false.
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public function no_match() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses a multi-string matching algorithm to search through $input for a number of given $words.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param string[] $words \AhoCorasick\MultiStringMatcher $matcher.
|
||||
* @return string[]|false Returns the words that were found in $input, or FALSE if no words were found.
|
||||
*/
|
||||
public function pm( $input, $words ) {
|
||||
$results = $this->get_multi_string_matcher( $words )->searchIn( $input );
|
||||
|
||||
return isset( $results[0] )
|
||||
? array_map(
|
||||
function ( $r ) {
|
||||
return $r[1]; },
|
||||
$results
|
||||
)
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The last-used pattern-matching algorithm.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $last_multi_string_matcher = array( null, null );
|
||||
|
||||
/**
|
||||
* Creates a matcher that uses the Aho-Corasick algorithm to efficiently find a number of words in an input string.
|
||||
* Caches the last-used matcher so that the same word list doesn't have to be compiled multiple times.
|
||||
*
|
||||
* @param string[] $words Words.
|
||||
* @return \AhoCorasick\MultiStringMatcher
|
||||
*/
|
||||
private function get_multi_string_matcher( $words ) {
|
||||
// only create a new matcher entity if we don't have one already for this word list.
|
||||
if ( $this->last_multi_string_matcher[0] !== $words ) {
|
||||
$this->last_multi_string_matcher = array( $words, new \AhoCorasick\MultiStringMatcher( $words ) );
|
||||
}
|
||||
|
||||
return $this->last_multi_string_matcher[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a regular expression match on the input subject using the given pattern.
|
||||
* Returns false if the pattern does not match, or the substring(s) of the input
|
||||
* that were matched by the pattern.
|
||||
*
|
||||
* @param string $subject Subject.
|
||||
* @param string $pattern Pattern.
|
||||
* @return string[]|false
|
||||
*/
|
||||
public function rx( $subject, $pattern ) {
|
||||
$matched = preg_match( $pattern, $subject, $matches );
|
||||
return 1 === $matched
|
||||
? $matches
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given input string matches the test string.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param string $test Test.
|
||||
* @return string|false
|
||||
*/
|
||||
public function streq( $input, $test ) {
|
||||
return $input === $test
|
||||
? $test
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true.
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @return bool
|
||||
*/
|
||||
public function unconditional_match( $input ) {
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the input string only contains characters within the given byte range
|
||||
*
|
||||
* @param string $input Input.
|
||||
* @param array $valid_range Valid range.
|
||||
* @return string
|
||||
*/
|
||||
public function validate_byte_range( $input, $valid_range ) {
|
||||
if ( '' === $input ) {
|
||||
// an empty string is considered "valid".
|
||||
return false;
|
||||
}
|
||||
$i = 0;
|
||||
while ( isset( $input[ $i ] ) ) {
|
||||
$n = ord( $input[ $i ] );
|
||||
if ( $n < $valid_range['min'] || $n > $valid_range['max'] ) {
|
||||
return $input[ $i ];
|
||||
}
|
||||
$valid = false;
|
||||
foreach ( $valid_range['range'] as $b ) {
|
||||
if ( $n === $b || is_array( $b ) && $n >= $b[0] && $n <= $b[1] ) {
|
||||
$valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( ! $valid ) {
|
||||
return $input[ $i ];
|
||||
}
|
||||
++$i;
|
||||
}
|
||||
|
||||
// if there weren't any invalid bytes, return false.
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the input value is found anywhere inside the test value
|
||||
* (i.e. the inverse of @contains)
|
||||
*
|
||||
* @param mixed $input Input.
|
||||
* @param mixed $test Test.
|
||||
* @return string|false
|
||||
*/
|
||||
public function within( $input, $test ) {
|
||||
if ( '' === $input || '' === $test ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return stripos( $test, $input ) !== false
|
||||
? $input
|
||||
: false;
|
||||
}
|
||||
}
|
@ -0,0 +1,329 @@
|
||||
<?php
|
||||
/**
|
||||
* HTTP request representation specific for the WAF.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
require_once __DIR__ . '/functions.php';
|
||||
|
||||
/**
|
||||
* Request representation.
|
||||
*
|
||||
* @template RequestFile as array{ name: string, filename: string }
|
||||
*/
|
||||
class Waf_Request {
|
||||
/**
|
||||
* The request URL, broken into three pieces: the host, the filename, and the query string
|
||||
*
|
||||
* @example for `https://wordpress.com/index.php?myvar=red`
|
||||
* $this->url = [ 'https://wordpress.com', '/index.php', '?myvar=red' ]
|
||||
* @var array{ 0: string, 1: string, 2: string }|null
|
||||
*/
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Trusted proxies.
|
||||
*
|
||||
* @var array List of trusted proxy IP addresses.
|
||||
*/
|
||||
private $trusted_proxies = array();
|
||||
|
||||
/**
|
||||
* Trusted headers.
|
||||
*
|
||||
* @var array List of headers to trust from the trusted proxies.
|
||||
*/
|
||||
private $trusted_headers = array();
|
||||
|
||||
/**
|
||||
* Sets the list of IP addresses for the proxies to trust. Trusted headers will only be accepted as the
|
||||
* user IP address from these IP adresses.
|
||||
*
|
||||
* Popular choices include:
|
||||
* - 192.168.0.1
|
||||
* - 10.0.0.1
|
||||
*
|
||||
* @param array $proxies List of proxy IP addresses.
|
||||
* @return void
|
||||
*/
|
||||
public function set_trusted_proxies( $proxies ) {
|
||||
$this->trusted_proxies = (array) $proxies;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list of headers to be trusted from the proxies. These headers will only be taken into account
|
||||
* if the request comes from a trusted proxy as configured with set_trusted_proxies().
|
||||
*
|
||||
* Popular choices include:
|
||||
* - HTTP_CLIENT_IP
|
||||
* - HTTP_X_FORWARDED_FOR
|
||||
* - HTTP_X_FORWARDED
|
||||
* - HTTP_X_CLUSTER_CLIENT_IP
|
||||
* - HTTP_FORWARDED_FOR
|
||||
* - HTTP_FORWARDED
|
||||
*
|
||||
* @param array $headers List of HTTP header strings.
|
||||
* @return void
|
||||
*/
|
||||
public function set_trusted_headers( $headers ) {
|
||||
$this->trusted_headers = (array) $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the users real IP address based on the settings passed to set_trusted_proxies() and
|
||||
* set_trusted_headers() before. On CLI, this will be null.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function get_real_user_ip_address() {
|
||||
$remote_addr = ! empty( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
||||
|
||||
if ( in_array( $remote_addr, $this->trusted_proxies, true ) ) {
|
||||
$ip_by_header = $this->get_ip_by_header( array_merge( $this->trusted_headers, array( 'REMOTE_ADDR' ) ) );
|
||||
if ( ! empty( $ip_by_header ) ) {
|
||||
return $ip_by_header;
|
||||
}
|
||||
}
|
||||
|
||||
return $remote_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates through a given list of HTTP headers and attempts to get the IP address from the header that
|
||||
* a proxy sends along. Make sure you trust the IP address before calling this method.
|
||||
*
|
||||
* @param array $headers The list of headers to check.
|
||||
* @return string|null
|
||||
*/
|
||||
private function get_ip_by_header( $headers ) {
|
||||
foreach ( $headers as $key ) {
|
||||
if ( isset( $_SERVER[ $key ] ) ) {
|
||||
foreach ( explode( ',', wp_unslash( $_SERVER[ $key ] ) ) as $ip ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- filter_var is applied below.
|
||||
$ip = trim( $ip );
|
||||
|
||||
if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) {
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the headers that were sent with this request
|
||||
*
|
||||
* @return array{ 0: string, 1: scalar }[]
|
||||
*/
|
||||
public function get_headers() {
|
||||
$value = array();
|
||||
$has_content_type = false;
|
||||
$has_content_length = false;
|
||||
foreach ( $_SERVER as $k => $v ) {
|
||||
$k = strtolower( $k );
|
||||
if ( 'http_' === substr( $k, 0, 5 ) ) {
|
||||
$value[] = array( $this->normalize_header_name( substr( $k, 5 ) ), $v );
|
||||
} elseif ( 'content_type' === $k && '' !== $v ) {
|
||||
$has_content_type = true;
|
||||
$value[] = array( 'content-type', $v );
|
||||
} elseif ( 'content_length' === $k && '' !== $v ) {
|
||||
$has_content_length = true;
|
||||
$value[] = array( 'content-length', $v );
|
||||
}
|
||||
}
|
||||
if ( ! $has_content_type ) {
|
||||
// default Content-Type per RFC 7231 section 3.1.5.5.
|
||||
$value[] = array( 'content-type', 'application/octet-stream' );
|
||||
}
|
||||
if ( ! $has_content_length ) {
|
||||
$value[] = array( 'content-length', '0' );
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a header name to all-lowercase and replace spaces and underscores with dashes.
|
||||
*
|
||||
* @param string $name The header name to normalize.
|
||||
* @return string
|
||||
*/
|
||||
public function normalize_header_name( $name ) {
|
||||
return str_replace( array( ' ', '_' ), '-', strtolower( $name ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the method for this request (GET, POST, etc).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_method() {
|
||||
return isset( $_SERVER['REQUEST_METHOD'] )
|
||||
? filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_DEFAULT )
|
||||
: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the protocol for this request (HTTP, HTTPS, etc)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_protocol() {
|
||||
return isset( $_SERVER['SERVER_PROTOCOL'] )
|
||||
? filter_var( wp_unslash( $_SERVER['SERVER_PROTOCOL'] ), FILTER_DEFAULT )
|
||||
: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL parts for this request.
|
||||
*
|
||||
* @see $this->url
|
||||
* @return array{ 0: string, 1: string, 2: string }
|
||||
*/
|
||||
protected function get_url() {
|
||||
if ( null !== $this->url ) {
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
$uri = isset( $_SERVER['REQUEST_URI'] ) ? filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_DEFAULT ) : '/';
|
||||
if ( false !== strpos( $uri, '?' ) ) {
|
||||
// remove the query string (we'll pull it from elsewhere later)
|
||||
$uri = substr( $uri, 0, strpos( $uri, '?' ) );
|
||||
}
|
||||
$query_string = isset( $_SERVER['QUERY_STRING'] ) ? '?' . filter_var( wp_unslash( $_SERVER['QUERY_STRING'] ), FILTER_DEFAULT ) : '';
|
||||
if ( 1 === preg_match( '/^https?:\/\//', $uri ) ) {
|
||||
// sometimes $_SERVER[REQUEST_URI] already includes the full domain name
|
||||
$uri_host = substr( $uri, 0, strpos( $uri, '/', 8 ) );
|
||||
$uri_path = substr( $uri, strlen( $uri_host ) );
|
||||
$this->url = array( $uri_host, $uri_path, $query_string );
|
||||
} else {
|
||||
// otherwise build the URI manually
|
||||
$uri_scheme = ( ! empty( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] )
|
||||
? 'https'
|
||||
: 'http';
|
||||
$uri_host = isset( $_SERVER['HTTP_HOST'] )
|
||||
? filter_var( wp_unslash( $_SERVER['HTTP_HOST'] ), FILTER_DEFAULT )
|
||||
: (
|
||||
isset( $_SERVER['SERVER_NAME'] )
|
||||
? filter_var( wp_unslash( $_SERVER['SERVER_NAME'] ), FILTER_DEFAULT )
|
||||
: ''
|
||||
);
|
||||
$uri_port = isset( $_SERVER['SERVER_PORT'] )
|
||||
? filter_var( wp_unslash( $_SERVER['SERVER_PORT'] ), FILTER_SANITIZE_NUMBER_INT )
|
||||
: '';
|
||||
// we only need to include the port if it's non-standard
|
||||
if ( $uri_port && ( 'http' === $uri_scheme && '80' !== $uri_port || 'https' === $uri_scheme && '443' !== $uri_port ) ) {
|
||||
$uri_port = ':' . $uri_port;
|
||||
} else {
|
||||
$uri_port = '';
|
||||
}
|
||||
$this->url = array(
|
||||
$uri_scheme . '://' . $uri_host . $uri_port,
|
||||
$uri,
|
||||
$query_string,
|
||||
);
|
||||
}
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the requested URI
|
||||
*
|
||||
* @param boolean $include_host If true, the scheme and domain will be included in the returned string (i.e. 'https://wordpress.com/index.php).
|
||||
* If false, only the requested URI path will be returned (i.e. '/index.php').
|
||||
* @return string
|
||||
*/
|
||||
public function get_uri( $include_host = false ) {
|
||||
list( $host, $file, $query ) = $this->get_url();
|
||||
|
||||
return ( $include_host ? $host : '' ) . $file . $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the filename part of the request
|
||||
*
|
||||
* @example for 'https://wordpress.com/some/page?id=5', return '/some/page'
|
||||
* @return string
|
||||
*/
|
||||
public function get_filename() {
|
||||
return $this->get_url()[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the query string. If present, it will be prefixed with '?'. Otherwise, it will be an empty string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_query_string() {
|
||||
return $this->get_url()[2];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the request body.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_body() {
|
||||
$body = file_get_contents( 'php://input' );
|
||||
return false === $body ? '' : $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cookies
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function get_cookies() {
|
||||
return flatten_array( $_COOKIE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the GET variables
|
||||
*
|
||||
* @return array<string, mixed|array>
|
||||
*/
|
||||
public function get_get_vars() {
|
||||
return flatten_array( $_GET );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the POST variables
|
||||
*
|
||||
* @return array<string, mixed|array>
|
||||
*/
|
||||
public function get_post_vars() {
|
||||
return flatten_array( $_POST );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the files that were uploaded with this request (i.e. what's in the $_FILES superglobal)
|
||||
*
|
||||
* @return RequestFile[]
|
||||
*/
|
||||
public function get_files() {
|
||||
$files = array();
|
||||
foreach ( $_FILES as $field_name => $arr ) {
|
||||
// flatten the values in case we were given inputs with brackets
|
||||
foreach ( flatten_array( $arr ) as list( $arr_key, $arr_value ) ) {
|
||||
if ( $arr_key === 'name' ) {
|
||||
// if this file was a simple (non-nested) name and unique, then just add it.
|
||||
$files[] = array(
|
||||
'name' => $field_name,
|
||||
'filename' => $arr_value,
|
||||
);
|
||||
} elseif ( 'name[' === substr( $arr_key, 0, 5 ) ) {
|
||||
// otherwise this was a file with a nested name and/or multiple files with the same name
|
||||
$files[] = array(
|
||||
'name' => $field_name . substr( $arr_key, 4 ),
|
||||
'filename' => $arr_value,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
}
|
@ -0,0 +1,612 @@
|
||||
<?php
|
||||
/**
|
||||
* Entrypoint for actually executing the WAF.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
use Automattic\Jetpack\Connection\Client;
|
||||
use Automattic\Jetpack\Modules;
|
||||
use Automattic\Jetpack\Status\Host;
|
||||
use Jetpack_Options;
|
||||
|
||||
/**
|
||||
* Executes the WAF.
|
||||
*/
|
||||
class Waf_Runner {
|
||||
|
||||
const WAF_MODULE_NAME = 'waf';
|
||||
const WAF_RULES_VERSION = '1.0.0';
|
||||
const MODE_OPTION_NAME = 'jetpack_waf_mode';
|
||||
const IP_LISTS_ENABLED_OPTION_NAME = 'jetpack_waf_ip_list';
|
||||
const IP_ALLOW_LIST_OPTION_NAME = 'jetpack_waf_ip_allow_list';
|
||||
const IP_BLOCK_LIST_OPTION_NAME = 'jetpack_waf_ip_block_list';
|
||||
const RULES_FILE = '/rules/rules.php';
|
||||
const ALLOW_IP_FILE = '/rules/allow-ip.php';
|
||||
const BLOCK_IP_FILE = '/rules/block-ip.php';
|
||||
const VERSION_OPTION_NAME = 'jetpack_waf_rules_version';
|
||||
const RULE_LAST_UPDATED_OPTION_NAME = 'jetpack_waf_last_updated_timestamp';
|
||||
const SHARE_DATA_OPTION_NAME = 'jetpack_waf_share_data';
|
||||
|
||||
/**
|
||||
* Run the WAF
|
||||
*/
|
||||
public static function initialize() {
|
||||
if ( ! self::is_enabled() ) {
|
||||
return;
|
||||
}
|
||||
self::define_mode();
|
||||
self::define_share_data();
|
||||
if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) {
|
||||
return;
|
||||
}
|
||||
// Don't run if in standalone mode
|
||||
if ( function_exists( 'add_action' ) ) {
|
||||
self::add_hooks();
|
||||
}
|
||||
if ( ! self::did_run() ) {
|
||||
self::run();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set action hooks
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function add_hooks() {
|
||||
add_action( 'update_option_' . self::IP_ALLOW_LIST_OPTION_NAME, array( static::class, 'activate' ), 10, 0 );
|
||||
add_action( 'update_option_' . self::IP_BLOCK_LIST_OPTION_NAME, array( static::class, 'activate' ), 10, 0 );
|
||||
add_action( 'update_option_' . self::IP_LISTS_ENABLED_OPTION_NAME, array( static::class, 'activate' ), 10, 0 );
|
||||
add_action( 'jetpack_waf_rules_update_cron', array( static::class, 'update_rules_cron' ) );
|
||||
// TODO: This doesn't exactly fit here - may need to find another home
|
||||
if ( ! wp_next_scheduled( 'jetpack_waf_rules_update_cron' ) ) {
|
||||
wp_schedule_event( time(), 'twicedaily', 'jetpack_waf_rules_update_cron' );
|
||||
}
|
||||
// Register REST routes.
|
||||
add_action( 'rest_api_init', array( new REST_Controller(), 'register_rest_routes' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the mode definition if it has not been set.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function define_mode() {
|
||||
if ( ! defined( 'JETPACK_WAF_MODE' ) ) {
|
||||
$mode_option = get_option( self::MODE_OPTION_NAME );
|
||||
define( 'JETPACK_WAF_MODE', $mode_option );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the mode definition if it has not been set.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function define_share_data() {
|
||||
if ( ! defined( 'JETPACK_WAF_SHARE_DATA' ) ) {
|
||||
$share_data_option = get_option( self::SHARE_DATA_OPTION_NAME, false );
|
||||
define( 'JETPACK_WAF_SHARE_DATA', $share_data_option );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Did the WAF run yet or not?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function did_run() {
|
||||
return defined( 'JETPACK_WAF_RUN' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the passed $option is one of the allowed WAF operation modes.
|
||||
*
|
||||
* @param string $option The mode option.
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_allowed_mode( $option ) {
|
||||
// Normal constants are defined prior to WP_CLI running causing problems for activation
|
||||
if ( defined( 'WAF_CLI_MODE' ) ) {
|
||||
$option = WAF_CLI_MODE;
|
||||
}
|
||||
|
||||
$allowed_modes = array(
|
||||
'normal',
|
||||
'silent',
|
||||
);
|
||||
|
||||
return in_array( $option, $allowed_modes, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the WAF is supported in the current environment.
|
||||
*
|
||||
* @since 0.8.0
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_supported_environment() {
|
||||
// Do not run when killswitch is enabled
|
||||
if ( defined( 'DISABLE_JETPACK_WAF' ) && DISABLE_JETPACK_WAF ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Do not run in the WPCOM context
|
||||
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Do not run on the Atomic platform
|
||||
if ( ( new Host() )->is_atomic_platform() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the WAF module is enabled on the site.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_enabled() {
|
||||
// if ABSPATH is defined, then WordPress has already been instantiated,
|
||||
// so we can check to see if the waf module is activated.
|
||||
if ( defined( 'ABSPATH' ) ) {
|
||||
return ( new Modules() )->is_active( self::WAF_MODULE_NAME );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the WAF module on the site.
|
||||
*/
|
||||
public static function enable() {
|
||||
return ( new Modules() )->activate( self::WAF_MODULE_NAME, false, false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Disabled the WAF module on the site.
|
||||
*/
|
||||
public static function disable() {
|
||||
return ( new Modules() )->deactivate( self::WAF_MODULE_NAME );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Config
|
||||
*
|
||||
* @return array The WAF settings and current configuration data.
|
||||
*/
|
||||
public static function get_config() {
|
||||
return array(
|
||||
self::IP_LISTS_ENABLED_OPTION_NAME => get_option( self::IP_LISTS_ENABLED_OPTION_NAME ),
|
||||
self::IP_ALLOW_LIST_OPTION_NAME => get_option( self::IP_ALLOW_LIST_OPTION_NAME ),
|
||||
self::IP_BLOCK_LIST_OPTION_NAME => get_option( self::IP_BLOCK_LIST_OPTION_NAME ),
|
||||
self::SHARE_DATA_OPTION_NAME => get_option( self::SHARE_DATA_OPTION_NAME ),
|
||||
'bootstrap_path' => self::get_bootstrap_file_path(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bootstrap File Path
|
||||
*
|
||||
* @return string The path to the Jetpack Firewall's bootstrap.php file.
|
||||
*/
|
||||
private static function get_bootstrap_file_path() {
|
||||
$bootstrap = new Waf_Standalone_Bootstrap();
|
||||
return $bootstrap->get_bootstrap_file_path();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get WAF File Path
|
||||
*
|
||||
* @param string $file The file path starting in the WAF directory.
|
||||
* @return string The full file path to the provided file in the WAF directory.
|
||||
*/
|
||||
public static function get_waf_file_path( $file ) {
|
||||
Waf_Constants::initialize_constants();
|
||||
|
||||
// Ensure the file path starts with a slash.
|
||||
if ( '/' !== substr( $file, 0, 1 ) ) {
|
||||
$file = "/$file";
|
||||
}
|
||||
|
||||
return JETPACK_WAF_DIR . $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the WAF and potentially stops the request if a problem is found.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function run() {
|
||||
// Make double-sure we are only running once.
|
||||
if ( self::did_run() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Waf_Constants::initialize_constants();
|
||||
|
||||
// if ABSPATH is defined, then WordPress has already been instantiated,
|
||||
// and we're running as a plugin (meh). Otherwise, we're running via something
|
||||
// like PHP's prepend_file setting (yay!).
|
||||
define( 'JETPACK_WAF_RUN', defined( 'ABSPATH' ) ? 'plugin' : 'preload' );
|
||||
|
||||
// if the WAF is being run before a command line script, don't try to execute rules (there's no request).
|
||||
if ( PHP_SAPI === 'cli' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if something terrible happens during the WAF running, we don't want to interfere with the rest of the site,
|
||||
// so we intercept errors ONLY while the WAF is running, then we remove our handler after the WAF finishes.
|
||||
$display_errors = ini_get( 'display_errors' );
|
||||
// phpcs:ignore
|
||||
ini_set( 'display_errors', 'Off' );
|
||||
// phpcs:ignore
|
||||
set_error_handler( array( self::class, 'errorHandler' ) );
|
||||
|
||||
try {
|
||||
|
||||
// phpcs:ignore
|
||||
$waf = new Waf_Runtime( new Waf_Transforms(), new Waf_Operators() );
|
||||
|
||||
// execute waf rules.
|
||||
$rules_file_path = self::get_waf_file_path( self::RULES_FILE );
|
||||
if ( file_exists( $rules_file_path ) ) {
|
||||
// phpcs:ignore
|
||||
include $rules_file_path;
|
||||
}
|
||||
} catch ( \Exception $err ) { // phpcs:ignore
|
||||
// Intentionally doing nothing.
|
||||
}
|
||||
|
||||
// remove the custom error handler, so we don't interfere with the site.
|
||||
restore_error_handler();
|
||||
// phpcs:ignore
|
||||
ini_set( 'display_errors', $display_errors );
|
||||
}
|
||||
|
||||
/**
|
||||
* Error handler to be used while the WAF is being executed.
|
||||
*
|
||||
* @param int $code The error code.
|
||||
* @param string $message The error message.
|
||||
* @param string $file File with the error.
|
||||
* @param string $line Line of the error.
|
||||
* @return void
|
||||
*/
|
||||
public static function errorHandler( $code, $message, $file, $line ) { // phpcs:ignore
|
||||
// Intentionally doing nothing for now.
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the WP filesystem.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception If filesystem is unavailable.
|
||||
*/
|
||||
public static function initialize_filesystem() {
|
||||
if ( ! function_exists( '\\WP_Filesystem' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
}
|
||||
|
||||
if ( ! \WP_Filesystem() ) {
|
||||
throw new \Exception( 'No filesystem available.' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates the WAF by generating the rules script and setting the version
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function activate() {
|
||||
self::define_mode();
|
||||
if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) {
|
||||
return;
|
||||
}
|
||||
$version = get_option( self::VERSION_OPTION_NAME );
|
||||
if ( ! $version ) {
|
||||
add_option( self::VERSION_OPTION_NAME, self::WAF_RULES_VERSION );
|
||||
}
|
||||
|
||||
add_option( self::SHARE_DATA_OPTION_NAME, true );
|
||||
|
||||
self::initialize_filesystem();
|
||||
self::create_waf_directory();
|
||||
self::generate_ip_rules();
|
||||
self::create_blocklog_table();
|
||||
self::generate_rules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Created the waf directory on activation.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception In case there's a problem when creating the directory.
|
||||
*/
|
||||
public static function create_waf_directory() {
|
||||
WP_Filesystem();
|
||||
Waf_Constants::initialize_constants();
|
||||
|
||||
global $wp_filesystem;
|
||||
if ( ! $wp_filesystem ) {
|
||||
throw new \Exception( 'Can not work without the file system being initialized.' );
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->is_dir( JETPACK_WAF_DIR ) ) {
|
||||
if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) {
|
||||
throw new \Exception( 'Failed creating WAF standalone bootstrap file directory: ' . JETPACK_WAF_DIR );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the log table when plugin is activated.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function create_blocklog_table() {
|
||||
global $wpdb;
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
|
||||
$sql = "
|
||||
CREATE TABLE {$wpdb->prefix}jetpack_waf_blocklog (
|
||||
log_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
timestamp datetime NOT NULL,
|
||||
rule_id BIGINT NOT NULL,
|
||||
reason longtext NOT NULL,
|
||||
PRIMARY KEY (log_id),
|
||||
KEY timestamp (timestamp)
|
||||
)
|
||||
";
|
||||
|
||||
dbDelta( $sql );
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivates the WAF by deleting the relevant options and emptying rules file.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception If file writing fails.
|
||||
*/
|
||||
public static function deactivate() {
|
||||
delete_option( self::MODE_OPTION_NAME );
|
||||
delete_option( self::VERSION_OPTION_NAME );
|
||||
|
||||
global $wp_filesystem;
|
||||
|
||||
self::initialize_filesystem();
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( self::get_waf_file_path( self::RULES_FILE ), "<?php\n" ) ) {
|
||||
throw new \Exception( 'Failed to empty rules.php file.' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries periodically to update the rules using our API.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function update_rules_cron() {
|
||||
self::define_mode();
|
||||
if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::generate_ip_rules();
|
||||
self::generate_rules();
|
||||
update_option( self::RULE_LAST_UPDATED_OPTION_NAME, time() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the rule set if rules version has changed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function update_rules_if_changed() {
|
||||
self::define_mode();
|
||||
if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) {
|
||||
return;
|
||||
}
|
||||
$version = get_option( self::VERSION_OPTION_NAME );
|
||||
if ( self::WAF_RULES_VERSION !== $version ) {
|
||||
update_option( self::VERSION_OPTION_NAME, self::WAF_RULES_VERSION );
|
||||
self::generate_ip_rules();
|
||||
self::generate_rules();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle updates to the WAF
|
||||
*/
|
||||
public static function update_waf() {
|
||||
self::update_rules_if_changed();
|
||||
// Re-generate the standalone bootstrap file on every update
|
||||
// TODO: We may consider only doing this when the WAF version changes
|
||||
( new Waf_Standalone_Bootstrap() )->generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve rules from the API
|
||||
*
|
||||
* @throws \Exception If site is not registered.
|
||||
* @throws \Exception If API did not respond 200.
|
||||
* @throws \Exception If data is missing from response.
|
||||
* @return array
|
||||
*/
|
||||
public static function get_rules_from_api() {
|
||||
$blog_id = Jetpack_Options::get_option( 'id' );
|
||||
if ( ! $blog_id ) {
|
||||
throw new \Exception( 'Site is not registered' );
|
||||
}
|
||||
|
||||
$response = Client::wpcom_json_api_request_as_blog(
|
||||
sprintf( '/sites/%s/waf-rules', $blog_id ),
|
||||
'2',
|
||||
array(),
|
||||
null,
|
||||
'wpcom'
|
||||
);
|
||||
|
||||
$response_code = wp_remote_retrieve_response_code( $response );
|
||||
|
||||
if ( 200 !== $response_code ) {
|
||||
throw new \Exception( 'API connection failed.', $response_code );
|
||||
}
|
||||
|
||||
$rules_json = wp_remote_retrieve_body( $response );
|
||||
$rules = json_decode( $rules_json, true );
|
||||
|
||||
if ( empty( $rules['data'] ) ) {
|
||||
throw new \Exception( 'Data missing from response.' );
|
||||
}
|
||||
|
||||
return $rules['data'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the rules.php script
|
||||
*
|
||||
* @throws \Exception If file writing fails.
|
||||
* @return void
|
||||
*/
|
||||
public static function generate_rules() {
|
||||
/**
|
||||
* WordPress filesystem abstraction.
|
||||
*
|
||||
* @var \WP_Filesystem_Base $wp_filesystem
|
||||
*/
|
||||
global $wp_filesystem;
|
||||
|
||||
self::initialize_filesystem();
|
||||
|
||||
$rules_file_path = self::get_waf_file_path( self::RULES_FILE );
|
||||
|
||||
$api_exception = null;
|
||||
$throw_api_exception = true;
|
||||
try {
|
||||
$rules = self::get_rules_from_api();
|
||||
} catch ( \Exception $e ) {
|
||||
if ( 401 === $e->getCode() ) {
|
||||
// do not throw API exceptions for users who do not have access
|
||||
$throw_api_exception = false;
|
||||
}
|
||||
|
||||
if ( $wp_filesystem->exists( $rules_file_path ) && $throw_api_exception ) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$rules = "<?php\n";
|
||||
$api_exception = $e;
|
||||
}
|
||||
|
||||
// Ensure that the folder exists.
|
||||
if ( ! $wp_filesystem->is_dir( dirname( $rules_file_path ) ) ) {
|
||||
$wp_filesystem->mkdir( dirname( $rules_file_path ) );
|
||||
}
|
||||
|
||||
$ip_allow_rules = self::get_waf_file_path( self::ALLOW_IP_FILE );
|
||||
$ip_block_rules = self::get_waf_file_path( self::BLOCK_IP_FILE );
|
||||
|
||||
$ip_list_code = "if ( file_exists( '$ip_allow_rules' ) ) { if ( require( '$ip_allow_rules' ) ) { return; } }\n" .
|
||||
"if ( file_exists( '$ip_block_rules' ) ) { if ( require( '$ip_block_rules' ) ) { return \$waf->block('block', -1, 'ip block list'); } }\n";
|
||||
|
||||
$rules_divided_by_line = explode( "\n", $rules );
|
||||
array_splice( $rules_divided_by_line, 1, 0, $ip_list_code );
|
||||
|
||||
$rules = implode( "\n", $rules_divided_by_line );
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $rules_file_path, $rules ) ) {
|
||||
throw new \Exception( 'Failed writing rules file to: ' . $rules_file_path );
|
||||
}
|
||||
|
||||
if ( null !== $api_exception && $throw_api_exception ) {
|
||||
throw $api_exception;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We allow for both, one IP per line or comma-; semicolon; or whitespace-separated lists. This also validates the IP addresses
|
||||
* and only returns the ones that look valid.
|
||||
*
|
||||
* @param string $ips List of ips - example: "8.8.8.8\n4.4.4.4,2.2.2.2;1.1.1.1 9.9.9.9,5555.5555.5555.5555".
|
||||
* @return array List of valid IP addresses. - example based on input example: array('8.8.8.8', '4.4.4.4', '2.2.2.2', '1.1.1.1', '9.9.9.9')
|
||||
*/
|
||||
private static function ip_option_to_array( $ips ) {
|
||||
$ips = (string) $ips;
|
||||
$ips = preg_split( '/[\s,;]/', $ips );
|
||||
|
||||
$result = array();
|
||||
|
||||
foreach ( $ips as $ip ) {
|
||||
if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) {
|
||||
$result[] = $ip;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the rules.php script
|
||||
*
|
||||
* @throws \Exception If filesystem is not available.
|
||||
* @throws \Exception If file writing fails.
|
||||
* @return void
|
||||
*/
|
||||
public static function generate_ip_rules() {
|
||||
/**
|
||||
* WordPress filesystem abstraction.
|
||||
*
|
||||
* @var \WP_Filesystem_Base $wp_filesystem
|
||||
*/
|
||||
global $wp_filesystem;
|
||||
|
||||
self::initialize_filesystem();
|
||||
|
||||
$rules_file_path = self::get_waf_file_path( self::RULES_FILE );
|
||||
$allow_ip_file_path = self::get_waf_file_path( self::ALLOW_IP_FILE );
|
||||
$block_ip_file_path = self::get_waf_file_path( self::BLOCK_IP_FILE );
|
||||
|
||||
// Ensure that the folder exists.
|
||||
if ( ! $wp_filesystem->is_dir( dirname( $rules_file_path ) ) ) {
|
||||
$wp_filesystem->mkdir( dirname( $rules_file_path ) );
|
||||
}
|
||||
|
||||
$allow_list = self::ip_option_to_array( get_option( self::IP_ALLOW_LIST_OPTION_NAME ) );
|
||||
$block_list = self::ip_option_to_array( get_option( self::IP_BLOCK_LIST_OPTION_NAME ) );
|
||||
|
||||
$lists_enabled = (bool) get_option( self::IP_LISTS_ENABLED_OPTION_NAME );
|
||||
if ( false === $lists_enabled ) {
|
||||
// Making the lists empty effectively disabled the feature while still keeping the other WAF rules evaluation active.
|
||||
$allow_list = array();
|
||||
$block_list = array();
|
||||
}
|
||||
|
||||
$allow_rules_content = '';
|
||||
// phpcs:disable WordPress.PHP.DevelopmentFunctions
|
||||
$allow_rules_content .= '$waf_allow_list = ' . var_export( $allow_list, true ) . ";\n";
|
||||
// phpcs:enable
|
||||
$allow_rules_content .= 'return $waf->is_ip_in_array( $waf_allow_list );' . "\n";
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $allow_ip_file_path, "<?php\n$allow_rules_content" ) ) {
|
||||
throw new \Exception( 'Failed writing allow list file to: ' . $allow_ip_file_path );
|
||||
}
|
||||
|
||||
$block_rules_content = '';
|
||||
// phpcs:disable WordPress.PHP.DevelopmentFunctions
|
||||
$block_rules_content .= '$waf_block_list = ' . var_export( $block_list, true ) . ";\n";
|
||||
// phpcs:enable
|
||||
$block_rules_content .= 'return $waf->is_ip_in_array( $waf_block_list );' . "\n";
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $block_ip_file_path, "<?php\n$block_rules_content" ) ) {
|
||||
throw new \Exception( 'Failed writing block list file to: ' . $block_ip_file_path );
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,783 @@
|
||||
<?php
|
||||
/**
|
||||
* Runtime for Jetpack Waf
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
require_once __DIR__ . '/functions.php';
|
||||
|
||||
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about sanitizing input.
|
||||
|
||||
/**
|
||||
* The environment variable that defined the WAF running mode.
|
||||
*
|
||||
* @var string JETPACK_WAF_MODE
|
||||
*/
|
||||
|
||||
/**
|
||||
* Waf_Runtime class
|
||||
*
|
||||
* @template Target as array{ only?: string[], except?: string[], count?: boolean }
|
||||
* @template TargetBag as array<string, Target>
|
||||
*/
|
||||
class Waf_Runtime {
|
||||
/**
|
||||
* If used, normalize_array_targets() will just return the number of matching values, instead of the values themselves.
|
||||
*/
|
||||
const NORMALIZE_ARRAY_COUNT = 1;
|
||||
/**
|
||||
* If used, normalize_array_targets() will apply "only" and "except" filters to the values of the source array, instead of the keys.
|
||||
*/
|
||||
const NORMALIZE_ARRAY_MATCH_VALUES = 2;
|
||||
|
||||
/**
|
||||
* Last rule.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $last_rule = '';
|
||||
/**
|
||||
* Matched vars.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $matched_vars = array();
|
||||
/**
|
||||
* Matched var.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $matched_var = '';
|
||||
/**
|
||||
* Matched var names.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $matched_var_names = array();
|
||||
/**
|
||||
* Matched var name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $matched_var_name = '';
|
||||
|
||||
/**
|
||||
* State.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $state = array();
|
||||
/**
|
||||
* Metadata.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $metadata = array();
|
||||
|
||||
/**
|
||||
* Transforms.
|
||||
*
|
||||
* @var Waf_Transforms
|
||||
*/
|
||||
private $transforms;
|
||||
/**
|
||||
* Operators.
|
||||
*
|
||||
* @var Waf_Operators
|
||||
*/
|
||||
private $operators;
|
||||
|
||||
/**
|
||||
* The request
|
||||
*
|
||||
* @var Waf_Request
|
||||
*/
|
||||
private $request;
|
||||
|
||||
/**
|
||||
* Rules to remove.
|
||||
*
|
||||
* @var array[]
|
||||
*/
|
||||
private $rules_to_remove = array(
|
||||
'id' => array(),
|
||||
'tag' => array(),
|
||||
);
|
||||
|
||||
/**
|
||||
* Targets to remove.
|
||||
*
|
||||
* @var array[]
|
||||
*/
|
||||
private $targets_to_remove = array(
|
||||
'id' => array(),
|
||||
'tag' => array(),
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor method.
|
||||
*
|
||||
* @param Waf_Transforms $transforms Transforms.
|
||||
* @param Waf_Operators $operators Operators.
|
||||
* @param Waf_Request? $request Information about the request.
|
||||
*/
|
||||
public function __construct( $transforms, $operators, $request = null ) {
|
||||
$this->transforms = $transforms;
|
||||
$this->operators = $operators;
|
||||
$this->request = null === $request
|
||||
? new Waf_Request()
|
||||
: $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rule removed method.
|
||||
*
|
||||
* @param string $id Ids.
|
||||
* @param string[] $tags Tags.
|
||||
*/
|
||||
public function rule_removed( $id, $tags ) {
|
||||
if ( isset( $this->rules_to_remove['id'][ $id ] ) ) {
|
||||
return true;
|
||||
}
|
||||
foreach ( $tags as $tag ) {
|
||||
if ( isset( $this->rules_to_remove['tag'][ $tag ] ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Targets.
|
||||
*
|
||||
* @param array $targets Targets.
|
||||
* @param string $rule_id Rule id.
|
||||
* @param string[] $rule_tags Rule tags.
|
||||
*/
|
||||
public function update_targets( $targets, $rule_id, $rule_tags ) {
|
||||
$updates = array();
|
||||
// look for target updates based on the rule's ID.
|
||||
if ( isset( $this->targets_to_remove['id'][ $rule_id ] ) ) {
|
||||
foreach ( $this->targets_to_remove['id'][ $rule_id ] as $name => $props ) {
|
||||
$updates[] = array( $name, $props );
|
||||
}
|
||||
}
|
||||
// look for target updates based on the rule's tags.
|
||||
foreach ( $rule_tags as $tag ) {
|
||||
if ( isset( $this->targets_to_remove['tag'][ $tag ] ) ) {
|
||||
foreach ( $this->targets_to_remove['tag'][ $tag ] as $name => $props ) {
|
||||
$updates[] = array( $name, $props );
|
||||
}
|
||||
}
|
||||
}
|
||||
// apply any found target updates.
|
||||
|
||||
foreach ( $updates as list( $name, $props ) ) {
|
||||
if ( isset( $targets[ $name ] ) ) {
|
||||
// we only need to remove targets that exist.
|
||||
if ( true === $props ) {
|
||||
// if the entire target is being removed, remove it.
|
||||
unset( $targets[ $name ] );
|
||||
} else {
|
||||
// otherwise just mark single props to ignore.
|
||||
$targets[ $name ]['except'] = array_merge(
|
||||
isset( $targets[ $name ]['except'] ) ? $targets[ $name ]['except'] : array(),
|
||||
$props
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return TRUE if at least one of the targets matches the rule.
|
||||
*
|
||||
* @param string[] $transforms One of the transform methods defined in the Jetpack Waf_Transforms class.
|
||||
* @param TargetBag $targets Targets.
|
||||
* @param string $match_operator Match operator.
|
||||
* @param mixed $match_value Match value.
|
||||
* @param bool $match_not Match not.
|
||||
* @param bool $capture Capture.
|
||||
* @return bool
|
||||
*/
|
||||
public function match_targets( $transforms, $targets, $match_operator, $match_value, $match_not, $capture = false ) {
|
||||
$this->matched_vars = array();
|
||||
$this->matched_var_names = array();
|
||||
$this->matched_var = '';
|
||||
$this->matched_var_name = '';
|
||||
$match_found = false;
|
||||
|
||||
// get values.
|
||||
$values = $this->normalize_targets( $targets );
|
||||
|
||||
// apply transforms.
|
||||
foreach ( $transforms as $t ) {
|
||||
foreach ( $values as &$v ) {
|
||||
$v['value'] = $this->transforms->$t( $v['value'] );
|
||||
}
|
||||
}
|
||||
|
||||
// pass each target value to the operator to find any that match.
|
||||
$matched = array();
|
||||
$captures = array();
|
||||
foreach ( $values as $v ) {
|
||||
$match = $this->operators->{$match_operator}( $v['value'], $match_value );
|
||||
$did_match = false !== $match;
|
||||
if ( $match_not !== $did_match ) {
|
||||
// If either:
|
||||
// - rule is negated ("not" flag set) and the target was not matched
|
||||
// - rule not negated and the target was matched
|
||||
// then this is considered a match.
|
||||
$match_found = true;
|
||||
$this->matched_var_names[] = $v['source'];
|
||||
$this->matched_vars[] = $v['value'];
|
||||
$this->matched_var_name = end( $this->matched_var_names );
|
||||
$this->matched_var = end( $this->matched_vars );
|
||||
$matched[] = array( $v, $match );
|
||||
// Set any captured matches into state if the rule has the "capture" flag.
|
||||
if ( $capture ) {
|
||||
$captures = is_array( $match ) ? $match : array( $match );
|
||||
foreach ( array_slice( $captures, 0, 10 ) as $i => $c ) {
|
||||
$this->set_var( "tx.$i", $c );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $match_found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Block.
|
||||
*
|
||||
* @param string $action Action.
|
||||
* @param string $rule_id Rule id.
|
||||
* @param string $reason Block reason.
|
||||
* @param int $status_code Http status code.
|
||||
*/
|
||||
public function block( $action, $rule_id, $reason, $status_code = 403 ) {
|
||||
if ( ! $reason ) {
|
||||
$reason = "rule $rule_id";
|
||||
} else {
|
||||
$reason = $this->sanitize_output( $reason );
|
||||
}
|
||||
|
||||
$this->write_blocklog( $rule_id, $reason );
|
||||
error_log( "Jetpack WAF Blocked Request\t$action\t$rule_id\t$status_code\t$reason" );
|
||||
header( "X-JetpackWAF-Blocked: $status_code - rule $rule_id" );
|
||||
if ( defined( 'JETPACK_WAF_MODE' ) && 'normal' === JETPACK_WAF_MODE ) {
|
||||
$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? wp_unslash( $_SERVER['SERVER_PROTOCOL'] ) : 'HTTP';
|
||||
header( $protocol . ' 403 Forbidden', true, $status_code );
|
||||
die( "rule $rule_id - reason $reason" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write block logs. We won't write to the file if it exceeds 100 mb.
|
||||
*
|
||||
* @param string $rule_id Rule id.
|
||||
* @param string $reason Block reason.
|
||||
*/
|
||||
public function write_blocklog( $rule_id, $reason ) {
|
||||
$log_data = array();
|
||||
$log_data['rule_id'] = $rule_id;
|
||||
$log_data['reason'] = $reason;
|
||||
$log_data['timestamp'] = gmdate( 'Y-m-d H:i:s' );
|
||||
|
||||
if ( defined( 'JETPACK_WAF_SHARE_DATA' ) && JETPACK_WAF_SHARE_DATA ) {
|
||||
$file_path = JETPACK_WAF_DIR . '/waf-blocklog';
|
||||
$file_exists = file_exists( $file_path );
|
||||
|
||||
if ( ! $file_exists || filesize( $file_path ) < ( 100 * 1024 * 1024 ) ) {
|
||||
$fp = fopen( $file_path, 'a+' );
|
||||
|
||||
if ( $fp ) {
|
||||
try {
|
||||
fwrite( $fp, json_encode( $log_data ) . "\n" );
|
||||
} finally {
|
||||
fclose( $fp );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->write_blocklog_row( $log_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Write block logs to database.
|
||||
*
|
||||
* @param array $log_data Log data.
|
||||
*/
|
||||
private function write_blocklog_row( $log_data ) {
|
||||
$conn = $this->connect_to_wordpress_db();
|
||||
|
||||
if ( ! $conn ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $table_prefix;
|
||||
|
||||
$statement = $conn->prepare( "INSERT INTO {$table_prefix}jetpack_waf_blocklog(reason,rule_id, timestamp) VALUES (?, ?, ?)" );
|
||||
if ( false !== $statement ) {
|
||||
$statement->bind_param( 'sis', $log_data['reason'], $log_data['rule_id'], $log_data['timestamp'] );
|
||||
$statement->execute();
|
||||
|
||||
if ( $conn->insert_id > 100 ) {
|
||||
$conn->query( "DELETE FROM {$table_prefix}jetpack_waf_blocklog ORDER BY log_id LIMIT 1" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to WordPress database.
|
||||
*/
|
||||
private function connect_to_wordpress_db() {
|
||||
if ( ! file_exists( JETPACK_WAF_WPCONFIG ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once JETPACK_WAF_WPCONFIG;
|
||||
$conn = new \mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME ); // phpcs:ignore WordPress.DB.RestrictedClasses.mysql__mysqli
|
||||
|
||||
if ( $conn->connect_error ) {
|
||||
error_log( 'Could not connect to the database:' . $conn->connect_error );
|
||||
return null;
|
||||
}
|
||||
|
||||
return $conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect.
|
||||
*
|
||||
* @param string $rule_id Rule id.
|
||||
* @param string $url Url.
|
||||
*/
|
||||
public function redirect( $rule_id, $url ) {
|
||||
error_log( "Jetpack WAF Redirected Request.\tRule:$rule_id\t$url" );
|
||||
header( "Location: $url" );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag rule for removal.
|
||||
*
|
||||
* @param string $prop Prop.
|
||||
* @param string $value Value.
|
||||
*/
|
||||
public function flag_rule_for_removal( $prop, $value ) {
|
||||
if ( 'id' === $prop ) {
|
||||
$this->rules_to_remove['id'][ $value ] = true;
|
||||
} else {
|
||||
$this->rules_to_remove['tag'][ $value ] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag target for removal.
|
||||
*
|
||||
* @param string $id_or_tag Id or tag.
|
||||
* @param string $id_or_tag_value Id or tag value.
|
||||
* @param string $name Name.
|
||||
* @param string $prop Prop.
|
||||
*/
|
||||
public function flag_target_for_removal( $id_or_tag, $id_or_tag_value, $name, $prop = null ) {
|
||||
if ( null === $prop ) {
|
||||
$this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] = true;
|
||||
} elseif (
|
||||
! isset( $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] )
|
||||
// if the entire target is already being removed then it would be redundant to remove a single property.
|
||||
|| true !== $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ]
|
||||
) {
|
||||
$this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ][] = $prop;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get variable value.
|
||||
*
|
||||
* @param string $key Key.
|
||||
*/
|
||||
public function get_var( $key ) {
|
||||
return isset( $this->state[ $key ] )
|
||||
? $this->state[ $key ]
|
||||
: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set variable value.
|
||||
*
|
||||
* @param string $key Key.
|
||||
* @param string $value Value.
|
||||
*/
|
||||
public function set_var( $key, $value ) {
|
||||
$this->state[ $key ] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment variable.
|
||||
*
|
||||
* @param string $key Key.
|
||||
* @param mixed $value Value.
|
||||
*/
|
||||
public function inc_var( $key, $value ) {
|
||||
if ( ! isset( $this->state[ $key ] ) ) {
|
||||
$this->state[ $key ] = 0;
|
||||
}
|
||||
$this->state[ $key ] += floatval( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrement variable.
|
||||
*
|
||||
* @param string $key Key.
|
||||
* @param mixed $value Value.
|
||||
*/
|
||||
public function dec_var( $key, $value ) {
|
||||
if ( ! isset( $this->state[ $key ] ) ) {
|
||||
$this->state[ $key ] = 0;
|
||||
}
|
||||
$this->state[ $key ] -= floatval( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Unset variable.
|
||||
*
|
||||
* @param string $key Key.
|
||||
*/
|
||||
public function unset_var( $key ) {
|
||||
unset( $this->state[ $key ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* A cache of metadata about the incoming request.
|
||||
*
|
||||
* @param string $key The type of metadata to request ('headers', 'request_method', etc.).
|
||||
*/
|
||||
public function meta( $key ) {
|
||||
if ( ! isset( $this->metadata[ $key ] ) ) {
|
||||
$value = null;
|
||||
switch ( $key ) {
|
||||
case 'headers':
|
||||
$value = $this->request->get_headers();
|
||||
break;
|
||||
case 'headers_names':
|
||||
$value = $this->args_names( $this->meta( 'headers' ) );
|
||||
break;
|
||||
case 'request_method':
|
||||
$value = $this->request->get_method();
|
||||
break;
|
||||
case 'request_protocol':
|
||||
$value = $this->request->get_protocol();
|
||||
break;
|
||||
case 'request_uri':
|
||||
$value = $this->request->get_uri( false );
|
||||
break;
|
||||
case 'request_uri_raw':
|
||||
$value = $this->request->get_uri( true );
|
||||
break;
|
||||
case 'request_filename':
|
||||
$value = $this->request->get_filename();
|
||||
break;
|
||||
case 'request_line':
|
||||
$value = sprintf(
|
||||
'%s %s %s',
|
||||
$this->request->get_method(),
|
||||
$this->request->get_uri( false ),
|
||||
$this->request->get_protocol()
|
||||
);
|
||||
break;
|
||||
case 'request_basename':
|
||||
$value = basename( $this->request->get_filename() );
|
||||
break;
|
||||
case 'request_body':
|
||||
$value = $this->request->get_body();
|
||||
break;
|
||||
case 'query_string':
|
||||
$value = $this->request->get_query_string();
|
||||
break;
|
||||
case 'args_get':
|
||||
$value = $this->request->get_get_vars();
|
||||
break;
|
||||
case 'args_get_names':
|
||||
$value = $this->args_names( $this->meta( 'args_get' ) );
|
||||
break;
|
||||
case 'args_post':
|
||||
$value = $this->request->get_post_vars();
|
||||
break;
|
||||
case 'args_post_names':
|
||||
$value = $this->args_names( $this->meta( 'args_post' ) );
|
||||
break;
|
||||
case 'args':
|
||||
$value = array_merge( $this->meta( 'args_get' ), $this->meta( 'args_post' ) );
|
||||
break;
|
||||
case 'args_names':
|
||||
$value = $this->args_names( $this->meta( 'args' ) );
|
||||
break;
|
||||
case 'request_cookies':
|
||||
$value = $this->request->get_cookies();
|
||||
break;
|
||||
case 'request_cookies_names':
|
||||
$value = $this->args_names( $this->meta( 'request_cookies' ) );
|
||||
break;
|
||||
case 'files':
|
||||
$value = array();
|
||||
foreach ( $this->request->get_files() as $f ) {
|
||||
$value[] = array( $f['name'], $f['filename'] );
|
||||
}
|
||||
break;
|
||||
case 'files_names':
|
||||
$value = $this->args_names( $this->meta( 'files' ) );
|
||||
break;
|
||||
}
|
||||
$this->metadata[ $key ] = $value;
|
||||
}
|
||||
|
||||
return $this->metadata[ $key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* State values.
|
||||
*
|
||||
* @param string $prefix Prefix.
|
||||
*/
|
||||
private function state_values( $prefix ) {
|
||||
$output = array();
|
||||
$len = strlen( $prefix );
|
||||
foreach ( $this->state as $k => $v ) {
|
||||
if ( 0 === stripos( $k, $prefix ) ) {
|
||||
$output[ substr( $k, $len ) ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a string to all lowercase and replace spaces and underscores with dashes.
|
||||
*
|
||||
* @param string $name Name.
|
||||
* @return string
|
||||
*/
|
||||
public function normalize_header_name( $name ) {
|
||||
return str_replace( array( ' ', '_' ), '-', strtolower( $name ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get match-able values from a collection of targets.
|
||||
*
|
||||
* This function expects an associative array of target items, and returns an array of possible values from those targets that can be used to match against.
|
||||
* The key is the lowercase target name (i.e. `args`, `request_headers`, etc) - see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Variables
|
||||
* The value is an associative array of options that define how to narrow down the returned values for that target if it's an array (ARGS, for example). The possible options are:
|
||||
* count: If `true`, then the returned value will a count of how many matched targets were found, rather then the actual values of those targets.
|
||||
* For example, &ARGS_GET will return the number of keys the query string.
|
||||
* only: If specified, then only values in that target that match the given key will be returned.
|
||||
* For example, ARGS_GET:id|ARGS_GET:/^name/ will only return the values for `$_GET['id']` and any key in `$_GET` that starts with `name`
|
||||
* except: If specified, then values in that target will be left out from the returned values (even if they were included in an `only` option)
|
||||
* For example, ARGS_GET|!ARGS_GET:z will return every value from `$_GET` except for `$_GET['z']`.
|
||||
*
|
||||
* This function will return an array of associative arrays. Each with:
|
||||
* name: The target name that this value came from (i.e. the key in the input `$targets` argument )
|
||||
* source: For targets that are associative arrays (like ARGS), this will be the target name AND the key in that target (i.e. "args:z" for ARGS:z)
|
||||
* value: The value that was found in the associated target.
|
||||
*
|
||||
* @param TargetBag $targets An assoc. array with keys that are target name(s) and values are options for how to process that target (include/exclude rules, whether to return values or counts).
|
||||
* @return array{ name: string, source: string, value: mixed }
|
||||
*/
|
||||
public function normalize_targets( $targets ) {
|
||||
$return = array();
|
||||
foreach ( $targets as $k => $v ) {
|
||||
$count_only = isset( $v['count'] ) ? self::NORMALIZE_ARRAY_COUNT : 0;
|
||||
$only = isset( $v['only'] ) ? $v['only'] : array();
|
||||
$except = isset( $v['except'] ) ? $v['except'] : array();
|
||||
$_k = strtolower( $k );
|
||||
switch ( $_k ) {
|
||||
case 'request_headers':
|
||||
$this->normalize_array_target(
|
||||
// get the headers that came in with this request
|
||||
$this->meta( 'headers' ),
|
||||
// ensure only and exclude filters are normalized
|
||||
array_map( array( $this->request, 'normalize_header_name' ), $only ),
|
||||
array_map( array( $this->request, 'normalize_header_name' ), $except ),
|
||||
$k,
|
||||
$return,
|
||||
// flags
|
||||
$count_only
|
||||
);
|
||||
continue 2;
|
||||
case 'request_headers_names':
|
||||
$this->normalize_array_target( $this->meta( 'headers_names' ), $only, $except, $k, $return, $count_only | self::NORMALIZE_ARRAY_MATCH_VALUES );
|
||||
continue 2;
|
||||
case 'request_method':
|
||||
case 'request_protocol':
|
||||
case 'request_uri':
|
||||
case 'request_uri_raw':
|
||||
case 'request_filename':
|
||||
case 'request_basename':
|
||||
case 'request_body':
|
||||
case 'query_string':
|
||||
case 'request_line':
|
||||
$v = $this->meta( $_k );
|
||||
break;
|
||||
case 'tx':
|
||||
case 'ip':
|
||||
$this->normalize_array_target( $this->state_values( "$k." ), $only, $except, $k, $return, $count_only );
|
||||
continue 2;
|
||||
case 'request_cookies':
|
||||
case 'args':
|
||||
case 'args_get':
|
||||
case 'args_post':
|
||||
case 'files':
|
||||
$this->normalize_array_target( $this->meta( $_k ), $only, $except, $k, $return, $count_only );
|
||||
continue 2;
|
||||
case 'request_cookies_names':
|
||||
case 'args_names':
|
||||
case 'args_get_names':
|
||||
case 'args_post_names':
|
||||
case 'files_names':
|
||||
// get the "full" data (for 'args_names' get data for 'args') and stripe it down to just the key names
|
||||
$data = array_map(
|
||||
function ( $item ) {
|
||||
return $item[0]; },
|
||||
$this->meta( substr( $_k, 0, -6 ) )
|
||||
);
|
||||
$this->normalize_array_target( $data, $only, $except, $k, $return, $count_only | self::NORMALIZE_ARRAY_MATCH_VALUES );
|
||||
continue 2;
|
||||
default:
|
||||
var_dump( 'Unknown target', $k, $v );
|
||||
exit;
|
||||
}
|
||||
$return[] = array(
|
||||
'name' => $k,
|
||||
'value' => $v,
|
||||
'source' => $k,
|
||||
);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies is ip from request is in an array.
|
||||
*
|
||||
* @param array $array Array to verify ip against.
|
||||
*/
|
||||
public function is_ip_in_array( $array ) {
|
||||
$real_ip = $this->request->get_real_user_ip_address();
|
||||
|
||||
return in_array( $real_ip, $array, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract values from an associative array, potentially applying filters and/or counting results.
|
||||
*
|
||||
* @param array{ 0: string, 1: scalar }|scalar[] $source The source assoc. array of values (i.e. $_GET, $_SERVER, etc.).
|
||||
* @param string[] $only Only include the values for these keys in the output.
|
||||
* @param string[] $excl Never include the values for these keys in the output.
|
||||
* @param string $name The name of this target (see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Variables).
|
||||
* @param array $results Array to add output values to, will be modified by this method.
|
||||
* @param int $flags Any of the NORMALIZE_ARRAY_* constants defined at the top of the class.
|
||||
*/
|
||||
private function normalize_array_target( $source, $only, $excl, $name, &$results, $flags = 0 ) {
|
||||
$output = array();
|
||||
$has_only = isset( $only[0] );
|
||||
$has_excl = isset( $excl[0] );
|
||||
|
||||
foreach ( $source as $source_key => $source_val ) {
|
||||
if ( is_array( $source_val ) ) {
|
||||
// if $source_val looks like a tuple from flatten_array(), then use the tuple as the key and value
|
||||
$source_key = $source_val[0];
|
||||
$source_val = $source_val[1];
|
||||
}
|
||||
$filter_match = ( $flags & self::NORMALIZE_ARRAY_MATCH_VALUES ) > 0 ? $source_val : $source_key;
|
||||
// if this key is on the "exclude" list, skip it
|
||||
if ( $has_excl && $this->key_matches( $filter_match, $excl ) ) {
|
||||
continue;
|
||||
}
|
||||
// if this key isn't in our "only" list, then skip it
|
||||
if ( $has_only && ! $this->key_matches( $filter_match, $only ) ) {
|
||||
continue;
|
||||
}
|
||||
// otherwise add this key/value to our output
|
||||
$output[] = array( $source_key, $source_val );
|
||||
}
|
||||
|
||||
if ( ( $flags & self::NORMALIZE_ARRAY_COUNT ) > 0 ) {
|
||||
// If we've been told to just count the values, then just count them.
|
||||
$results[] = array(
|
||||
'name' => (string) $name,
|
||||
'value' => count( $output ),
|
||||
'source' => '&' . $name,
|
||||
);
|
||||
} else {
|
||||
foreach ( $output as list( $item_name, $item_value ) ) {
|
||||
$results[] = array(
|
||||
'name' => (string) $item_name,
|
||||
'value' => $item_value,
|
||||
'source' => "$name:$item_name",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an array of tuples - probably from flatten_array() - return a new array
|
||||
* consisting of only the first value (the key name) from each tuple.
|
||||
*
|
||||
* @param array{0:string, 1:scalar}[] $flat_array An array of tuples.
|
||||
* @return string[]
|
||||
*/
|
||||
private function args_names( $flat_array ) {
|
||||
$names = array_map(
|
||||
function ( $tuple ) {
|
||||
return $tuple[0];
|
||||
},
|
||||
$flat_array
|
||||
);
|
||||
return array_unique( $names );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether or not a given $input key matches one of the given $patterns.
|
||||
*
|
||||
* @param string $input Key name to test against patterns.
|
||||
* @param string[] $patterns Patterns to test key name with.
|
||||
* @return bool
|
||||
*/
|
||||
private function key_matches( $input, $patterns ) {
|
||||
foreach ( $patterns as $p ) {
|
||||
if ( '/' === $p[0] ) {
|
||||
if ( 1 === preg_match( $p, $input ) ) {
|
||||
return true;
|
||||
}
|
||||
} elseif ( 0 === strcasecmp( $p, $input ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize output generated from the request that was blocked.
|
||||
*
|
||||
* @param string $output Output to sanitize.
|
||||
*/
|
||||
public function sanitize_output( $output ) {
|
||||
$url_decoded_output = rawurldecode( $output );
|
||||
$html_entities_output = htmlentities( $url_decoded_output, ENT_QUOTES, 'UTF-8' );
|
||||
// @phpcs:disable Squiz.Strings.DoubleQuoteUsage.NotRequired
|
||||
$escapers = array( "\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c" );
|
||||
$replacements = array( "\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b" );
|
||||
// @phpcs:enable Squiz.Strings.DoubleQuoteUsage.NotRequired
|
||||
|
||||
return( str_replace( $escapers, $replacements, $html_entities_output ) );
|
||||
}
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/**
|
||||
* Handles generation and deletion of the bootstrap for the standalone WAF mode.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
use Composer\InstalledVersions;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Handles the bootstrap.
|
||||
*/
|
||||
class Waf_Standalone_Bootstrap {
|
||||
|
||||
/**
|
||||
* Ensures that constants are initialized if this class is used.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->guard_against_missing_abspath();
|
||||
$this->initialize_constants();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that this class is not used unless we are in the right context.
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception If we are outside of WordPress.
|
||||
*/
|
||||
private function guard_against_missing_abspath() {
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
throw new Exception( 'Cannot generate the WAF bootstrap if we are not running in WordPress context.' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the constants required for generating the bootstrap, if they have not been initialized yet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function initialize_constants() {
|
||||
Waf_Constants::initialize_constants();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialized the WP filesystem and serves as a mocking hook for tests.
|
||||
*
|
||||
* Should only be implemented after the wp_loaded action hook:
|
||||
*
|
||||
* @link https://developer.wordpress.org/reference/functions/wp_filesystem/#more-information
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function initialize_filesystem() {
|
||||
if ( ! function_exists( '\\WP_Filesystem' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
}
|
||||
|
||||
WP_Filesystem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the autoloader, which can then be used to require the autoloader in the generated boostrap file.
|
||||
*
|
||||
* @return string|null
|
||||
* @throws Exception In case the autoloader file can not be found.
|
||||
*/
|
||||
private function locate_autoloader_file() {
|
||||
global $jetpack_autoloader_loader;
|
||||
|
||||
$autoload_file = null;
|
||||
|
||||
// Try the Jetpack autoloader.
|
||||
if ( isset( $jetpack_autoloader_loader ) ) {
|
||||
$class_file = $jetpack_autoloader_loader->find_class_file( Waf_Runner::class );
|
||||
if ( $class_file ) {
|
||||
$autoload_file = dirname( dirname( dirname( dirname( dirname( $class_file ) ) ) ) ) . '/vendor/autoload.php';
|
||||
}
|
||||
}
|
||||
|
||||
// Try Composer's autoloader.
|
||||
if ( null === $autoload_file
|
||||
&& is_callable( array( InstalledVersions::class, 'getInstallPath' ) )
|
||||
&& InstalledVersions::isInstalled( 'automattic/jetpack-waf' )
|
||||
) {
|
||||
$package_file = InstalledVersions::getInstallPath( 'automattic/jetpack-waf' );
|
||||
if ( substr( $package_file, -23 ) === '/automattic/jetpack-waf' ) {
|
||||
$autoload_file = dirname( dirname( dirname( $package_file ) ) ) . '/vendor/autoload.php';
|
||||
}
|
||||
}
|
||||
|
||||
// Guess. First look for being in a `vendor/automattic/jetpack-waf/src/', then see if we're standalone with our own vendor dir.
|
||||
if ( null === $autoload_file ) {
|
||||
$autoload_file = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/vendor/autoload.php';
|
||||
if ( ! file_exists( $autoload_file ) ) {
|
||||
$autoload_file = dirname( __DIR__ ) . '/vendor/autoload.php';
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the determined file actually exists.
|
||||
if ( ! file_exists( $autoload_file ) ) {
|
||||
throw new Exception( 'Can not find autoloader, and the WAF standalone boostrap will not work without it.' );
|
||||
}
|
||||
|
||||
return $autoload_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path to the bootstrap.php file.
|
||||
*
|
||||
* @return string The bootstrap.php file path.
|
||||
*/
|
||||
public function get_bootstrap_file_path() {
|
||||
return trailingslashit( JETPACK_WAF_DIR ) . 'bootstrap.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the bootstrap file.
|
||||
*
|
||||
* @return string Absolute path to the bootstrap file.
|
||||
* @throws Exception In case the file can not be written.
|
||||
*/
|
||||
public function generate() {
|
||||
|
||||
$this->initialize_filesystem();
|
||||
|
||||
global $wp_filesystem;
|
||||
if ( ! $wp_filesystem ) {
|
||||
throw new Exception( 'Can not work without the file system being initialized.' );
|
||||
}
|
||||
|
||||
$bootstrap_file = $this->get_bootstrap_file_path();
|
||||
$mode_option = get_option( Waf_Runner::MODE_OPTION_NAME, false );
|
||||
$share_data_option = get_option( Waf_Runner::SHARE_DATA_OPTION_NAME, false );
|
||||
|
||||
// phpcs:disable WordPress.PHP.DevelopmentFunctions
|
||||
$code = "<?php\n"
|
||||
. sprintf( "define( 'DISABLE_JETPACK_WAF', %s );\n", var_export( defined( 'DISABLE_JETPACK_WAF' ) && DISABLE_JETPACK_WAF, true ) )
|
||||
. "if ( defined( 'DISABLE_JETPACK_WAF' ) && DISABLE_JETPACK_WAF ) return;\n"
|
||||
. sprintf( "define( 'JETPACK_WAF_MODE', %s );\n", var_export( $mode_option ? $mode_option : 'silent', true ) )
|
||||
. sprintf( "define( 'JETPACK_WAF_SHARE_DATA', %s );\n", var_export( $share_data_option, true ) )
|
||||
. sprintf( "define( 'JETPACK_WAF_DIR', %s );\n", var_export( JETPACK_WAF_DIR, true ) )
|
||||
. sprintf( "define( 'JETPACK_WAF_WPCONFIG', %s );\n", var_export( JETPACK_WAF_WPCONFIG, true ) )
|
||||
. 'require_once ' . var_export( $this->locate_autoloader_file(), true ) . ";\n"
|
||||
. "Automattic\Jetpack\Waf\Waf_Runner::initialize();\n";
|
||||
// phpcs:enable
|
||||
|
||||
if ( ! $wp_filesystem->is_dir( JETPACK_WAF_DIR ) ) {
|
||||
if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) {
|
||||
throw new Exception( 'Failed creating WAF standalone bootstrap file directory: ' . JETPACK_WAF_DIR );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $bootstrap_file, $code ) ) {
|
||||
throw new Exception( 'Failed writing WAF standalone bootstrap file to: ' . $bootstrap_file );
|
||||
}
|
||||
|
||||
return $bootstrap_file;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,342 @@
|
||||
<?php
|
||||
/**
|
||||
* Transforms for Jetpack Waf
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
/**
|
||||
* Waf_Transforms class
|
||||
*/
|
||||
class Waf_Transforms {
|
||||
/**
|
||||
* Decode a Base64-encoded string.
|
||||
*
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function base64_decode( $value ) {
|
||||
return base64_decode( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all characters that might escape a command line command
|
||||
*
|
||||
* @see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#cmdLine
|
||||
* @param string $value value to be escaped.
|
||||
* @return string
|
||||
*/
|
||||
public function cmd_line( $value ) {
|
||||
return strtolower(
|
||||
preg_replace(
|
||||
'/\s+/',
|
||||
' ',
|
||||
str_replace(
|
||||
array( ',', ';' ),
|
||||
' ',
|
||||
preg_replace(
|
||||
'/\s+(?=[\/\(])/',
|
||||
'',
|
||||
str_replace(
|
||||
array( '^', "'", '"', '\\' ),
|
||||
'',
|
||||
$value
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a SQL hex string.
|
||||
*
|
||||
* @example 414243 decodes to "ABC"
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function sql_hex_decode( $value ) {
|
||||
return preg_replace_callback(
|
||||
'/0x[a-f0-9]+/i',
|
||||
function ( $matches ) {
|
||||
$str = substr( $matches[0], 2 );
|
||||
if ( 0 !== strlen( $str ) % 2 ) {
|
||||
$str = '0' . $str;
|
||||
}
|
||||
return hex2bin( $str );
|
||||
},
|
||||
$value
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode a string using Base64 encoding.
|
||||
*
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function base64_encode( $value ) {
|
||||
return base64_encode( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert all whitespace characters to a space and remove any repeated spaces.
|
||||
*
|
||||
* @param string $value value to be converted.
|
||||
* @return string
|
||||
*/
|
||||
public function compress_whitespace( $value ) {
|
||||
return preg_replace( '/\s+/', ' ', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode string (possibly containing binary characters) by replacing each input byte with two hexadecimal characters.
|
||||
*
|
||||
* @param string $value value to be encoded.
|
||||
* @return string
|
||||
*/
|
||||
public function hex_encode( $value ) {
|
||||
return bin2hex( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode string that was previously encoded by hexEncode()
|
||||
*
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function hex_decode( $value ) {
|
||||
return pack( 'H*', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode the characters encoded as HTML entities.
|
||||
*
|
||||
* @param mixed $value value do be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function html_entity_decode( $value ) {
|
||||
return html_entity_decode( $value, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the length of the input string.
|
||||
*
|
||||
* @param string $value input string.
|
||||
* @return int
|
||||
*/
|
||||
public function length( $value ) {
|
||||
return strlen( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert all characters to lowercase.
|
||||
*
|
||||
* @param string $value string to be converted.
|
||||
* @return string
|
||||
*/
|
||||
public function lowercase( $value ) {
|
||||
return strtolower( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate an md5 hash for the given data
|
||||
*
|
||||
* @param mixed $value value to be hashed.
|
||||
* @return string
|
||||
*/
|
||||
public function md5( $value ) {
|
||||
return md5( $value, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes multiple slashes, directory self-references, and directory back-references (except when at the beginning of the input) from input string.
|
||||
*
|
||||
* @param string $value value to be normalized.
|
||||
* @return string
|
||||
*/
|
||||
public function normalize_path( $value ) {
|
||||
$parts = explode(
|
||||
'/',
|
||||
// replace any duplicate slashes with a single one.
|
||||
preg_replace( '~/{2,}~', '/', $value )
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
while ( isset( $parts[ $i ] ) ) {
|
||||
switch ( $parts[ $i ] ) {
|
||||
// If this folder is a self-reference, remove it.
|
||||
case '..':
|
||||
// If this folder is a backreference, remove it unless we're already at the root.
|
||||
if ( isset( $parts[ $i - 1 ] ) && ! in_array( $parts[ $i - 1 ], array( '', '..' ), true ) ) {
|
||||
array_splice( $parts, $i - 1, 2 );
|
||||
--$i;
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
case '.':
|
||||
array_splice( $parts, $i, 1 );
|
||||
continue 2;
|
||||
}
|
||||
++$i;
|
||||
}
|
||||
|
||||
return implode( '/', $parts );
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert backslash characters to forward slashes, and then normalize using `normalizePath`
|
||||
*
|
||||
* @param string $value to be normalized.
|
||||
* @return string
|
||||
*/
|
||||
public function normalize_path_win( $value ) {
|
||||
return $this->normalize_path( str_replace( '\\', '/', $value ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all NUL bytes from input.
|
||||
*
|
||||
* @param string $value value to be filtered.
|
||||
* @return string
|
||||
*/
|
||||
public function remove_nulls( $value ) {
|
||||
return str_replace( "\x0", '', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all whitespace characters from input.
|
||||
*
|
||||
* @param string $value value to be filtered.
|
||||
* @return string
|
||||
*/
|
||||
public function remove_whitespace( $value ) {
|
||||
return preg_replace( '/\s/', '', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces each occurrence of a C-style comment (/ * ... * /) with a single space.
|
||||
* Unterminated comments will also be replaced with a space. However, a standalone termination of a comment (* /) will not be acted upon.
|
||||
*
|
||||
* @param string $value value to be filtered.
|
||||
* @return string
|
||||
*/
|
||||
public function replace_comments( $value ) {
|
||||
$value = preg_replace( '~/\*.*?\*/|/\*.*?$~Ds', ' ', $value );
|
||||
return explode( '/*', $value, 2 )[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes common comments chars (/ *, * /, --, #).
|
||||
*
|
||||
* @param string $value value to be filtered.
|
||||
* @return string
|
||||
*/
|
||||
public function remove_comments_char( $value ) {
|
||||
return preg_replace( '~/*|*/|--|#|//~', '', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces each NUL byte in input with a space.
|
||||
*
|
||||
* @param string $value value to be filtered.
|
||||
* @return string
|
||||
*/
|
||||
public function replace_nulls( $value ) {
|
||||
return str_replace( "\x0", ' ', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a URL-encoded input string.
|
||||
*
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function url_decode( $value ) {
|
||||
return urldecode( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a URL-encoded input string.
|
||||
*
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function url_decode_uni( $value ) {
|
||||
error_log( 'JETPACKWAF TRANSFORM NOT IMPLEMENTED: urlDecodeUni' );
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a json encoded input string.
|
||||
*
|
||||
* @param string $value value to be decoded.
|
||||
* @return string
|
||||
*/
|
||||
public function js_decode( $value ) {
|
||||
error_log( 'JETPACKWAF TRANSFORM NOT IMPLEMENTED: jsDecode' );
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert all characters to uppercase.
|
||||
*
|
||||
* @param string $value value to be encoded.
|
||||
* @return string
|
||||
*/
|
||||
public function uppercase( $value ) {
|
||||
return strtoupper( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate a SHA1 hash from the input string.
|
||||
*
|
||||
* @param mixed $value value to be hashed.
|
||||
* @return string
|
||||
*/
|
||||
public function sha1( $value ) {
|
||||
return sha1( $value, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove whitespace from the left side of the input string.
|
||||
*
|
||||
* @param string $value value to be trimmed.
|
||||
* @return string
|
||||
*/
|
||||
public function trim_left( $value ) {
|
||||
return ltrim( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove whitespace from the right side of the input string.
|
||||
*
|
||||
* @param string $value value to be trimmed.
|
||||
* @return string
|
||||
*/
|
||||
public function trim_right( $value ) {
|
||||
return rtrim( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove whitespace from both sides of the input string.
|
||||
*
|
||||
* @param string $value value to be trimmed.
|
||||
* @return string
|
||||
*/
|
||||
public function trim( $value ) {
|
||||
return trim( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert utf-8 characters to unicode characters
|
||||
*
|
||||
* @param string $value value to be encoded.
|
||||
* @return string
|
||||
*/
|
||||
public function utf8_to_unicode( $value ) {
|
||||
return preg_replace( '/\\\u(?=[a-f0-9]{4})/', '%u', substr( json_encode( $value ), 1, -1 ) );
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Utility functions for WAF.
|
||||
*
|
||||
* @package automattic/jetpack-waf
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Waf;
|
||||
|
||||
/**
|
||||
* A wrapper for WordPress's `wp_unslash()`.
|
||||
*
|
||||
* Even though PHP itself dropped the option to add slashes to superglobals a decade ago,
|
||||
* WordPress still does it through some misguided extreme backwards compatibility. 🙄
|
||||
*
|
||||
* If WordPress's function exists, assume it needs to be called. If not, assume it doesn't.
|
||||
*
|
||||
* @param string|array $value String or array of data to unslash.
|
||||
* @return string|array Possibly unslashed $value.
|
||||
*/
|
||||
function wp_unslash( $value ) {
|
||||
if ( function_exists( '\\wp_unslash' ) ) {
|
||||
return \wp_unslash( $value );
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP helpfully parses request data into nested arrays in superglobals like $_GET and $_POST,
|
||||
* and as part of that parsing turns field names like "myfield[x][y]" into a nested array
|
||||
* that looks like [ "myfield" => [ "x" => [ "y" => "..." ] ] ]
|
||||
* However, modsecurity (and thus our WAF rules) expect the original (non-nested) names.
|
||||
*
|
||||
* Therefore, this method takes an array of any depth and returns a single-depth array with nested
|
||||
* keys translated back to a single string with brackets.
|
||||
*
|
||||
* Because there might be multiple items with the same name, this function will return an array of tuples,
|
||||
* with the first item in the tuple the re-created original field name, and the second item the value.
|
||||
*
|
||||
* @example
|
||||
* flatten_array( [ "field1" => "abc", "field2" => [ "d", "e", "f" ] ] )
|
||||
* => [
|
||||
* [ "field1", "abc" ],
|
||||
* [ "field2[0]", "d" ],
|
||||
* [ "field2[1]", "e" ],
|
||||
* [ "field2[2]", "f" ],
|
||||
* ]
|
||||
*
|
||||
* @param array $array An array that resembles one of the PHP superglobals like $_GET or $_POST.
|
||||
* @param string $key_prefix String that should be prepended to the keys output by this function.
|
||||
* Usually only used internally as part of recursion when flattening a nested array.
|
||||
* @return array{ 0: string, 1: scalar }[] $key_prefix An array of key/value tuples, one for each distinct value in the input array.
|
||||
*/
|
||||
function flatten_array( $array, $key_prefix = '' ) {
|
||||
$return = array();
|
||||
foreach ( $array as $source_key => $source_value ) {
|
||||
$key = ( '' === $key_prefix )
|
||||
// if this is the first level, the key name isn't enclosed in brackets
|
||||
? $source_key
|
||||
// for every level after the first, enclose the key name in brackets.
|
||||
: $key_prefix . '[' . $source_key . ']';
|
||||
if ( ! is_array( $source_value ) ) {
|
||||
$return[] = array( $key, $source_value );
|
||||
} else {
|
||||
$return = array_merge( $return, flatten_array( $source_value, $key ) );
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
@ -6,11 +6,11 @@ return array(
|
||||
'packages' => array(
|
||||
'jetpack-admin-ui' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-admin-ui',
|
||||
'ver' => '0.2.13',
|
||||
'ver' => '0.2.14',
|
||||
),
|
||||
'jetpack-assets' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-assets',
|
||||
'ver' => '1.17.27',
|
||||
'ver' => '1.17.28',
|
||||
),
|
||||
'jetpack-config' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-config',
|
||||
@ -18,39 +18,43 @@ return array(
|
||||
),
|
||||
'jetpack-connection' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-connection',
|
||||
'ver' => '1.47.0',
|
||||
'ver' => '1.47.1',
|
||||
),
|
||||
'jetpack-idc' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-identity-crisis',
|
||||
'ver' => '0.8.32',
|
||||
'ver' => '0.8.33',
|
||||
),
|
||||
'jetpack-jitm' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-jitm',
|
||||
'ver' => '2.2.34',
|
||||
'ver' => '2.2.35',
|
||||
),
|
||||
'jetpack-licensing' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-licensing',
|
||||
'ver' => '1.7.12',
|
||||
'ver' => '1.7.13',
|
||||
),
|
||||
'jetpack-my-jetpack' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack',
|
||||
'ver' => '2.5.1',
|
||||
'ver' => '2.6.0',
|
||||
),
|
||||
'jetpack-password-checker' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-password-checker',
|
||||
'ver' => '0.2.8',
|
||||
'ver' => '0.2.9',
|
||||
),
|
||||
'jetpack-plugins-installer' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-plugins-installer',
|
||||
'ver' => '0.2.1',
|
||||
'ver' => '0.2.2',
|
||||
),
|
||||
'jetpack-sync' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-sync',
|
||||
'ver' => '1.44.0',
|
||||
'ver' => '1.44.1',
|
||||
),
|
||||
'jetpack-transport-helper' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-transport-helper',
|
||||
'ver' => '0.1.1',
|
||||
'ver' => '0.1.2',
|
||||
),
|
||||
'jetpack-waf' => array(
|
||||
'path' => 'jetpack_vendor/automattic/jetpack-waf',
|
||||
'ver' => '0.8.1',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -4,7 +4,7 @@ Tags: jetpack, protect, security, malware, scan
|
||||
Requires at least: 6.0
|
||||
Requires PHP: 5.6
|
||||
Tested up to: 6.1
|
||||
Stable tag: 1.1.2
|
||||
Stable tag: 1.2.0
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
@ -109,8 +109,12 @@ The features of the new Jetpack Protect plugin are not included in the [Jetpack
|
||||
3. View all the found vulnerabilities in your site and learn how to fix them.
|
||||
|
||||
== Changelog ==
|
||||
### 1.1.2 - 2022-11-30
|
||||
#### Changed
|
||||
- changed description and author
|
||||
- Updated package dependencies.
|
||||
### 1.2.0 - 2023-01-16
|
||||
#### Added
|
||||
- Add web application firewall (WAF) features
|
||||
- Add progress bar to site scannnig screen
|
||||
|
||||
#### Fixed
|
||||
- Poll for scan status while scanner is provisioning
|
||||
- Bug fixes
|
||||
|
||||
|
@ -27,12 +27,15 @@ use Automattic\Jetpack\Protect\Threats;
|
||||
use Automattic\Jetpack\Status as Jetpack_Status;
|
||||
use Automattic\Jetpack\Sync\Functions as Sync_Functions;
|
||||
use Automattic\Jetpack\Sync\Sender;
|
||||
use Automattic\Jetpack\Waf\Waf_Runner;
|
||||
|
||||
/**
|
||||
* Class Jetpack_Protect
|
||||
*/
|
||||
class Jetpack_Protect {
|
||||
|
||||
const JETPACK_WAF_MODULE_SLUG = 'waf';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@ -79,9 +82,14 @@ class Jetpack_Protect {
|
||||
|
||||
// Identity crisis package.
|
||||
$config->ensure( 'identity_crisis' );
|
||||
|
||||
// Web application firewall package.
|
||||
$config->ensure( 'waf' );
|
||||
},
|
||||
1
|
||||
);
|
||||
|
||||
add_filter( 'jetpack_get_available_standalone_modules', array( $this, 'protect_filter_available_modules' ), 10, 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -186,8 +194,14 @@ class Jetpack_Protect {
|
||||
'adminUrl' => 'admin.php?page=jetpack-protect',
|
||||
'siteSuffix' => ( new Jetpack_Status() )->get_site_suffix(),
|
||||
'jetpackScan' => My_Jetpack_Products::get_product( 'scan' ),
|
||||
'productData' => My_Jetpack_Products::get_product( 'protect' ),
|
||||
'hasRequiredPlan' => Plan::has_required_plan(),
|
||||
'waf' => array(
|
||||
'isSupported' => Waf_Runner::is_supported_environment(),
|
||||
'isSeen' => self::get_waf_seen_status(),
|
||||
'isEnabled' => Waf_Runner::is_enabled(),
|
||||
'isLoading' => false,
|
||||
'config' => Waf_Runner::get_config(),
|
||||
),
|
||||
);
|
||||
|
||||
$initial_state['jetpackScan']['pricingForUi'] = Plan::get_product( 'jetpack_scan' );
|
||||
@ -249,6 +263,16 @@ class Jetpack_Protect {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds module to the list of available modules
|
||||
*
|
||||
* @param array $modules The available modules.
|
||||
* @return array
|
||||
*/
|
||||
public function protect_filter_available_modules( $modules ) {
|
||||
return array_merge( array( self::JETPACK_WAF_MODULE_SLUG ), $modules );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the REST API routes.
|
||||
*
|
||||
@ -350,6 +374,54 @@ class Jetpack_Protect {
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
'jetpack-protect/v1',
|
||||
'toggle-waf',
|
||||
array(
|
||||
'methods' => \WP_REST_SERVER::EDITABLE,
|
||||
'callback' => __CLASS__ . '::api_toggle_waf',
|
||||
'permission_callback' => function () {
|
||||
return current_user_can( 'manage_options' );
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
'jetpack-protect/v1',
|
||||
'waf',
|
||||
array(
|
||||
'methods' => \WP_REST_SERVER::READABLE,
|
||||
'callback' => __CLASS__ . '::api_get_waf',
|
||||
'permission_callback' => function () {
|
||||
return current_user_can( 'manage_options' );
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
'jetpack-protect/v1',
|
||||
'waf-seen',
|
||||
array(
|
||||
'methods' => \WP_REST_SERVER::READABLE,
|
||||
'callback' => __CLASS__ . '::get_waf_seen_status',
|
||||
'permission_callback' => function () {
|
||||
return current_user_can( 'manage_options' );
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
'jetpack-protect/v1',
|
||||
'waf-seen',
|
||||
array(
|
||||
'methods' => \WP_REST_SERVER::EDITABLE,
|
||||
'callback' => __CLASS__ . '::set_waf_seen_status',
|
||||
'permission_callback' => function () {
|
||||
return current_user_can( 'manage_options' );
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -482,4 +554,52 @@ class Jetpack_Protect {
|
||||
|
||||
return new WP_REST_Response( 'Scan enqueued.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the WAF module on or off for the API endpoint
|
||||
*
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public static function api_toggle_waf() {
|
||||
if ( Waf_Runner::is_enabled() ) {
|
||||
Waf_Runner::disable();
|
||||
return rest_ensure_response( true, 200 );
|
||||
}
|
||||
|
||||
Waf_Runner::enable();
|
||||
return rest_ensure_response( true, 200 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get WAF data for the API endpoint
|
||||
*
|
||||
* @return WP_Rest_Response
|
||||
*/
|
||||
public static function api_get_waf() {
|
||||
return new WP_REST_Response(
|
||||
array(
|
||||
'is_seen' => self::get_waf_seen_status(),
|
||||
'is_enabled' => Waf_Runner::is_enabled(),
|
||||
'config' => Waf_Runner::get_config(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get WAF "Seen" Status
|
||||
*
|
||||
* @return bool Whether the current user has viewed the WAF screen.
|
||||
*/
|
||||
public static function get_waf_seen_status() {
|
||||
return (bool) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_seen', true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set WAF "Seen" Status
|
||||
*
|
||||
* @return bool True if seen status updated to true, false on failure.
|
||||
*/
|
||||
public static function set_waf_seen_status() {
|
||||
return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_seen', true );
|
||||
}
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ class Scan_Status extends Status {
|
||||
$status->num_themes_threats = 0;
|
||||
$status->num_plugins_threats = 0;
|
||||
$status->has_unchecked_items = false;
|
||||
$status->current_progress = isset( $scan_data->current->progress ) ? $scan_data->current->progress : null;
|
||||
|
||||
if ( ! empty( $scan_data->most_recent->timestamp ) ) {
|
||||
$date = new \DateTime( $scan_data->most_recent->timestamp );
|
||||
|
@ -95,6 +95,13 @@ class Status_Model {
|
||||
*/
|
||||
public $has_unchecked_items;
|
||||
|
||||
/**
|
||||
* The estimated percentage of the current scan.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $current_progress;
|
||||
|
||||
/**
|
||||
* Whether there was an error loading the status.
|
||||
*
|
||||
|
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2::getLoader();
|
||||
return ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0::getLoader();
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2;
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0;
|
||||
|
||||
// phpcs:ignore
|
||||
|
||||
|
@ -5,6 +5,10 @@ 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.8] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
|
||||
## [0.2.7] - 2022-11-22
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
@ -62,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Deprecated
|
||||
- Moved the options class into Connection. [#24095]
|
||||
|
||||
[0.2.8]: https://github.com/Automattic/jetpack-plans/compare/v0.2.7...v0.2.8
|
||||
[0.2.7]: https://github.com/Automattic/jetpack-plans/compare/v0.2.6...v0.2.7
|
||||
[0.2.6]: https://github.com/Automattic/jetpack-plans/compare/v0.2.5...v0.2.6
|
||||
[0.2.5]: https://github.com/Automattic/jetpack-plans/compare/v0.2.4...v0.2.5
|
||||
|
@ -4,12 +4,12 @@
|
||||
"type": "library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-connection": "^1.46.4"
|
||||
"automattic/jetpack-connection": "^1.47.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2.1",
|
||||
"automattic/jetpack-status": "^1.15.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2",
|
||||
"automattic/jetpack-status": "^1.15.2",
|
||||
"automattic/wordbless": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -6,6 +6,8 @@ $vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'AhoCorasick\\MultiStringMatcher' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringMatcher.php',
|
||||
'AhoCorasick\\MultiStringReplacer' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringReplacer.php',
|
||||
'Automattic\\Jetpack\\A8c_Mc_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php',
|
||||
'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php',
|
||||
'Automattic\\Jetpack\\Assets' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php',
|
||||
@ -159,6 +161,17 @@ return array(
|
||||
'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php',
|
||||
'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php',
|
||||
'Automattic\\Jetpack\\Transport_Helper\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php',
|
||||
'Automattic\\Jetpack\\Waf\\CLI' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php',
|
||||
'Automattic\\Jetpack\\Waf\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Initializer' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Operators' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Request' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Runner' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Runtime' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Transforms' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'Jetpack_IXR_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php',
|
||||
'Jetpack_IXR_ClientMulticall' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php',
|
||||
|
@ -8,4 +8,5 @@ $baseDir = dirname($vendorDir);
|
||||
return array(
|
||||
'3773ef3f09c37da5478d578e32b03a4b' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php',
|
||||
'590147edb63acb03b2852d5c4db13ce8' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php',
|
||||
'3d45c7e6a7f0e71849e33afe4b3b3ede' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/cli.php',
|
||||
);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
class ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,21 @@ class ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2', 'loadClassLoader'), true, true);
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirec4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2($fileIdentifier, $file);
|
||||
composerRequirec4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +48,7 @@ class ComposerAutoloaderInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequirec4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2($fileIdentifier, $file)
|
||||
function composerRequirec4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
@ -4,11 +4,12 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
class ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0
|
||||
{
|
||||
public static $files = array (
|
||||
'3773ef3f09c37da5478d578e32b03a4b' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/actions.php',
|
||||
'590147edb63acb03b2852d5c4db13ce8' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php',
|
||||
'3d45c7e6a7f0e71849e33afe4b3b3ede' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/cli.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
@ -26,6 +27,8 @@ class ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'AhoCorasick\\MultiStringMatcher' => __DIR__ . '/..' . '/wikimedia/aho-corasick/src/MultiStringMatcher.php',
|
||||
'AhoCorasick\\MultiStringReplacer' => __DIR__ . '/..' . '/wikimedia/aho-corasick/src/MultiStringReplacer.php',
|
||||
'Automattic\\Jetpack\\A8c_Mc_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php',
|
||||
'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php',
|
||||
'Automattic\\Jetpack\\Assets' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php',
|
||||
@ -179,6 +182,17 @@ class ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php',
|
||||
'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php',
|
||||
'Automattic\\Jetpack\\Transport_Helper\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php',
|
||||
'Automattic\\Jetpack\\Waf\\CLI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php',
|
||||
'Automattic\\Jetpack\\Waf\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Initializer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Operators' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Request' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Runner' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Runtime' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php',
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Transforms' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php',
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'Jetpack_IXR_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php',
|
||||
'Jetpack_IXR_ClientMulticall' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php',
|
||||
@ -193,9 +207,9 @@ class ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,48 +11,48 @@
|
||||
),
|
||||
'versions' => array(
|
||||
'automattic/jetpack-a8c-mc-stats' => array(
|
||||
'pretty_version' => 'v1.4.16',
|
||||
'version' => '1.4.16.0',
|
||||
'pretty_version' => 'v1.4.17',
|
||||
'version' => '1.4.17.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-a8c-mc-stats',
|
||||
'aliases' => array(),
|
||||
'reference' => '60cc966a8c12092ce4ee609eb9f52ad8bafe349b',
|
||||
'reference' => 'bb1f94fe891053789633b52860a48aa4751a09be',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-admin-ui' => array(
|
||||
'pretty_version' => 'v0.2.13',
|
||||
'version' => '0.2.13.0',
|
||||
'pretty_version' => 'v0.2.14',
|
||||
'version' => '0.2.14.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-admin-ui',
|
||||
'aliases' => array(),
|
||||
'reference' => '054349177910cdb0840c2194f244b0603f92f82e',
|
||||
'reference' => 'e1deffd3173204b4b8702adfeffa3f37731b654f',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-assets' => array(
|
||||
'pretty_version' => 'v1.17.27',
|
||||
'version' => '1.17.27.0',
|
||||
'pretty_version' => 'v1.17.28',
|
||||
'version' => '1.17.28.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-assets',
|
||||
'aliases' => array(),
|
||||
'reference' => '2372db5c0ecaf23fa28ae79b84992685bd0c7c7b',
|
||||
'reference' => '6d3544111163f6ffaf32fdaf4f7ab76715e980e1',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-autoloader' => array(
|
||||
'pretty_version' => 'v2.11.12',
|
||||
'version' => '2.11.12.0',
|
||||
'pretty_version' => 'v2.11.13',
|
||||
'version' => '2.11.13.0',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-autoloader',
|
||||
'aliases' => array(),
|
||||
'reference' => '60a1cbf0a0acff63b412c49baf9d417e5bd5779e',
|
||||
'reference' => 'e4242fa1a20e882975ae3b7b918f46e662c5a6ee',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-composer-plugin' => array(
|
||||
'pretty_version' => 'v1.1.6',
|
||||
'version' => '1.1.6.0',
|
||||
'pretty_version' => 'v1.1.7',
|
||||
'version' => '1.1.7.0',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-composer-plugin',
|
||||
'aliases' => array(),
|
||||
'reference' => '5bb520ea9376eafb92993e8bfe660d399857f08f',
|
||||
'reference' => '225e2afdd372875064457daf6d2b6fa653547ad8',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-config' => array(
|
||||
@ -65,111 +65,111 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-connection' => array(
|
||||
'pretty_version' => 'v1.47.0',
|
||||
'version' => '1.47.0.0',
|
||||
'pretty_version' => 'v1.47.1',
|
||||
'version' => '1.47.1.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-connection',
|
||||
'aliases' => array(),
|
||||
'reference' => 'dd2a6c2cede50d717890d07499db59d9e335deac',
|
||||
'reference' => 'd9d789cbd6faaeed9325d050a1504fcc69568f3c',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-constants' => array(
|
||||
'pretty_version' => 'v1.6.19',
|
||||
'version' => '1.6.19.0',
|
||||
'pretty_version' => 'v1.6.20',
|
||||
'version' => '1.6.20.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-constants',
|
||||
'aliases' => array(),
|
||||
'reference' => 'a224991e11045e15250bac415cf92788e0b59bb7',
|
||||
'reference' => 'c57b99b82c20d20f6dd2d2d701bb5b50b2cbe33a',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-device-detection' => array(
|
||||
'pretty_version' => 'v1.4.21',
|
||||
'version' => '1.4.21.0',
|
||||
'pretty_version' => 'v1.4.22',
|
||||
'version' => '1.4.22.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-device-detection',
|
||||
'aliases' => array(),
|
||||
'reference' => '3fb859a414b52d8a98ff50e62ae1ada94b0d677e',
|
||||
'reference' => '2da848bca9a3622885c05509f0a1dab8264067b2',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-identity-crisis' => array(
|
||||
'pretty_version' => 'v0.8.32',
|
||||
'version' => '0.8.32.0',
|
||||
'pretty_version' => 'v0.8.33',
|
||||
'version' => '0.8.33.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-identity-crisis',
|
||||
'aliases' => array(),
|
||||
'reference' => '46b473843770daf1884c24b3bb76cb809da84318',
|
||||
'reference' => '9356eab5416e8ebb71df3bace7ef28d30e3ba630',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-jitm' => array(
|
||||
'pretty_version' => 'v2.2.34',
|
||||
'version' => '2.2.34.0',
|
||||
'pretty_version' => 'v2.2.35',
|
||||
'version' => '2.2.35.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-jitm',
|
||||
'aliases' => array(),
|
||||
'reference' => '0662b1935f7a2157268cdd0556f3bfb5c84fb5f5',
|
||||
'reference' => '2d19faef459c1beaac8a00ad8d51b945b8358091',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-licensing' => array(
|
||||
'pretty_version' => 'v1.7.12',
|
||||
'version' => '1.7.12.0',
|
||||
'pretty_version' => 'v1.7.13',
|
||||
'version' => '1.7.13.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-licensing',
|
||||
'aliases' => array(),
|
||||
'reference' => 'a5869854c012fd411d4b7311654fc745b5380730',
|
||||
'reference' => '4db2c3ec7440eed268c1d9ee7ee80cb5dde8c558',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-logo' => array(
|
||||
'pretty_version' => 'v1.5.19',
|
||||
'version' => '1.5.19.0',
|
||||
'pretty_version' => 'v1.5.20',
|
||||
'version' => '1.5.20.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-logo',
|
||||
'aliases' => array(),
|
||||
'reference' => '4a872f151e6708e88041bc2e9355d43232d6fab7',
|
||||
'reference' => '74e3fdc172753672488110418cf379fd8b2f4e75',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-my-jetpack' => array(
|
||||
'pretty_version' => 'v2.5.1',
|
||||
'version' => '2.5.1.0',
|
||||
'pretty_version' => 'v2.6.0',
|
||||
'version' => '2.6.0.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-my-jetpack',
|
||||
'aliases' => array(),
|
||||
'reference' => 'b54cfd6c1e6160a7fc262d59fcc18ce8152bccd1',
|
||||
'reference' => 'f8352a9be345449db7936fbd3e2fa9e94dd2b557',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-partner' => array(
|
||||
'pretty_version' => 'v1.7.20',
|
||||
'version' => '1.7.20.0',
|
||||
'pretty_version' => 'v1.7.21',
|
||||
'version' => '1.7.21.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-partner',
|
||||
'aliases' => array(),
|
||||
'reference' => '299f5bdbd820df8d9120771cb21c624f92f5559a',
|
||||
'reference' => '67a89bfab8da4fb45cb005d2399512fa343befee',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-password-checker' => array(
|
||||
'pretty_version' => 'v0.2.8',
|
||||
'version' => '0.2.8.0',
|
||||
'pretty_version' => 'v0.2.9',
|
||||
'version' => '0.2.9.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-password-checker',
|
||||
'aliases' => array(),
|
||||
'reference' => 'dd72762218e43cac18deff9b5c409c13c8d80dd0',
|
||||
'reference' => 'bc372d55252fbdbbea251b0fb84fc109d7b31f54',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-plans' => array(
|
||||
'pretty_version' => 'v0.2.7',
|
||||
'version' => '0.2.7.0',
|
||||
'pretty_version' => 'v0.2.8',
|
||||
'version' => '0.2.8.0',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../automattic/jetpack-plans',
|
||||
'aliases' => array(),
|
||||
'reference' => '81dc92ebf07fd8d547079639b24b7e984156cd19',
|
||||
'reference' => 'f62608398c70864ff9a79a374b919865e626bf2d',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-plugins-installer' => array(
|
||||
'pretty_version' => 'v0.2.1',
|
||||
'version' => '0.2.1.0',
|
||||
'pretty_version' => 'v0.2.2',
|
||||
'version' => '0.2.2.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-plugins-installer',
|
||||
'aliases' => array(),
|
||||
'reference' => 'c133eec6a0a947130c1c5ee9e85b0408e93eb675',
|
||||
'reference' => 'e4a3eb71be7698dd896ad9c18565139007f0e7eb',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-protect' => array(
|
||||
@ -182,48 +182,66 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-redirect' => array(
|
||||
'pretty_version' => 'v1.7.20',
|
||||
'version' => '1.7.20.0',
|
||||
'pretty_version' => 'v1.7.21',
|
||||
'version' => '1.7.21.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-redirect',
|
||||
'aliases' => array(),
|
||||
'reference' => '8106e58119e204549badeb55da8d97ee36a09eb2',
|
||||
'reference' => '0f56502a8cc74fbde1ab6a4222e8b7f48a30d51f',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-roles' => array(
|
||||
'pretty_version' => 'v1.4.18',
|
||||
'version' => '1.4.18.0',
|
||||
'pretty_version' => 'v1.4.20',
|
||||
'version' => '1.4.20.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-roles',
|
||||
'aliases' => array(),
|
||||
'reference' => '23b6fb028544b19fb6231440c726e64fd7af3e2a',
|
||||
'reference' => '8f4ce9fdfa0a50ffc4fd3108370392c9c4ced27a',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-status' => array(
|
||||
'pretty_version' => 'v1.15.1',
|
||||
'version' => '1.15.1.0',
|
||||
'pretty_version' => 'v1.15.2',
|
||||
'version' => '1.15.2.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-status',
|
||||
'aliases' => array(),
|
||||
'reference' => '197f3ab6fd6ab8c2fa0e0d577160a82bf68ab529',
|
||||
'reference' => '9097545f48fe3d45a737255e25d9c56d18a326ab',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-sync' => array(
|
||||
'pretty_version' => 'v1.44.0',
|
||||
'version' => '1.44.0.0',
|
||||
'pretty_version' => 'v1.44.1',
|
||||
'version' => '1.44.1.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-sync',
|
||||
'aliases' => array(),
|
||||
'reference' => '8b1e3796c09a7423dd484399a5032a420e5966bf',
|
||||
'reference' => '869c02f9bb180670a9dbd86d2f133e286f1e7a52',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-transport-helper' => array(
|
||||
'pretty_version' => 'v0.1.1',
|
||||
'version' => '0.1.1.0',
|
||||
'pretty_version' => 'v0.1.2',
|
||||
'version' => '0.1.2.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-transport-helper',
|
||||
'aliases' => array(),
|
||||
'reference' => '430c07ef5f029c89cf6003503ef1073fba136412',
|
||||
'reference' => 'cb87e4fb26449af1e0dcd6924c5c72e1478eb18b',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'automattic/jetpack-waf' => array(
|
||||
'pretty_version' => 'v0.8.1',
|
||||
'version' => '0.8.1.0',
|
||||
'type' => 'jetpack-library',
|
||||
'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-waf',
|
||||
'aliases' => array(),
|
||||
'reference' => '876bb9157dc2d45a54b526c00fe502734f1241df',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'wikimedia/aho-corasick' => array(
|
||||
'pretty_version' => 'v1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../wikimedia/aho-corasick',
|
||||
'aliases' => array(),
|
||||
'reference' => '2f3a1bd765913637a66eade658d11d82f0e551be',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
|
@ -6,56 +6,64 @@ $vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'AhoCorasick\\MultiStringMatcher' => array(
|
||||
'version' => '1.0.1.0',
|
||||
'path' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringMatcher.php'
|
||||
),
|
||||
'AhoCorasick\\MultiStringReplacer' => array(
|
||||
'version' => '1.0.1.0',
|
||||
'path' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringReplacer.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\A8c_Mc_Stats' => array(
|
||||
'version' => '1.4.16.0',
|
||||
'version' => '1.4.17.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => array(
|
||||
'version' => '0.2.13.0',
|
||||
'version' => '0.2.14.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Assets' => array(
|
||||
'version' => '1.17.27.0',
|
||||
'version' => '1.17.28.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Assets\\Logo' => array(
|
||||
'version' => '1.5.19.0',
|
||||
'version' => '1.5.20.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Assets\\Semver' => array(
|
||||
'version' => '1.17.27.0',
|
||||
'version' => '1.17.28.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => array(
|
||||
'version' => '2.11.12.0',
|
||||
'version' => '2.11.13.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array(
|
||||
'version' => '2.11.12.0',
|
||||
'version' => '2.11.13.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => array(
|
||||
'version' => '2.11.12.0',
|
||||
'version' => '2.11.13.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => array(
|
||||
'version' => '2.11.12.0',
|
||||
'version' => '2.11.13.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => array(
|
||||
'version' => '2.11.12.0',
|
||||
'version' => '2.11.13.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Automatic_Install_Skin' => array(
|
||||
'version' => '0.2.1.0',
|
||||
'version' => '0.2.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Composer\\Manager' => array(
|
||||
'version' => '1.1.6.0',
|
||||
'version' => '1.1.7.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-manager.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Composer\\Plugin' => array(
|
||||
'version' => '1.1.6.0',
|
||||
'version' => '1.1.7.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-plugin.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Config' => array(
|
||||
@ -63,263 +71,263 @@ return array(
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Client' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Error_Handler' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Initial_State' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Manager' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Manager_Interface' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Nonce_Handler' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Package_Version' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Plugin' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Plugin_Storage' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\REST_Connector' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Rest_Authentication' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Secrets' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Server_Sandbox' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Tokens' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Urls' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Utils' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Webhooks' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Constants' => array(
|
||||
'version' => '1.6.19.0',
|
||||
'version' => '1.6.20.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\CookieState' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Current_Plan' => array(
|
||||
'version' => '0.2.7.0',
|
||||
'version' => '0.2.8.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-plans/src/class-current-plan.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Device_Detection' => array(
|
||||
'version' => '1.4.21.0',
|
||||
'version' => '1.4.22.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => array(
|
||||
'version' => '1.4.21.0',
|
||||
'version' => '1.4.22.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Errors' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Files' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Heartbeat' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => array(
|
||||
'version' => '0.8.32.0',
|
||||
'version' => '0.8.33.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\IdentityCrisis\\UI' => array(
|
||||
'version' => '0.8.32.0',
|
||||
'version' => '0.8.33.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Identity_Crisis' => array(
|
||||
'version' => '0.8.32.0',
|
||||
'version' => '0.8.33.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\JITMS\\JITM' => array(
|
||||
'version' => '2.2.34.0',
|
||||
'version' => '2.2.35.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => array(
|
||||
'version' => '2.2.34.0',
|
||||
'version' => '2.2.35.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => array(
|
||||
'version' => '2.2.34.0',
|
||||
'version' => '2.2.35.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => array(
|
||||
'version' => '2.2.34.0',
|
||||
'version' => '2.2.35.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Licensing' => array(
|
||||
'version' => '1.7.12.0',
|
||||
'version' => '1.7.13.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Licensing\\Endpoints' => array(
|
||||
'version' => '1.7.12.0',
|
||||
'version' => '1.7.13.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Modules' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Initializer' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Product' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => array(
|
||||
'version' => '2.5.1.0',
|
||||
'version' => '2.6.0.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Partner' => array(
|
||||
'version' => '1.7.20.0',
|
||||
'version' => '1.7.21.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Partner_Coupon' => array(
|
||||
'version' => '1.7.20.0',
|
||||
'version' => '1.7.21.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Password_Checker' => array(
|
||||
'version' => '0.2.8.0',
|
||||
'version' => '0.2.9.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Paths' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Plans' => array(
|
||||
'version' => '0.2.7.0',
|
||||
'version' => '0.2.8.0',
|
||||
'path' => $vendorDir . '/automattic/jetpack-plans/src/class-plans.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Plugins_Installer' => array(
|
||||
'version' => '0.2.1.0',
|
||||
'version' => '0.2.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Protect\\Credentials' => array(
|
||||
@ -363,271 +371,315 @@ return array(
|
||||
'path' => $baseDir . '/src/class-threats.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Redirect' => array(
|
||||
'version' => '1.7.20.0',
|
||||
'version' => '1.7.21.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Roles' => array(
|
||||
'version' => '1.4.18.0',
|
||||
'version' => '1.4.20.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Status' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Status\\Cache' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Status\\Host' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Status\\Visitor' => array(
|
||||
'version' => '1.15.1.0',
|
||||
'version' => '1.15.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Actions' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Codec_Interface' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Data_Settings' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Defaults' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Functions' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Health' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Listener' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Lock' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Main' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Callables' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Comments' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Constants' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Import' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Menus' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Meta' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Module' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Options' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Posts' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Protect' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Search' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Stats' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Terms' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Themes' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Updates' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\Users' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Package_Version' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Queue' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Queue_Buffer' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\REST_Endpoints' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\REST_Sender' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Replicastore' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Sender' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Server' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Settings' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Simple_Codec' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Users' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Sync\\Utils' => array(
|
||||
'version' => '1.44.0.0',
|
||||
'version' => '1.44.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Terms_Of_Service' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Tracking' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager' => array(
|
||||
'version' => '0.1.1.0',
|
||||
'version' => '0.1.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => array(
|
||||
'version' => '0.1.1.0',
|
||||
'version' => '0.1.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Transport_Helper\\REST_Controller' => array(
|
||||
'version' => '0.1.1.0',
|
||||
'version' => '0.1.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\CLI' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\REST_Controller' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Constants' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Initializer' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Operators' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Request' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Runner' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Runtime' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php'
|
||||
),
|
||||
'Automattic\\Jetpack\\Waf\\Waf_Transforms' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php'
|
||||
),
|
||||
'Jetpack_IXR_Client' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php'
|
||||
),
|
||||
'Jetpack_IXR_ClientMulticall' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php'
|
||||
),
|
||||
'Jetpack_Options' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php'
|
||||
),
|
||||
'Jetpack_Protect' => array(
|
||||
@ -635,19 +687,19 @@ return array(
|
||||
'path' => $baseDir . '/src/class-jetpack-protect.php'
|
||||
),
|
||||
'Jetpack_Signature' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php'
|
||||
),
|
||||
'Jetpack_Tracks_Client' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php'
|
||||
),
|
||||
'Jetpack_Tracks_Event' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php'
|
||||
),
|
||||
'Jetpack_XMLRPC_Server' => array(
|
||||
'version' => '1.47.0.0',
|
||||
'version' => '1.47.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php'
|
||||
),
|
||||
);
|
||||
|
@ -7,11 +7,15 @@ $baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'3773ef3f09c37da5478d578e32b03a4b' => array(
|
||||
'version' => '1.17.27.0',
|
||||
'version' => '1.17.28.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php'
|
||||
),
|
||||
'590147edb63acb03b2852d5c4db13ce8' => array(
|
||||
'version' => '0.1.1.0',
|
||||
'version' => '0.1.2.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php'
|
||||
),
|
||||
'3d45c7e6a7f0e71849e33afe4b3b3ede' => array(
|
||||
'version' => '0.8.1.0',
|
||||
'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/cli.php'
|
||||
),
|
||||
);
|
||||
|
26
wp-content/plugins/jetpack-protect/vendor/composer/platform_check.php
vendored
Normal file
26
wp-content/plugins/jetpack-protect/vendor/composer/platform_check.php
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// platform_check.php @generated by Composer
|
||||
|
||||
$issues = array();
|
||||
|
||||
if (!(PHP_VERSION_ID >= 50509)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.9". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2;
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0;
|
||||
|
||||
// phpcs:ignore
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2;
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0;
|
||||
|
||||
// phpcs:ignore
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @package automattic/jetpack-autoloader
|
||||
*/
|
||||
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_1_2;
|
||||
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_2_0;
|
||||
|
||||
// phpcs:ignore
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user