updated plugin Jetpack Protect
version 1.3.0
This commit is contained in:
@ -5,6 +5,26 @@ 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.16.2] - 2023-02-20
|
||||
### Changed
|
||||
- Minor internal updates.
|
||||
|
||||
## [1.16.1] - 2023-01-23
|
||||
### Added
|
||||
- Add new filters for the latest status methods [#28328]
|
||||
|
||||
## [1.16.0] - 2023-01-16
|
||||
### Added
|
||||
- Add 2 new methods to detect whether a site is private or not. [#28322]
|
||||
|
||||
## [1.15.4] - 2023-01-11
|
||||
### Changed
|
||||
- Modules: Allow for deactivating multiple plugins when activating a module. [#28181]
|
||||
|
||||
## [1.15.3] - 2022-12-19
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [1.15.2] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
@ -220,6 +240,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Packages: Introduce a status package
|
||||
|
||||
[1.16.2]: https://github.com/Automattic/jetpack-status/compare/v1.16.1...v1.16.2
|
||||
[1.16.1]: https://github.com/Automattic/jetpack-status/compare/v1.16.0...v1.16.1
|
||||
[1.16.0]: https://github.com/Automattic/jetpack-status/compare/v1.15.4...v1.16.0
|
||||
[1.15.4]: https://github.com/Automattic/jetpack-status/compare/v1.15.3...v1.15.4
|
||||
[1.15.3]: https://github.com/Automattic/jetpack-status/compare/v1.15.2...v1.15.3
|
||||
[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
|
||||
|
@ -4,12 +4,12 @@
|
||||
"type": "jetpack-library",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"require": {
|
||||
"automattic/jetpack-constants": "^1.6.20"
|
||||
"automattic/jetpack-constants": "^1.6.21"
|
||||
},
|
||||
"require-dev": {
|
||||
"brain/monkey": "2.6.1",
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
"automattic/jetpack-changelogger": "^3.3.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
@ -20,9 +20,6 @@
|
||||
"phpunit": [
|
||||
"./vendor/phpunit/phpunit/phpunit --colors=always"
|
||||
],
|
||||
"test-coverage": [
|
||||
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/clover.xml\""
|
||||
],
|
||||
"test-php": [
|
||||
"@composer phpunit"
|
||||
]
|
||||
@ -36,7 +33,7 @@
|
||||
"link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-trunk": "1.15.x-dev"
|
||||
"dev-trunk": "1.16.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @package automattic/jetpack-status
|
||||
*/
|
||||
|
||||
// phpcs:disable WordPress.PHP.IniSet.display_errors_Blacklisted
|
||||
// phpcs:disable WordPress.PHP.IniSet.display_errors_Disallowed
|
||||
// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
// phpcs:disable WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting
|
||||
// phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_error_reporting
|
||||
|
@ -416,11 +416,17 @@ class Modules {
|
||||
|
||||
// Check and see if the old plugin is active.
|
||||
if ( isset( $jetpack->plugins_to_deactivate[ $module ] ) ) {
|
||||
// Deactivate the old plugin.
|
||||
if ( \Jetpack_Client_Server::deactivate_plugin( $jetpack->plugins_to_deactivate[ $module ][0], $jetpack->plugins_to_deactivate[ $module ][1] ) ) {
|
||||
// If we deactivated the old plugin, remembere that with ::state() and redirect back to this page to activate the module
|
||||
// We can't activate the module on this page load since the newly deactivated old plugin is still loaded on this page load.
|
||||
$state->state( 'deactivated_plugins', $module );
|
||||
// Deactivate the old plugins.
|
||||
$deactivated = array();
|
||||
foreach ( $jetpack->plugins_to_deactivate[ $module ] as $idx => $deactivate_me ) {
|
||||
if ( \Jetpack_Client_Server::deactivate_plugin( $deactivate_me[0], $deactivate_me[1] ) ) {
|
||||
// If we deactivated the old plugin, remembere that with ::state() and redirect back to this page to activate the module
|
||||
// We can't activate the module on this page load since the newly deactivated old plugin is still loaded on this page load.
|
||||
$deactivated[] = "$module:$idx";
|
||||
}
|
||||
}
|
||||
if ( $deactivated ) {
|
||||
$state->state( 'deactivated_plugins', join( ',', $deactivated ) );
|
||||
wp_safe_redirect( add_query_arg( 'jetpack_restate', 1 ) );
|
||||
exit;
|
||||
}
|
||||
|
@ -314,6 +314,63 @@ class Status {
|
||||
return \Jetpack_Options::get_option( 'onboarding' ) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the site is currently private or not.
|
||||
* On WordPress.com and WoA, sites can be marked as private
|
||||
*
|
||||
* @since 1.16.0
|
||||
*
|
||||
* @return bool True if the site is private.
|
||||
*/
|
||||
public function is_private_site() {
|
||||
$ret = Cache::get( 'is_private_site' );
|
||||
if ( null === $ret ) {
|
||||
$is_private_site = '-1' === get_option( 'blog_public' );
|
||||
|
||||
/**
|
||||
* Filters the is_private_site check.
|
||||
*
|
||||
* @since 1.16.1
|
||||
*
|
||||
* @param bool $is_private_site True if the site is private.
|
||||
*/
|
||||
$is_private_site = apply_filters( 'jetpack_is_private_site', $is_private_site );
|
||||
|
||||
Cache::set( 'is_private_site', $is_private_site );
|
||||
return $is_private_site;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the site is currently unlaunched or not.
|
||||
* On WordPress.com and WoA, sites can be marked as "coming soon", aka unlaunched
|
||||
*
|
||||
* @since 1.16.0
|
||||
*
|
||||
* @return bool True if the site is not launched.
|
||||
*/
|
||||
public function is_coming_soon() {
|
||||
$ret = Cache::get( 'is_coming_soon' );
|
||||
if ( null === $ret ) {
|
||||
$is_coming_soon = (bool) ( function_exists( 'site_is_coming_soon' ) && \site_is_coming_soon() )
|
||||
|| get_option( 'wpcom_public_coming_soon' );
|
||||
|
||||
/**
|
||||
* Filters the is_coming_soon check.
|
||||
*
|
||||
* @since 1.16.1
|
||||
*
|
||||
* @param bool $is_coming_soon True if the site is coming soon (i.e. unlaunched).
|
||||
*/
|
||||
$is_coming_soon = apply_filters( 'jetpack_is_coming_soon', $is_coming_soon );
|
||||
|
||||
Cache::set( 'is_coming_soon', $is_coming_soon );
|
||||
return $is_coming_soon;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the site slug suffix to be used as part of Calypso URLs.
|
||||
*
|
||||
|
Reference in New Issue
Block a user