From e59a366ae6bb94266d68c671dfaa455f5c77f4fd Mon Sep 17 00:00:00 2001 From: Luiz Kowalski Date: Thu, 16 Nov 2023 11:57:53 -0300 Subject: [PATCH 01/80] Jetpack AI: Use the Usage Helper to set ai-assistant-feature endpoint fields (#34151) * Use Usage Helper to set is-over-limit flag * Use Usage Helper to set the requests_limit (free limit) * Use Usage Helper to fetch all time requests count * Remove OpenAI class checks since the class is not needed anymore * Add changelog file --- .../_inc/lib/class-jetpack-ai-helper.php | 31 ++----------------- ...ate-jetpack-ai-use-usage-helper-for-fields | 4 +++ 2 files changed, 7 insertions(+), 28 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-for-fields diff --git a/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php b/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php index 5c60526cebd8b..bfc3d90d04b78 100644 --- a/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php +++ b/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php @@ -343,31 +343,6 @@ public static function get_ai_assistance_feature() { if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { $has_ai_assistant_feature = \wpcom_site_has_feature( 'ai-assistant' ); - if ( ! class_exists( 'OpenAI' ) ) { - \require_lib( 'openai' ); - } - - if ( ! class_exists( 'OpenAI_Limit_Usage' ) ) { - if ( is_readable( WP_CONTENT_DIR . '/lib/openai/openai-limit-usage.php' ) ) { - require_once WP_CONTENT_DIR . '/lib/openai/openai-limit-usage.php'; - } else { - return new WP_Error( - 'openai_limit_usage_not_found', - __( 'OpenAI_Limit_Usage class not found.', 'jetpack' ) - ); - } - } - - if ( ! class_exists( 'OpenAI_Request_Count' ) ) { - if ( is_readable( WP_CONTENT_DIR . '/lib/openai/openai-request-count.php' ) ) { - require_once WP_CONTENT_DIR . '/lib/openai/openai-request-count.php'; - } else { - return new WP_Error( - 'openai_request_count_not_found', - __( 'OpenAI_Request_Count class not found.', 'jetpack' ) - ); - } - } if ( ! class_exists( 'WPCOM\Jetpack_AI\Usage\Helper' ) ) { if ( is_readable( WP_CONTENT_DIR . '/lib/jetpack-ai/usage/helper.php' ) ) { @@ -381,9 +356,9 @@ public static function get_ai_assistance_feature() { } $blog_id = get_current_blog_id(); - $is_over_limit = \OpenAI_Limit_Usage::is_blog_over_request_limit( $blog_id ); - $requests_limit = \OpenAI_Limit_Usage::get_free_requests_limit( $blog_id ); - $requests_count = \OpenAI_Request_Count::get_count( $blog_id ); + $is_over_limit = WPCOM\Jetpack_AI\Usage\Helper::is_over_limit( $blog_id ); + $requests_limit = WPCOM\Jetpack_AI\Usage\Helper::get_free_requests_limit( $blog_id ); + $requests_count = WPCOM\Jetpack_AI\Usage\Helper::get_all_time_requests_count( $blog_id ); // Check if the site requires an upgrade. $require_upgrade = $is_over_limit && ! $has_ai_assistant_feature; diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-for-fields b/projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-for-fields new file mode 100644 index 0000000000000..c51a42400848c --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-for-fields @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Jetpack AI: use the Usage Helper to set fields on the ai-assistant-feature endpoint. From efa4dcb43227dc68a5ad8af53f8035048d09a92d Mon Sep 17 00:00:00 2001 From: Peter Petrov Date: Thu, 16 Nov 2023 17:09:31 +0200 Subject: [PATCH 02/80] Boost: Migrate benefits interstitial component to react (#34042) --- .../plugins/boost/app/admin/class-config.php | 14 +- .../boost/app/assets/src/js/Main.svelte | 6 +- .../boost/app/assets/src/js/global.d.ts | 1 + .../src/js/pages/upgrade/Upgrade.svelte | 132 ------------------ .../src/js/pages/upgrade/upgrade.module.scss | 8 ++ .../assets/src/js/pages/upgrade/upgrade.tsx | 112 +++++++++++++++ .../app/assets/src/js/svg/jetpack-green.tsx | 36 ++--- .../update-boost-react-benefits-interstitial | 4 + 8 files changed, 155 insertions(+), 158 deletions(-) delete mode 100644 projects/plugins/boost/app/assets/src/js/pages/upgrade/Upgrade.svelte create mode 100644 projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.module.scss create mode 100644 projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.tsx create mode 100644 projects/plugins/boost/changelog/update-boost-react-benefits-interstitial diff --git a/projects/plugins/boost/app/admin/class-config.php b/projects/plugins/boost/app/admin/class-config.php index 7f2a9fbc45d2a..3f0da63dfddb5 100644 --- a/projects/plugins/boost/app/admin/class-config.php +++ b/projects/plugins/boost/app/admin/class-config.php @@ -22,6 +22,7 @@ public function init() { public function constants() { $optimizations = ( new Modules_Setup() )->get_status(); $internal_path = apply_filters( 'jetpack_boost_asset_internal_path', 'app/assets/dist/' ); + $static_path = 'app/assets/static/'; $constants = array( 'version' => JETPACK_BOOST_VERSION, @@ -32,12 +33,13 @@ public function constants() { 'optimizations' => $optimizations, 'locale' => get_locale(), 'site' => array( - 'domain' => ( new Status() )->get_site_suffix(), - 'url' => get_home_url(), - 'online' => ! ( new Status() )->is_offline_mode(), - 'assetPath' => plugins_url( $internal_path, JETPACK_BOOST_PATH ), - 'isAtomic' => ( new Host() )->is_woa_site(), - 'postTypes' => self::get_custom_post_types(), + 'domain' => ( new Status() )->get_site_suffix(), + 'url' => get_home_url(), + 'online' => ! ( new Status() )->is_offline_mode(), + 'assetPath' => plugins_url( $internal_path, JETPACK_BOOST_PATH ), + 'staticAssetPath' => plugins_url( $static_path, JETPACK_BOOST_PATH ), + 'isAtomic' => ( new Host() )->is_woa_site(), + 'postTypes' => self::get_custom_post_types(), ), 'isPremium' => Premium_Features::has_any(), 'preferences' => array( diff --git a/projects/plugins/boost/app/assets/src/js/Main.svelte b/projects/plugins/boost/app/assets/src/js/Main.svelte index fd9bb51bbbdd9..c0f8b9b361d96 100644 --- a/projects/plugins/boost/app/assets/src/js/Main.svelte +++ b/projects/plugins/boost/app/assets/src/js/Main.svelte @@ -4,7 +4,7 @@ import RecommendationsPage from './pages/image-size-analysis/ImageSizeAnalysis.svelte'; import Index from './pages/index/Index.svelte'; import PurchaseSuccess from './pages/purchase-success/purchase-success'; - import Upgrade from './pages/upgrade/Upgrade.svelte'; + import Upgrade from './pages/upgrade/upgrade'; import ReactComponent from '$features/ReactComponent.svelte'; import Redirect from '$features/Redirect.svelte'; import SettingsPage from '$layout/SettingsPage/SettingsPage.svelte'; @@ -44,8 +44,8 @@ - - + + - import { PricingCard } from '@automattic/jetpack-components'; - import React from 'react'; - import { __ } from '@wordpress/i18n'; - import ActivateLicense from '$features/activate-license/activate-license'; - import { BackButton } from '$features/ui'; - import ReactComponent from '$features/ReactComponent.svelte'; - import Footer from '$layout/footer/footer'; - import Header from '$layout/header/header'; - import { getUpgradeURL } from '$lib/stores/connection'; - import { recordBoostEvent } from '$lib/utils/analytics'; - import Logo from '$svg/jetpack-green.svg'; - - // svelte-ignore unused-export-let - Ignored values supplied by svelte-navigator. - export let location, navigate; - export let pricing: ( typeof Jetpack_Boost )[ 'pricing' ]; - export let siteDomain: string; - export let userConnected: boolean; - - const ctaText = __( 'Upgrade Jetpack Boost', 'jetpack-boost' ); - - async function goToCheckout() { - const eventProps = {}; - await recordBoostEvent( 'checkout_from_pricing_page_in_plugin', eventProps ); - window.location.href = getUpgradeURL( siteDomain, userConnected ); - } - - if ( ! ( 'yearly' in pricing ) ) { - goToCheckout(); - } - - const activateLicense = React.createElement( ActivateLicense ); - - -
- - -
-
- -
-
- -

{__( "Optimize your website's performance", 'jetpack-boost' )}

-

- {__( - 'Automatically regenerate critical CSS after site changes, and hunt down image issues with ease.', - 'jetpack-boost' - )} -

-
    -
  • {__( 'Automatic critical CSS regeneration', 'jetpack-boost' )}
  • -
  • - {__( 'Performance scores are recalculated after each change', 'jetpack-boost' )} -
  • -
  • {__( 'Automatically scan your site for image size issues', 'jetpack-boost' )}
  • -
  • - {__( 'Historical performance scores with Core Web Vitals data', 'jetpack-boost' )} -
  • -
  • - {__( - 'Fine-tune your CDN images with customizable quality settings.', - 'jetpack-boost' - )} -
  • -
  • {__( 'Dedicated email support', 'jetpack-boost' )}
  • -
-
- -
- {#if 'yearly' in pricing} - - - {/if} -
-
-
- {__( - 'Special introductory pricing, all renewals are at full price. 14 day money back guarantee.', - 'jetpack-boost' - )} -
-
-
- - -
- - diff --git a/projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.module.scss b/projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.module.scss new file mode 100644 index 0000000000000..cd99d754026d3 --- /dev/null +++ b/projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.module.scss @@ -0,0 +1,8 @@ +.body { + background-color: var( --jp-white-off ); + padding-block-end: 64px; +} + +.footer { + background-color: var( --jp-white ); +} diff --git a/projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.tsx b/projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.tsx new file mode 100644 index 0000000000000..d80a9723e737c --- /dev/null +++ b/projects/plugins/boost/app/assets/src/js/pages/upgrade/upgrade.tsx @@ -0,0 +1,112 @@ +import { PricingCard } from '@automattic/jetpack-components'; +import classNames from 'classnames'; +import { __ } from '@wordpress/i18n'; +import ActivateLicense from '$features/activate-license/activate-license'; +import { getUpgradeURL } from '$lib/stores/connection'; +import { recordBoostEventAndRedirect } from '$lib/utils/analytics'; +import BackButton from '$features/ui/back-button/back-button'; +import Footer from '$layout/footer/footer'; +import Header from '$layout/header/header'; +import JetpackLogo from '$svg/jetpack-green'; +import styles from './upgrade.module.scss'; + +type UpgradeProps = { + pricing: ( typeof Jetpack_Boost )[ 'pricing' ]; + siteDomain: string; + userConnected: boolean; +}; + +const Upgrade: React.FC< UpgradeProps > = ( { pricing, siteDomain, userConnected } ) => { + const goToCheckout = () => { + recordBoostEventAndRedirect( + getUpgradeURL( siteDomain, userConnected ), + 'checkout_from_pricing_page_in_plugin' + ); + }; + + if ( ! ( 'yearly' in pricing ) ) { + goToCheckout(); + } + + return ( +
+
+ +
+ +
+
+ +
+
+ +

+ { __( "Optimize your website's performance", 'jetpack-boost' ) } +

+

+ { __( + 'Automatically regenerate critical CSS after site changes, and hunt down image issues with ease.', + 'jetpack-boost' + ) } +

+
    +
  • { __( 'Automatic critical CSS regeneration', 'jetpack-boost' ) }
  • +
  • + { __( 'Performance scores are recalculated after each change', 'jetpack-boost' ) } +
  • +
  • + { __( 'Automatically scan your site for image size issues', 'jetpack-boost' ) } +
  • +
  • + { __( + 'Historical performance scores with Core Web Vitals data', + 'jetpack-boost' + ) } +
  • +
  • + { __( + 'Fine-tune your CDN images with customizable quality settings.', + 'jetpack-boost' + ) } +
  • +
  • { __( 'Dedicated email support', 'jetpack-boost' ) }
  • +
+
+ +
+ { 'yearly' in pricing && ( + + ) } +
+
+
+ { __( + 'Special introductory pricing, all renewals are at full price. 14 day money back guarantee.', + 'jetpack-boost' + ) } +
+
+
+ +
+
+
+
+ ); +}; + +export default Upgrade; diff --git a/projects/plugins/boost/app/assets/src/js/svg/jetpack-green.tsx b/projects/plugins/boost/app/assets/src/js/svg/jetpack-green.tsx index c98e25a2678c5..b01b270138bb3 100644 --- a/projects/plugins/boost/app/assets/src/js/svg/jetpack-green.tsx +++ b/projects/plugins/boost/app/assets/src/js/svg/jetpack-green.tsx @@ -1,19 +1,21 @@ -const JetpackGreen = ( { className } ) => ( - - - -); +const JetpackGreen = props => { + return ( + + + + ); +}; export default JetpackGreen; diff --git a/projects/plugins/boost/changelog/update-boost-react-benefits-interstitial b/projects/plugins/boost/changelog/update-boost-react-benefits-interstitial new file mode 100644 index 0000000000000..311314f515883 --- /dev/null +++ b/projects/plugins/boost/changelog/update-boost-react-benefits-interstitial @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated Benefits Interstitial to react. Also, renamed it to Upgrade. From 4ff02ad57d9f59beaaaa799750db3487435a68ad Mon Sep 17 00:00:00 2001 From: Dylan Munson <65001528+CodeyGuyDylan@users.noreply.github.com> Date: Thu, 16 Nov 2023 08:19:37 -0700 Subject: [PATCH 03/80] Remove/unneeded condition from product data api (#33997) * Remove unneeded condition from backup call * changelog * Improve efficiency of site activity API call * Fix versions * update lockfiles * changelog --- .../backup-card/index.jsx | 6 +++- ...e-unneeded-condition-from-product-data-api | 4 +++ projects/packages/my-jetpack/composer.json | 2 +- projects/packages/my-jetpack/package.json | 2 +- .../my-jetpack/src/class-initializer.php | 2 +- .../src/class-rest-product-data.php | 35 ++++--------------- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/backup/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/boost/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/jetpack/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/migration/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/protect/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/search/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/social/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/starter-plugin/composer.lock | 4 +-- ...e-unneeded-condition-from-product-data-api | 5 +++ projects/plugins/videopress/composer.lock | 4 +-- 24 files changed, 81 insertions(+), 51 deletions(-) create mode 100644 projects/packages/my-jetpack/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/backup/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/boost/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/jetpack/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/migration/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/protect/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/search/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/social/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/starter-plugin/changelog/remove-unneeded-condition-from-product-data-api create mode 100644 projects/plugins/videopress/changelog/remove-unneeded-condition-from-product-data-api diff --git a/projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx b/projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx index f3ab7897c4a65..7d1f885ad0702 100644 --- a/projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx @@ -118,6 +118,10 @@ const WithBackupsValueSection = ( { lastUndoableEvent } ) => { } const { last_rewindable_event: lastRewindableEvent = {} } = lastUndoableEvent.data; + if ( ! lastRewindableEvent ) { + return null; + } + return (
@@ -189,7 +193,7 @@ const BackupCard = ( { admin, productData, fetchingProductData } ) => { productData || {}; const lastRewindableEventTime = lastUndoableEvent?.data?.last_rewindable_event?.published; - const hasRewindableEvent = hasBackups && lastUndoableEvent?.data; + const hasRewindableEvent = hasBackups && lastUndoableEvent?.data?.last_rewindable_event; const undoBackupId = lastUndoableEvent?.data?.undo_backup_id; const handleUndoClick = () => { diff --git a/projects/packages/my-jetpack/changelog/remove-unneeded-condition-from-product-data-api b/projects/packages/my-jetpack/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..56360c82bdd8b --- /dev/null +++ b/projects/packages/my-jetpack/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Remove condition from the backup undoable event call, this datapoint will be removed diff --git a/projects/packages/my-jetpack/composer.json b/projects/packages/my-jetpack/composer.json index f28e415e1e322..15f9d2ca6505d 100644 --- a/projects/packages/my-jetpack/composer.json +++ b/projects/packages/my-jetpack/composer.json @@ -75,7 +75,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/packages/my-jetpack/package.json b/projects/packages/my-jetpack/package.json index 3a6bc85a4fdb0..2b17f6433a1d9 100644 --- a/projects/packages/my-jetpack/package.json +++ b/projects/packages/my-jetpack/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-my-jetpack", - "version": "3.12.3-alpha", + "version": "3.13.0-alpha", "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/my-jetpack/#readme", "bugs": { diff --git a/projects/packages/my-jetpack/src/class-initializer.php b/projects/packages/my-jetpack/src/class-initializer.php index b0b974bb3a75c..95704e43d35bb 100644 --- a/projects/packages/my-jetpack/src/class-initializer.php +++ b/projects/packages/my-jetpack/src/class-initializer.php @@ -32,7 +32,7 @@ class Initializer { * * @var string */ - const PACKAGE_VERSION = '3.12.3-alpha'; + const PACKAGE_VERSION = '3.13.0-alpha'; /** * HTML container ID for the IDC screen on My Jetpack page. diff --git a/projects/packages/my-jetpack/src/class-rest-product-data.php b/projects/packages/my-jetpack/src/class-rest-product-data.php index 72844220d6a45..70fbaed122324 100644 --- a/projects/packages/my-jetpack/src/class-rest-product-data.php +++ b/projects/packages/my-jetpack/src/class-rest-product-data.php @@ -62,18 +62,17 @@ public static function get_all_product_data() { $capabilities = self::get_backup_capabilities(); + if ( is_wp_error( $response ) || empty( $response['body'] ) || 200 !== $response_code ) { + return new WP_Error( 'site_products_data_fetch_failed', 'Site products data fetch failed', array( 'status' => $response_code ? $response_code : 400 ) ); + } + // If site has backups and the realtime backup capability, add latest undo event if ( - $body->backups->last_finished_backup_time && in_array( 'backup-realtime', $capabilities->data['capabilities'], true ) ) { $body->backups->last_undoable_event = self::get_site_backup_undo_event(); } - if ( is_wp_error( $response ) || empty( $response['body'] ) || 200 !== $response_code ) { - return new WP_Error( 'site_products_data_fetch_failed', 'Site products data fetch failed', array( 'status' => $response_code ? $response_code : 400 ) ); - } - return rest_ensure_response( $body, 200 ); } @@ -113,24 +112,13 @@ public static function get_backup_capabilities() { * This will fetch the last rewindable event from the Activity Log and * the last rewind_id prior to that. * - * @param int $page - numbered page of activity logs to fetch. - * * @return array|WP_Error|null */ - public static function get_site_backup_undo_event( $page = null ) { - if ( ! $page ) { - $page = 1; - } - - // Cap out at checking 10 pages of activity log - if ( $page >= 10 ) { - return null; - } - + public static function get_site_backup_undo_event() { $blog_id = \Jetpack_Options::get_option( 'id' ); $response = Client::wpcom_json_api_request_as_user( - '/sites/' . $blog_id . '/activity?force=wpcom&page=' . $page, + '/sites/' . $blog_id . '/activity/rewindable?force=wpcom', 'v2', array(), null, @@ -147,11 +135,6 @@ public static function get_site_backup_undo_event( $page = null ) { return null; } - // If page has no item, we have reached the end of the activity log. - if ( ! isset( $body['current']['orderedItems'] ) || count( $body['current']['orderedItems'] ) === 0 ) { - return null; - } - // Preparing the response structure $undo_event = array( 'last_rewindable_event' => null, @@ -185,12 +168,6 @@ public static function get_site_backup_undo_event( $page = null ) { } } - // Keep checking for rewindable event until one is found. - if ( $undo_event['last_rewindable_event'] === null || $undo_event['undo_backup_id'] === null ) { - $new_page = $page + 1; - return self::get_site_backup_undo_event( $new_page ); - } - return rest_ensure_response( $undo_event, 200 ); } } diff --git a/projects/plugins/backup/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/backup/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/backup/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/backup/composer.lock b/projects/plugins/backup/composer.lock index fed0b3e8adebc..fa7c9958f2ace 100644 --- a/projects/plugins/backup/composer.lock +++ b/projects/plugins/backup/composer.lock @@ -898,7 +898,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -929,7 +929,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/boost/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/boost/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/boost/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/boost/composer.lock b/projects/plugins/boost/composer.lock index 5ca02b8a76a72..0999a1e44d8c6 100644 --- a/projects/plugins/boost/composer.lock +++ b/projects/plugins/boost/composer.lock @@ -953,7 +953,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -984,7 +984,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/jetpack/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/jetpack/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..f800f23377713 --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Just updating lockfile + + diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock index b5e4be1fd2efd..8bc4dba5e7aa5 100644 --- a/projects/plugins/jetpack/composer.lock +++ b/projects/plugins/jetpack/composer.lock @@ -1637,7 +1637,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -1668,7 +1668,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/migration/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/migration/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/migration/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/migration/composer.lock b/projects/plugins/migration/composer.lock index ab6067bf5097c..0638cc6fc8e59 100644 --- a/projects/plugins/migration/composer.lock +++ b/projects/plugins/migration/composer.lock @@ -898,7 +898,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -929,7 +929,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/protect/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/protect/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/protect/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/protect/composer.lock b/projects/plugins/protect/composer.lock index 9eaa43c06c726..2a5958ef36aaf 100644 --- a/projects/plugins/protect/composer.lock +++ b/projects/plugins/protect/composer.lock @@ -813,7 +813,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -844,7 +844,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/search/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/search/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/search/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/search/composer.lock b/projects/plugins/search/composer.lock index 67ff73330dd88..4899457ee3f8c 100644 --- a/projects/plugins/search/composer.lock +++ b/projects/plugins/search/composer.lock @@ -813,7 +813,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -844,7 +844,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/social/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/social/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/social/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index b1ce92d01622a..78cd5a52680c9 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -813,7 +813,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -844,7 +844,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/starter-plugin/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/starter-plugin/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/starter-plugin/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/starter-plugin/composer.lock b/projects/plugins/starter-plugin/composer.lock index 383c651aea84b..f6b87de69df15 100644 --- a/projects/plugins/starter-plugin/composer.lock +++ b/projects/plugins/starter-plugin/composer.lock @@ -813,7 +813,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -844,7 +844,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" diff --git a/projects/plugins/videopress/changelog/remove-unneeded-condition-from-product-data-api b/projects/plugins/videopress/changelog/remove-unneeded-condition-from-product-data-api new file mode 100644 index 0000000000000..b2105c90164a2 --- /dev/null +++ b/projects/plugins/videopress/changelog/remove-unneeded-condition-from-product-data-api @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Just updating lockfile + + diff --git a/projects/plugins/videopress/composer.lock b/projects/plugins/videopress/composer.lock index 05b97db06f660..34b19c070b224 100644 --- a/projects/plugins/videopress/composer.lock +++ b/projects/plugins/videopress/composer.lock @@ -813,7 +813,7 @@ "dist": { "type": "path", "url": "../../packages/my-jetpack", - "reference": "e57d5539d4458fa476194c0364c59df998a5b383" + "reference": "3eb2f21243cf091284e6a9f9819be6a62230057a" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -844,7 +844,7 @@ "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" }, "branch-alias": { - "dev-trunk": "3.12.x-dev" + "dev-trunk": "3.13.x-dev" }, "version-constants": { "::PACKAGE_VERSION": "src/class-initializer.php" From a9889736ba223db410e4a168d815250bf74204be Mon Sep 17 00:00:00 2001 From: Sergey Mitroshin Date: Thu, 16 Nov 2023 12:07:59 -0500 Subject: [PATCH 04/80] Connection: confirm blog ID and access token were saved (#34136) Confirm blog ID and access token were actually saved into the database before proceeding with the connection flow. Co-authored-by: Jeremy Herve --- .../changelog/update-connection-handle-database-failure | 4 ++++ projects/packages/connection/src/class-manager.php | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 projects/packages/connection/changelog/update-connection-handle-database-failure diff --git a/projects/packages/connection/changelog/update-connection-handle-database-failure b/projects/packages/connection/changelog/update-connection-handle-database-failure new file mode 100644 index 0000000000000..597808c912322 --- /dev/null +++ b/projects/packages/connection/changelog/update-connection-handle-database-failure @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Confirm blog ID and access token were saved before proceeding with connection flow. diff --git a/projects/packages/connection/src/class-manager.php b/projects/packages/connection/src/class-manager.php index f22f10ee1bb5a..f1c6d01bf489b 100644 --- a/projects/packages/connection/src/class-manager.php +++ b/projects/packages/connection/src/class-manager.php @@ -1192,7 +1192,7 @@ public function register( $api_endpoint = 'register' ) { $jetpack_public = false; } - \Jetpack_Options::update_options( + Jetpack_Options::update_options( array( 'id' => (int) $registration_details->jetpack_id, 'public' => $jetpack_public, @@ -1203,6 +1203,13 @@ public function register( $api_endpoint = 'register' ) { $this->get_tokens()->update_blog_token( (string) $registration_details->jetpack_secret ); + if ( ! Jetpack_Options::get_option( 'id' ) || ! $this->get_tokens()->get_access_token() ) { + return new WP_Error( + 'connection_data_save_failed', + 'Failed to save connection data in the database' + ); + } + $alternate_authorization_url = isset( $registration_details->alternate_authorization_url ) ? $registration_details->alternate_authorization_url : ''; add_filter( From e33a355ce215bdb543de026ce4a7a808eef8d9dc Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Thu, 16 Nov 2023 15:45:49 -0300 Subject: [PATCH 05/80] AI Assistant: default unlimited request limit (#34169) * make the hard limit 'almost a billion', just like in backend * use the constant instead of literal value * changelog --- .../jetpack/changelog/change-default-unlimited-request-limit | 4 ++++ .../jetpack/extensions/store/wordpress-com/constants.ts | 2 +- .../jetpack/extensions/store/wordpress-com/reducer.ts | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/change-default-unlimited-request-limit diff --git a/projects/plugins/jetpack/changelog/change-default-unlimited-request-limit b/projects/plugins/jetpack/changelog/change-default-unlimited-request-limit new file mode 100644 index 0000000000000..952904ae7b633 --- /dev/null +++ b/projects/plugins/jetpack/changelog/change-default-unlimited-request-limit @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Use the same value as in backend for unlimited plan limit (needed for int comparisons), 999.999.999 (almost a billion), as a constant. Replace literal value usage. diff --git a/projects/plugins/jetpack/extensions/store/wordpress-com/constants.ts b/projects/plugins/jetpack/extensions/store/wordpress-com/constants.ts index 44b200bbf3a37..c53d5902cbe11 100644 --- a/projects/plugins/jetpack/extensions/store/wordpress-com/constants.ts +++ b/projects/plugins/jetpack/extensions/store/wordpress-com/constants.ts @@ -21,7 +21,7 @@ export const ENDPOINT_AI_ASSISTANT_FEATURE = '/wpcom/v2/jetpack-ai/ai-assistant- * New AI Assistant feature async request */ export const FREE_PLAN_REQUESTS_LIMIT = 20; -export const UNLIMITED_PLAN_REQUESTS_LIMIT = 922337203685477600; +export const UNLIMITED_PLAN_REQUESTS_LIMIT = 999999999; export const ASYNC_REQUEST_COUNTDOWN_INIT_VALUE = 3; export const NEW_ASYNC_REQUEST_TIMER_INTERVAL = 5000; export const ACTION_DECREASE_NEW_ASYNC_REQUEST_COUNTDOWN = 'DECREASE_NEW_ASYNC_REQUEST_COUNTDOWN'; diff --git a/projects/plugins/jetpack/extensions/store/wordpress-com/reducer.ts b/projects/plugins/jetpack/extensions/store/wordpress-com/reducer.ts index d16d7923dfef8..3f163d8e968a7 100644 --- a/projects/plugins/jetpack/extensions/store/wordpress-com/reducer.ts +++ b/projects/plugins/jetpack/extensions/store/wordpress-com/reducer.ts @@ -12,6 +12,7 @@ import { ACTION_STORE_AI_ASSISTANT_FEATURE, ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT, + UNLIMITED_PLAN_REQUESTS_LIMIT, } from './constants'; import type { PlanStateProps } from './types'; @@ -40,7 +41,7 @@ const INITIAL_STATE: PlanStateProps = { nextTier: { slug: 'ai-assistant-tier-unlimited', value: 1, - limit: 922337203685477600, + limit: UNLIMITED_PLAN_REQUESTS_LIMIT, readableLimit: __( 'Unlimited', 'jetpack' ), }, _meta: { @@ -116,7 +117,7 @@ export default function reducer( state = INITIAL_STATE, action ) { let requestsLimit = state.features.aiAssistant.currentTier?.limit; if ( isUnlimitedTierPlan ) { - requestsLimit = Infinity; + requestsLimit = UNLIMITED_PLAN_REQUESTS_LIMIT; } else if ( isFreeTierPlan ) { requestsLimit = state.features.aiAssistant.requestsLimit; } From 03939a76f90a53b64b1864b650494a539442521b Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Thu, 16 Nov 2023 15:46:15 -0300 Subject: [PATCH 06/80] AI Assistant: use new async data on excerpt panel (#34156) * disable controls when plan isOverLimit * useAiFeature to get isOverLimit * fix wee typo on excerpt setter/discard * changelog --- .../change-ai-excerpt-use-assistant-data | 4 ++++ .../components/ai-excerpt-control/index.tsx | 7 ++++++- .../extend/ai-post-excerpt/index.tsx | 17 +++++++---------- .../ai-model-selector-control/index.tsx | 2 ++ 4 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/change-ai-excerpt-use-assistant-data diff --git a/projects/plugins/jetpack/changelog/change-ai-excerpt-use-assistant-data b/projects/plugins/jetpack/changelog/change-ai-excerpt-use-assistant-data new file mode 100644 index 0000000000000..d2aa5b275686c --- /dev/null +++ b/projects/plugins/jetpack/changelog/change-ai-excerpt-use-assistant-data @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Use new async flow to get isOverLimit from useAiFeature. Fix wee typos on excerpt term" diff --git a/projects/plugins/jetpack/extensions/plugins/ai-content-lens/components/ai-excerpt-control/index.tsx b/projects/plugins/jetpack/extensions/plugins/ai-content-lens/components/ai-excerpt-control/index.tsx index 7cab811ea2c05..c43eb8317c4e4 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-content-lens/components/ai-excerpt-control/index.tsx +++ b/projects/plugins/jetpack/extensions/plugins/ai-content-lens/components/ai-excerpt-control/index.tsx @@ -116,7 +116,12 @@ export function AiExcerptControl( { label={ langLabel } /> - +
+ { ( planType === PLAN_TYPE_FREE || planType === PLAN_TYPE_TIERED ) && canUpgrade && ( +
+ +
) }
diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/usage-panel/style.scss b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/usage-panel/style.scss index 5507ef9863c58..733470cd0cac0 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/usage-panel/style.scss +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/usage-panel/style.scss @@ -6,4 +6,8 @@ p.muted { color: var( --jp-gray-50 ); } + + .jetpack-ai-usage-panel-upgrade-button { + margin-top: 1em; + } } From 4a18b253b9737e2e1877bad99371ca2840c6f967 Mon Sep 17 00:00:00 2001 From: Douglas Henri Date: Mon, 20 Nov 2023 18:48:11 -0300 Subject: [PATCH 31/80] My Jetpack: Mark Jetpack AI as upgradable in interstitial page (#34215) * set jetpack ai product as upgradable if active * add upgradeInInterstitial flag to product card * changelog --- .../connected-product-card/index.jsx | 2 ++ .../components/product-card/action-button.jsx | 16 ++++++++-- .../product-cards-section/ai-card.jsx | 2 +- ...pdate-ai-assistant-my-jetpack-card-upgrade | 4 +++ projects/packages/my-jetpack/package.json | 2 +- .../my-jetpack/src/class-initializer.php | 2 +- .../src/products/class-jetpack-ai.php | 32 +++++++++++++++++-- 7 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 projects/packages/my-jetpack/changelog/update-ai-assistant-my-jetpack-card-upgrade diff --git a/projects/packages/my-jetpack/_inc/components/connected-product-card/index.jsx b/projects/packages/my-jetpack/_inc/components/connected-product-card/index.jsx index 766b82466ba21..65b4b3c14c3a9 100644 --- a/projects/packages/my-jetpack/_inc/components/connected-product-card/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/connected-product-card/index.jsx @@ -21,6 +21,7 @@ const ConnectedProductCard = ( { Description = null, additionalActions = null, menuItems = [], + upgradeInInterstitial = false, } ) => { const { isRegistered, isUserConnected } = useConnection(); @@ -136,6 +137,7 @@ const ConnectedProductCard = ( { onInstallStandalone={ handleInstallStandalone } onActivateStandalone={ handleInstallStandalone } onDeactivateStandalone={ handleDeactivateStandalone } + upgradeInInterstitial={ upgradeInInterstitial } > { children } diff --git a/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx b/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx index 2458e91d3fad5..e6f200fb90f48 100644 --- a/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx +++ b/projects/packages/my-jetpack/_inc/components/product-card/action-button.jsx @@ -31,6 +31,7 @@ const ActionButton = ( { isDeactivatingStandalone, className, onAdd, + upgradeInInterstitial, } ) => { const [ isDropdownOpen, setIsDropdownOpen ] = useState( false ); const [ currentAction, setCurrentAction ] = useState( {} ); @@ -75,11 +76,21 @@ const ActionButton = ( { onClick: null, }; } - case PRODUCT_STATUSES.NEEDS_PURCHASE: + case PRODUCT_STATUSES.NEEDS_PURCHASE: { + return { + ...buttonState, + href: purchaseUrl || `#/add-${ slug }`, + size: 'small', + variant: 'primary', + weight: 'regular', + label: __( 'Purchase', 'jetpack-my-jetpack' ), + onClick: onAdd, + }; + } case PRODUCT_STATUSES.CAN_UPGRADE: { const upgradeText = __( 'Upgrade', 'jetpack-my-jetpack' ); const purchaseText = __( 'Purchase', 'jetpack-my-jetpack' ); - const buttonText = purchaseUrl ? upgradeText : purchaseText; + const buttonText = purchaseUrl || upgradeInInterstitial ? upgradeText : purchaseText; return { ...buttonState, @@ -152,6 +163,7 @@ const ActionButton = ( { purchaseUrl, slug, status, + upgradeInInterstitial, ] ); const allActions = useMemo( diff --git a/projects/packages/my-jetpack/_inc/components/product-cards-section/ai-card.jsx b/projects/packages/my-jetpack/_inc/components/product-cards-section/ai-card.jsx index 07f2c5bfeccbd..405120fe5fec6 100644 --- a/projects/packages/my-jetpack/_inc/components/product-cards-section/ai-card.jsx +++ b/projects/packages/my-jetpack/_inc/components/product-cards-section/ai-card.jsx @@ -3,7 +3,7 @@ import React from 'react'; import ProductCard from '../connected-product-card'; const AiCard = ( { admin } ) => { - return ; + return ; }; AiCard.propTypes = { diff --git a/projects/packages/my-jetpack/changelog/update-ai-assistant-my-jetpack-card-upgrade b/projects/packages/my-jetpack/changelog/update-ai-assistant-my-jetpack-card-upgrade new file mode 100644 index 0000000000000..e314c1c2ceb5b --- /dev/null +++ b/projects/packages/my-jetpack/changelog/update-ai-assistant-my-jetpack-card-upgrade @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +My Jetpack: Mark Jetpack AI as upgradable in interstitial page diff --git a/projects/packages/my-jetpack/package.json b/projects/packages/my-jetpack/package.json index 78d7a7116ff98..29ca27b638ef7 100644 --- a/projects/packages/my-jetpack/package.json +++ b/projects/packages/my-jetpack/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-my-jetpack", - "version": "4.0.0", + "version": "4.0.1-alpha", "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/my-jetpack/#readme", "bugs": { diff --git a/projects/packages/my-jetpack/src/class-initializer.php b/projects/packages/my-jetpack/src/class-initializer.php index 6911519b82dc6..401fda404e762 100644 --- a/projects/packages/my-jetpack/src/class-initializer.php +++ b/projects/packages/my-jetpack/src/class-initializer.php @@ -32,7 +32,7 @@ class Initializer { * * @var string */ - const PACKAGE_VERSION = '4.0.0'; + const PACKAGE_VERSION = '4.0.1-alpha'; /** * HTML container ID for the IDC screen on My Jetpack page. diff --git a/projects/packages/my-jetpack/src/products/class-jetpack-ai.php b/projects/packages/my-jetpack/src/products/class-jetpack-ai.php index d2d85f399d351..3e337f25dd32a 100644 --- a/projects/packages/my-jetpack/src/products/class-jetpack-ai.php +++ b/projects/packages/my-jetpack/src/products/class-jetpack-ai.php @@ -75,11 +75,11 @@ public static function get_title() { } /** - * Get the next usage tier + * Get the current usage tier * * @return int */ - public static function get_next_usage_tier() { + public static function get_current_usage_tier() { $info = self::get_ai_assistant_feature(); // Bail early if it's not possible to fetch the feature data. @@ -89,6 +89,17 @@ public static function get_next_usage_tier() { $current_tier = isset( $info['current-tier']['value'] ) ? $info['current-tier']['value'] : null; + return $current_tier; + } + + /** + * Get the next usage tier + * + * @return int + */ + public static function get_next_usage_tier() { + $current_tier = self::get_current_usage_tier(); + if ( null === $current_tier ) { return 1; } @@ -292,6 +303,23 @@ public static function has_required_plan() { return false; } + /** + * Checks whether the product can be upgraded to a different product. + * + * @return boolean + */ + public static function is_upgradable() { + $has_required_plan = self::has_required_plan(); + $current_tier = self::get_current_usage_tier(); + + // Mark as not upgradable if user is on unlimited tier or does not have any plan. + if ( ! $has_required_plan || null === $current_tier || 1 === $current_tier ) { + return false; + } + + return true; + } + /** * Get the URL where the user manages the product * From 127c052ee00bf41b4806c73ba402e3a6220c2026 Mon Sep 17 00:00:00 2001 From: arthur791004 Date: Tue, 21 Nov 2023 15:16:32 +0900 Subject: [PATCH 32/80] Jetpack Google Fonts: Print font faces that are in use instead of ALL (#34157) * Jetpack Google Fonts: Print fonts in use instead of all * Turn off hooks to call wp_print_fonts * Handle fonts that have alias slug names * Check whether Jetpack_Google_Font_Face is available before loading * changelog --- .../changelog/feat-print-font-faces-in-use | 4 + .../class-jetpack-google-font-face.php | 188 ++++++++++++++++++ .../current/load-google-fonts.php | 11 + 3 files changed, 203 insertions(+) create mode 100644 projects/plugins/jetpack/changelog/feat-print-font-faces-in-use create mode 100644 projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php diff --git a/projects/plugins/jetpack/changelog/feat-print-font-faces-in-use b/projects/plugins/jetpack/changelog/feat-print-font-faces-in-use new file mode 100644 index 0000000000000..b21f556658c16 --- /dev/null +++ b/projects/plugins/jetpack/changelog/feat-print-font-faces-in-use @@ -0,0 +1,4 @@ +Significance: minor +Type: major + +Generate and print the fonts that are used in global styles or block-level settings if the Jetpack Google Fonts module is enabled to avoid printing all google fonts definition in the head diff --git a/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php b/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php new file mode 100644 index 0000000000000..bf6b72eb21274 --- /dev/null +++ b/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php @@ -0,0 +1,188 @@ +get_fonts(); + $fonts_to_print = array(); + + $this->collect_global_styles_fonts(); + $this->fonts_in_use = array_values( array_unique( $this->fonts_in_use, SORT_STRING ) ); + foreach ( $fonts as $font_family => $font_faces ) { + if ( in_array( _wp_to_kebab_case( $font_family ), $this->fonts_in_use, true ) ) { + $fonts_to_print[ $font_family ] = $font_faces; + } + } + + if ( ! empty( $fonts_to_print ) ) { + wp_print_font_faces( $fonts_to_print ); + } + } + + /** + * Collect fonts used for global styles settings. + */ + public function collect_global_styles_fonts() { + $global_styles = wp_get_global_styles(); + + $global_styles_font_slug = $this->get_font_slug_from_setting( $global_styles ); + if ( $global_styles_font_slug ) { + $this->fonts_in_use[] = $global_styles_font_slug; + } + + if ( isset( $global_styles['blocks'] ) ) { + foreach ( $global_styles['blocks'] as $setting ) { + $font_slug = $this->get_font_slug_from_setting( $setting ); + + if ( $font_slug ) { + $this->fonts_in_use[] = $font_slug; + } + } + } + + if ( isset( $global_styles['elements'] ) ) { + foreach ( $global_styles['elements'] as $setting ) { + $font_slug = $this->get_font_slug_from_setting( $setting ); + + if ( $font_slug ) { + $this->fonts_in_use[] = $font_slug; + } + } + } + } + + /** + * Collect fonts used for block-level settings. + * + * @filter pre_render_block + * + * @param string|null $content The pre-rendered content. Default null. + * @param array $parsed_block The block being rendered. + */ + public function collect_block_fonts( $content, $parsed_block ) { + if ( ! is_admin() && isset( $parsed_block['attrs']['fontFamily'] ) ) { + $block_font_family = $parsed_block['attrs']['fontFamily']; + $this->fonts_in_use[] = $block_font_family; + } + + return $content; + } + + /** + * Get all font definitions from theme json. + */ + public function get_fonts() { + $fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json(); + + // The font definition might define an alias slug name, so we have to add the map from the slug name to font faces. + // See https://github.com/WordPress/twentytwentyfour/blob/df92472089ede6fae5924c124a93c843b84e8cbd/theme.json#L215. + $theme_json = WP_Theme_JSON_Resolver::get_theme_data(); + $raw_data = $theme_json->get_data(); + if ( ! empty( $raw_data['settings']['typography']['fontFamilies'] ) ) { + foreach ( $raw_data['settings']['typography']['fontFamilies'] as $font ) { + $font_family_name = $this->get_font_family_name( $font ); + $font_slug = isset( $font['slug'] ) ? $font['slug'] : ''; + if ( $font_slug && ! array_key_exists( $font_slug, $fonts ) && array_key_exists( $font_family_name, $fonts ) ) { + $fonts[ $font_slug ] = $fonts[ $font_family_name ]; + } + } + } + + return $fonts; + } + + /** + * Get the font family name from a font. + * + * @param array $font The font definition object. + */ + public function get_font_family_name( $font ) { + $font_family = $font['fontFamily']; + if ( str_contains( $font_family, ',' ) ) { + $font_family = explode( ',', $font_family )[0]; + } + + return trim( $font_family, "\"'" ); + } + + /** + * Get the font family slug from a settings array. + * + * @param array $setting The settings object. + * + * @return string|null + */ + public function get_font_slug_from_setting( $setting ) { + if ( ! isset( $setting['typography']['fontFamily'] ) ) { + return null; + } + + $font_family = $setting['typography']['fontFamily']; + + // Full string: var(--wp--preset--font-family--slug). + // We do not care about the origin of the font, only its slug. + preg_match( '/font-family--(?P.+)\)$/', $font_family, $matches ); + + if ( isset( $matches['slug'] ) ) { + return $matches['slug']; + } + + // Full string: var:preset|font-family|slug + // We do not care about the origin of the font, only its slug. + preg_match( '/font-family\|(?P.+)$/', $font_family, $matches ); + + if ( isset( $matches['slug'] ) ) { + return $matches['slug']; + } + + return $font_family; + } +} diff --git a/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php b/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php index 0aabb894f44be..82b58407355c6 100644 --- a/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php +++ b/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php @@ -147,3 +147,14 @@ function ( $google_fonts_family ) use ( $available_google_fonts_map, $theme_font } add_filter( 'wp_theme_json_data_default', 'jetpack_register_google_fonts_to_theme_json' ); + +if ( ! class_exists( 'Jetpack_Google_Font_Face' ) ) { + /** + * Load Jetpack Google Font Face + */ + require_once __DIR__ . '/class-jetpack-google-font-face.php'; + + // Initialize Jetpack Google Font Face to avoid printing **ALL** google fonts provided by this module. + // See p1700040028362329-slack-C4GAQ900P and p7DVsv-jib-p2 + new Jetpack_Google_Font_Face(); +} From e72844945be3d3d20c614a48e33a968819bfcc3b Mon Sep 17 00:00:00 2001 From: Foteini Giannaropoulou Date: Tue, 21 Nov 2023 10:31:55 +0200 Subject: [PATCH 33/80] Jetpack Sync: Gracefully handle exceptions when calculating checksums (#34165) * Sync Checksums: Handle Exceptions gracefully --- .../fix-sync-checksums-handle-exceptions | 5 +++ .../sync/src/class-package-version.php | 2 +- .../packages/sync/src/class-replicastore.php | 40 ++++++++----------- .../class-table-checksum-users.php | 2 + 4 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 projects/packages/sync/changelog/fix-sync-checksums-handle-exceptions diff --git a/projects/packages/sync/changelog/fix-sync-checksums-handle-exceptions b/projects/packages/sync/changelog/fix-sync-checksums-handle-exceptions new file mode 100644 index 0000000000000..9cc10ec20a3bd --- /dev/null +++ b/projects/packages/sync/changelog/fix-sync-checksums-handle-exceptions @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Jetpack Sync: Updated Checksums logic to handle exceptions gracefully + + diff --git a/projects/packages/sync/src/class-package-version.php b/projects/packages/sync/src/class-package-version.php index a8abbc4b14200..6ce6c06255270 100644 --- a/projects/packages/sync/src/class-package-version.php +++ b/projects/packages/sync/src/class-package-version.php @@ -12,7 +12,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '2.0.0'; + const PACKAGE_VERSION = '2.0.1-alpha'; const PACKAGE_SLUG = 'sync'; diff --git a/projects/packages/sync/src/class-replicastore.php b/projects/packages/sync/src/class-replicastore.php index cab0354910992..f10c5ff7a86b9 100644 --- a/projects/packages/sync/src/class-replicastore.php +++ b/projects/packages/sync/src/class-replicastore.php @@ -1306,7 +1306,6 @@ public function get_min_max_object_id( $id_field, $object_table, $where, $bucket * @param bool $perform_text_conversion If text fields should be converted to latin1 during the checksum calculation. * * @return array|WP_Error The checksum histogram. - * @throws Exception Throws an exception if data validation fails inside `Table_Checksum` calls. */ public function checksum_histogram( $table, $buckets = null, $start_id = null, $end_id = null, $columns = null, $strip_non_ascii = true, $salt = '', $only_range_edges = false, $detailed_drilldown = false, $perform_text_conversion = false ) { global $wpdb; @@ -1318,16 +1317,12 @@ public function checksum_histogram( $table, $buckets = null, $start_id = null, $ return new WP_Error( 'checksum_disabled', $ex->getMessage() ); } - // Validate / Determine Buckets. - if ( $buckets === null || $buckets < 1 ) { - $buckets = $this->calculate_buckets( $table, $start_id, $end_id ); - } - if ( is_wp_error( $buckets ) ) { - return $buckets; + try { + $range_edges = $checksum_table->get_range_edges( $start_id, $end_id ); + } catch ( Exception $ex ) { + return new WP_Error( 'invalid_range_edges', '[' . $start_id . '-' . $end_id . ']: ' . $ex->getMessage() ); } - $range_edges = $checksum_table->get_range_edges( $start_id, $end_id ); - if ( $only_range_edges ) { return $range_edges; } @@ -1338,12 +1333,21 @@ public function checksum_histogram( $table, $buckets = null, $start_id = null, $ return array(); } + // Validate / Determine Buckets. + if ( $buckets === null || $buckets < 1 ) { + $buckets = $this->calculate_buckets( $table, $object_count ); + } + $bucket_size = (int) ceil( $object_count / $buckets ); $previous_max_id = max( 0, $range_edges['min_range'] ); $histogram = array(); do { - $ids_range = $checksum_table->get_range_edges( $previous_max_id, null, $bucket_size ); + try { + $ids_range = $checksum_table->get_range_edges( $previous_max_id, null, $bucket_size ); + } catch ( Exception $ex ) { + return new WP_Error( 'invalid_range_edges', '[' . $previous_max_id . '- ]: ' . $ex->getMessage() ); + } if ( empty( $ids_range['min_range'] ) || empty( $ids_range['max_range'] ) ) { // Nothing to checksum here... @@ -1401,20 +1405,10 @@ private function invalid_call() { * Determine number of buckets to use in full table checksum. * * @param string $table Object Type. - * @param int $start_id Min Object ID. - * @param int $end_id Max Object ID. - * @return int|WP_Error Number of Buckets to use. + * @param int $object_count Object count. + * @return int Number of Buckets to use. */ - private function calculate_buckets( $table, $start_id = null, $end_id = null ) { - // Get # of objects. - try { - $checksum_table = $this->get_table_checksum_instance( $table ); - } catch ( Exception $ex ) { - return new WP_Error( 'checksum_disabled', $ex->getMessage() ); - } - $range_edges = $checksum_table->get_range_edges( $start_id, $end_id ); - $object_count = $range_edges['item_count']; - + private function calculate_buckets( $table, $object_count ) { // Ensure no division by 0. if ( 0 === (int) $object_count ) { return 1; diff --git a/projects/packages/sync/src/replicastore/class-table-checksum-users.php b/projects/packages/sync/src/replicastore/class-table-checksum-users.php index a6024c253db27..c36b0e3df345b 100644 --- a/projects/packages/sync/src/replicastore/class-table-checksum-users.php +++ b/projects/packages/sync/src/replicastore/class-table-checksum-users.php @@ -7,6 +7,8 @@ namespace Automattic\Jetpack\Sync\Replicastore; +use Exception; + /** * Class to handle Table Checksums for the Users table. */ From e928924167698d3ae7f4cf46fdbbbeadd74aab49 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 21 Nov 2023 04:22:52 -0500 Subject: [PATCH 34/80] Clean up code with comments about PHP 5 (#34220) In some code we attached comments referring to what we could do once PHP 5 support was dropped. That happened, so let's clean it up. Left one instance in `projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-test-base.php` because that looks like it will need more testing to make sure the called-for replacement functions. --- .../changelog/remove-cleanup-php5.6-code | 4 ++ projects/packages/boost-core/package.json | 2 +- .../boost-core/src/lib/class-cacheable.php | 15 +------ .../changelog/remove-cleanup-php5.6-code | 5 +++ .../packages/licensing/tests/.phpcs.dir.xml | 4 ++ .../php/class-test-licensing-endpoints.php | 43 ++++++------------- .../changelog/remove-cleanup-php5.6-code | 5 +++ .../packages/stats/tests/php/test-main.php | 11 ----- .../beta/changelog/remove-cleanup-php5.6-code | 5 +++ .../beta/src/admin/branch-card.template.php | 6 +-- .../admin/show-needed-updates.template.php | 6 +-- .../_inc/lib/debugger/debug-functions.php | 2 +- .../changelog/remove-cleanup-php5.6-code | 5 +++ .../plugins/jetpack/functions.cookies.php | 2 +- 14 files changed, 49 insertions(+), 66 deletions(-) create mode 100644 projects/packages/boost-core/changelog/remove-cleanup-php5.6-code create mode 100644 projects/packages/licensing/changelog/remove-cleanup-php5.6-code create mode 100644 projects/packages/licensing/tests/.phpcs.dir.xml create mode 100644 projects/packages/stats/changelog/remove-cleanup-php5.6-code create mode 100644 projects/plugins/beta/changelog/remove-cleanup-php5.6-code create mode 100644 projects/plugins/jetpack/changelog/remove-cleanup-php5.6-code diff --git a/projects/packages/boost-core/changelog/remove-cleanup-php5.6-code b/projects/packages/boost-core/changelog/remove-cleanup-php5.6-code new file mode 100644 index 0000000000000..8ee1f77bf7c2e --- /dev/null +++ b/projects/packages/boost-core/changelog/remove-cleanup-php5.6-code @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Abstract static methods in `Automattic\Jetpack\Boost_Core\Lib\Cacheable` are now actually abstract, instead of being implemented to always throw. diff --git a/projects/packages/boost-core/package.json b/projects/packages/boost-core/package.json index ca58eec8aa292..6b03225fc4ae0 100644 --- a/projects/packages/boost-core/package.json +++ b/projects/packages/boost-core/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-boost-core", - "version": "0.2.0", + "version": "0.2.1-alpha", "description": "Core functionality for boost and relevant packages to depend on", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/boost-core/#readme", "bugs": { diff --git a/projects/packages/boost-core/src/lib/class-cacheable.php b/projects/packages/boost-core/src/lib/class-cacheable.php index 06d30ba7b472b..7cc9d96608d2e 100644 --- a/projects/packages/boost-core/src/lib/class-cacheable.php +++ b/projects/packages/boost-core/src/lib/class-cacheable.php @@ -58,15 +58,8 @@ protected function generate_cache_id() { * @param array $data Serialized data to restore the object from. * * @throws \Exception Throw an exception to remind to implement the method in child classes. - * - * phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable */ - public static function jsonUnserialize( $data ) { - // PHP 5.6 does not support abstract static classes. Throwing an error is a way to make sure we remember to override them in the child classes. - $class = get_called_class(); - throw new \Exception( "Must implement static method jsonUnserialize in class $class" ); - } - // phpcs:enable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + abstract public static function jsonUnserialize( $data ); /** * Fetch an object with the given ID. @@ -137,9 +130,5 @@ public static function delete_by_cache_id( $cache_id ) { * * @throws \Exception Throw an exception to remind to implement the method in child classes. */ - protected static function cache_prefix() { - // PHP 5.6 does not support abstract static classes. Throwing an error is a way to make sure we remember to override them in the child classes. - $class = get_called_class(); - throw new \Exception( "Must implement static method cache_prefix in class $class" ); - } + abstract protected static function cache_prefix(); } diff --git a/projects/packages/licensing/changelog/remove-cleanup-php5.6-code b/projects/packages/licensing/changelog/remove-cleanup-php5.6-code new file mode 100644 index 0000000000000..9f40cd75c1585 --- /dev/null +++ b/projects/packages/licensing/changelog/remove-cleanup-php5.6-code @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix test class to use `set_up_before_class()` instead of having to cry inside. + + diff --git a/projects/packages/licensing/tests/.phpcs.dir.xml b/projects/packages/licensing/tests/.phpcs.dir.xml new file mode 100644 index 0000000000000..46951fe77b37e --- /dev/null +++ b/projects/packages/licensing/tests/.phpcs.dir.xml @@ -0,0 +1,4 @@ + + + + diff --git a/projects/packages/licensing/tests/php/class-test-licensing-endpoints.php b/projects/packages/licensing/tests/php/class-test-licensing-endpoints.php index a2f51309eb301..a24fc35faa0ff 100644 --- a/projects/packages/licensing/tests/php/class-test-licensing-endpoints.php +++ b/projects/packages/licensing/tests/php/class-test-licensing-endpoints.php @@ -21,35 +21,18 @@ class Test_Licensing_Endpoints extends BaseTestCase { * * @var WP_REST_Server */ - private $server; + private static $server; - /** - * Used to store a boolean for whether we've initialized licensing before running tests. - * - * @var boolean - */ - private $has_done_setup; + public static function set_up_before_class() { + parent::set_up_before_class(); + $licensing = new Licensing(); + $licensing->initialize(); // Ensure that licensing hooks are initialized so that we can register endpoints. - /** - * Ensure that Licensing package has been setup and hooks have been registered. - * - * We could be using setupBeforeClass() here, but that has a conflict with our PHP 5.6 lint. So, using this workaround - * and crying inside a bit. See: https://github.com/Automattic/jetpack/pull/23687#discussion_r838790636. - * - * @since 1.7.0 - */ - public function maybe_do_setup() { - if ( ! $this->has_done_setup ) { - $licensing = new Licensing(); - $licensing->initialize(); // Ensure that licensing hooks are initialized so that we can register endpoints. - - global $wp_rest_server; - $wp_rest_server = new \WP_REST_Server(); - $this->server = $wp_rest_server; + global $wp_rest_server; + $wp_rest_server = new \WP_REST_Server(); + static::$server = $wp_rest_server; - $this->has_done_setup = true; - do_action( 'rest_api_init' ); // Now, register endpoints. - } + do_action( 'rest_api_init' ); // Now, register endpoints. } /** @@ -110,7 +93,7 @@ protected function create_and_get_request( $route = '', $json_params = array(), $request->set_param( $key, $value ); } } - return $this->server->dispatch( $request ); + return static::$server->dispatch( $request ); } /** @@ -135,8 +118,6 @@ protected function assertResponseStatus( $status, $response ) { * @since 1.7.0 */ public function test_licensing_error() { - $this->maybe_do_setup(); - // Create a user and set it up as current. $user = $this->create_and_get_user( 'administrator' ); $user->add_cap( 'jetpack_admin_page' ); @@ -144,7 +125,7 @@ public function test_licensing_error() { // Should be empty by default. $request = new \WP_REST_Request( 'GET', '/jetpack/v4/licensing/error' ); - $response = $this->server->dispatch( $request ); + $response = static::$server->dispatch( $request ); $this->assertResponseStatus( 200, $response ); $this->assertSame( '', $response->get_data() ); @@ -161,7 +142,7 @@ public function test_licensing_error() { // Should return updated value. $request = new \WP_REST_Request( 'GET', '/jetpack/v4/licensing/error' ); - $response = $this->server->dispatch( $request ); + $response = static::$server->dispatch( $request ); $this->assertResponseStatus( 200, $response ); $this->assertEquals( 'foo', $response->get_data() ); } diff --git a/projects/packages/stats/changelog/remove-cleanup-php5.6-code b/projects/packages/stats/changelog/remove-cleanup-php5.6-code new file mode 100644 index 0000000000000..872c830917006 --- /dev/null +++ b/projects/packages/stats/changelog/remove-cleanup-php5.6-code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Remove comment about tests failing in PHP 5.6 when run out of order. What was happening is that in PHPUnit <6.0, `@before` ran after `setUp()` so the first test's `Stats::init()` call would hook the hooks before WorDBless saved them. In PHPUnit 6.0 the `@before`-annotated methods run first so WorDBless saves the hooks before that first test's `Stats::init()` call. + + diff --git a/projects/packages/stats/tests/php/test-main.php b/projects/packages/stats/tests/php/test-main.php index 75a300457361d..78934b27a0009 100644 --- a/projects/packages/stats/tests/php/test-main.php +++ b/projects/packages/stats/tests/php/test-main.php @@ -14,13 +14,6 @@ /** * Class to test the Main class. * - * Important! All the *_with_jp_version_lt_11_5_a_2 need to run before their counterpart - * that test the same hooks but without JP version set to `11.5-a.1`. - * This happens because the PHP 5.6 unit tests would fail as the global $wp_filter - * is not being properly reset between tests. - * - * @todo Investigate why this happens and fix it. - * * @covers Automattic\Jetpack\Stats\Main */ class Test_Main extends StatsBaseTestCase { @@ -33,8 +26,6 @@ class Test_Main extends StatsBaseTestCase { /** * Set up before each test - * - * @before */ protected function set_up() { parent::set_up(); @@ -48,8 +39,6 @@ protected function set_up() { /** * Clean up the testing environment. - * - * @after */ public function tear_down() { parent::tear_down(); diff --git a/projects/plugins/beta/changelog/remove-cleanup-php5.6-code b/projects/plugins/beta/changelog/remove-cleanup-php5.6-code new file mode 100644 index 0000000000000..290cc55ce725c --- /dev/null +++ b/projects/plugins/beta/changelog/remove-cleanup-php5.6-code @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Use `( function() {} )();` now that we no longer support PHP 5.6. + + diff --git a/projects/plugins/beta/src/admin/branch-card.template.php b/projects/plugins/beta/src/admin/branch-card.template.php index 0835e0d788d43..5c0ba9033279e 100644 --- a/projects/plugins/beta/src/admin/branch-card.template.php +++ b/projects/plugins/beta/src/admin/branch-card.template.php @@ -33,8 +33,7 @@ // ------------- -// TODO: Once we drop PHP 5.6 support, we can do `( function () { ... } )();` instead of assigning to `$tmp`. -$tmp = function ( $plugin, $branch, $active_branch ) { +( function ( $plugin, $branch, $active_branch ) { $slug = 'dev' === $branch->which ? $plugin->dev_plugin_slug() : $plugin->plugin_slug(); $classes = array( 'dops-foldable-card', 'has-expanded-summary', 'dops-card', 'branch-card' ); $data_attr = ''; @@ -107,5 +106,4 @@
Date: Tue, 21 Nov 2023 04:34:39 -0500 Subject: [PATCH 35/80] codesniffer: Enable and fix `Modernize.FunctionCalls.Dirname.Nested` sniff (#34218) The WordPress-Extra ruleset turns this off. Now that we've dropped PHP 5.6, we can turn it on. Then, of course, we have to fix all the existing instances of the problem. --- docs/examples/bootstrap.php | 6 +++--- ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 5 +++++ projects/packages/assets/tests/php/test-assets.php | 4 ++-- ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 5 +++++ projects/packages/autoloader/src/AutoloadGenerator.php | 2 +- projects/packages/autoloader/src/class-plugin-locator.php | 2 +- projects/packages/autoloader/tests/php/bootstrap.php | 2 +- ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 5 +++++ projects/packages/changelogger/src/Application.php | 2 +- .../changelogger/tests/php/tests/src/ConfigTest.php | 2 +- projects/packages/codesniffer/Jetpack/ruleset.xml | 5 +++++ ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 4 ++++ ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 5 +++++ projects/packages/connection/src/class-package-version.php | 2 +- .../packages/connection/tests/php/test_Server_Sandbox.php | 4 ++-- ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 5 +++++ .../packages/waf/src/class-waf-standalone-bootstrap.php | 6 +++--- ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 5 +++++ projects/plugins/crm/tests/php/bootstrap.php | 2 +- ...codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff | 4 ++++ .../test-class-wpcom-rest-api-v2-endpoint-admin-menu.php | 2 +- ...test-class-wpcom-rest-api-v2-endpoint-external-media.php | 4 ++-- ...lass-wpcom-rest-api-v2-endpoint-publicize-share-post.php | 2 +- ...-class-wpcom-rest-api-v2-endpoint-send-email-preview.php | 2 +- .../test-class-wpcom-rest-api-v2-endpoint-transient.php | 2 +- ...ss-test-wpcom-rest-api-v2-attachment-videopress-data.php | 4 ++-- .../wpcom-fields/test-attachment-fields-videopress.php | 4 ++-- .../core-api/wpcom-fields/test-class.service-api-keys.php | 2 +- .../wpcom-fields/test-class.subscribers-endpoint.php | 2 +- .../wpcom-fields/test-post-fields-publicize-connections.php | 2 +- .../tests/php/lib/class-wp-test-jetpack-rest-testcase.php | 2 +- 31 files changed, 74 insertions(+), 31 deletions(-) create mode 100644 projects/packages/assets/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/packages/autoloader/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/packages/changelogger/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/packages/codesniffer/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/packages/connection/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/packages/waf/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/plugins/crm/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff create mode 100644 projects/plugins/jetpack/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff diff --git a/docs/examples/bootstrap.php b/docs/examples/bootstrap.php index 84448cec7e862..84793d2a92051 100644 --- a/docs/examples/bootstrap.php +++ b/docs/examples/bootstrap.php @@ -6,7 +6,7 @@ */ // Assume we're in tests/php/bootstrap.php. -$_plugin_root = dirname( dirname( __DIR__ ) ); +$_plugin_root = dirname( __DIR__, 2 ); // Locate WordPress or wordpress-develop. We look in several places. if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) { @@ -18,9 +18,9 @@ } elseif ( false !== getenv( 'WP_TESTS_DIR' ) ) { // WordPress core environment variable. $_tests_dir = getenv( 'WP_TESTS_DIR' ); -} elseif ( file_exists( dirname( dirname( $_plugin_root ) ) . '/tests/phpunit/includes/bootstrap.php' ) ) { +} elseif ( file_exists( dirname( $_plugin_root, 2 ) . '/tests/phpunit/includes/bootstrap.php' ) ) { // Installed inside wordpress-develop. - $_tests_dir = dirname( dirname( $_plugin_root ) ) . '/tests/phpunit/includes/bootstrap.php'; + $_tests_dir = dirname( $_plugin_root, 2 ) . '/tests/phpunit/includes/bootstrap.php'; } elseif ( file_exists( '/vagrant/www/wordpress-develop/public_html/tests/phpunit/includes/bootstrap.php' ) ) { // VVV. $_tests_dir = '/vagrant/www/wordpress-develop/public_html/tests/phpunit'; diff --git a/projects/packages/assets/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/packages/assets/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..62a350fe59dbe --- /dev/null +++ b/projects/packages/assets/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. + + diff --git a/projects/packages/assets/tests/php/test-assets.php b/projects/packages/assets/tests/php/test-assets.php index 3e1bc5777db27..639a0cddf1a92 100644 --- a/projects/packages/assets/tests/php/test-assets.php +++ b/projects/packages/assets/tests/php/test-assets.php @@ -29,7 +29,7 @@ class AssetsTest extends TestCase { */ public function set_up() { Monkey\setUp(); - $plugin_dir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/'; + $plugin_dir = dirname( __DIR__, 4 ) . '/'; Jetpack_Constants::set_constant( 'JETPACK__PLUGIN_FILE', $plugin_dir . 'jetpack.php' ); Functions\stubs( @@ -180,7 +180,7 @@ public function get_file_url_for_environment_full_urls_data_provider() { public function get_file_url_for_environment_package_path_data_provider() { $min_path = 'src/js/test.min.js'; $non_min_path = 'src/js/test.js'; - $package_path = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/packages/test-package/test-package.php'; + $package_path = dirname( __DIR__, 4 ) . '/packages/test-package/test-package.php'; return array( 'script-debug-true' => array( diff --git a/projects/packages/autoloader/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/packages/autoloader/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..62a350fe59dbe --- /dev/null +++ b/projects/packages/autoloader/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. + + diff --git a/projects/packages/autoloader/src/AutoloadGenerator.php b/projects/packages/autoloader/src/AutoloadGenerator.php index cb8c1fa195cd0..4fe1d47d97fe7 100644 --- a/projects/packages/autoloader/src/AutoloadGenerator.php +++ b/projects/packages/autoloader/src/AutoloadGenerator.php @@ -21,7 +21,7 @@ */ class AutoloadGenerator { - const VERSION = '3.0.0'; + const VERSION = '3.0.1-alpha'; /** * IO object. diff --git a/projects/packages/autoloader/src/class-plugin-locator.php b/projects/packages/autoloader/src/class-plugin-locator.php index 3a784c808d8d2..8dafeff50dfd9 100644 --- a/projects/packages/autoloader/src/class-plugin-locator.php +++ b/projects/packages/autoloader/src/class-plugin-locator.php @@ -31,7 +31,7 @@ public function __construct( $path_processor ) { */ public function find_current_plugin() { // Escape from `vendor/__DIR__` to root plugin directory. - $plugin_directory = dirname( dirname( __DIR__ ) ); + $plugin_directory = dirname( __DIR__, 2 ); // Use the path processor to ensure that this is an autoloader we're referencing. $path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() ); diff --git a/projects/packages/autoloader/tests/php/bootstrap.php b/projects/packages/autoloader/tests/php/bootstrap.php index 2a6d9e818967c..de5fa56514d32 100644 --- a/projects/packages/autoloader/tests/php/bootstrap.php +++ b/projects/packages/autoloader/tests/php/bootstrap.php @@ -9,7 +9,7 @@ define( 'TEST_DIR', str_replace( '\\', '/', __DIR__ ) ); // Make sure its easy to reference the test files. -define( 'TEST_PACKAGE_DIR', dirname( dirname( TEST_DIR ) ) ); +define( 'TEST_PACKAGE_DIR', dirname( TEST_DIR, 2 ) ); define( 'TEST_TEMP_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'tmp' ); // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged diff --git a/projects/packages/changelogger/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/packages/changelogger/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..62a350fe59dbe --- /dev/null +++ b/projects/packages/changelogger/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. + + diff --git a/projects/packages/changelogger/src/Application.php b/projects/packages/changelogger/src/Application.php index 02f4e670cbc9d..08be8f7130509 100644 --- a/projects/packages/changelogger/src/Application.php +++ b/projects/packages/changelogger/src/Application.php @@ -18,7 +18,7 @@ */ class Application extends SymfonyApplication { - const VERSION = '4.0.0'; + const VERSION = '4.0.1-alpha'; /** * Constructor. diff --git a/projects/packages/changelogger/tests/php/tests/src/ConfigTest.php b/projects/packages/changelogger/tests/php/tests/src/ConfigTest.php index 6f109f8ed323a..5dbf6933b4366 100644 --- a/projects/packages/changelogger/tests/php/tests/src/ConfigTest.php +++ b/projects/packages/changelogger/tests/php/tests/src/ConfigTest.php @@ -156,7 +156,7 @@ public function testBase() { $this->resetConfigCache(); putenv( 'COMPOSER=' . __DIR__ . '/../../../../composer.json' ); - $this->assertSame( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ), Config::base() ); + $this->assertSame( dirname( __DIR__, 4 ), Config::base() ); } /** diff --git a/projects/packages/codesniffer/Jetpack/ruleset.xml b/projects/packages/codesniffer/Jetpack/ruleset.xml index a8e084fbe01e0..b961fae119253 100644 --- a/projects/packages/codesniffer/Jetpack/ruleset.xml +++ b/projects/packages/codesniffer/Jetpack/ruleset.xml @@ -74,6 +74,11 @@ + + + 5 + + error diff --git a/projects/packages/codesniffer/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/packages/codesniffer/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..02a059ee09fc5 --- /dev/null +++ b/projects/packages/codesniffer/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +Enable `Modernize.FunctionCalls.Dirname.Nested` sniff that is currently being disabled by WordPress-Extra. diff --git a/projects/packages/connection/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/packages/connection/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..62a350fe59dbe --- /dev/null +++ b/projects/packages/connection/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. + + diff --git a/projects/packages/connection/src/class-package-version.php b/projects/packages/connection/src/class-package-version.php index e9df2eb2fd117..9694b141ebce2 100644 --- a/projects/packages/connection/src/class-package-version.php +++ b/projects/packages/connection/src/class-package-version.php @@ -12,7 +12,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '2.0.0'; + const PACKAGE_VERSION = '2.0.1-alpha'; const PACKAGE_SLUG = 'connection'; diff --git a/projects/packages/connection/tests/php/test_Server_Sandbox.php b/projects/packages/connection/tests/php/test_Server_Sandbox.php index ff83cb6aee8bd..a7d387d32b79f 100644 --- a/projects/packages/connection/tests/php/test_Server_Sandbox.php +++ b/projects/packages/connection/tests/php/test_Server_Sandbox.php @@ -245,7 +245,7 @@ public function data_provider_test_server_sandbox_with_xdebug() { * admin bar menu when the JETPACK__DOMAIN_SANDBOX constant is not set. */ public function test_admin_bar_add_sandbox_item_constant_not_set() { - require_once dirname( dirname( __DIR__ ) ) . '/wordpress/wp-includes/class-wp-admin-bar.php'; + require_once dirname( __DIR__, 2 ) . '/wordpress/wp-includes/class-wp-admin-bar.php'; $wp_admin_bar = new \WP_Admin_Bar(); ( new Server_Sandbox() )->admin_bar_add_sandbox_item( $wp_admin_bar ); @@ -260,7 +260,7 @@ public function test_admin_bar_add_sandbox_item_constant_not_set() { */ public function test_admin_bar_add_sandbox_item_constant_set() { Constants::set_constant( 'JETPACK__SANDBOX_DOMAIN', 'www.example.com' ); - require_once dirname( dirname( __DIR__ ) ) . '/wordpress/wp-includes/class-wp-admin-bar.php'; + require_once dirname( __DIR__, 2 ) . '/wordpress/wp-includes/class-wp-admin-bar.php'; $wp_admin_bar = new \WP_Admin_Bar(); ( new Server_Sandbox() )->admin_bar_add_sandbox_item( $wp_admin_bar ); diff --git a/projects/packages/waf/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/packages/waf/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..62a350fe59dbe --- /dev/null +++ b/projects/packages/waf/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. + + diff --git a/projects/packages/waf/src/class-waf-standalone-bootstrap.php b/projects/packages/waf/src/class-waf-standalone-bootstrap.php index 7d12c2ad4ba66..0180e340d3e7d 100644 --- a/projects/packages/waf/src/class-waf-standalone-bootstrap.php +++ b/projects/packages/waf/src/class-waf-standalone-bootstrap.php @@ -80,7 +80,7 @@ private function locate_autoloader_file() { 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'; + $autoload_file = dirname( $class_file, 5 ) . '/vendor/autoload.php'; } } @@ -91,13 +91,13 @@ private function locate_autoloader_file() { ) { $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'; + $autoload_file = dirname( $package_file, 3 ) . '/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'; + $autoload_file = dirname( __DIR__, 4 ) . '/vendor/autoload.php'; if ( ! file_exists( $autoload_file ) ) { $autoload_file = dirname( __DIR__ ) . '/vendor/autoload.php'; } diff --git a/projects/plugins/crm/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/plugins/crm/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..62a350fe59dbe --- /dev/null +++ b/projects/plugins/crm/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. + + diff --git a/projects/plugins/crm/tests/php/bootstrap.php b/projects/plugins/crm/tests/php/bootstrap.php index 7761f90fbee88..11faf2c1daf38 100644 --- a/projects/plugins/crm/tests/php/bootstrap.php +++ b/projects/plugins/crm/tests/php/bootstrap.php @@ -13,7 +13,7 @@ /** * Assume we're in tests/php/bootstrap.php. */ -$_plugin_root = dirname( dirname( __DIR__ ) ); +$_plugin_root = dirname( __DIR__, 2 ); /** * Locate WordPress or wordpress-develop. We look in several places. diff --git a/projects/plugins/jetpack/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff b/projects/plugins/jetpack/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff new file mode 100644 index 0000000000000..aa3dc6f7d7464 --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-codesniffer-Modernize.FunctionCalls.Dirname.Nested-sniff @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Replace nested `dirname` with use of the php 7.0+ `$levels` parameter. No change in functionality. diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-admin-menu.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-admin-menu.php index 9b5a1fc0dc90a..e00fb6a451ef6 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-admin-menu.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-admin-menu.php @@ -5,7 +5,7 @@ use WpOrg\Requests\Requests; -require_once dirname( dirname( __DIR__ ) ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; +require_once dirname( __DIR__, 2 ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; /** * Class WP_Test_WPCOM_REST_API_V2_Endpoint_Admin_Menu diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-external-media.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-external-media.php index f5cb82acc1d1f..55e6d1836d415 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-external-media.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-external-media.php @@ -5,7 +5,7 @@ use WpOrg\Requests\Requests; -require_once dirname( dirname( __DIR__ ) ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; +require_once dirname( __DIR__, 2 ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; /** * Class WP_Test_WPCOM_REST_API_V2_Endpoint_External_Media @@ -42,7 +42,7 @@ class WP_Test_WPCOM_REST_API_V2_Endpoint_External_Media extends WP_Test_Jetpack_ */ public static function wpSetUpBeforeClass( $factory ) { static::$user_id = $factory->user->create( array( 'role' => 'administrator' ) ); - static::$image_path = dirname( dirname( __DIR__ ) ) . '/files/jetpack.jpg'; + static::$image_path = dirname( __DIR__, 2 ) . '/files/jetpack.jpg'; } /** diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-publicize-share-post.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-publicize-share-post.php index 9f85de69d296b..4ce5f42963bc0 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-publicize-share-post.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-publicize-share-post.php @@ -7,7 +7,7 @@ use WpOrg\Requests\Requests; -require_once dirname( dirname( __DIR__ ) ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; +require_once dirname( __DIR__, 2 ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; /** * Class WP_Test_WPCOM_REST_API_V2_Endpoint_Publicize_Share_Post diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-send-email-preview.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-send-email-preview.php index ca9378d06a979..366def34b5b0c 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-send-email-preview.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-send-email-preview.php @@ -7,7 +7,7 @@ use WpOrg\Requests\Requests; -require_once dirname( dirname( __DIR__ ) ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; +require_once dirname( __DIR__, 2 ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; /** * Class WP_Test_WPCOM_REST_API_V2_Endpoint_Send_Email_Preview diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-transient.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-transient.php index 126010f85d737..b923fe351120f 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-transient.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-endpoints/test-class-wpcom-rest-api-v2-endpoint-transient.php @@ -5,7 +5,7 @@ use WpOrg\Requests\Requests; -require_once dirname( dirname( __DIR__ ) ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; +require_once dirname( __DIR__, 2 ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; /** * Class WP_Test_WPCOM_REST_API_V2_Endpoint_Transient diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/class-test-wpcom-rest-api-v2-attachment-videopress-data.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/class-test-wpcom-rest-api-v2-attachment-videopress-data.php index bbd9e45b3b8fc..0b18202ff5424 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/class-test-wpcom-rest-api-v2-attachment-videopress-data.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/class-test-wpcom-rest-api-v2-attachment-videopress-data.php @@ -12,7 +12,7 @@ /** * The base testcase class. */ -require_once dirname( dirname( __DIR__ ) ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; +require_once dirname( __DIR__, 2 ) . '/lib/class-wp-test-jetpack-rest-testcase.php'; use Automattic\Jetpack\VideoPress\WPCOM_REST_API_V2_Attachment_VideoPress_Field; @@ -59,7 +59,7 @@ public function test_attachment_fields_videopress_get() { ) ); - $attachment_id = self::factory()->attachment->create_upload_object( dirname( dirname( __DIR__ ) ) . '/jetpack-icon.jpg', 0 ); + $attachment_id = self::factory()->attachment->create_upload_object( dirname( __DIR__, 2 ) . '/jetpack-icon.jpg', 0 ); $object = array( 'id' => $attachment_id, ); diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-attachment-fields-videopress.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-attachment-fields-videopress.php index c24be8ff05f12..6bd648da6f5e7 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-attachment-fields-videopress.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-attachment-fields-videopress.php @@ -1,6 +1,6 @@ returnValue( 'mocked_videopress_guid' ) ); - $attachment_id = self::factory()->attachment->create_upload_object( dirname( dirname( __DIR__ ) ) . '/jetpack-icon.jpg', 0 ); + $attachment_id = self::factory()->attachment->create_upload_object( dirname( __DIR__, 2 ) . '/jetpack-icon.jpg', 0 ); $object = array( 'id' => $attachment_id, ); diff --git a/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-class.service-api-keys.php b/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-class.service-api-keys.php index fb6f5ebb3780d..9f69791173fc6 100644 --- a/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-class.service-api-keys.php +++ b/projects/plugins/jetpack/tests/php/core-api/wpcom-fields/test-class.service-api-keys.php @@ -1,6 +1,6 @@ Date: Tue, 21 Nov 2023 04:36:04 -0500 Subject: [PATCH 36/80] Clean up Composer deps now that we dropped PHP 5.6 (#34217) * `johnkary/phpunit-speedtrap` option for version 1.1.0 is no longer needed, PHP 7.0 uses 2.0. * `symfony/console` and `symfony/process` still need 3.4 for PHP 7.0, but when I was checking I noticed that 7.1 can use 4.4 so added that as an option. * [Wikimedia stopped using `wikimedia/at-ease`][1] since PHP 7 improved the behavior of the `@` operator. So let's drop it too. [1]: https://phabricator.wikimedia.org/T253461 --- composer.lock | 3 +- .../changelog/remove-old-composer-deps | 4 ++ .../changelog/remove-old-composer-deps#2 | 4 ++ projects/packages/changelogger/composer.json | 5 +- .../packages/changelogger/src/AddCommand.php | 18 ++++-- .../changelogger/src/SquashCommand.php | 4 +- projects/packages/changelogger/src/Utils.php | 10 +-- .../changelogger/src/VersionCommand.php | 4 +- .../changelogger/src/WriteCommand.php | 10 +-- .../tests/php/includes/src/TestCase.php | 4 +- .../tests/php/tests/src/UtilsTest.php | 4 +- .../changelog/remove-old-composer-deps | 4 ++ projects/packages/ignorefile/composer.json | 1 - .../ignorefile/tests/php/IgnoreFileTest.php | 4 +- .../backup/changelog/remove-old-composer-deps | 5 ++ projects/plugins/backup/composer.lock | 62 +----------------- .../beta/changelog/remove-old-composer-deps | 5 ++ projects/plugins/beta/composer.lock | 62 +----------------- .../boost/changelog/remove-old-composer-deps | 5 ++ projects/plugins/boost/composer.lock | 62 +----------------- .../crm/changelog/remove-old-composer-deps | 5 ++ projects/plugins/crm/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/debug-helper/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/inspect/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ .../changelog/remove-old-composer-deps#2 | 5 ++ projects/plugins/jetpack/composer.json | 2 +- projects/plugins/jetpack/composer.lock | 64 ++----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/migration/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ .../plugins/mu-wpcom-plugin/composer.json | 2 +- .../plugins/mu-wpcom-plugin/composer.lock | 62 +----------------- .../mu-wpcom-plugin/mu-wpcom-plugin.php | 2 +- projects/plugins/mu-wpcom-plugin/package.json | 2 +- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/protect/composer.lock | 62 +----------------- .../search/changelog/remove-old-composer-deps | 5 ++ projects/plugins/search/composer.lock | 62 +----------------- .../social/changelog/remove-old-composer-deps | 5 ++ projects/plugins/social/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/starter-plugin/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/super-cache/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/vaultpress/composer.lock | 62 +----------------- .../changelog/remove-old-composer-deps | 5 ++ projects/plugins/videopress/composer.lock | 62 +----------------- 51 files changed, 186 insertions(+), 980 deletions(-) create mode 100644 projects/packages/changelogger/changelog/remove-old-composer-deps create mode 100644 projects/packages/changelogger/changelog/remove-old-composer-deps#2 create mode 100644 projects/packages/ignorefile/changelog/remove-old-composer-deps create mode 100644 projects/plugins/backup/changelog/remove-old-composer-deps create mode 100644 projects/plugins/beta/changelog/remove-old-composer-deps create mode 100644 projects/plugins/boost/changelog/remove-old-composer-deps create mode 100644 projects/plugins/crm/changelog/remove-old-composer-deps create mode 100644 projects/plugins/debug-helper/changelog/remove-old-composer-deps create mode 100644 projects/plugins/inspect/changelog/remove-old-composer-deps create mode 100644 projects/plugins/jetpack/changelog/remove-old-composer-deps create mode 100644 projects/plugins/jetpack/changelog/remove-old-composer-deps#2 create mode 100644 projects/plugins/migration/changelog/remove-old-composer-deps create mode 100644 projects/plugins/mu-wpcom-plugin/changelog/remove-old-composer-deps create mode 100644 projects/plugins/protect/changelog/remove-old-composer-deps create mode 100644 projects/plugins/search/changelog/remove-old-composer-deps create mode 100644 projects/plugins/social/changelog/remove-old-composer-deps create mode 100644 projects/plugins/starter-plugin/changelog/remove-old-composer-deps create mode 100644 projects/plugins/super-cache/changelog/remove-old-composer-deps create mode 100644 projects/plugins/vaultpress/changelog/remove-old-composer-deps create mode 100644 projects/plugins/videopress/changelog/remove-old-composer-deps diff --git a/composer.lock b/composer.lock index 968f8eed763a0..a00df25e8669b 100644 --- a/composer.lock +++ b/composer.lock @@ -13,14 +13,13 @@ "dist": { "type": "path", "url": "projects/packages/ignorefile", - "reference": "f16411d7c59144043f0110c14365228574e179b1" + "reference": "89185202e00673d6c11a84c10b6da8373e0f371c" }, "require": { "php": ">=7.0" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "wikimedia/at-ease": "^1.2 || ^2.0", "yoast/phpunit-polyfills": "1.1.0" }, "type": "library", diff --git a/projects/packages/changelogger/changelog/remove-old-composer-deps b/projects/packages/changelogger/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..bce664f1f0a4b --- /dev/null +++ b/projects/packages/changelogger/changelog/remove-old-composer-deps @@ -0,0 +1,4 @@ +Significance: patch +Type: removed + +Remove use of `wikimedia/at-ease` package as PHP 7 improved the behavior of `@`. diff --git a/projects/packages/changelogger/changelog/remove-old-composer-deps#2 b/projects/packages/changelogger/changelog/remove-old-composer-deps#2 new file mode 100644 index 0000000000000..de5bb5d3df3c0 --- /dev/null +++ b/projects/packages/changelogger/changelog/remove-old-composer-deps#2 @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Add `symfony/*` v4.4 as an option, for use with PHP 7.1. diff --git a/projects/packages/changelogger/composer.json b/projects/packages/changelogger/composer.json index c832de8a1b47f..47e13ba1ac597 100644 --- a/projects/packages/changelogger/composer.json +++ b/projects/packages/changelogger/composer.json @@ -11,9 +11,8 @@ ], "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "yoast/phpunit-polyfills": "1.1.0", diff --git a/projects/packages/changelogger/src/AddCommand.php b/projects/packages/changelogger/src/AddCommand.php index 1aadfbc5f0492..8c29145924b35 100644 --- a/projects/packages/changelogger/src/AddCommand.php +++ b/projects/packages/changelogger/src/AddCommand.php @@ -14,7 +14,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\Question; -use function Wikimedia\quietCall; /** * "Add" command for the changelogger tool CLI. @@ -166,7 +165,8 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $dir = Config::changesDir(); if ( ! is_dir( $dir ) ) { Utils::error_clear_last(); - if ( ! quietCall( 'mkdir', $dir, 0775, true ) ) { + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + if ( ! @mkdir( $dir, 0775, true ) ) { $err = error_get_last(); $output->writeln( "Could not create directory $dir: {$err['message']}" ); return 1; @@ -323,16 +323,20 @@ function ( $v ) { ); $contents .= "\n"; Utils::error_clear_last(); - $fp = quietCall( 'fopen', "$dir/$filename", 'x' ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $fp = @fopen( "$dir/$filename", 'x' ); if ( ! $fp || - quietCall( 'fwrite', $fp, $contents ) !== strlen( $contents ) || - ! quietCall( 'fclose', $fp ) + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @fwrite( $fp, $contents ) !== strlen( $contents ) || + ! fclose( $fp ) ) { // @codeCoverageIgnoreStart $err = error_get_last(); $output->writeln( "Failed to write file \"$dir/$filename\": {$err['message']}." ); - quietCall( 'fclose', $fp ); - quietCall( 'unlink', "$dir/$filename" ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @fclose( $fp ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @unlink( "$dir/$filename" ); return 1; // @codeCoverageIgnoreEnd } diff --git a/projects/packages/changelogger/src/SquashCommand.php b/projects/packages/changelogger/src/SquashCommand.php index 0c29957df4a7a..bb58b354351ea 100644 --- a/projects/packages/changelogger/src/SquashCommand.php +++ b/projects/packages/changelogger/src/SquashCommand.php @@ -12,7 +12,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use function Wikimedia\quietCall; /** * "Squash" command for the changelogger tool CLI. @@ -161,7 +160,8 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $regex = $input->getOption( 'regex' ); $output->writeln( "Looking for entries matching regex $regex", OutputInterface::VERBOSITY_DEBUG ); while ( $inEntries ) { - $ret = quietCall( 'preg_match', $regex, $inEntries[0]->getVersion() ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $ret = @preg_match( $regex, $inEntries[0]->getVersion() ); if ( false === $ret ) { $err = error_get_last()['message']; if ( substr( $err, 0, 14 ) === 'preg_match(): ' ) { diff --git a/projects/packages/changelogger/src/Utils.php b/projects/packages/changelogger/src/Utils.php index ff9a79f7fd74f..341b645ab8506 100644 --- a/projects/packages/changelogger/src/Utils.php +++ b/projects/packages/changelogger/src/Utils.php @@ -12,7 +12,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Process; use function error_clear_last; // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.error_clear_lastFound -use function Wikimedia\quietCall; /** * Utilities for the changelogger tool. @@ -28,7 +27,8 @@ public static function error_clear_last() { error_clear_last(); } else { // @codeCoverageIgnoreStart - quietCall( 'trigger_error', '', E_USER_NOTICE ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + @trigger_error( '', E_USER_NOTICE ); // @codeCoverageIgnoreEnd } } @@ -111,7 +111,8 @@ public static function loadChangeFile( $filename, &$diagnostics = null ) { } self::error_clear_last(); - $contents = quietCall( 'file_get_contents', $filename ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $contents = @file_get_contents( $filename ); // @codeCoverageIgnoreStart if ( false === $contents ) { $err = error_get_last(); @@ -203,7 +204,8 @@ public static function getRepoData( $file, OutputInterface $output, DebugFormatt } if ( ! $repo_data['timestamp'] ) { - $mtime = quietCall( 'filemtime', $file ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $mtime = @filemtime( $file ); if ( false !== $mtime ) { $repo_data['timestamp'] = gmdate( 'Y-m-d\\TH:i:s\\Z', $mtime ); } diff --git a/projects/packages/changelogger/src/VersionCommand.php b/projects/packages/changelogger/src/VersionCommand.php index 80c8811191d87..e5995394fb37c 100644 --- a/projects/packages/changelogger/src/VersionCommand.php +++ b/projects/packages/changelogger/src/VersionCommand.php @@ -12,7 +12,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use function Wikimedia\quietCall; /** * "Version" command for the changelogger tool CLI. @@ -148,7 +147,8 @@ protected function execute( InputInterface $input, OutputInterface $output ) { } Utils::error_clear_last(); - $contents = quietCall( 'file_get_contents', $file ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $contents = @file_get_contents( $file ); // @codeCoverageIgnoreStart if ( ! is_string( $contents ) ) { $err = error_get_last(); diff --git a/projects/packages/changelogger/src/WriteCommand.php b/projects/packages/changelogger/src/WriteCommand.php index 9de9890b171ee..259a50ac073c5 100644 --- a/projects/packages/changelogger/src/WriteCommand.php +++ b/projects/packages/changelogger/src/WriteCommand.php @@ -17,7 +17,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; -use function Wikimedia\quietCall; /** * "Write" command for the changelogger tool CLI. @@ -151,7 +150,8 @@ protected function loadChangelog( InputInterface $input, OutputInterface $output } else { $output->writeln( "Reading changelog from $file...", OutputInterface::VERBOSITY_DEBUG ); Utils::error_clear_last(); - $contents = quietCall( 'file_get_contents', $file ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $contents = @file_get_contents( $file ); // @codeCoverageIgnoreStart if ( ! is_string( $contents ) ) { $err = error_get_last(); @@ -222,7 +222,8 @@ protected function writeChangelog( InputInterface $input, OutputInterface $outpu } Utils::error_clear_last(); - $ok = quietCall( 'file_put_contents', $file, $contents ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $ok = @file_put_contents( $file, $contents ); if ( strlen( $contents ) !== $ok ) { $err = error_get_last(); $output->writeln( "Failed to write $file: {$err['message']}" ); @@ -248,7 +249,8 @@ protected function deleteChanges( InputInterface $input, OutputInterface $output continue; } Utils::error_clear_last(); - $ok = quietCall( 'unlink', $dir . DIRECTORY_SEPARATOR . $name ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $ok = @unlink( $dir . DIRECTORY_SEPARATOR . $name ); if ( $ok ) { $output->writeln( "Deleted change file $name.", OutputInterface::VERBOSITY_DEBUG ); } else { diff --git a/projects/packages/changelogger/tests/php/includes/src/TestCase.php b/projects/packages/changelogger/tests/php/includes/src/TestCase.php index af35b32975e43..d08591dfd86ac 100644 --- a/projects/packages/changelogger/tests/php/includes/src/TestCase.php +++ b/projects/packages/changelogger/tests/php/includes/src/TestCase.php @@ -10,7 +10,6 @@ use Automattic\Jetpack\Changelogger\Config; use PHPUnit\Framework\TestCase as PHPUnit_TestCase; use Wikimedia\TestingAccessWrapper; -use function Wikimedia\quietCall; /** * Base test case for the changelogger tool. @@ -75,7 +74,8 @@ protected function useTempDir() { $mask = rand( 0, 0xffffff ); for ( $i = 0; $i < 0xffffff; $i++ ) { $tmpdir = $base . sprintf( '%06x', $i ^ $mask ); - if ( quietCall( 'mkdir', $tmpdir, 0700 ) ) { + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + if ( @mkdir( $tmpdir, 0700 ) ) { // Success! file_put_contents( "$tmpdir/composer.json", "{}\n" ); $this->oldcwd = getcwd(); diff --git a/projects/packages/changelogger/tests/php/tests/src/UtilsTest.php b/projects/packages/changelogger/tests/php/tests/src/UtilsTest.php index 836431f1968fd..4efebb9478e64 100644 --- a/projects/packages/changelogger/tests/php/tests/src/UtilsTest.php +++ b/projects/packages/changelogger/tests/php/tests/src/UtilsTest.php @@ -18,7 +18,6 @@ use Symfony\Component\Process\Exception\ProcessTimedOutException; use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\Process; -use function Wikimedia\quietCall; /** * Tests for the changelogger utils. @@ -35,7 +34,8 @@ class UtilsTest extends TestCase { * Test error_clear_last. */ public function test_error_clear_last() { - quietCall( 'trigger_error', 'Test', E_USER_NOTICE ); + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + @trigger_error( 'Test', E_USER_NOTICE ); $err = error_get_last(); $this->assertSame( 'Test', $err['message'] ); diff --git a/projects/packages/ignorefile/changelog/remove-old-composer-deps b/projects/packages/ignorefile/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..7ba58c619e2fb --- /dev/null +++ b/projects/packages/ignorefile/changelog/remove-old-composer-deps @@ -0,0 +1,4 @@ +Significance: patch +Type: removed + +Remove use of deprecated `wikimedia/at-ease` package. PHP 7 improved error handling so `@` is ok to use now. diff --git a/projects/packages/ignorefile/composer.json b/projects/packages/ignorefile/composer.json index dc8a6dbc8f028..cc69ca56919e1 100644 --- a/projects/packages/ignorefile/composer.json +++ b/projects/packages/ignorefile/composer.json @@ -8,7 +8,6 @@ }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "wikimedia/at-ease": "^1.2 || ^2.0", "yoast/phpunit-polyfills": "1.1.0" }, "autoload": { diff --git a/projects/packages/ignorefile/tests/php/IgnoreFileTest.php b/projects/packages/ignorefile/tests/php/IgnoreFileTest.php index 82bda72fea5c1..4941a30336104 100644 --- a/projects/packages/ignorefile/tests/php/IgnoreFileTest.php +++ b/projects/packages/ignorefile/tests/php/IgnoreFileTest.php @@ -19,7 +19,6 @@ use RecursiveIteratorIterator; use RuntimeException; use SplFileInfo; -use function Wikimedia\quietCall; /** Tests for IgnoreFile. */ class IgnoreFileTest extends TestCase { @@ -105,7 +104,8 @@ private function mktempdir() { $mask = rand( 0, 0xffffff ); for ( $i = 0; $i < 0xffffff; $i++ ) { $tmpdir = $base . sprintf( '%06x', $i ^ $mask ); - if ( quietCall( 'mkdir', $tmpdir, 0700 ) ) { + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + if ( @mkdir( $tmpdir, 0700 ) ) { return $tmpdir; } } diff --git a/projects/plugins/backup/changelog/remove-old-composer-deps b/projects/plugins/backup/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/backup/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/backup/composer.lock b/projects/plugins/backup/composer.lock index dd30df91b9877..914e5e4dfed56 100644 --- a/projects/plugins/backup/composer.lock +++ b/projects/plugins/backup/composer.lock @@ -1417,13 +1417,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -3987,61 +3986,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/beta/changelog/remove-old-composer-deps b/projects/plugins/beta/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/beta/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/beta/composer.lock b/projects/plugins/beta/composer.lock index 73d91e6ab4fd9..2bc6dd69fc028 100644 --- a/projects/plugins/beta/composer.lock +++ b/projects/plugins/beta/composer.lock @@ -270,13 +270,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -1107,61 +1106,6 @@ } ], "time": "2023-11-09T08:28:21+00:00" - }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" } ], "aliases": [], diff --git a/projects/plugins/boost/changelog/remove-old-composer-deps b/projects/plugins/boost/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/boost/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/boost/composer.lock b/projects/plugins/boost/composer.lock index f9506ee428b93..d5dadf3b9be81 100644 --- a/projects/plugins/boost/composer.lock +++ b/projects/plugins/boost/composer.lock @@ -1640,13 +1640,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4645,61 +4644,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/crm/changelog/remove-old-composer-deps b/projects/plugins/crm/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/crm/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/crm/composer.lock b/projects/plugins/crm/composer.lock index 003ed5e8997d3..13923d8e54b6b 100644 --- a/projects/plugins/crm/composer.lock +++ b/projects/plugins/crm/composer.lock @@ -576,13 +576,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -5159,61 +5158,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/debug-helper/changelog/remove-old-composer-deps b/projects/plugins/debug-helper/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/debug-helper/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/debug-helper/composer.lock b/projects/plugins/debug-helper/composer.lock index 886b4288b56dd..df5d5edf688e6 100644 --- a/projects/plugins/debug-helper/composer.lock +++ b/projects/plugins/debug-helper/composer.lock @@ -13,13 +13,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -850,61 +849,6 @@ } ], "time": "2023-11-09T08:28:21+00:00" - }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" } ], "aliases": [], diff --git a/projects/plugins/inspect/changelog/remove-old-composer-deps b/projects/plugins/inspect/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/inspect/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/inspect/composer.lock b/projects/plugins/inspect/composer.lock index 07b50aca53490..baab94deee297 100644 --- a/projects/plugins/inspect/composer.lock +++ b/projects/plugins/inspect/composer.lock @@ -637,13 +637,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -3207,61 +3206,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/jetpack/changelog/remove-old-composer-deps b/projects/plugins/jetpack/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..7e40c60523f8f --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Remove option of `johnkary/phpunit-speedtrap` v1.1.0 now that we no longer support php 5.6. + + diff --git a/projects/plugins/jetpack/changelog/remove-old-composer-deps#2 b/projects/plugins/jetpack/changelog/remove-old-composer-deps#2 new file mode 100644 index 0000000000000..a1c1831fa1ef7 --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-old-composer-deps#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Updated composer.lock. + + diff --git a/projects/plugins/jetpack/composer.json b/projects/plugins/jetpack/composer.json index c5a1e975094ed..acff6497e71a7 100644 --- a/projects/plugins/jetpack/composer.json +++ b/projects/plugins/jetpack/composer.json @@ -57,7 +57,7 @@ "require-dev": { "antecedent/patchwork": "2.1.25", "automattic/jetpack-changelogger": "@dev", - "johnkary/phpunit-speedtrap": "^4.0.0 || ^2.0.0 || ^1.1.0", + "johnkary/phpunit-speedtrap": "^4.0.0 || ^2.0.0", "yoast/phpunit-polyfills": "1.1.0" }, "scripts": { diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock index b9b3fbc59f832..a9b7f98913bc0 100644 --- a/projects/plugins/jetpack/composer.lock +++ b/projects/plugins/jetpack/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2b5fe1c8d3a7f6f75ab962e21ceb6434", + "content-hash": "b7534d9502e63b345ea04c2b2373af7f", "packages": [ { "name": "automattic/jetpack-a8c-mc-stats", @@ -3006,13 +3006,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -5628,61 +5627,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/migration/changelog/remove-old-composer-deps b/projects/plugins/migration/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/migration/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/migration/composer.lock b/projects/plugins/migration/composer.lock index 136dcec8274ef..aebc6c7d4a28d 100644 --- a/projects/plugins/migration/composer.lock +++ b/projects/plugins/migration/composer.lock @@ -1417,13 +1417,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4216,61 +4215,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/mu-wpcom-plugin/changelog/remove-old-composer-deps b/projects/plugins/mu-wpcom-plugin/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/mu-wpcom-plugin/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/mu-wpcom-plugin/composer.json b/projects/plugins/mu-wpcom-plugin/composer.json index 9c957b21708a8..60afd0e9d2eb5 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.json +++ b/projects/plugins/mu-wpcom-plugin/composer.json @@ -46,6 +46,6 @@ ] }, "config": { - "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_0_0" + "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_0_1_alpha" } } diff --git a/projects/plugins/mu-wpcom-plugin/composer.lock b/projects/plugins/mu-wpcom-plugin/composer.lock index 3380a911cb609..fdecf98f6d297 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.lock +++ b/projects/plugins/mu-wpcom-plugin/composer.lock @@ -81,13 +81,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -2651,61 +2650,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php index ed98d896ec255..11bcfef8fabee 100644 --- a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php +++ b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php @@ -3,7 +3,7 @@ * * Plugin Name: WordPress.com Features * Description: Test plugin for the jetpack-mu-wpcom package - * Version: 2.0.0 + * Version: 2.0.1-alpha * Author: Automattic * License: GPLv2 or later * Text Domain: jetpack-mu-wpcom-plugin diff --git a/projects/plugins/mu-wpcom-plugin/package.json b/projects/plugins/mu-wpcom-plugin/package.json index f7b126ce0aa37..165dd553e3e1f 100644 --- a/projects/plugins/mu-wpcom-plugin/package.json +++ b/projects/plugins/mu-wpcom-plugin/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-mu-wpcom-plugin", - "version": "2.0.0", + "version": "2.0.1-alpha", "description": "Test plugin for the jetpack-mu-wpcom package", "homepage": "https://jetpack.com", "bugs": { diff --git a/projects/plugins/protect/changelog/remove-old-composer-deps b/projects/plugins/protect/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/protect/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/protect/composer.lock b/projects/plugins/protect/composer.lock index 2b7249dbd1921..e053daa23cd7b 100644 --- a/projects/plugins/protect/composer.lock +++ b/projects/plugins/protect/composer.lock @@ -1524,13 +1524,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4323,61 +4322,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/search/changelog/remove-old-composer-deps b/projects/plugins/search/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/search/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/search/composer.lock b/projects/plugins/search/composer.lock index 323fa453ab93d..0cca826f6044d 100644 --- a/projects/plugins/search/composer.lock +++ b/projects/plugins/search/composer.lock @@ -1477,13 +1477,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4047,61 +4046,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/social/changelog/remove-old-composer-deps b/projects/plugins/social/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/social/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index 6dc323439bd2a..ee5aa45ae392f 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -1456,13 +1456,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4461,61 +4460,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/starter-plugin/changelog/remove-old-composer-deps b/projects/plugins/starter-plugin/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/starter-plugin/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/starter-plugin/composer.lock b/projects/plugins/starter-plugin/composer.lock index 6e928d870b87f..e2390c73795e8 100644 --- a/projects/plugins/starter-plugin/composer.lock +++ b/projects/plugins/starter-plugin/composer.lock @@ -1379,13 +1379,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4384,61 +4383,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/super-cache/changelog/remove-old-composer-deps b/projects/plugins/super-cache/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/super-cache/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/super-cache/composer.lock b/projects/plugins/super-cache/composer.lock index 1a206a66bcdae..306c6de34744a 100644 --- a/projects/plugins/super-cache/composer.lock +++ b/projects/plugins/super-cache/composer.lock @@ -64,13 +64,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -2634,61 +2633,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/vaultpress/changelog/remove-old-composer-deps b/projects/plugins/vaultpress/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/vaultpress/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/vaultpress/composer.lock b/projects/plugins/vaultpress/composer.lock index 09d55bd1d9eac..fbf578b4d8058 100644 --- a/projects/plugins/vaultpress/composer.lock +++ b/projects/plugins/vaultpress/composer.lock @@ -127,13 +127,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -2697,61 +2696,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", diff --git a/projects/plugins/videopress/changelog/remove-old-composer-deps b/projects/plugins/videopress/changelog/remove-old-composer-deps new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/videopress/changelog/remove-old-composer-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/videopress/composer.lock b/projects/plugins/videopress/composer.lock index d09afdb8fa066..b92852c757be5 100644 --- a/projects/plugins/videopress/composer.lock +++ b/projects/plugins/videopress/composer.lock @@ -1410,13 +1410,12 @@ "dist": { "type": "path", "url": "../../packages/changelogger", - "reference": "56a217920dd8542c690d4d6aa9a9dda9c7acf40f" + "reference": "28b3a05e274c08410b266fa803ed73520d5c2874" }, "require": { "php": ">=7.0", - "symfony/console": "^3.4 || ^5.2 || ^6.0", - "symfony/process": "^3.4 || ^5.2 || ^6.0", - "wikimedia/at-ease": "^1.2 || ^2.0" + "symfony/console": "^3.4 || ^4.4 || ^5.2 || ^6.0", + "symfony/process": "^3.4 || ^4.4 || ^5.2 || ^6.0" }, "require-dev": { "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", @@ -4209,61 +4208,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "wikimedia/at-ease", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/at-ease.git", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/at-ease/zipball/e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "reference": "e8ebaa7bb7c8a8395481a05f6dc4deaceab11c33", - "shasum": "" - }, - "require": { - "php": ">=7.2.9" - }, - "require-dev": { - "mediawiki/mediawiki-codesniffer": "35.0.0", - "mediawiki/minus-x": "1.1.1", - "ockcyp/covers-validator": "1.3.3", - "php-parallel-lint/php-console-highlighter": "0.5.0", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/Wikimedia/Functions.php" - ], - "psr-4": { - "Wikimedia\\AtEase\\": "src/Wikimedia/AtEase/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Tim Starling", - "email": "tstarling@wikimedia.org" - }, - { - "name": "MediaWiki developers", - "email": "wikitech-l@lists.wikimedia.org" - } - ], - "description": "Safe replacement to @ for suppressing warnings.", - "homepage": "https://www.mediawiki.org/wiki/at-ease", - "support": { - "source": "https://github.com/wikimedia/at-ease/tree/v2.1.0" - }, - "time": "2021-02-27T15:53:37+00:00" - }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", From 6e2ed4566db621514afdcfbec595d927e38be3fa Mon Sep 17 00:00:00 2001 From: Peter Petrov Date: Tue, 21 Nov 2023 12:24:15 +0200 Subject: [PATCH 37/80] Boost: Refactor AdvancedCriticalCss to React (#34068) --- .../boost/app/assets/src/css/admin-style.scss | 1 - .../boost/app/assets/src/js/Main.svelte | 4 +- .../CriticalCssErrorDescription.svelte | 113 ------------------ .../CriticalCssShowStopperError.svelte | 8 +- .../features/critical-css/NumberedList.svelte | 25 ---- .../critical-css/UrlComponentsExample.svelte | 24 ---- .../error-description.module.scss | 39 ++++++ .../error-description/error-description.tsx | 84 +++++++++++++ .../critical-css/error-description/types.ts | 19 +++ .../folding-element.module.scss | 28 +++++ .../folding-element/folding-element.tsx | 37 ++++++ .../describe-critical-css-recommendations.ts | 18 +-- .../more-list/more-list.module.scss | 3 + .../critical-css/more-list/more-list.tsx | 47 ++++++++ .../numbered-list/numbered-list.module.scss} | 0 .../numbered-list/numbered-list.tsx | 25 ++++ .../suggestion/suggestion.module.scss | 10 ++ .../critical-css/suggestion/suggestion.tsx | 45 +++++++ .../url-components-example.tsx | 28 +++++ .../features/ui/close-button/close-button.tsx | 17 +++ .../app/assets/src/js/features/ui/index.ts | 1 + .../lib/utils/action-link-interpolate-var.tsx | 30 +++++ .../utils/external-link-interpolate-var.tsx | 13 ++ .../src/js/lib/utils/interplate-vars-types.ts | 3 + .../assets/src/js/lib/utils/poll-promise.ts | 9 +- .../utils/support-link-interpolate-var.tsx | 14 +++ .../CriticalCssAdvanced.svelte | 93 -------------- .../critical-css-advanced.module.scss | 6 + .../critical-css-advanced.tsx | 103 ++++++++++++++++ .../boost/app/assets/src/js/svg/info.tsx | 10 ++ .../update-boost-react-advanced-critical-css | 4 + projects/plugins/boost/tsconfig.json | 35 ++---- 32 files changed, 598 insertions(+), 298 deletions(-) delete mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/CriticalCssErrorDescription.svelte delete mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/NumberedList.svelte delete mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/UrlComponentsExample.svelte create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/error-description/error-description.module.scss create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/error-description/error-description.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/error-description/types.ts create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/folding-element/folding-element.module.scss create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/folding-element/folding-element.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/more-list/more-list.module.scss create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/more-list/more-list.tsx rename projects/plugins/boost/app/assets/src/{css/components/numbered-list.scss => js/features/critical-css/numbered-list/numbered-list.module.scss} (100%) create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/numbered-list/numbered-list.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/suggestion/suggestion.module.scss create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/suggestion/suggestion.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/features/critical-css/url-components-example/url-components-example.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/features/ui/close-button/close-button.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/lib/utils/action-link-interpolate-var.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/lib/utils/external-link-interpolate-var.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/lib/utils/interplate-vars-types.ts create mode 100644 projects/plugins/boost/app/assets/src/js/lib/utils/support-link-interpolate-var.tsx delete mode 100644 projects/plugins/boost/app/assets/src/js/pages/critical-css-advanced/CriticalCssAdvanced.svelte create mode 100644 projects/plugins/boost/app/assets/src/js/pages/critical-css-advanced/critical-css-advanced.module.scss create mode 100644 projects/plugins/boost/app/assets/src/js/pages/critical-css-advanced/critical-css-advanced.tsx create mode 100644 projects/plugins/boost/app/assets/src/js/svg/info.tsx create mode 100644 projects/plugins/boost/changelog/update-boost-react-advanced-critical-css diff --git a/projects/plugins/boost/app/assets/src/css/admin-style.scss b/projects/plugins/boost/app/assets/src/css/admin-style.scss index 15306299468be..ca468e8fd2570 100644 --- a/projects/plugins/boost/app/assets/src/css/admin-style.scss +++ b/projects/plugins/boost/app/assets/src/css/admin-style.scss @@ -14,7 +14,6 @@ @import 'components/error-message'; @import 'components/critical-css'; @import 'components/close-button'; -@import 'components/numbered-list'; @import 'components/rating-card'; @import 'components/button'; @import 'components/card'; diff --git a/projects/plugins/boost/app/assets/src/js/Main.svelte b/projects/plugins/boost/app/assets/src/js/Main.svelte index c0f8b9b361d96..3db9c4e67cec5 100644 --- a/projects/plugins/boost/app/assets/src/js/Main.svelte +++ b/projects/plugins/boost/app/assets/src/js/Main.svelte @@ -1,5 +1,5 @@ - -
- - - - - - - {entry.label} - - - - {#if showSuggestion} -
- {__( 'What to do', 'jetpack-boost' )} -
- -

- - {#if suggestion( errorSet ).list} - - {/if} -

- {#if showClosingParagraph && suggestion( errorSet ).closingParagraph} -

- -

- {/if} - - - {/if} - - {#if rawError( errorSet )} - {#if foldRawErrors} - -

- {rawError( errorSet )} -

-
- {:else} -

- {rawError( errorSet )} -

- {/if} - {/if} -
diff --git a/projects/plugins/boost/app/assets/src/js/features/critical-css/CriticalCssShowStopperError.svelte b/projects/plugins/boost/app/assets/src/js/features/critical-css/CriticalCssShowStopperError.svelte index 35a42f75a7cad..99e1b5689c2a4 100644 --- a/projects/plugins/boost/app/assets/src/js/features/critical-css/CriticalCssShowStopperError.svelte +++ b/projects/plugins/boost/app/assets/src/js/features/critical-css/CriticalCssShowStopperError.svelte @@ -6,10 +6,11 @@ import { onDestroy } from 'svelte'; import { slide } from 'svelte/transition'; import { __ } from '@wordpress/i18n'; - import CriticalCssErrorDescription from './CriticalCssErrorDescription.svelte'; + import CriticalCssErrorDescription from './error-description/error-description'; import FoldingElement from './FoldingElement.svelte'; import ErrorNotice from '$features/ErrorNotice.svelte'; - import { CriticalCssState } from '$features/critical-css-state-types'; + import { CriticalCssState } from './lib/stores/critical-css-state-types'; + import ReactComponent from '$features/ReactComponent.svelte'; export let supportLink = 'https://wordpress.org/support/plugin/jetpack-boost/'; export let status: CriticalCssState[ 'status' ]; @@ -46,7 +47,8 @@ >
{#if showProviderError} - - import TemplatedString from '$features/TemplatedString.svelte'; - import { TemplateVars } from '$lib/utils/copy-dom-template'; - - /** - * List of string items to include in the list. - */ - export let items: string[]; - - /** - * Template vars to fill in