updated plugin Jetpack Protect version 2.1.0

This commit is contained in:
2024-04-19 10:49:36 +00:00
committed by Gitium
parent 620280b550
commit 7841fd5dc6
179 changed files with 6360 additions and 1476 deletions

View File

@ -5,6 +5,27 @@ 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).
## [3.1.1] - 2024-03-14
### Changed
- Internal updates.
## [3.1.0] - 2024-03-12
### Changed
- Performance: only enqueue the JITM JavaScript on pages where it will be used. [#35997]
- Updated package dependencies. [#36325]
## [3.0.5] - 2024-03-04
### Changed
- Updated package dependencies. [#36095]
## [3.0.4] - 2024-02-13
### Changed
- Updated package dependencies. [#35608]
## [3.0.3] - 2024-02-05
### Changed
- Updated package dependencies. [#35384]
## [3.0.2] - 2024-01-04
### Changed
- Updated package dependencies. [#34815]
@ -662,6 +683,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update Jetpack to use new JITM package
[3.1.1]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.0...v3.1.1
[3.1.0]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.5...v3.1.0
[3.0.5]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.4...v3.0.5
[3.0.4]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.3...v3.0.4
[3.0.3]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.2...v3.0.3
[3.0.2]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.1...v3.0.2
[3.0.1]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.0...v3.0.1
[3.0.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.5.3...v3.0.0

View File

@ -1 +1 @@
<?php return array('dependencies' => array('jquery', 'wp-polyfill'), 'version' => 'be1957276194cda30e35');
<?php return array('dependencies' => array('jquery', 'wp-polyfill'), 'version' => '42733b29f872f13c5451');

View File

@ -5,18 +5,18 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-a8c-mc-stats": "^2.0.0",
"automattic/jetpack-assets": "^2.0.4",
"automattic/jetpack-connection": "^2.1.1",
"automattic/jetpack-device-detection": "^2.0.1",
"automattic/jetpack-logo": "^2.0.0",
"automattic/jetpack-redirect": "^2.0.0",
"automattic/jetpack-status": "^2.0.2"
"automattic/jetpack-a8c-mc-stats": "^2.0.1",
"automattic/jetpack-assets": "^2.1.4",
"automattic/jetpack-connection": "^2.4.1",
"automattic/jetpack-device-detection": "^2.1.1",
"automattic/jetpack-logo": "^2.0.1",
"automattic/jetpack-redirect": "^2.0.1",
"automattic/jetpack-status": "^2.1.2"
},
"require-dev": {
"brain/monkey": "2.6.1",
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "^4.0.5"
"automattic/jetpack-changelogger": "^4.1.1"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
@ -57,7 +57,7 @@
"link-template": "https://github.com/Automattic/jetpack-jitm/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "3.0.x-dev"
"dev-trunk": "3.1.x-dev"
}
}
}

View File

@ -20,7 +20,7 @@ use Automattic\Jetpack\Status;
*/
class JITM {
const PACKAGE_VERSION = '3.0.2';
const PACKAGE_VERSION = '3.1.1';
/**
* The configuration method that is called from the jetpack-config package.
@ -130,11 +130,42 @@ class JITM {
}
}
/**
* Check if the current page is a Jetpack or WooCommerce admin page.
* Noting that this is a very basic check, and pages from other plugins may also match.
*
* @since 3.1.0
*
* @return bool True if the current page is a Jetpack or WooCommerce admin page, else false.
*/
public function is_a8c_admin_page() {
if ( ! function_exists( 'get_current_screen' ) ) {
return false;
}
$current_screen = get_current_screen();
// We never want to show JITMs on the block editor.
if (
method_exists( $current_screen, 'is_block_editor' )
&& $current_screen->is_block_editor()
) {
return false;
}
return (
$current_screen
&& $current_screen->id
&& (bool) preg_match( '/jetpack|woo|shop|product/', $current_screen->id )
);
}
/**
* Function to enqueue jitm css and js
*/
public function jitm_enqueue_files() {
if ( $this->is_gutenberg_page() ) {
// Only load those files on the Jetpack or Woo admin pages.
if ( ! $this->is_a8c_admin_page() ) {
return;
}
@ -145,9 +176,9 @@ class JITM {
array(
'in_footer' => true,
'dependencies' => array( 'jquery' ),
'enqueue' => true,
)
);
Assets::enqueue_script( 'jetpack-jitm' );
wp_localize_script(
'jetpack-jitm',
'jitm_config',
@ -167,8 +198,11 @@ class JITM {
*
* @since 1.1.0
* @since-jetpack 8.0.0
*
* @deprecated 3.1.0
*/
public function is_gutenberg_page() {
_deprecated_function( __METHOD__, '3.1.0' );
$current_screen = get_current_screen();
return ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() );
}
@ -192,8 +226,8 @@ class JITM {
return;
}
// do not display on Gutenberg pages.
if ( $this->is_gutenberg_page() ) {
// Only add this to Jetpack or Woo admin pages.
if ( ! $this->is_a8c_admin_page() ) {
return;
}