updated plugin Jetpack Protect version 4.0.0

This commit is contained in:
2025-04-29 21:19:56 +00:00
committed by Gitium
parent eb9181b250
commit ebd40ef928
265 changed files with 11864 additions and 3987 deletions

View File

@ -1,3 +0,0 @@
module.exports = {
extends: [ require.resolve( 'jetpack-js-tools/eslintrc/react' ) ],
};

View File

@ -5,6 +5,101 @@ 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).
## [4.0.14] - 2025-03-21
### Changed
- Internal updates.
## [4.0.13] - 2025-03-18
### Changed
- Update dependencies. [#42545]
## [4.0.12] - 2025-03-17
### Changed
- Internal updates.
## [4.0.11] - 2025-03-12
### Changed
- Internal updates.
## [4.0.10] - 2025-03-05
### Changed
- Internal updates.
## [4.0.9] - 2025-03-03
### Changed
- Update package dependencies. [#42163]
## [4.0.8] - 2025-02-24
### Added
- User data: Add permissions to the current user object. [#41859]
## [4.0.7] - 2025-02-17
### Changed
- Update dependencies.
## [4.0.6] - 2025-02-11
### Changed
- Update dependencies.
## [4.0.5] - 2025-02-05
### Changed
- Updated package dependencies. [#41491]
## [4.0.4] - 2025-02-03
### Changed
- Updated package dependencies. [#41286]
## [4.0.3] - 2025-01-20
### Changed
- Updated package dependencies. [#41099]
## [4.0.2] - 2024-12-16
### Changed
- Updated package dependencies. [#40564]
## [4.0.1] - 2024-12-04
### Changed
- Updated package dependencies. [#40363]
## [4.0.0] - 2024-11-25
### Changed
- Updated package dependencies. [#40258] [#40288]
### Removed
- Remove JSX runtime polyfill, now that we've dropped support for WordPress < 6.6. [#40200]
## [3.0.0] - 2024-11-14
### Removed
- General: Update minimum PHP version to 7.2. [#40147]
## [2.3.14] - 2024-11-11
### Changed
- Updated package dependencies. [#39999]
## [2.3.13] - 2024-11-04
### Added
- Enable test coverage. [#39961]
## [2.3.12] - 2024-10-29
### Changed
- Internal updates.
## [2.3.11] - 2024-10-29
### Fixed
- Fixed the outdated JS build for script-data [#39937]
## [2.3.10] - 2024-10-10
### Changed
- Updated package dependencies.
## [2.3.9] - 2024-10-07
### Changed
- Updated package dependencies. [#39594]
## [2.3.8] - 2024-09-10
### Changed
- Updated package dependencies. [#39302]
## [2.3.7] - 2024-09-05
### Changed
- Internal updates.
@ -497,6 +592,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Statically access asset tools
[4.0.14]: https://github.com/Automattic/jetpack-assets/compare/v4.0.13...v4.0.14
[4.0.13]: https://github.com/Automattic/jetpack-assets/compare/v4.0.12...v4.0.13
[4.0.12]: https://github.com/Automattic/jetpack-assets/compare/v4.0.11...v4.0.12
[4.0.11]: https://github.com/Automattic/jetpack-assets/compare/v4.0.10...v4.0.11
[4.0.10]: https://github.com/Automattic/jetpack-assets/compare/v4.0.9...v4.0.10
[4.0.9]: https://github.com/Automattic/jetpack-assets/compare/v4.0.8...v4.0.9
[4.0.8]: https://github.com/Automattic/jetpack-assets/compare/v4.0.7...v4.0.8
[4.0.7]: https://github.com/Automattic/jetpack-assets/compare/v4.0.6...v4.0.7
[4.0.6]: https://github.com/Automattic/jetpack-assets/compare/v4.0.5...v4.0.6
[4.0.5]: https://github.com/Automattic/jetpack-assets/compare/v4.0.4...v4.0.5
[4.0.4]: https://github.com/Automattic/jetpack-assets/compare/v4.0.3...v4.0.4
[4.0.3]: https://github.com/Automattic/jetpack-assets/compare/v4.0.2...v4.0.3
[4.0.2]: https://github.com/Automattic/jetpack-assets/compare/v4.0.1...v4.0.2
[4.0.1]: https://github.com/Automattic/jetpack-assets/compare/v4.0.0...v4.0.1
[4.0.0]: https://github.com/Automattic/jetpack-assets/compare/v3.0.0...v4.0.0
[3.0.0]: https://github.com/Automattic/jetpack-assets/compare/v2.3.14...v3.0.0
[2.3.14]: https://github.com/Automattic/jetpack-assets/compare/v2.3.13...v2.3.14
[2.3.13]: https://github.com/Automattic/jetpack-assets/compare/v2.3.12...v2.3.13
[2.3.12]: https://github.com/Automattic/jetpack-assets/compare/v2.3.11...v2.3.12
[2.3.11]: https://github.com/Automattic/jetpack-assets/compare/v2.3.10...v2.3.11
[2.3.10]: https://github.com/Automattic/jetpack-assets/compare/v2.3.9...v2.3.10
[2.3.9]: https://github.com/Automattic/jetpack-assets/compare/v2.3.8...v2.3.9
[2.3.8]: https://github.com/Automattic/jetpack-assets/compare/v2.3.7...v2.3.8
[2.3.7]: https://github.com/Automattic/jetpack-assets/compare/v2.3.6...v2.3.7
[2.3.6]: https://github.com/Automattic/jetpack-assets/compare/v2.3.5...v2.3.6
[2.3.5]: https://github.com/Automattic/jetpack-assets/compare/v2.3.4...v2.3.5

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '0274966690f87adbeccb');
<?php return array('dependencies' => array(), 'version' => '7f1c9fc474dccfef702f');

View File

@ -1 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JetpackScriptDataModule=t():e.JetpackScriptDataModule=t()}(self,(()=>(()=>{var e={729:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getActiveFeatures:()=>a.mH,getAdminUrl:()=>a.hT,getJetpackAdminPageUrl:()=>a.oQ,getMyJetpackUrl:()=>a.e5,getScriptData:()=>a.au,getSiteData:()=>a.sV});var o=r(428),n={};for(const e in o)"default"!==e&&(n[e]=()=>o[e]);r.d(t,n);var a=r(336)},428:()=>{},336:(e,t,r)=>{"use strict";function o(){return window.JetpackScriptData}function n(){return o().site}function a(e=""){return`${o().site.admin_url}${e}`}function i(e=""){return a(`admin.php?page=jetpack${e}`)}function u(e=""){return a(`admin.php?page=my-jetpack${e}`)}function p(){return o().site.plan?.features?.active??[]}r.d(t,{au:()=>o,e5:()=>u,hT:()=>a,mH:()=>p,oQ:()=>i,sV:()=>n})}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o);var e=r(729),t={};for(const r in e)"default"!==r&&(t[r]=()=>e[r]);r.d(o,t)})(),o})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JetpackScriptDataModule=t():e.JetpackScriptDataModule=t()}(globalThis,(()=>(()=>{"use strict";var e={729:(e,t,r)=>{r.d(t,{$8:()=>n.$8,IT:()=>n.IT,L2:()=>n.L2,Sy:()=>n.Sy,au:()=>n.au,d9:()=>n.d9,d_:()=>n.d_,e5:()=>n.e5,hT:()=>n.hT,lI:()=>n.lI,mH:()=>n.mH,oQ:()=>n.oQ,sV:()=>n.sV});var n=r(336)},336:(e,t,r)=>{function n(){return window.JetpackScriptData}function o(){return n().site}function i(e=""){return`${n().site.admin_url}${e}`}function u(e=""){return i(`admin.php?page=jetpack${e}`)}function a(e=""){return i(`admin.php?page=my-jetpack${e}`)}function c(){return n().site.plan?.features?.active??[]}function s(e){return c().includes(e)}function p(){return"wpcom"===n().site?.host}function d(){return"atomic"===n().site?.host}function f(){return"woa"===n().site?.host}function l(){return p()||f()}function m(){return"unknown"===n()?.site?.host}function S(e){return n().user.current_user.capabilities[e]}r.d(t,{$8:()=>l,IT:()=>s,L2:()=>m,Sy:()=>p,au:()=>n,d9:()=>d,d_:()=>S,e5:()=>a,hT:()=>i,lI:()=>f,mH:()=>c,oQ:()=>u,sV:()=>o})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{currentUserCan:()=>o.d_,getActiveFeatures:()=>o.mH,getAdminUrl:()=>o.hT,getJetpackAdminPageUrl:()=>o.oQ,getMyJetpackUrl:()=>o.e5,getScriptData:()=>o.au,getSiteData:()=>o.sV,isAtomicSite:()=>o.d9,isJetpackSelfHostedSite:()=>o.L2,isSimpleSite:()=>o.Sy,isWoASite:()=>o.lI,isWpcomPlatformSite:()=>o.$8,siteHasFeature:()=>o.IT});var o=r(729);return n})()));

View File

@ -1,2 +0,0 @@
/*! For license information please see react-jsx-runtime.js.LICENSE.txt */
(()=>{"use strict";var r={572:(r,e,t)=>{var o=t(609),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function _(r,e,t){var o,s={},_=null,i=null;for(o in void 0!==t&&(_=""+t),void 0!==e.key&&(_=""+e.key),void 0!==e.ref&&(i=e.ref),e)a.call(e,o)&&!p.hasOwnProperty(o)&&(s[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===s[o]&&(s[o]=e[o]);return{$$typeof:n,type:r,key:_,ref:i,props:s,_owner:f.current}}e.Fragment=s,e.jsx=_,e.jsxs=_},48:(r,e,t)=>{r.exports=t(572)},609:r=>{r.exports=window.React}},e={},t=function t(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return r[o](s,s.exports,t),s.exports}(48);window.ReactJSXRuntime=t})();

View File

@ -1,9 +0,0 @@
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

View File

@ -4,14 +4,15 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-constants": "^2.0.4"
"php": ">=7.2",
"automattic/jetpack-constants": "^3.0.5"
},
"require-dev": {
"brain/monkey": "2.6.1",
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "^4.2.6",
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0"
"brain/monkey": "^2.6.2",
"yoast/phpunit-polyfills": "^3.0.0",
"automattic/jetpack-changelogger": "^6.0.2",
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0",
"automattic/phpunit-select-config": "^1.0.1"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
@ -32,8 +33,9 @@
"pnpm run build-production"
],
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
"phpunit-select-config phpunit.#.xml.dist --colors=always"
],
"test-coverage": "pnpm concurrently --names php,js 'php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"' 'pnpm:test-coverage'",
"test-js": [
"pnpm run test"
],
@ -51,7 +53,7 @@
"link-template": "https://github.com/Automattic/jetpack-assets/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "2.3.x-dev"
"dev-trunk": "4.0.x-dev"
}
}
}

View File

@ -537,12 +537,6 @@ class Assets {
$wp_scripts->add( 'wp-jp-i18n-state', false, array( 'wp-deprecated', $handle ) );
$wp_scripts->add_inline_script( 'wp-jp-i18n-state', 'wp.deprecated( "wp-jp-i18n-state", { alternative: "wp-jp-i18n-loader" } );' );
$wp_scripts->add_inline_script( 'wp-jp-i18n-state', 'wp.jpI18nState = wp.jpI18nLoader.state;' );
// Register the React JSX runtime script - used as a polyfill until we can update JSX transforms. See https://github.com/Automattic/jetpack/issues/38424.
// @todo Remove this when we drop support for WordPress 6.5, as well as the script inclusion in test_wp_default_scripts_hook.
$jsx_url = self::normalize_path( plugins_url( '../build/react-jsx-runtime.js', __FILE__ ) );
$wp_scripts->add( 'react-jsx-runtime', $jsx_url, array( 'react' ), '18.3.1', true );
$wp_scripts->add_data( 'react-jsx-runtime', 'group', 1 );
}
// endregion .

View File

@ -215,6 +215,10 @@ class Script_Data {
return array(
'display_name' => $current_user->display_name,
'id' => $current_user->ID,
'capabilities' => array(
'manage_options' => current_user_can( 'manage_options' ),
'manage_modules' => current_user_can( 'jetpack_manage_modules' ),
),
);
}
}