updated plugin Jetpack Protect
version 1.0.4
This commit is contained in:
@ -5,6 +5,37 @@ 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.0.3] - 2022-08-29
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [2.0.2] - 2022-08-25
|
||||
### Changed
|
||||
- Activate plugins in normal mode to trigger plugin_activated hooks [#25727]
|
||||
- Updated package dependencies. [#25814]
|
||||
|
||||
### Fixed
|
||||
- Licensing: do not enable the Licensing UI if My Jetpack cannot be enabled. [#25667]
|
||||
- Search: increased search plan/pricing API timeouts to 5s [#25775]
|
||||
|
||||
## [2.0.1] - 2022-08-23
|
||||
### Added
|
||||
- My Jetpack: Add container for JITMs [#22452]
|
||||
|
||||
### Changed
|
||||
- Updated package dependencies. [#25338, #25339, #25377, #25422, #25628, #25762, #25764]
|
||||
|
||||
## [2.0.0] - 2022-08-09
|
||||
### Added
|
||||
- Make product cards compatible with disclaimers and add disclaimer for backup card [#25265]
|
||||
|
||||
### Changed
|
||||
- Search: changed to only require site level connection [#24477]
|
||||
|
||||
## [1.8.3] - 2022-08-03
|
||||
### Changed
|
||||
- Updated package dependencies. [#25300, #25315]
|
||||
|
||||
## [1.8.2] - 2022-07-27
|
||||
### Changed
|
||||
- My Jetpack: changed link used in ProductCard component to a button when the plugin is absent
|
||||
@ -548,6 +579,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
- Created package
|
||||
|
||||
[2.0.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.2...2.0.3
|
||||
[2.0.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.1...2.0.2
|
||||
[2.0.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.3...2.0.0
|
||||
[1.8.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.2...1.8.3
|
||||
[1.8.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.1...1.8.2
|
||||
[1.8.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.0...1.8.1
|
||||
[1.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.4...1.8.0
|
||||
|
@ -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' => 'acd7f9241cf1f9ee3a32');
|
||||
<?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' => 'ef234302efce2d8f505a');
|
||||
|
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
@ -6,9 +6,10 @@
|
||||
"require": {
|
||||
"automattic/jetpack-admin-ui": "^0.2",
|
||||
"automattic/jetpack-assets": "^1.17",
|
||||
"automattic/jetpack-connection": "^1.41",
|
||||
"automattic/jetpack-connection": "^1.44",
|
||||
"automattic/jetpack-jitm": "^2.2",
|
||||
"automattic/jetpack-licensing": "^1.7",
|
||||
"automattic/jetpack-plugins-installer": "^0.1",
|
||||
"automattic/jetpack-plugins-installer": "^0.2",
|
||||
"automattic/jetpack-redirect": "^1.7",
|
||||
"automattic/jetpack-constants": "^1.6"
|
||||
},
|
||||
@ -63,7 +64,7 @@
|
||||
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-trunk": "1.8.x-dev"
|
||||
"dev-trunk": "2.0.x-dev"
|
||||
},
|
||||
"version-constants": {
|
||||
"::PACKAGE_VERSION": "src/class-initializer.php"
|
||||
|
@ -13,6 +13,7 @@ use Automattic\Jetpack\Connection\Client as Client;
|
||||
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
|
||||
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
|
||||
use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentication;
|
||||
use Automattic\Jetpack\JITMS\JITM as JITM;
|
||||
use Automattic\Jetpack\Licensing;
|
||||
use Automattic\Jetpack\Status as Status;
|
||||
use Automattic\Jetpack\Terms_Of_Service;
|
||||
@ -28,7 +29,7 @@ class Initializer {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const PACKAGE_VERSION = '1.8.2';
|
||||
const PACKAGE_VERSION = '2.0.3';
|
||||
|
||||
/**
|
||||
* Initialize My Jetapack
|
||||
@ -64,6 +65,9 @@ class Initializer {
|
||||
|
||||
add_action( 'load-' . $page_suffix, array( __CLASS__, 'admin_init' ) );
|
||||
|
||||
// Sets up JITMS.
|
||||
JITM::configure();
|
||||
|
||||
/**
|
||||
* Fires after the My Jetpack package is initialized
|
||||
*
|
||||
@ -80,6 +84,17 @@ class Initializer {
|
||||
* @return boolean
|
||||
*/
|
||||
public static function is_licensing_ui_enabled() {
|
||||
// Default changed to true in 1.5.0.
|
||||
$is_enabled = true;
|
||||
|
||||
/*
|
||||
* Bail if My Jetpack is not enabled,
|
||||
* and thus the licensing UI shouldn't be enabled either.
|
||||
*/
|
||||
if ( ! self::should_initialize() ) {
|
||||
$is_enabled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Acts as a feature flag, returning a boolean for whether we should show the licensing UI.
|
||||
*
|
||||
@ -90,7 +105,7 @@ class Initializer {
|
||||
*/
|
||||
return apply_filters(
|
||||
'jetpack_my_jetpack_should_enable_add_license_screen',
|
||||
true
|
||||
$is_enabled
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -89,11 +89,26 @@ class Backup extends Hybrid_Product {
|
||||
return array(
|
||||
_x( 'Real-time cloud backups', 'Backup Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( '10GB of backup storage', 'Backup Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( '30-day archive & activity log', 'Backup Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( '30-day archive & activity log*', 'Backup Product Feature', 'jetpack-my-jetpack' ),
|
||||
_x( 'One-click restores', 'Backup Product Feature', 'jetpack-my-jetpack' ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get disclaimers corresponding to a feature
|
||||
*
|
||||
* @return array Backup disclaimers list
|
||||
*/
|
||||
public static function get_disclaimers() {
|
||||
return array(
|
||||
array(
|
||||
'text' => _x( '* Subject to your usage and storage limit.', 'Backup Product Disclaimer', 'jetpack-my-jetpack' ),
|
||||
'link_text' => _x( 'Learn more', 'Backup Product Disclaimer', 'jetpack-my-jetpack' ),
|
||||
'url' => Redirect::get_url( 'jetpack-faq-backup-disclaimer' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the WPCOM product slug used to make the purchase
|
||||
*
|
||||
|
@ -135,9 +135,6 @@ class Extras extends Product {
|
||||
* @return null|WP_Error Null on success, WP_Error on invalid file.
|
||||
*/
|
||||
public static function activate_plugin() {
|
||||
/*
|
||||
* Silent mode True to avoid redirect
|
||||
*/
|
||||
return activate_plugin( static::get_installed_plugin_filename( 'jetpack' ), '', false, true );
|
||||
return activate_plugin( static::get_installed_plugin_filename( 'jetpack' ) );
|
||||
}
|
||||
}
|
||||
|
@ -69,11 +69,9 @@ abstract class Hybrid_Product extends Product {
|
||||
public static function activate_plugin() {
|
||||
/*
|
||||
* Activate self-installed plugin if it's installed.
|
||||
* Silent mode True to avoid redirects in Backup.
|
||||
* @TODO When new Hybrid products are added, we might not want to go silent with all of them.
|
||||
*/
|
||||
if ( parent::is_plugin_installed() ) {
|
||||
return activate_plugin( static::get_installed_plugin_filename(), '', false, true );
|
||||
return activate_plugin( static::get_installed_plugin_filename() );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -118,6 +118,7 @@ abstract class Product {
|
||||
'description' => static::get_description(),
|
||||
'long_description' => static::get_long_description(),
|
||||
'features' => static::get_features(),
|
||||
'disclaimers' => static::get_disclaimers(),
|
||||
'status' => static::get_status(),
|
||||
'pricing_for_ui' => static::get_pricing_for_ui(),
|
||||
'is_bundle' => static::is_bundle_product(),
|
||||
@ -199,6 +200,15 @@ abstract class Product {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the disclaimers corresponding to a feature
|
||||
*
|
||||
* @return ?array
|
||||
*/
|
||||
public static function get_disclaimers() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the current plan (or purchases) of the site already supports the product
|
||||
*
|
||||
|
@ -51,6 +51,13 @@ class Search extends Hybrid_Product {
|
||||
'jetpack-search-dev/jetpack-search.php',
|
||||
);
|
||||
|
||||
/**
|
||||
* Search only requires site connection
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public static $requires_user_connection = false;
|
||||
|
||||
/**
|
||||
* Get the internationalized product name
|
||||
*
|
||||
@ -153,10 +160,10 @@ class Search extends Hybrid_Product {
|
||||
|
||||
$response = wp_remote_get(
|
||||
sprintf( Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ) . '/wpcom/v2/jetpack-search/pricing?record_count=%1$d&locale=%2$s', $record_count, get_user_locale() ),
|
||||
array( 'timeout' => 2 )
|
||||
array( 'timeout' => 5 )
|
||||
);
|
||||
|
||||
if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
|
||||
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
|
||||
return new WP_Error( 'search_pricing_fetch_failed' );
|
||||
}
|
||||
|
||||
@ -184,12 +191,12 @@ class Search extends Hybrid_Product {
|
||||
$response = Client::wpcom_json_api_request_as_blog(
|
||||
'/sites/' . $blog_id . '/jetpack-search/plan',
|
||||
'2',
|
||||
array( 'timeout' => 2 ),
|
||||
array( 'timeout' => 5 ),
|
||||
null,
|
||||
'wpcom'
|
||||
);
|
||||
|
||||
if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
|
||||
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
|
||||
return new WP_Error( 'search_state_fetch_failed' );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user