+
+ );
+};
+
+export default ConnectionScreenBody;
diff --git a/projects/packages/my-jetpack/_inc/components/connection-screen/footer.tsx b/projects/packages/my-jetpack/_inc/components/connection-screen/footer.tsx
new file mode 100644
index 0000000000000..e95586da066ba
--- /dev/null
+++ b/projects/packages/my-jetpack/_inc/components/connection-screen/footer.tsx
@@ -0,0 +1,32 @@
+import { __ } from '@wordpress/i18n';
+import appleLogo from './apple.svg';
+import googleLogo from './google.svg';
+import styles from './styles.module.scss';
+import wordpressLogo from './wordpress.svg';
+
+const ConnectionScreenFooter: React.FC = () => (
+ <>
+ { /* not using p here since connect screen apply styles for all p down the tree */ }
+ { /* https://github.com/Automattic/jetpack/blob/trunk/projects/js-packages/connection/components/connect-screen/layout/style.scss#L49-L54 */ }
+
+ { __( 'You can use your existing account on any of these services:', 'jetpack-my-jetpack' ) }
+
+ { /*
+ Since the list style type is set to none, `role=list` is required for VoiceOver (on Safari) to announce the list.
+ See: https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html
+ */ }
+
+
+
+
+
+
+
+
+
+
+
+ >
+);
+
+export default ConnectionScreenFooter;
diff --git a/projects/packages/my-jetpack/_inc/components/connection-screen/index.jsx b/projects/packages/my-jetpack/_inc/components/connection-screen/index.jsx
deleted file mode 100644
index 563e374805535..0000000000000
--- a/projects/packages/my-jetpack/_inc/components/connection-screen/index.jsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import { Container, Col, AdminPage, getRedirectUrl } from '@automattic/jetpack-components';
-import { ConnectScreen } from '@automattic/jetpack-connection';
-import { VisuallyHidden } from '@wordpress/components';
-import { __ } from '@wordpress/i18n';
-import { Icon, external } from '@wordpress/icons';
-import React from 'react';
-import { useSearchParams } from 'react-router-dom';
-import useMyJetpackConnection from '../../hooks/use-my-jetpack-connection';
-import CloseLink from '../close-link';
-import appleLogo from './apple.svg';
-import connectImage from './connect.png';
-import googleLogo from './google.svg';
-import styles from './styles.module.scss';
-import wordpressLogo from './wordpress.svg';
-
-const ConnectionScreenFooter = () => {
- return (
- <>
- { /* not using p here since connect screen apply styles for all p down the tree */ }
- { /* https://github.com/Automattic/jetpack/blob/trunk/projects/js-packages/connection/components/connect-screen/layout/style.scss#L49-L54 */ }
-
- { __(
- 'You can use your existing account on any of these services:',
- 'jetpack-my-jetpack'
- ) }
-
- { /*
- Since the list style type is set to none, `role=list` is required for VoiceOver (on Safari) to announce the list.
- See: https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html
- */ }
-
- }
- from="my-jetpack"
- redirectUri={ returnToPage }
- >
- { /*
- Since the list style type is set to none, `role=list` is required for VoiceOver (on Safari) to announce the list.
- See: https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html
- */ }
-
-
-
-
-
- );
-};
-
-/**
- * Looks at query parameters to determine where the browser should go
- * after a user connection is established. Usually the My Jetpack root
- * is a safe bet, but in some instances (e.g., trying to activate a license),
- * it's easier on people to be sent back to a different page
- * (e.g., the license activation form).
- *
- * @returns {string} the URL of a My Jetpack page that should be displayed after connection.
- */
-const useMyJetpackReturnToPage = () => {
- const [ searchParams ] = useSearchParams();
-
- const returnTo = searchParams.get( 'returnTo' );
- if ( returnTo ) {
- return `admin.php?page=my-jetpack#/${ returnTo }`;
- }
-
- return `admin.php?page=my-jetpack`;
-};
-
-export default ConnectionScreen;
diff --git a/projects/packages/my-jetpack/_inc/components/connection-screen/index.tsx b/projects/packages/my-jetpack/_inc/components/connection-screen/index.tsx
new file mode 100644
index 0000000000000..35fda85b8e13a
--- /dev/null
+++ b/projects/packages/my-jetpack/_inc/components/connection-screen/index.tsx
@@ -0,0 +1,28 @@
+import { Container, Col, AdminPage } from '@automattic/jetpack-components';
+import { __ } from '@wordpress/i18n';
+import useMyJetpackReturnToPage from '../../hooks/use-my-jetpack-return-to-page';
+import CloseLink from '../close-link';
+import ConnectionScreenBody from './body';
+import styles from './styles.module.scss';
+
+const ConnectionScreen: React.FC = () => {
+ const returnToPage = useMyJetpackReturnToPage();
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default ConnectionScreen;
diff --git a/projects/packages/my-jetpack/_inc/hooks/use-my-jetpack-return-to-page/index.ts b/projects/packages/my-jetpack/_inc/hooks/use-my-jetpack-return-to-page/index.ts
new file mode 100644
index 0000000000000..14096205ccdc8
--- /dev/null
+++ b/projects/packages/my-jetpack/_inc/hooks/use-my-jetpack-return-to-page/index.ts
@@ -0,0 +1,23 @@
+import { useSearchParams } from 'react-router-dom';
+
+/**
+ * Looks at query parameters to determine where the browser should go
+ * after a user connection is established. Usually the My Jetpack root
+ * is a safe bet, but in some instances (e.g., trying to activate a license),
+ * it's easier on people to be sent back to a different page
+ * (e.g., the license activation form).
+ *
+ * @returns {string} the URL of a My Jetpack page that should be displayed after connection.
+ */
+const useMyJetpackReturnToPage = () => {
+ const [ searchParams ] = useSearchParams();
+
+ const returnTo = searchParams.get( 'returnTo' );
+ if ( returnTo ) {
+ return `admin.php?page=my-jetpack#/${ returnTo }`;
+ }
+
+ return `admin.php?page=my-jetpack`;
+};
+
+export default useMyJetpackReturnToPage;
diff --git a/projects/packages/my-jetpack/changelog/refactor-connection-screen-duplicate b/projects/packages/my-jetpack/changelog/refactor-connection-screen-duplicate
new file mode 100644
index 0000000000000..95db492afb632
--- /dev/null
+++ b/projects/packages/my-jetpack/changelog/refactor-connection-screen-duplicate
@@ -0,0 +1,5 @@
+Significance: patch
+Type: changed
+Comment: Moved components into their own files
+
+
diff --git a/projects/packages/my-jetpack/global.d.ts b/projects/packages/my-jetpack/global.d.ts
index 8f188f1f7fc03..7076d3b5fa4ff 100644
--- a/projects/packages/my-jetpack/global.d.ts
+++ b/projects/packages/my-jetpack/global.d.ts
@@ -1,3 +1,8 @@
+declare module '*.png';
+declare module '*.svg';
+declare module '*.jpeg';
+declare module '*.jpg';
+declare module '*.scss';
interface Window {
myJetpackInitialState?: {
siteSuffix: string;
From 25afd194660a52f31cc3d7b08741616fa7935dfa Mon Sep 17 00:00:00 2001
From: Emanuele Buccelli
Date: Thu, 21 Mar 2024 15:22:23 +0100
Subject: [PATCH 03/18] Verbum: Gutenberg to all users (#36476)
Co-authored-by: Anthony Grullon
Co-authored-by: heavyweight
---
.../update-gutenberg-verbum-all-users | 4 ++++
.../verbum-comments/class-verbum-comments.php | 19 +------------------
2 files changed, 5 insertions(+), 18 deletions(-)
create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users b/projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users
new file mode 100644
index 0000000000000..477f71982f911
--- /dev/null
+++ b/projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users
@@ -0,0 +1,4 @@
+Significance: minor
+Type: changed
+
+Releasing Gutenberg to all Verbum users.
diff --git a/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php b/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php
index 7530996db1cbc..b39441539d3d5 100644
--- a/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php
+++ b/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php
@@ -568,24 +568,7 @@ public function should_load_gutenberg_comments() {
return false;
}
- $blog_id = $this->blog_id;
- $e2e_tests = function_exists( 'has_blog_sticker' ) && has_blog_sticker( 'a8c-e2e-test-blog', $blog_id );
- $has_blocks_flag = function_exists( 'has_blog_sticker' ) && has_blog_sticker( 'verbum-block-comments', $blog_id );
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended
- $gutenberg_query_param = isset( $_GET['verbum_gutenberg'] ) ? intval( $_GET['verbum_gutenberg'] ) : null;
- // This will release to 80% of sites.
- $blog_in_80_percent = $blog_id % 100 >= 20;
- // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
- $is_proxied = isset( $_SERVER['A8C_PROXIED_REQUEST'] )
- ? sanitize_text_field( wp_unslash( $_SERVER['A8C_PROXIED_REQUEST'] ) )
- : defined( 'A8C_PROXIED_REQUEST' ) && A8C_PROXIED_REQUEST;
-
- // Check if the parameter is set and its value is either 0 or 1, if any random value is passed, it is ignored.
- if ( $gutenberg_query_param !== null ) {
- return $gutenberg_query_param === 1;
- }
-
- return $has_blocks_flag || $e2e_tests || $blog_in_80_percent;
+ return true;
}
/**
From d88b0adc9e85e514ba78436594f9ad8ddb9f3ede Mon Sep 17 00:00:00 2001
From: Dylan Munson <65001528+CodeyGuyDylan@users.noreply.github.com>
Date: Thu, 21 Mar 2024 10:15:33 -0600
Subject: [PATCH 04/18] Add/bad installation notices to my jetpack (#36449)
* Add red bubble notification for bad installations
* changelog
* remove log statement
* fixup project versions
* Display bad install messages on My Jetpack
* Remove purposeful bad installment
* Make watcher a bit more consistent
* Update project version
* Fix changelogs
* changelog
* Add tracks event for bad notice click
* Remove intentional bad installation
* Simplify use of red bubble filter
* Fix Jetpack Social hook
* Split hooks up into individual files
---
.../components/my-jetpack-screen/index.jsx | 4 +-
.../_inc/components/product-card/index.jsx | 1 +
.../hooks/use-connection-watcher/index.ts | 68 -------------------
.../hooks/use-notification-watcher/index.ts | 12 ++++
.../use-bad-install-notice.ts | 62 +++++++++++++++++
.../use-site-connection-notice.ts | 61 +++++++++++++++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/packages/my-jetpack/global.d.ts | 8 +++
.../my-jetpack/src/class-initializer.php | 2 +-
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/backup/jetpack-backup.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/beta/jetpack-beta.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/boost/jetpack-boost.php | 14 ++++
projects/plugins/crm/ZeroBSCRM.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/jetpack/jetpack.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
.../plugins/migration/wpcom-migration.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/protect/jetpack-protect.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/search/jetpack-search.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/social/jetpack-social.php | 14 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
.../starter-plugin/jetpack-starter-plugin.php | 16 ++++-
...add-bad-installation-notices-to-my-jetpack | 4 ++
projects/plugins/vaultpress/vaultpress.php | 15 ++++
...add-bad-installation-notices-to-my-jetpack | 4 ++
.../plugins/videopress/jetpack-videopress.php | 14 ++++
33 files changed, 369 insertions(+), 72 deletions(-)
delete mode 100644 projects/packages/my-jetpack/_inc/hooks/use-connection-watcher/index.ts
create mode 100644 projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/index.ts
create mode 100644 projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-bad-install-notice.ts
create mode 100644 projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-site-connection-notice.ts
create mode 100644 projects/packages/my-jetpack/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/backup/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/beta/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/boost/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/crm/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/jetpack/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/migration/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/protect/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/search/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/social/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/starter-plugin/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/vaultpress/changelog/add-bad-installation-notices-to-my-jetpack
create mode 100644 projects/plugins/videopress/changelog/add-bad-installation-notices-to-my-jetpack
diff --git a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx
index fd17496e9af60..31923e68c6afa 100644
--- a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx
+++ b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx
@@ -31,7 +31,7 @@ import useProduct from '../../data/products/use-product';
import useSimpleQuery from '../../data/use-simple-query';
import { getMyJetpackWindowInitialState } from '../../data/utils/get-my-jetpack-window-state';
import useAnalytics from '../../hooks/use-analytics';
-import useConnectionWatcher from '../../hooks/use-connection-watcher';
+import useNotificationWatcher from '../../hooks/use-notification-watcher';
import ConnectionsSection from '../connections-section';
import IDCModal from '../idc-modal';
import JetpackManageBanner from '../jetpack-manage-banner';
@@ -93,7 +93,7 @@ const GlobalNotice = ( { message, options } ) => {
* @returns {object} The MyJetpackScreen component.
*/
export default function MyJetpackScreen() {
- useConnectionWatcher();
+ useNotificationWatcher();
const { hasBeenDismissed = false } = getMyJetpackWindowInitialState( 'welcomeBanner' );
const { showFullJetpackStatsCard = false } = getMyJetpackWindowInitialState( 'myJetpackFlags' );
const { jetpackManage = {}, adminUrl } = getMyJetpackWindowInitialState();
diff --git a/projects/packages/my-jetpack/_inc/components/product-card/index.jsx b/projects/packages/my-jetpack/_inc/components/product-card/index.jsx
index 994a97ceadc27..87f4c8f65f0fa 100644
--- a/projects/packages/my-jetpack/_inc/components/product-card/index.jsx
+++ b/projects/packages/my-jetpack/_inc/components/product-card/index.jsx
@@ -251,6 +251,7 @@ ProductCard.propTypes = {
PRODUCT_STATUSES.NEEDS_PURCHASE,
PRODUCT_STATUSES.NEEDS_PURCHASE_OR_FREE,
PRODUCT_STATUSES.CAN_UPGRADE,
+ PRODUCT_STATUSES.MODULE_DISABLED,
] ).isRequired,
};
diff --git a/projects/packages/my-jetpack/_inc/hooks/use-connection-watcher/index.ts b/projects/packages/my-jetpack/_inc/hooks/use-connection-watcher/index.ts
deleted file mode 100644
index 59191e6bafab6..0000000000000
--- a/projects/packages/my-jetpack/_inc/hooks/use-connection-watcher/index.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-import { __, sprintf } from '@wordpress/i18n';
-import { useEffect, useContext } from 'react';
-import { MyJetpackRoutes } from '../../constants';
-import { NOTICE_PRIORITY_HIGH } from '../../context/constants';
-import { NoticeContext } from '../../context/notices/noticeContext';
-import { useAllProducts } from '../../data/products/use-product';
-import getProductSlugsThatRequireUserConnection from '../../data/utils/get-product-slugs-that-require-user-connection';
-import useMyJetpackConnection from '../use-my-jetpack-connection';
-import useMyJetpackNavigate from '../use-my-jetpack-navigate';
-
-/**
- * React custom hook to watch connection.
- * For instance, when the user is not connected,
- * the hook dispatches an action to populate the global notice.
- */
-export default function useConnectionWatcher() {
- const { setNotice } = useContext( NoticeContext );
- const navToConnection = useMyJetpackNavigate( MyJetpackRoutes.Connection );
- const products = useAllProducts();
- const productSlugsThatRequireUserConnection =
- getProductSlugsThatRequireUserConnection( products );
-
- const { isSiteConnected, hasConnectedOwner, isUserConnected } = useMyJetpackConnection();
- const requiresUserConnection =
- ! hasConnectedOwner && ! isUserConnected && productSlugsThatRequireUserConnection.length > 0;
-
- const oneProductMessage = sprintf(
- /* translators: placeholder is product name. */
- __(
- 'Jetpack %s needs a user connection to WordPress.com to be able to work.',
- 'jetpack-my-jetpack'
- ),
- productSlugsThatRequireUserConnection[ 0 ]
- );
-
- const needsUserConnectionMessage =
- productSlugsThatRequireUserConnection.length === 1
- ? oneProductMessage
- : __(
- 'Some products need a user connection to WordPress.com to be able to work.',
- 'jetpack-my-jetpack'
- );
-
- useEffect( () => {
- if ( ! isSiteConnected || requiresUserConnection ) {
- setNotice( {
- message: needsUserConnectionMessage,
- options: {
- status: 'warning',
- actions: [
- {
- label: __( 'Connect your user account to fix this', 'jetpack-my-jetpack' ),
- onClick: navToConnection,
- noDefaultClasses: true,
- },
- ],
- },
- priority: NOTICE_PRIORITY_HIGH,
- } );
- }
- }, [
- isSiteConnected,
- needsUserConnectionMessage,
- requiresUserConnection,
- navToConnection,
- setNotice,
- ] );
-}
diff --git a/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/index.ts b/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/index.ts
new file mode 100644
index 0000000000000..5016b21c5e310
--- /dev/null
+++ b/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/index.ts
@@ -0,0 +1,12 @@
+import { getMyJetpackWindowInitialState } from '../../data/utils/get-my-jetpack-window-state';
+import useBadInstallNotice from './use-bad-install-notice';
+import useSiteConnectionNotice from './use-site-connection-notice';
+
+const useNotificationWatcher = () => {
+ const { redBubbleAlerts } = getMyJetpackWindowInitialState();
+
+ useBadInstallNotice( redBubbleAlerts );
+ useSiteConnectionNotice( redBubbleAlerts );
+};
+
+export default useNotificationWatcher;
diff --git a/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-bad-install-notice.ts b/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-bad-install-notice.ts
new file mode 100644
index 0000000000000..7e0f8e49e4eef
--- /dev/null
+++ b/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-bad-install-notice.ts
@@ -0,0 +1,62 @@
+import { __, sprintf } from '@wordpress/i18n';
+import { useContext, useEffect } from 'react';
+import { NOTICE_PRIORITY_MEDIUM } from '../../context/constants';
+import { NoticeContext } from '../../context/notices/noticeContext';
+import useAnalytics from '../use-analytics';
+
+type RedBubbleAlerts = Window[ 'myJetpackInitialState' ][ 'redBubbleAlerts' ];
+
+const useBadInstallNotice = ( redBubbleAlerts: RedBubbleAlerts ) => {
+ const { setNotice } = useContext( NoticeContext );
+ const { recordEvent } = useAnalytics();
+
+ useEffect( () => {
+ const badInstallAlerts = Object.keys( redBubbleAlerts ).filter( key =>
+ key.endsWith( '-bad-installation' )
+ ) as Array< `${ string }-bad-installation` >;
+
+ if ( badInstallAlerts.length === 0 ) {
+ return;
+ }
+
+ const alert = redBubbleAlerts[ badInstallAlerts[ 0 ] ];
+ const { plugin } = alert.data;
+ const devEnvUrl =
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md';
+
+ const errorMessage = sprintf(
+ // translators: %s is the name of the plugin that has a bad installation.
+ __(
+ 'Your installation of %1$s is incomplete. If you installed %1$s from GitHub, please refer to the developer documentation to set up your development environment.',
+ 'jetpack-my-jetpack'
+ ),
+ plugin
+ );
+
+ const onCtaClick = () => {
+ window.open( devEnvUrl );
+ recordEvent( 'jetpack_my_jetpack_bad_installation_notice_cta_click', {
+ plugin,
+ } );
+ };
+
+ const noticeOptions = {
+ status: 'error',
+ actions: [
+ {
+ label: __( 'See documentation', 'jetpack-my-jetpack' ),
+ onClick: onCtaClick,
+ noDefaultClasses: true,
+ },
+ ],
+ };
+
+ setNotice( {
+ message: errorMessage,
+ options: noticeOptions,
+ priority: NOTICE_PRIORITY_MEDIUM,
+ } );
+ }, [ redBubbleAlerts, setNotice, recordEvent ] );
+};
+
+export default useBadInstallNotice;
diff --git a/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-site-connection-notice.ts b/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-site-connection-notice.ts
new file mode 100644
index 0000000000000..5178ab862df2e
--- /dev/null
+++ b/projects/packages/my-jetpack/_inc/hooks/use-notification-watcher/use-site-connection-notice.ts
@@ -0,0 +1,61 @@
+import { __, sprintf } from '@wordpress/i18n';
+import { useContext, useEffect } from 'react';
+import { MyJetpackRoutes } from '../../constants';
+import { NOTICE_PRIORITY_HIGH } from '../../context/constants';
+import { NoticeContext } from '../../context/notices/noticeContext';
+import { useAllProducts } from '../../data/products/use-product';
+import getProductSlugsThatRequireUserConnection from '../../data/utils/get-product-slugs-that-require-user-connection';
+import useMyJetpackNavigate from '../use-my-jetpack-navigate';
+
+type RedBubbleAlerts = Window[ 'myJetpackInitialState' ][ 'redBubbleAlerts' ];
+
+const useSiteConnectionNotice = ( redBubbleAlerts: RedBubbleAlerts ) => {
+ const { setNotice } = useContext( NoticeContext );
+ const products = useAllProducts();
+ const navToConnection = useMyJetpackNavigate( MyJetpackRoutes.Connection );
+
+ useEffect( () => {
+ if ( ! Object.keys( redBubbleAlerts ).includes( 'missing-site-connection' ) ) {
+ return;
+ }
+
+ const productSlugsThatRequireUserConnection =
+ getProductSlugsThatRequireUserConnection( products );
+
+ const oneProductMessage = sprintf(
+ /* translators: placeholder is product name. */
+ __(
+ 'Jetpack %s needs a user connection to WordPress.com to be able to work.',
+ 'jetpack-my-jetpack'
+ ),
+ productSlugsThatRequireUserConnection[ 0 ]
+ );
+
+ const needsUserConnectionMessage =
+ productSlugsThatRequireUserConnection.length === 1
+ ? oneProductMessage
+ : __(
+ 'Some products need a user connection to WordPress.com to be able to work.',
+ 'jetpack-my-jetpack'
+ );
+
+ const noticeOptions = {
+ status: 'warning',
+ actions: [
+ {
+ label: __( 'Connect your user account to fix this', 'jetpack-my-jetpack' ),
+ onClick: navToConnection,
+ noDefaultClasses: true,
+ },
+ ],
+ };
+
+ setNotice( {
+ message: needsUserConnectionMessage,
+ options: noticeOptions,
+ priority: NOTICE_PRIORITY_HIGH,
+ } );
+ }, [ navToConnection, products, redBubbleAlerts, setNotice ] );
+};
+
+export default useSiteConnectionNotice;
diff --git a/projects/packages/my-jetpack/changelog/add-bad-installation-notices-to-my-jetpack b/projects/packages/my-jetpack/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..5cf6fb645e17e
--- /dev/null
+++ b/projects/packages/my-jetpack/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Hook into red bubble notification when bad installation is detected
diff --git a/projects/packages/my-jetpack/global.d.ts b/projects/packages/my-jetpack/global.d.ts
index 7076d3b5fa4ff..774aa556c3f86 100644
--- a/projects/packages/my-jetpack/global.d.ts
+++ b/projects/packages/my-jetpack/global.d.ts
@@ -184,6 +184,14 @@ interface Window {
check_dns: boolean;
} >;
};
+ redBubbleAlerts: {
+ 'missing-site-connection'?: null;
+ [ key: `${ string }-bad-installation` ]: {
+ data: {
+ plugin: string;
+ };
+ };
+ };
topJetpackMenuItemUrl: string;
userIsAdmin: string;
userIsNewToJetpack: string;
diff --git a/projects/packages/my-jetpack/src/class-initializer.php b/projects/packages/my-jetpack/src/class-initializer.php
index f509d218dc948..1439a4e7a2356 100644
--- a/projects/packages/my-jetpack/src/class-initializer.php
+++ b/projects/packages/my-jetpack/src/class-initializer.php
@@ -661,7 +661,7 @@ public static function get_red_bubble_alerts() {
*/
public static function alert_if_missing_site_connection( array $red_bubble_slugs ) {
if ( ! ( new Connection_Manager() )->is_connected() ) {
- $red_bubble_slugs[] = self::MISSING_SITE_CONNECTION_NOTIFICATION_KEY;
+ $red_bubble_slugs[ self::MISSING_SITE_CONNECTION_NOTIFICATION_KEY ] = null;
}
return $red_bubble_slugs;
diff --git a/projects/plugins/backup/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/backup/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/backup/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/backup/jetpack-backup.php b/projects/plugins/backup/jetpack-backup.php
index f641c5c23a31d..fde32d0e9e358 100644
--- a/projects/plugins/backup/jetpack-backup.php
+++ b/projects/plugins/backup/jetpack-backup.php
@@ -100,6 +100,20 @@ function () use ( $jetpack_backup_meets_requirements ) {
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-vaultpress-backup-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack VaultPress Backup',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
diff --git a/projects/plugins/beta/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/beta/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..5cf6fb645e17e
--- /dev/null
+++ b/projects/plugins/beta/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Hook into red bubble notification when bad installation is detected
diff --git a/projects/plugins/beta/jetpack-beta.php b/projects/plugins/beta/jetpack-beta.php
index 72a05dd390a1c..559b00a2da9e1 100644
--- a/projects/plugins/beta/jetpack-beta.php
+++ b/projects/plugins/beta/jetpack-beta.php
@@ -63,6 +63,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-beta-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack Beta',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
/**
* Outputs an admin notice for folks running Jetpack Beta without having run composer install.
*
diff --git a/projects/plugins/boost/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/boost/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/boost/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/boost/jetpack-boost.php b/projects/plugins/boost/jetpack-boost.php
index be88abcb07aa0..689637643f046 100644
--- a/projects/plugins/boost/jetpack-boost.php
+++ b/projects/plugins/boost/jetpack-boost.php
@@ -85,6 +85,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-boost-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack Boost',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
/**
* Outputs an admin notice for folks running Jetpack Boost without having run composer install.
*
diff --git a/projects/plugins/crm/ZeroBSCRM.php b/projects/plugins/crm/ZeroBSCRM.php
index ecf1a81434f47..4f1b8e6ece042 100644
--- a/projects/plugins/crm/ZeroBSCRM.php
+++ b/projects/plugins/crm/ZeroBSCRM.php
@@ -52,6 +52,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-crm-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack CRM',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
diff --git a/projects/plugins/crm/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/crm/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..5cf6fb645e17e
--- /dev/null
+++ b/projects/plugins/crm/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Hook into red bubble notification when bad installation is detected
diff --git a/projects/plugins/jetpack/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/jetpack/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..3f0201953ef48
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: enhancement
+
+Trigger red bubble notifiction on My Jetpack when bad install is detected
diff --git a/projects/plugins/jetpack/jetpack.php b/projects/plugins/jetpack/jetpack.php
index f64d144e2ec25..91c2217d868ba 100644
--- a/projects/plugins/jetpack/jetpack.php
+++ b/projects/plugins/jetpack/jetpack.php
@@ -156,6 +156,20 @@ function jetpack_admin_unsupported_wp_notice() {
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
/**
* Outputs an admin notice for folks running Jetpack without having run composer install.
*
diff --git a/projects/plugins/migration/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/migration/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/migration/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/migration/wpcom-migration.php b/projects/plugins/migration/wpcom-migration.php
index 6845e26ade573..1dd99a460f593 100644
--- a/projects/plugins/migration/wpcom-migration.php
+++ b/projects/plugins/migration/wpcom-migration.php
@@ -55,6 +55,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['move-to-wordpress-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Move to WordPress.com',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
diff --git a/projects/plugins/protect/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/protect/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/protect/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/protect/jetpack-protect.php b/projects/plugins/protect/jetpack-protect.php
index 3fca96027d352..dcb131e321d4e 100644
--- a/projects/plugins/protect/jetpack-protect.php
+++ b/projects/plugins/protect/jetpack-protect.php
@@ -56,6 +56,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-protect-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack Protect',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
diff --git a/projects/plugins/search/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/search/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/search/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/search/jetpack-search.php b/projects/plugins/search/jetpack-search.php
index de28c440a61cc..d57098d5ee120 100644
--- a/projects/plugins/search/jetpack-search.php
+++ b/projects/plugins/search/jetpack-search.php
@@ -55,6 +55,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-search-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack Search',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
/**
* Outputs an admin notice for folks running Jetpack Search without having run composer install.
*
diff --git a/projects/plugins/social/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/social/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/social/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/social/jetpack-social.php b/projects/plugins/social/jetpack-social.php
index b902a92dcaf3c..1b3234687c5d9 100644
--- a/projects/plugins/social/jetpack-social.php
+++ b/projects/plugins/social/jetpack-social.php
@@ -55,6 +55,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-social-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack Social',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
diff --git a/projects/plugins/starter-plugin/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/starter-plugin/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/starter-plugin/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/starter-plugin/jetpack-starter-plugin.php b/projects/plugins/starter-plugin/jetpack-starter-plugin.php
index 9f08645300837..f63b3939000e3 100644
--- a/projects/plugins/starter-plugin/jetpack-starter-plugin.php
+++ b/projects/plugins/starter-plugin/jetpack-starter-plugin.php
@@ -55,6 +55,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-starter-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack Starter',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
@@ -68,7 +82,7 @@ function () {
printf(
wp_kses(
/* translators: Placeholder is a link to a support document. */
- __( 'Your installation of Jetpack Starter Plugin is incomplete. If you installed Jetpack Starter Plugin from GitHub, please refer to this document to set up your development environment. Jetpack Starter Plugin must have Composer dependencies installed and built via the build command.', 'jetpack-starter-plugin' ),
+ __( 'Your installation of Jetpack Starter is incomplete. If you installed Jetpack Starter Plugin from GitHub, please refer to this document to set up your development environment. Jetpack Starter Plugin must have Composer dependencies installed and built via the build command.', 'jetpack-starter-plugin' ),
array(
'a' => array(
'href' => array(),
diff --git a/projects/plugins/vaultpress/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/vaultpress/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..5cf6fb645e17e
--- /dev/null
+++ b/projects/plugins/vaultpress/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Hook into red bubble notification when bad installation is detected
diff --git a/projects/plugins/vaultpress/vaultpress.php b/projects/plugins/vaultpress/vaultpress.php
index 94eae5a02724c..fd91d1f9fa363 100644
--- a/projects/plugins/vaultpress/vaultpress.php
+++ b/projects/plugins/vaultpress/vaultpress.php
@@ -39,6 +39,21 @@
)
);
}
+
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['vaultpress-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'VaultPress',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
/**
* Outputs an admin notice for folks running VaultPress without having run `composer install`.
*/
diff --git a/projects/plugins/videopress/changelog/add-bad-installation-notices-to-my-jetpack b/projects/plugins/videopress/changelog/add-bad-installation-notices-to-my-jetpack
new file mode 100644
index 0000000000000..7a8c5684ef4be
--- /dev/null
+++ b/projects/plugins/videopress/changelog/add-bad-installation-notices-to-my-jetpack
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Trigger red bubble notification when bad install is detected
diff --git a/projects/plugins/videopress/jetpack-videopress.php b/projects/plugins/videopress/jetpack-videopress.php
index 7324839bfa0ae..0916b0867bb9e 100644
--- a/projects/plugins/videopress/jetpack-videopress.php
+++ b/projects/plugins/videopress/jetpack-videopress.php
@@ -55,6 +55,20 @@
);
}
+ // Add a red bubble notification to My Jetpack if the installation is bad.
+ add_filter(
+ 'my_jetpack_red_bubble_notification_slugs',
+ function ( $slugs ) {
+ $slugs['jetpack-videopress-plugin-bad-installation'] = array(
+ 'data' => array(
+ 'plugin' => 'Jetpack VideoPress',
+ ),
+ );
+
+ return $slugs;
+ }
+ );
+
add_action(
'admin_notices',
function () {
From 08c645eaa6e0187bb13e07094e99ac74f9b2e8f2 Mon Sep 17 00:00:00 2001
From: Linas Valiukas
Date: Thu, 21 Mar 2024 19:18:39 +0200
Subject: [PATCH 05/18] Backup: Change some error messages to not trigger
security scanners (#36496)
* Make t_file_get_contents() and t_file_put_contents() labels less suspicious
Some security scanners grep for `file_get_contents()` / `file_put_contents()`, and mark them as suspicious.
* Bump namespace version
* Appease changelog gods
* Change some more error messages / variable names just in case
* Appease versioning gods
---
.../changelog/backup-change-log-label | 4 ++++
.../src/class-helper-script-manager-impl.php | 2 +-
.../src/class-helper-script-manager.php | 2 +-
.../src/class-throw-on-errors.php | 18 ++++++++++--------
.../test-class-helper-script-manager-impl.php | 2 +-
.../tests/php/test-class-throw-on-errors.php | 10 +++++-----
projects/packages/backup/actions.php | 4 ++--
.../backup/changelog/backup-change-log-label | 4 ++++
.../backup/src/class-initial-state.php | 2 +-
.../src/class-jetpack-backup-upgrades.php | 2 +-
.../backup/src/class-jetpack-backup.php | 4 ++--
.../backup/src/class-rest-controller.php | 2 +-
.../backup/tests/php/test-rest-controller.php | 4 ++--
.../tests/php/test-storage-addon-upsell.php | 2 +-
projects/packages/transport-helper/actions.php | 4 ++--
.../changelog/backup-change-log-label | 4 ++++
.../packages/transport-helper/package.json | 2 +-
.../src/class-package-version.php | 2 +-
.../src/class-rest-controller.php | 4 ++--
.../tests/php/test-rest-controller.php | 4 ++--
.../backup/changelog/backup-change-log-label | 4 ++++
projects/plugins/backup/jetpack-backup.php | 4 ++--
.../jetpack/changelog/backup-change-log-label | 4 ++++
...pi-delete-backup-helper-script-endpoint.php | 2 +-
...i-install-backup-helper-script-endpoint.php | 2 +-
projects/plugins/jetpack/uninstall.php | 2 +-
.../changelog/backup-change-log-label | 4 ++++
.../migration/src/class-wpcom-migration.php | 2 +-
28 files changed, 66 insertions(+), 40 deletions(-)
create mode 100644 projects/packages/backup-helper-script-manager/changelog/backup-change-log-label
create mode 100644 projects/packages/backup/changelog/backup-change-log-label
create mode 100644 projects/packages/transport-helper/changelog/backup-change-log-label
create mode 100644 projects/plugins/backup/changelog/backup-change-log-label
create mode 100644 projects/plugins/jetpack/changelog/backup-change-log-label
create mode 100644 projects/plugins/migration/changelog/backup-change-log-label
diff --git a/projects/packages/backup-helper-script-manager/changelog/backup-change-log-label b/projects/packages/backup-helper-script-manager/changelog/backup-change-log-label
new file mode 100644
index 0000000000000..abe37d7ec52e8
--- /dev/null
+++ b/projects/packages/backup-helper-script-manager/changelog/backup-change-log-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Backup: change some error messages to not trigger security scanners
diff --git a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php
index b41c11c7c48df..adab13b8167bb 100644
--- a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php
+++ b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use Exception;
use WP_Error;
diff --git a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php
index 73b37a2911ea0..5833abaffb662 100644
--- a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php
+++ b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
/**
* Manage installation, deletion and cleanup of Helper Scripts to assist with backing up Jetpack Sites.
diff --git a/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php b/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php
index 552c9cdd4e456..1f59694f4c487 100644
--- a/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php
+++ b/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php
@@ -8,7 +8,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use Exception;
use Throwable;
@@ -430,7 +430,7 @@ public static function t_file_put_contents( $filename, $data ) {
// PHP 5.x won't complain about parameter being unset, so let's do it ourselves.
if ( ! $filename ) {
- throw new Exception( 'Filename for file_put_contents() is unset' );
+ throw new Exception( 'Filename for f_p_c() is unset' );
}
if ( $data === null ) {
throw new Exception( 'Data to write is null' );
@@ -438,7 +438,8 @@ public static function t_file_put_contents( $filename, $data ) {
$data_length = strlen( $data );
- $label = "file_put_contents( '$filename', $data_length bytes of data )";
+ // Weird label is intentional, otherwise security scanners find this label suspicious.
+ $label = "f_p_c( '$filename', $data_length bytes of data )";
$number_of_bytes_written = static::throw_on_warnings(
function () use ( $filename, $data ) {
@@ -474,12 +475,13 @@ public static function t_file_get_contents( $filename ) {
// PHP 5.x won't complain about parameter being unset, so let's do it ourselves.
if ( ! $filename ) {
- throw new Exception( 'Filename for file_get_contents() is unset' );
+ throw new Exception( 'Filename for f_g_c() is unset' );
}
- $label = "file_get_contents( '$filename' )";
+ // Weird label is intentional, otherwise security scanners find this label suspicious.
+ $label = "f_g_c( '$filename' )";
- $file_get_contents_result = static::throw_on_warnings(
+ $fgc_result = static::throw_on_warnings(
function () use ( $filename ) {
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
return file_get_contents( $filename );
@@ -487,10 +489,10 @@ function () use ( $filename ) {
$label
);
- if ( false === $file_get_contents_result ) {
+ if ( false === $fgc_result ) {
throw new Exception( "Unable to $label" );
}
- return $file_get_contents_result;
+ return $fgc_result;
}
}
diff --git a/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php b/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php
index bfcabb29b0932..a347d3b9cff3a 100644
--- a/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php
+++ b/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php
@@ -4,7 +4,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use WorDBless\BaseTestCase;
use WP_Error;
diff --git a/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php b/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php
index 32df6dd02d3ab..fa0482c4de1dc 100644
--- a/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php
+++ b/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php
@@ -8,7 +8,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use Exception;
use PHPUnit\Framework\TestCase;
@@ -457,7 +457,7 @@ public function testFilePutContents() {
*/
public function testFilePutContentsNullParams() {
$this->expectException( Exception::class );
- $this->expectExceptionMessage( 'Filename for file_put_contents() is unset' );
+ $this->expectExceptionMessage( 'Filename for f_p_c() is unset' );
/** @noinspection PhpParamsInspection */
Throw_On_Errors::t_file_put_contents( null, null );
}
@@ -467,7 +467,7 @@ public function testFilePutContentsNullParams() {
*/
public function testFilePutContentsEmptyParams() {
$this->expectException( Exception::class );
- $this->expectExceptionMessage( 'Filename for file_put_contents() is unset' );
+ $this->expectExceptionMessage( 'Filename for f_p_c() is unset' );
/** @noinspection PhpParamsInspection */
Throw_On_Errors::t_file_put_contents( '', null );
}
@@ -491,7 +491,7 @@ public function testFileGetContents() {
*/
public function testFileGetContentsNullParams() {
$this->expectException( Exception::class );
- $this->expectExceptionMessage( 'Filename for file_get_contents() is unset' );
+ $this->expectExceptionMessage( 'Filename for f_g_c() is unset' );
/** @noinspection PhpParamsInspection */
Throw_On_Errors::t_file_get_contents( null );
}
@@ -501,7 +501,7 @@ public function testFileGetContentsNullParams() {
*/
public function testFileGetContentsEmptyParams() {
$this->expectException( Exception::class );
- $this->expectExceptionMessage( 'Filename for file_get_contents() is unset' );
+ $this->expectExceptionMessage( 'Filename for f_g_c() is unset' );
/** @noinspection PhpParamsInspection */
Throw_On_Errors::t_file_get_contents( '' );
}
diff --git a/projects/packages/backup/actions.php b/projects/packages/backup/actions.php
index 322d90e6f3e53..9c5f041de4da0 100644
--- a/projects/packages/backup/actions.php
+++ b/projects/packages/backup/actions.php
@@ -23,10 +23,10 @@
}
// Clean up expired Helper Scripts from a scheduled event.
-$add_action( 'jetpack_backup_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0003\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
+$add_action( 'jetpack_backup_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
// Register REST routes.
-$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0003\\REST_Controller', 'register_rest_routes' ) );
+$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0004\\REST_Controller', 'register_rest_routes' ) );
// Set up package version hook.
$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Backup\\Package_Version::send_package_version_to_tracker' );
diff --git a/projects/packages/backup/changelog/backup-change-log-label b/projects/packages/backup/changelog/backup-change-log-label
new file mode 100644
index 0000000000000..abe37d7ec52e8
--- /dev/null
+++ b/projects/packages/backup/changelog/backup-change-log-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Backup: change some error messages to not trigger security scanners
diff --git a/projects/packages/backup/src/class-initial-state.php b/projects/packages/backup/src/class-initial-state.php
index 79c2b6fe54170..164c291f6a1da 100644
--- a/projects/packages/backup/src/class-initial-state.php
+++ b/projects/packages/backup/src/class-initial-state.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use Automattic\Jetpack\Connection\Plugin_Storage as Connection_Plugin_Storage;
use Automattic\Jetpack\Status;
diff --git a/projects/packages/backup/src/class-jetpack-backup-upgrades.php b/projects/packages/backup/src/class-jetpack-backup-upgrades.php
index 58f11085d31ce..eddf0ba54ec24 100644
--- a/projects/packages/backup/src/class-jetpack-backup-upgrades.php
+++ b/projects/packages/backup/src/class-jetpack-backup-upgrades.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use function get_option;
use function update_option;
diff --git a/projects/packages/backup/src/class-jetpack-backup.php b/projects/packages/backup/src/class-jetpack-backup.php
index 00a1f5151bba2..91c8d0a01c985 100644
--- a/projects/packages/backup/src/class-jetpack-backup.php
+++ b/projects/packages/backup/src/class-jetpack-backup.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
if ( ! defined( 'ABSPATH' ) ) {
exit;
@@ -17,7 +17,7 @@
use Automattic\Jetpack\Admin_UI\Admin_Menu;
use Automattic\Jetpack\Assets;
-use Automattic\Jetpack\Backup\V0003\Initial_State as Backup_Initial_State;
+use Automattic\Jetpack\Backup\V0004\Initial_State as Backup_Initial_State;
use Automattic\Jetpack\Config;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
diff --git a/projects/packages/backup/src/class-rest-controller.php b/projects/packages/backup/src/class-rest-controller.php
index 7bdb9f3411658..f0b4f30d855e2 100644
--- a/projects/packages/backup/src/class-rest-controller.php
+++ b/projects/packages/backup/src/class-rest-controller.php
@@ -10,7 +10,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Rest_Authentication;
diff --git a/projects/packages/backup/tests/php/test-rest-controller.php b/projects/packages/backup/tests/php/test-rest-controller.php
index d7a851e4e4ce9..91e60c6659218 100644
--- a/projects/packages/backup/tests/php/test-rest-controller.php
+++ b/projects/packages/backup/tests/php/test-rest-controller.php
@@ -4,7 +4,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentication;
use PHPUnit\Framework\TestCase;
@@ -65,7 +65,7 @@ public function set_up() {
wp_set_current_user( 0 );
// Register REST routes.
- add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0003\\REST_Controller', 'register_rest_routes' ) );
+ add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0004\\REST_Controller', 'register_rest_routes' ) );
do_action( 'rest_api_init' );
}
diff --git a/projects/packages/backup/tests/php/test-storage-addon-upsell.php b/projects/packages/backup/tests/php/test-storage-addon-upsell.php
index 93c36b55d3bb9..890f6faf94245 100644
--- a/projects/packages/backup/tests/php/test-storage-addon-upsell.php
+++ b/projects/packages/backup/tests/php/test-storage-addon-upsell.php
@@ -4,7 +4,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0003;
+namespace Automattic\Jetpack\Backup\V0004;
use PHPUnit\Framework\TestCase;
diff --git a/projects/packages/transport-helper/actions.php b/projects/packages/transport-helper/actions.php
index e5d0c355b50e1..9621437e18fa8 100644
--- a/projects/packages/transport-helper/actions.php
+++ b/projects/packages/transport-helper/actions.php
@@ -23,10 +23,10 @@
}
// Clean up expired Jetpack Helper Scripts from a scheduled event.
-$add_action( 'jetpack_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0003\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
+$add_action( 'jetpack_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
// Register REST routes.
-$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0003\\REST_Controller', 'register_rest_routes' ) );
+$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0004\\REST_Controller', 'register_rest_routes' ) );
// Set up package version hook.
$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Transport_Helper\\Package_Version::send_package_version_to_tracker' );
diff --git a/projects/packages/transport-helper/changelog/backup-change-log-label b/projects/packages/transport-helper/changelog/backup-change-log-label
new file mode 100644
index 0000000000000..abe37d7ec52e8
--- /dev/null
+++ b/projects/packages/transport-helper/changelog/backup-change-log-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Backup: change some error messages to not trigger security scanners
diff --git a/projects/packages/transport-helper/package.json b/projects/packages/transport-helper/package.json
index 72a0cc8e36b94..957f68aaa8def 100644
--- a/projects/packages/transport-helper/package.json
+++ b/projects/packages/transport-helper/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-transport-helper",
- "version": "0.2.2",
+ "version": "0.2.3-alpha",
"description": "Package to help transport server communication",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/transport-helper/#readme",
"bugs": {
diff --git a/projects/packages/transport-helper/src/class-package-version.php b/projects/packages/transport-helper/src/class-package-version.php
index fd6cb38e86597..e92fcbf893069 100644
--- a/projects/packages/transport-helper/src/class-package-version.php
+++ b/projects/packages/transport-helper/src/class-package-version.php
@@ -16,7 +16,7 @@
*/
class Package_Version {
- const PACKAGE_VERSION = '0.2.2';
+ const PACKAGE_VERSION = '0.2.3-alpha';
const PACKAGE_SLUG = 'transport-helper';
diff --git a/projects/packages/transport-helper/src/class-rest-controller.php b/projects/packages/transport-helper/src/class-rest-controller.php
index 0eda452a11547..9bdf49ebb4775 100644
--- a/projects/packages/transport-helper/src/class-rest-controller.php
+++ b/projects/packages/transport-helper/src/class-rest-controller.php
@@ -10,9 +10,9 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Transport_Helper\V0003;
+namespace Automattic\Jetpack\Transport_Helper\V0004;
-use Automattic\Jetpack\Backup\V0003\Helper_Script_Manager;
+use Automattic\Jetpack\Backup\V0004\Helper_Script_Manager;
use Automattic\Jetpack\Connection\Rest_Authentication;
use WP_Error;
use WP_REST_Request;
diff --git a/projects/packages/transport-helper/tests/php/test-rest-controller.php b/projects/packages/transport-helper/tests/php/test-rest-controller.php
index 56f32fbb29c57..0653706dd0e18 100644
--- a/projects/packages/transport-helper/tests/php/test-rest-controller.php
+++ b/projects/packages/transport-helper/tests/php/test-rest-controller.php
@@ -4,7 +4,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Transport_Helper\V0003;
+namespace Automattic\Jetpack\Transport_Helper\V0004;
use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentication;
use PHPUnit\Framework\TestCase;
@@ -63,7 +63,7 @@ public function set_up() {
wp_set_current_user( 0 );
// Register REST routes.
- add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0003\\REST_Controller', 'register_rest_routes' ) );
+ add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0004\\REST_Controller', 'register_rest_routes' ) );
do_action( 'rest_api_init' );
}
diff --git a/projects/plugins/backup/changelog/backup-change-log-label b/projects/plugins/backup/changelog/backup-change-log-label
new file mode 100644
index 0000000000000..abe37d7ec52e8
--- /dev/null
+++ b/projects/plugins/backup/changelog/backup-change-log-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Backup: change some error messages to not trigger security scanners
diff --git a/projects/plugins/backup/jetpack-backup.php b/projects/plugins/backup/jetpack-backup.php
index fde32d0e9e358..26d9f7aea0add 100644
--- a/projects/plugins/backup/jetpack-backup.php
+++ b/projects/plugins/backup/jetpack-backup.php
@@ -29,7 +29,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-use Automattic\Jetpack\Backup\V0003\Jetpack_Backup as My_Jetpack_Backup;
+use Automattic\Jetpack\Backup\V0004\Jetpack_Backup as My_Jetpack_Backup;
use Automattic\Jetpack\My_Jetpack\Initializer as My_Jetpack_Initializer;
if ( ! defined( 'ABSPATH' ) ) {
@@ -180,7 +180,7 @@ function ( $actions ) {
}
);
-register_deactivation_hook( __FILE__, array( 'Automattic\\Jetpack\\Backup\\V0003\\Jetpack_Backup', 'plugin_deactivation' ) );
+register_deactivation_hook( __FILE__, array( 'Automattic\\Jetpack\\Backup\\V0004\\Jetpack_Backup', 'plugin_deactivation' ) );
// Main plugin class.
My_Jetpack_Backup::initialize();
diff --git a/projects/plugins/jetpack/changelog/backup-change-log-label b/projects/plugins/jetpack/changelog/backup-change-log-label
new file mode 100644
index 0000000000000..97333b6658889
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/backup-change-log-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Backup: change some error messages to not trigger security scanners
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script-endpoint.php
index a8d33eb3564a4..420f0b4e4bced 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script-endpoint.php
@@ -6,7 +6,7 @@
* @package automattic/jetpack
*/
-use Automattic\Jetpack\Backup\V0003\Helper_Script_Manager;
+use Automattic\Jetpack\Backup\V0004\Helper_Script_Manager;
/**
* API endpoint /sites/%s/delete-backup-helper-script
diff --git a/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script-endpoint.php b/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script-endpoint.php
index fc519d1f0c612..2ec111fb63621 100644
--- a/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script-endpoint.php
+++ b/projects/plugins/jetpack/json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script-endpoint.php
@@ -6,7 +6,7 @@
* @package automattic/jetpack
*/
-use Automattic\Jetpack\Backup\V0003\Helper_Script_Manager;
+use Automattic\Jetpack\Backup\V0004\Helper_Script_Manager;
/**
* API endpoint /sites/%s/install-backup-helper-script
diff --git a/projects/plugins/jetpack/uninstall.php b/projects/plugins/jetpack/uninstall.php
index a39d6fe66bfaf..848bf6266f44d 100644
--- a/projects/plugins/jetpack/uninstall.php
+++ b/projects/plugins/jetpack/uninstall.php
@@ -5,7 +5,7 @@
* @package automattic/jetpack
*/
-use Automattic\Jetpack\Backup\V0003\Helper_Script_Manager;
+use Automattic\Jetpack\Backup\V0004\Helper_Script_Manager;
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\Sync\Sender;
diff --git a/projects/plugins/migration/changelog/backup-change-log-label b/projects/plugins/migration/changelog/backup-change-log-label
new file mode 100644
index 0000000000000..abe37d7ec52e8
--- /dev/null
+++ b/projects/plugins/migration/changelog/backup-change-log-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Backup: change some error messages to not trigger security scanners
diff --git a/projects/plugins/migration/src/class-wpcom-migration.php b/projects/plugins/migration/src/class-wpcom-migration.php
index 34c1bf216d2b8..035aec5f06e89 100644
--- a/projects/plugins/migration/src/class-wpcom-migration.php
+++ b/projects/plugins/migration/src/class-wpcom-migration.php
@@ -12,7 +12,7 @@
}
use Automattic\Jetpack\Assets;
-use Automattic\Jetpack\Backup\V0003\Jetpack_Backup;
+use Automattic\Jetpack\Backup\V0004\Jetpack_Backup;
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\Connection\Rest_Authentication as Connection_Rest_Authentication;
From 3c0198fad8ca4c33c3ead18f2d8263fce2fe9490 Mon Sep 17 00:00:00 2001
From: Christian Gastrell
Date: Thu, 21 Mar 2024 14:29:23 -0300
Subject: [PATCH 06/18] AI Assistant: promote post title when safe (#36500)
* use first heading as post title when safe
* improve list quick action prompt
---
.../add-ai-promote-post-title-when-safe | 4 ++++
.../components/ai-assistant-controls/index.tsx | 3 ++-
.../extensions/blocks/ai-assistant/edit.js | 16 +++++++++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 projects/plugins/jetpack/changelog/add-ai-promote-post-title-when-safe
diff --git a/projects/plugins/jetpack/changelog/add-ai-promote-post-title-when-safe b/projects/plugins/jetpack/changelog/add-ai-promote-post-title-when-safe
new file mode 100644
index 0000000000000..afe5308ca38dc
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/add-ai-promote-post-title-when-safe
@@ -0,0 +1,4 @@
+Significance: minor
+Type: enhancement
+
+Jetpack AI: when response includes a title and post title is empty, use provided title as post title
diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx b/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx
index 5f04896e9348d..2879b7f7cb650 100644
--- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx
+++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx
@@ -98,7 +98,8 @@ const quickActionsList = {
aiSuggestion: PROMPT_TYPE_USER_PROMPT,
icon: post,
options: {
- userPrompt: 'Write a post based on the list items. Try to use a heading for each entry',
+ userPrompt:
+ 'Write a post based on the list items. Include a title as first order heading and try to use secondary headings for each entry',
},
},
],
diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/edit.js b/projects/plugins/jetpack/extensions/blocks/ai-assistant/edit.js
index e4eb508dba50a..6c38aefd1a0bb 100644
--- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/edit.js
+++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/edit.js
@@ -338,11 +338,25 @@ export default function AIAssistantEdit( { attributes, setAttributes, clientId,
* - Get HTML code from markdown content
* - Create blocks from HTML code
*/
- const HTML = markdownConverter
+ let HTML = markdownConverter
.render( attributes.content || '' )
// Fix list indentation
.replace( /
- { __(
- 'Add an extra layer of security to your website by enabling WordPress.com login and secure authentication. If you have multiple sites with this option enabled, you will be able to log in to every one of them with the same credentials.',
- 'jetpack'
- ) }
-
-
-
- { this.props.getModule( 'sso' ).description }
-
-
-
-
-
+ { __(
+ 'Add an extra layer of security to your website by enabling WordPress.com login and secure authentication. If you have multiple sites with this option enabled, you will be able to log in to every one of them with the same credentials.',
'jetpack'
) }
- />
-
-
+
{ __( "Optimize your website's performance", 'jetpack-boost' ) }
+
+ { __( "Optimize your website's performance on the go", 'jetpack-boost' ) }
+
{ __(
- 'Automatically regenerate critical CSS after site changes, and hunt down image issues with ease.',
+ 'Unlock the full potential of Jetpack Boost with automated performance optimization tools and more.',
'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' ) }
+ { createInterpolateElement(
+ __(
+ "Automated Critical CSS Generation: Improve your site's load time. Say goodbye to manual tweaks and boost your speed scores with zero effort.",
+ 'jetpack-boost'
+ ),
+ {
+ strong: ,
+ }
+ ) }
- { __( 'Fine-tune your CDN images with customizable quality settings.', 'jetpack-boost' ) }
+ { createInterpolateElement(
+ __(
+ 'Automated Image Scanning: Always be on top of potential image size issues that might impact your site load time and SEO ranking.',
+ 'jetpack-boost'
+ ),
+ {
+ strong: ,
+ }
+ ) }
+
+
+ { createInterpolateElement(
+ __(
+ 'In-depth Performance Insights: Track your success with historical performance and Core Web Vitals scores to see how your site improves over time.',
+ 'jetpack-boost'
+ ),
+ {
+ strong: ,
+ }
+ ) }
+
+
+ { createInterpolateElement(
+ __(
+ 'Customizable Image Optimization: Control your image quality and loading speeds with customizable CDN settings, balancing aesthetics with efficiency.',
+ 'jetpack-boost'
+ ),
+ {
+ strong: ,
+ }
+ ) }
+
+
+ { createInterpolateElement(
+ __(
+ 'Expert Support With a Personal Touch: Enjoy dedicated email support from our Happiness Engineers, ensuring a smoother experience and peace of mind.',
+ 'jetpack-boost'
+ ),
+ {
+ strong: ,
+ }
+ ) }
);
diff --git a/projects/plugins/boost/changelog/update-activation-upgrade-screens-copy b/projects/plugins/boost/changelog/update-activation-upgrade-screens-copy
new file mode 100644
index 0000000000000..91bb809ad14c7
--- /dev/null
+++ b/projects/plugins/boost/changelog/update-activation-upgrade-screens-copy
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Update getting started and upgrade copies.
From cccb93c1bbde68f8d6f5d60681bb0dd572227a50 Mon Sep 17 00:00:00 2001
From: Emanuele Buccelli
Date: Fri, 22 Mar 2024 05:14:13 +0100
Subject: [PATCH 12/18] User management: Add a checkbox for stating if the user
is a contractor (#36479)
Co-authored-by: Anthony Grullon
---
.../changelog/update-user-new-contractor | 4 +
.../sso/class.jetpack-sso-user-admin.php | 76 +++++++++++++++++++
.../sso/jetpack-sso-admin-create-user.js | 13 +++-
3 files changed, 92 insertions(+), 1 deletion(-)
create mode 100644 projects/plugins/jetpack/changelog/update-user-new-contractor
diff --git a/projects/plugins/jetpack/changelog/update-user-new-contractor b/projects/plugins/jetpack/changelog/update-user-new-contractor
new file mode 100644
index 0000000000000..617b31c504284
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-user-new-contractor
@@ -0,0 +1,4 @@
+Significance: minor
+Type: other
+
+Added the possibility of stating if a new invited user is a contractor.
diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php
index ce0149a485de3..7224fb10b351f 100644
--- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php
+++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php
@@ -41,6 +41,7 @@ public function __construct() {
add_filter( 'wp_send_new_user_notification_to_user', array( $this, 'should_send_wp_mail_new_user' ) );
add_action( 'user_new_form', array( $this, 'render_invitation_email_message' ) );
add_action( 'user_new_form', array( $this, 'render_wpcom_invite_checkbox' ), 1 );
+ add_action( 'user_new_form', array( $this, 'render_wpcom_external_user_checkbox' ), 1 );
add_action( 'user_new_form', array( $this, 'render_custom_email_message_form_field' ), 1 );
add_action( 'delete_user_form', array( $this, 'render_invitations_notices_for_deleted_users' ) );
add_action( 'delete_user', array( $this, 'revoke_user_invite' ) );
@@ -125,6 +126,12 @@ public function revoke_user_invite( $user_id ) {
}
return $response;
+ } else {
+ // Delete external contributor if it exists.
+ $wpcom_user_data = Jetpack::connection()->get_connected_user_data( $user_id );
+ if ( isset( $wpcom_user_data['ID'] ) ) {
+ return self::delete_external_contributor( $wpcom_user_data['ID'] );
+ }
}
} catch ( Exception $e ) {
return false;
@@ -695,6 +702,40 @@ public function render_wpcom_invite_checkbox( $type ) {
}
}
+ /**
+ * Render a checkbox to differentiate if a user is external.
+ *
+ * @param string $type The type of new user form the hook follows.
+ */
+ public function render_wpcom_external_user_checkbox( $type ) {
+ if ( $type === 'add-new-user' ) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 'POST',
+ ),
+ array(
+ 'user_id' => $user_id,
+ ),
+ 'wpcom'
+ );
+
+ if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
+ return false;
+ }
+
+ return true;
+ }
+
/**
* Show Jetpack SSO user connection status.
*
diff --git a/projects/plugins/jetpack/modules/sso/jetpack-sso-admin-create-user.js b/projects/plugins/jetpack/modules/sso/jetpack-sso-admin-create-user.js
index 458dca1a9a885..a6728fc2d31a8 100644
--- a/projects/plugins/jetpack/modules/sso/jetpack-sso-admin-create-user.js
+++ b/projects/plugins/jetpack/modules/sso/jetpack-sso-admin-create-user.js
@@ -1,13 +1,19 @@
jQuery( document ).ready( function ( $ ) {
var sendUserNotificationCheckbox = $( '#send_user_notification' );
+ var userExternalContractorCheckbox = $( '#user_external_contractor' );
var inviteUserWpcomCheckbox = $( '#invite_user_wpcom' );
- if ( inviteUserWpcomCheckbox && sendUserNotificationCheckbox ) {
+ if ( inviteUserWpcomCheckbox && sendUserNotificationCheckbox && userExternalContractorCheckbox ) {
// Toggle Send User Notification checkbox enabled/disabled based on Invite User checkbox
+ // Enable External Contractor checkbox if Invite User checkbox is checked
inviteUserWpcomCheckbox.on( 'change', function () {
sendUserNotificationCheckbox.prop( 'disabled', inviteUserWpcomCheckbox.prop( 'checked' ) );
if ( inviteUserWpcomCheckbox.prop( 'checked' ) ) {
sendUserNotificationCheckbox.prop( 'checked', false );
+ userExternalContractorCheckbox.prop( 'disabled', false );
+ } else {
+ userExternalContractorCheckbox.prop( 'disabled', true );
+ userExternalContractorCheckbox.prop( 'checked', false );
}
} );
@@ -16,5 +22,10 @@ jQuery( document ).ready( function ( $ ) {
sendUserNotificationCheckbox.prop( 'disabled', true );
sendUserNotificationCheckbox.prop( 'checked', false );
}
+
+ // On load, disable External Contractor checkbox if Invite User checkbox is unchecked
+ if ( ! inviteUserWpcomCheckbox.prop( 'checked' ) ) {
+ userExternalContractorCheckbox.prop( 'disabled', true );
+ }
}
} );
From 11b2a22cb5f378000689a6318fdb39347c2d11d0 Mon Sep 17 00:00:00 2001
From: Brandon Kraft
Date: Fri, 22 Mar 2024 04:47:04 -0500
Subject: [PATCH 13/18] Enhanced Distribution: begin deprecation (#36168)
* Enhanced Distribution: begin deprecation
* Remove from module list
* Move Reader hooks to 3rd-party
* Update version
* Remove mention in My Jetpack
* Update projects/plugins/jetpack/modules/enhanced-distribution.php
Co-authored-by: Jeremy Herve
* Remove additional reference to a JP Dash test
* Remove from array of modules that lack UI
* Update RSS feed addition hooks
* Ver bumps
* Ensure Reader utilities load on most recent RSS feeds
See https://github.com/Automattic/jetpack/pull/36168#issuecomment-2004421624
* Simplify output of each function
* Remove redundant casting
---------
Co-authored-by: Jeremy Herve
---
.../my-jetpack/changelog/remove-enhdist | 4 +
.../my-jetpack/src/products/class-creator.php | 14 ----
.../plugins/jetpack/3rd-party/3rd-party.php | 3 +
.../jetpack/3rd-party/wpcom-reader.php | 66 +++++++++++++++
.../settings-card/test/component.js | 1 -
.../settings-group/test/component.js | 1 -
.../_inc/client/searchable-modules/index.jsx | 2 +-
.../plugins/jetpack/changelog/remove-enhdist | 4 +
projects/plugins/jetpack/class.jetpack.php | 11 +--
.../jetpack/modules/enhanced-distribution.php | 80 ++-----------------
.../plugins/jetpack/modules/module-info.php | 20 -----
projects/plugins/jetpack/readme.txt | 1 -
.../jetpack/tests/php/test-get-modules.php | 1 -
tools/e2e-commons/helpers/plan-helper.js | 1 -
14 files changed, 89 insertions(+), 120 deletions(-)
create mode 100644 projects/packages/my-jetpack/changelog/remove-enhdist
create mode 100644 projects/plugins/jetpack/3rd-party/wpcom-reader.php
create mode 100644 projects/plugins/jetpack/changelog/remove-enhdist
diff --git a/projects/packages/my-jetpack/changelog/remove-enhdist b/projects/packages/my-jetpack/changelog/remove-enhdist
new file mode 100644
index 0000000000000..f8e9f8d513519
--- /dev/null
+++ b/projects/packages/my-jetpack/changelog/remove-enhdist
@@ -0,0 +1,4 @@
+Significance: patch
+Type: removed
+
+Removed reference to Creator Network, which is being deprecated.
diff --git a/projects/packages/my-jetpack/src/products/class-creator.php b/projects/packages/my-jetpack/src/products/class-creator.php
index 44259932713db..2d54bfbb9ba27 100644
--- a/projects/packages/my-jetpack/src/products/class-creator.php
+++ b/projects/packages/my-jetpack/src/products/class-creator.php
@@ -156,20 +156,6 @@ public static function get_features_by_tier() {
),
),
),
- array(
- 'name' => __( 'Creator network', 'jetpack-my-jetpack' ),
- 'info' => array(
- 'content' => __(
- '
The creator network is the network of websites either hosted with WordPress.com or self-hosted and connected with Jetpack.
-
Sites that are part of the creator network can gain exposure to new readers. Sites on the Creator plan have enhanced distribution to more areas of the Reader.
',
- 'jetpack-my-jetpack'
- ),
- ),
- 'tiers' => array(
- self::FREE_TIER_SLUG => array( 'included' => true ),
- self::UPGRADED_TIER_SLUG => array( 'included' => true ),
- ),
- ),
array(
'name' => __( 'Jetpack Blocks', 'jetpack-my-jetpack' ),
'info' => array(
diff --git a/projects/plugins/jetpack/3rd-party/3rd-party.php b/projects/plugins/jetpack/3rd-party/3rd-party.php
index 36f4ad2f6465a..281b25c3dca0e 100644
--- a/projects/plugins/jetpack/3rd-party/3rd-party.php
+++ b/projects/plugins/jetpack/3rd-party/3rd-party.php
@@ -90,6 +90,9 @@ function load_3rd_party_compat_filters() {
require_once JETPACK__PLUGIN_DIR . '/3rd-party/atomic.php';
}
+ // WordPress.com Reader
+ require_once JETPACK__PLUGIN_DIR . '/3rd-party/wpcom-reader.php';
+
// WPML
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
require_once JETPACK__PLUGIN_DIR . '/3rd-party/wpml.php';
diff --git a/projects/plugins/jetpack/3rd-party/wpcom-reader.php b/projects/plugins/jetpack/3rd-party/wpcom-reader.php
new file mode 100644
index 0000000000000..e01fd781978f0
--- /dev/null
+++ b/projects/plugins/jetpack/3rd-party/wpcom-reader.php
@@ -0,0 +1,66 @@
+is_wpcom_simple()
+ || (
+ ( new Connection_Manager() )->is_connected()
+ && ! ( new Status() )->is_offline_mode()
+ )
+ ) {
+ $blog_id = Connection_Manager::get_site_id( true ); // Silence since we're not wanting to handle the error state.
+ if ( ! $blog_id ) {
+ return;
+ }
+
+ printf(
+ '%d',
+ (int) $blog_id
+ );
+ }
+}
+
+/**
+ * Output feed item identifier based on current post ID.
+ *
+ * @return void
+ */
+function jetpack_wpcomreader_post_id() {
+ $id = get_the_ID();
+ if ( ! $id ) {
+ return;
+ }
+
+ printf(
+ '%d',
+ (int) $id
+ );
+}
diff --git a/projects/plugins/jetpack/_inc/client/components/settings-card/test/component.js b/projects/plugins/jetpack/_inc/client/components/settings-card/test/component.js
index 4872bb8ff55db..97a19d5ddb783 100644
--- a/projects/plugins/jetpack/_inc/client/components/settings-card/test/component.js
+++ b/projects/plugins/jetpack/_inc/client/components/settings-card/test/component.js
@@ -59,7 +59,6 @@ describe( 'SettingsCard', () => {
'notes',
'subscriptions',
'protect',
- 'enhanced-distribution',
'comments',
'json-api',
'photon',
diff --git a/projects/plugins/jetpack/_inc/client/components/settings-group/test/component.js b/projects/plugins/jetpack/_inc/client/components/settings-group/test/component.js
index 4e5f7129b1818..368959bd5c180 100644
--- a/projects/plugins/jetpack/_inc/client/components/settings-group/test/component.js
+++ b/projects/plugins/jetpack/_inc/client/components/settings-group/test/component.js
@@ -35,7 +35,6 @@ describe( 'SettingsGroup', () => {
'notes',
'subscriptions',
'protect',
- 'enhanced-distribution',
'comments',
'json-api',
'photon',
diff --git a/projects/plugins/jetpack/_inc/client/searchable-modules/index.jsx b/projects/plugins/jetpack/_inc/client/searchable-modules/index.jsx
index 6ea2e8dce88e7..69ac65264db73 100644
--- a/projects/plugins/jetpack/_inc/client/searchable-modules/index.jsx
+++ b/projects/plugins/jetpack/_inc/client/searchable-modules/index.jsx
@@ -36,7 +36,7 @@ export const SearchableModules = withModuleSettingsFormHelpers(
}
// Only should be features that don't already have a UI, and we want to reveal in search.
- const safelist = [ 'contact-form', 'enhanced-distribution', 'json-api', 'notes' ];
+ const safelist = [ 'contact-form', 'json-api', 'notes' ];
const allModules = this.props.modules,
results = [];
diff --git a/projects/plugins/jetpack/changelog/remove-enhdist b/projects/plugins/jetpack/changelog/remove-enhdist
new file mode 100644
index 0000000000000..764c87c21fbbe
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/remove-enhdist
@@ -0,0 +1,4 @@
+Significance: minor
+Type: bugfix
+
+Enhanced Distribution: begin deprecation process as the Firehose is winding down
diff --git a/projects/plugins/jetpack/class.jetpack.php b/projects/plugins/jetpack/class.jetpack.php
index 74adcd78ba48c..62b0da71bc615 100644
--- a/projects/plugins/jetpack/class.jetpack.php
+++ b/projects/plugins/jetpack/class.jetpack.php
@@ -2289,11 +2289,12 @@ public static function get_default_modules( $min_version = false, $max_version =
*/
public function handle_deprecated_modules( $modules ) {
$deprecated_modules = array(
- 'debug' => null, // Closed out and moved to the debugger library.
- 'wpcc' => 'sso', // Closed out in 2.6 -- SSO provides the same functionality.
- 'gplus-authorship' => null, // Closed out in 3.2 -- Google dropped support.
- 'minileven' => null, // Closed out in 8.3 -- Responsive themes are common now, and so is AMP.
- 'lazy-images' => null, // Closed out in 12.8 -- WordPress core now has native lazy loading.
+ 'debug' => null, // Closed out and moved to the debugger library.
+ 'wpcc' => 'sso', // Closed out in 2.6 -- SSO provides the same functionality.
+ 'gplus-authorship' => null, // Closed out in 3.2 -- Google dropped support.
+ 'minileven' => null, // Closed out in 8.3 -- Responsive themes are common now, and so is AMP.
+ 'lazy-images' => null, // Closed out in 12.8 -- WordPress core now has native lazy loading.
+ 'enhanced-distribution' => null, // Closed out in 13.3 -- WP.com is winding down the firehose.
);
// Don't activate SSO if they never completed activating WPCC.
diff --git a/projects/plugins/jetpack/modules/enhanced-distribution.php b/projects/plugins/jetpack/modules/enhanced-distribution.php
index 58c4a331556de..9552b31e3ab0a 100644
--- a/projects/plugins/jetpack/modules/enhanced-distribution.php
+++ b/projects/plugins/jetpack/modules/enhanced-distribution.php
@@ -1,81 +1,11 @@
=' ) ) {
- return;
- }
-
- Jetpack::check_privacy( __FILE__ );
-}
-
-add_action( 'jetpack_before_activate_default_modules', 'jetpack_enhanced_distribution_before_activate_default_modules' );
-
-if ( isset( $_GET['get_freshly_pressed_data'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
- /**
- * If a request has ?get_freshly_pressed_data=true appended
- * to the end, then let's provide the necessary data back via JSON.
- */
- function jetpack_get_freshly_pressed_data() {
- if ( is_single() ) {
- wp_send_json_success(
- array(
- 'blog_id' => Jetpack_Options::get_option( 'id' ),
- 'post_id' => get_the_ID(),
- )
- );
- } else {
- wp_send_json_error(
- array(
- 'message' => 'Not Singular',
- )
- );
- }
- }
- add_action( 'template_redirect', 'jetpack_get_freshly_pressed_data' );
-}
-
-add_action( 'rss_head', 'jetpack_enhanced_distribution_feed_id' );
-add_action( 'rss_item', 'jetpack_enhanced_distribution_post_id' );
-add_action( 'rss2_head', 'jetpack_enhanced_distribution_feed_id' );
-add_action( 'rss2_item', 'jetpack_enhanced_distribution_post_id' );
-
-/**
- * Output feed identifier based on blog ID.
- */
-function jetpack_enhanced_distribution_feed_id() {
- $id = (int) Jetpack_Options::get_option( 'id' );
- if ( $id > 0 ) {
- $output = sprintf( '%d', $id );
- echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- }
-}
-
-/**
- * Output feed item identifier based on current post ID.
- */
-function jetpack_enhanced_distribution_post_id() {
- $id = (int) get_the_ID();
- if ( $id ) {
- $output = sprintf( '%d', $id );
- echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- }
-}
+_deprecated_file( basename( __FILE__ ), 'jetpack-$$next-version$$' );
+// Silence is golden. Left here to ensure no fatals on some seemingly misconfigured opcache setups.
diff --git a/projects/plugins/jetpack/modules/module-info.php b/projects/plugins/jetpack/modules/module-info.php
index dfca5da8b0993..ad2593daa0f54 100644
--- a/projects/plugins/jetpack/modules/module-info.php
+++ b/projects/plugins/jetpack/modules/module-info.php
@@ -240,26 +240,6 @@ function jetpack_subscriptions_more_info() {
}
add_action( 'jetpack_module_more_info_subscriptions', 'jetpack_subscriptions_more_info' );
-/**
- * Enhanced Distribution support link.
- */
-function jetpack_enhanced_distribution_more_link() {
- echo esc_url( Redirect::get_url( 'jetpack-support-enhanced-distribution' ) );
-}
-add_action( 'jetpack_learn_more_button_enhanced-distribution', 'jetpack_enhanced_distribution_more_link' );
-
-/**
- * Enhanced Distribution description.
- */
-function jetpack_enhanced_distribution_more_info() {
- esc_html_e(
- 'Jetpack will automatically take your great published content and share it instantly with third-party services
- like search engines, increasing your reach and traffic.',
- 'jetpack'
- );
-}
-add_action( 'jetpack_module_more_info_enhanced-distribution', 'jetpack_enhanced_distribution_more_info' );
-
/**
* Protect support link.
*/
diff --git a/projects/plugins/jetpack/readme.txt b/projects/plugins/jetpack/readme.txt
index a7847d44e9f60..bf8404dd9d4b2 100644
--- a/projects/plugins/jetpack/readme.txt
+++ b/projects/plugins/jetpack/readme.txt
@@ -216,7 +216,6 @@ Jetpack is the ultimate toolkit for WP for both the classic editor and the block
* Custom CSS — Customize the appearance of your theme without creating a child theme or worrying about updates overwriting your customizations.
* Custom Content Types — Adds custom post types (CPTs) to your site.
* Downtime Monitor — Alerts you via electronic mail if your site goes down to ensure you keep uptime.
-* Enhanced Distribution — Increase your reach by allowing your content to be included in the WordPress.com “firehose” of public blog content.
* Extra Sidebar Widgets — Extra widgets you can add to your blog, including RSS Links and Facebook Like Boxes.
* Gravatar Hovercards — Make your Gravatar profile visible to those viewing your blog.
* Google Analytics (GA) — Track your WordPress site statistics thanks to Google Analytics.
diff --git a/projects/plugins/jetpack/tests/php/test-get-modules.php b/projects/plugins/jetpack/tests/php/test-get-modules.php
index b782c6dfbc7bd..995a7eb534630 100644
--- a/projects/plugins/jetpack/tests/php/test-get-modules.php
+++ b/projects/plugins/jetpack/tests/php/test-get-modules.php
@@ -39,7 +39,6 @@ public function test_get_available_modules() {
'copy-post',
'custom-content-types',
'custom-css',
- 'enhanced-distribution',
'google-analytics',
'gravatar-hovercards',
'infinite-scroll',
diff --git a/tools/e2e-commons/helpers/plan-helper.js b/tools/e2e-commons/helpers/plan-helper.js
index 780a5ec9b66ad..17c9b91f3094e 100644
--- a/tools/e2e-commons/helpers/plan-helper.js
+++ b/tools/e2e-commons/helpers/plan-helper.js
@@ -171,7 +171,6 @@ function getPlanData(
'contact-form',
'custom-content-types',
'custom-css',
- 'enhanced-distribution',
'gravatar-hovercards',
'json-api',
'latex',
From 7c6900f187b33d0218ae28e9ccc20d7afd64a40c Mon Sep 17 00:00:00 2001
From: arthur791004
Date: Fri, 22 Mar 2024 18:32:01 +0800
Subject: [PATCH 14/18] Block Patterns: Fix the starter patterns modal isn't
shown on a new post (#36516)
* Block Patterns: Fix the modal of the starter patterns isn't shown owhen you're creating a new post
* changelog
---
.../fix-start-page-options-modal-for-new-post | 4 ++++
.../class-wpcom-block-patterns-from-api.php | 10 ++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post b/projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post
new file mode 100644
index 0000000000000..295f1c4e6792a
--- /dev/null
+++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Block Patterns: The modal of the starter patterns isn't shown when you're creating a new post
diff --git a/projects/packages/jetpack-mu-wpcom/src/features/block-patterns/class-wpcom-block-patterns-from-api.php b/projects/packages/jetpack-mu-wpcom/src/features/block-patterns/class-wpcom-block-patterns-from-api.php
index 1e124fb6ba62d..889ff87cbd5ef 100644
--- a/projects/packages/jetpack-mu-wpcom/src/features/block-patterns/class-wpcom-block-patterns-from-api.php
+++ b/projects/packages/jetpack-mu-wpcom/src/features/block-patterns/class-wpcom-block-patterns-from-api.php
@@ -139,7 +139,12 @@ function ( $a, $b ) {
}
}
- $this->update_pattern_block_types();
+ // We prefer to show the starter page patterns modal of wpcom instead of core
+ // if it's available. Hence, we have to update the block types of patterns
+ // to disable the core's.
+ if ( class_exists( '\A8C\FSE\Starter_Page_Templates' ) ) {
+ $this->update_pattern_block_types();
+ }
// Temporarily removing the call to `update_pattern_post_types` while we investigate
// https://github.com/Automattic/wp-calypso/issues/79145.
@@ -280,7 +285,8 @@ private function update_pattern_block_types() {
}
$post_content_offset = array_search( 'core/post-content', $pattern['blockTypes'], true );
- if ( $post_content_offset !== false ) {
+ $is_page_pattern = empty( $pattern['postTypes'] ) || in_array( 'page', $pattern['postTypes'], true );
+ if ( $post_content_offset !== false && $is_page_pattern ) {
unregister_block_pattern( $pattern['name'] );
array_splice( $pattern['blockTypes'], $post_content_offset, 1 );
From 3bb70fef874b6016a74bd0bc9d898b480c54b7d5 Mon Sep 17 00:00:00 2001
From: Tim Broddin
Date: Fri, 22 Mar 2024 12:29:07 +0100
Subject: [PATCH 15/18] Plugin update manager: transfers the status when
editing a schedule (#36521)
* Transfer status when updating schedule
* Transfer status when updating schedule
* Account for null
* Account for null
* Bump version
---
.../fix-plugin-update-mgr-edit-status | 4 ++
.../src/class-scheduled-updates.php | 2 +-
...-rest-api-v2-endpoint-update-schedules.php | 11 ++++-
...-api-v2-endpoint-update-schedules-test.php | 49 +++++++++++++++++++
4 files changed, 64 insertions(+), 2 deletions(-)
create mode 100644 projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status
diff --git a/projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status b/projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status
new file mode 100644
index 0000000000000..a156a2e74fd89
--- /dev/null
+++ b/projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Transfer status when editing a schedule.
diff --git a/projects/packages/scheduled-updates/src/class-scheduled-updates.php b/projects/packages/scheduled-updates/src/class-scheduled-updates.php
index bbefd19c82003..cfd1e8147ab3c 100644
--- a/projects/packages/scheduled-updates/src/class-scheduled-updates.php
+++ b/projects/packages/scheduled-updates/src/class-scheduled-updates.php
@@ -20,7 +20,7 @@ class Scheduled_Updates {
*
* @var string
*/
- const PACKAGE_VERSION = '0.5.0';
+ const PACKAGE_VERSION = '0.5.1-alpha';
/**
* The cron event hook for the scheduled plugins update.
*
diff --git a/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php b/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php
index 79bdcf846af17..286d9b12eaba6 100644
--- a/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php
+++ b/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php
@@ -331,12 +331,21 @@ public function update_item( $request ) {
return $result;
}
+ $previous_schedule_status = Scheduled_Updates::get_scheduled_update_status( $request['schedule_id'] );
+
$deleted = $this->delete_item( $request );
if ( is_wp_error( $deleted ) ) {
return $deleted;
}
- return $this->create_item( $request );
+ $item = $this->create_item( $request );
+
+ // Sets the previous status
+ if ( $previous_schedule_status ) {
+ Scheduled_Updates::set_scheduled_update_status( $item->data, $previous_schedule_status['last_run_timestamp'], $previous_schedule_status['last_run_status'] );
+ }
+
+ return $item;
}
/**
diff --git a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php
index efc0968a9ac87..d701555870574 100644
--- a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php
+++ b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php
@@ -563,6 +563,55 @@ public function test_update_item() {
$this->assertSame( $schedule_id, $result->get_data() );
}
+ /**
+ * Test update item.
+ *
+ * @covers ::update_item
+ */
+ public function test_update_item_with_status() {
+ $plugins = array(
+ 'custom-plugin/custom-plugin.php',
+ 'gutenberg/gutenberg.php',
+ );
+ $timestamp = strtotime( 'last Monday 8:00' );
+ $status = 'success';
+
+ $schedule_id = Scheduled_Updates::generate_schedule_id( $plugins );
+
+ wp_schedule_event( strtotime( 'next Monday 8:00' ), 'weekly', Scheduled_Updates::PLUGIN_CRON_HOOK, $plugins );
+
+ Scheduled_Updates::set_scheduled_update_status( $schedule_id, $timestamp, $status );
+
+ $request = new WP_REST_Request( 'PUT', '/wpcom/v2/update-schedules/' . $schedule_id );
+ $request->set_body_params(
+ array(
+ 'plugins' => $plugins,
+ 'schedule' => array(
+ 'timestamp' => strtotime( 'next Tuesday 9:00' ),
+ 'interval' => 'daily',
+ ),
+ )
+ );
+
+ // Successful request.
+ wp_set_current_user( $this->admin_id );
+ $result = rest_do_request( $request );
+
+ $this->assertSame( 200, $result->get_status() );
+ $schedule_id = $result->get_data();
+
+ // Get the updated status
+ $updated_status = Scheduled_Updates::get_scheduled_update_status( $schedule_id );
+ if ( $updated_status === null ) {
+ $this->fail( 'Scheduled_Updates::get_scheduled_update_status() returned null.' );
+ } else {
+ $this->assertIsArray( $updated_status, 'Scheduled_Updates::get_scheduled_update_status() should return an array.' );
+ // doing these null checks for the static analyzer
+ $this->assertSame( $timestamp, $updated_status['last_run_timestamp'] ?? null );
+ $this->assertSame( $status, $updated_status['last_run_status'] ?? null );
+ }
+ }
+
/**
* Test update_item with invalid schedule ID.
*
From ae42cc84baa682d2a40a19fd7caa709788466233 Mon Sep 17 00:00:00 2001
From: Jeremy Herve
Date: Fri, 22 Mar 2024 14:01:04 +0100
Subject: [PATCH 16/18] Boost: fix typo in tooltip string. (#36520)
---
.../boost-card/use-boost-tooltip-copy.ts | 4 ++--
.../packages/my-jetpack/changelog/update-boost-strings-css | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
create mode 100644 projects/packages/my-jetpack/changelog/update-boost-strings-css
diff --git a/projects/packages/my-jetpack/_inc/components/product-cards-section/boost-card/use-boost-tooltip-copy.ts b/projects/packages/my-jetpack/_inc/components/product-cards-section/boost-card/use-boost-tooltip-copy.ts
index f19cfbc47b7e2..c28cbf7b1f35d 100644
--- a/projects/packages/my-jetpack/_inc/components/product-cards-section/boost-card/use-boost-tooltip-copy.ts
+++ b/projects/packages/my-jetpack/_inc/components/product-cards-section/boost-card/use-boost-tooltip-copy.ts
@@ -37,12 +37,12 @@ export const useBoostTooltipCopy = ( { speedLetterGrade } ): string => {
switch ( speedLetterGrade ) {
case 'A':
return __(
- 'Your site is fast! But maintaining a high speed isn’t easy. Upgrade Boost to use automated CCS and image optimization tools to improve your performance on the go.',
+ 'Your site is fast! But maintaining a high speed isn’t easy. Upgrade Boost to use automated CSS and image optimization tools to improve your performance on the go.',
'jetpack-my-jetpack'
);
case 'B':
return __(
- 'You are one step away from making your site blazing fast. Upgrade Boost to use automated CCS and image optimization tools to improve your performance.',
+ 'You are one step away from making your site blazing fast. Upgrade Boost to use automated CSS and image optimization tools to improve your performance.',
'jetpack-my-jetpack'
);
default:
diff --git a/projects/packages/my-jetpack/changelog/update-boost-strings-css b/projects/packages/my-jetpack/changelog/update-boost-strings-css
new file mode 100644
index 0000000000000..eabcc70518a44
--- /dev/null
+++ b/projects/packages/my-jetpack/changelog/update-boost-strings-css
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Boost tooltips: fix typo in string.
From 5eaab12859863a11252f5b8f7449de87e16be3fd Mon Sep 17 00:00:00 2001
From: Konstantin Obenland
Date: Fri, 22 Mar 2024 14:11:59 +0100
Subject: [PATCH 17/18] Scheduled Updates: Fix off-by-one error for Sunday
schedules (#36524)
* Scheduled Updates: Fix off-by-one error for Sunday schedules
* Fix automated tools feedback
* Add unit test.
* Looks like data providers need to be public
* Update get_scheduled_update_text to use wp_date
* Use new wp_date for improved compat
Props @TimBroddin
---------
Co-authored-by: Tim Broddin
---
.../changelog/fix-day-of-week | 4 ++
.../src/class-scheduled-updates.php | 22 +++----
.../php/class-scheduled-updates-test.php | 64 ++++++++++++++++---
3 files changed, 69 insertions(+), 21 deletions(-)
create mode 100644 projects/packages/scheduled-updates/changelog/fix-day-of-week
diff --git a/projects/packages/scheduled-updates/changelog/fix-day-of-week b/projects/packages/scheduled-updates/changelog/fix-day-of-week
new file mode 100644
index 0000000000000..7b15b591fb4db
--- /dev/null
+++ b/projects/packages/scheduled-updates/changelog/fix-day-of-week
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Fixed a bug where the weekday index was not properly accounted for in list of weekdays.
diff --git a/projects/packages/scheduled-updates/src/class-scheduled-updates.php b/projects/packages/scheduled-updates/src/class-scheduled-updates.php
index cfd1e8147ab3c..8dd1076299bc6 100644
--- a/projects/packages/scheduled-updates/src/class-scheduled-updates.php
+++ b/projects/packages/scheduled-updates/src/class-scheduled-updates.php
@@ -221,30 +221,30 @@ public static function get_scheduled_update_text( $schedule ) {
$html = sprintf(
/* translators: %s is the time of day. Daily at 10 am. */
esc_html__( 'Daily at %s.', 'jetpack-scheduled-updates' ),
- get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $schedule->timestamp ), get_option( 'time_format' ) )
+ wp_date( get_option( 'time_format' ), $schedule->timestamp )
);
} else {
// Not getting smart about passing in weekdays makes it easier to translate.
$weekdays = array(
- /* translators: %s is the time of day. Sundays at 10 am. */
- __( 'Sundays at %s.', 'jetpack-scheduled-updates' ),
/* translators: %s is the time of day. Mondays at 10 am. */
- __( 'Mondays at %s.', 'jetpack-scheduled-updates' ),
+ 1 => __( 'Mondays at %s.', 'jetpack-scheduled-updates' ),
/* translators: %s is the time of day. Tuesdays at 10 am. */
- __( 'Tuesdays at %s.', 'jetpack-scheduled-updates' ),
+ 2 => __( 'Tuesdays at %s.', 'jetpack-scheduled-updates' ),
/* translators: %s is the time of day. Wednesdays at 10 am. */
- __( 'Wednesdays at %s.', 'jetpack-scheduled-updates' ),
+ 3 => __( 'Wednesdays at %s.', 'jetpack-scheduled-updates' ),
/* translators: %s is the time of day. Thursdays at 10 am. */
- __( 'Thursdays at %s.', 'jetpack-scheduled-updates' ),
+ 4 => __( 'Thursdays at %s.', 'jetpack-scheduled-updates' ),
/* translators: %s is the time of day. Fridays at 10 am. */
- __( 'Fridays at %s.', 'jetpack-scheduled-updates' ),
+ 5 => __( 'Fridays at %s.', 'jetpack-scheduled-updates' ),
/* translators: %s is the time of day. Saturdays at 10 am. */
- __( 'Saturdays at %s.', 'jetpack-scheduled-updates' ),
+ 6 => __( 'Saturdays at %s.', 'jetpack-scheduled-updates' ),
+ /* translators: %s is the time of day. Sundays at 10 am. */
+ 7 => __( 'Sundays at %s.', 'jetpack-scheduled-updates' ),
);
$html = sprintf(
- $weekdays[ date_i18n( 'N', $schedule->timestamp ) ],
- get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $schedule->timestamp ), get_option( 'time_format' ) )
+ $weekdays[ wp_date( 'N', $schedule->timestamp ) ],
+ wp_date( get_option( 'time_format' ), $schedule->timestamp )
);
}
diff --git a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php
index 8bae36af10326..ced9d0f49c857 100644
--- a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php
+++ b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php
@@ -63,7 +63,7 @@ protected function set_up() {
// Ensure plugin directory exists.
$this->wp_filesystem->mkdir( $this->plugin_dir );
- // init the hook
+ // Init the hook.
add_action( 'rest_api_init', array( 'Automattic\Jetpack\Scheduled_Updates', 'add_is_managed_extension_field' ) );
do_action( 'rest_api_init' );
@@ -75,10 +75,10 @@ protected function set_up() {
* @after
*/
protected function tear_down() {
- // Clean up the temporary plugin directory
+ // Clean up the temporary plugin directory.
$this->wp_filesystem->rmdir( $this->plugin_dir, true );
- // Clean up the plugins cache created by get_plugins()
+ // Clean up the plugins cache created by get_plugins().
wp_cache_delete( 'plugins', 'plugins' );
wp_clear_scheduled_hook( Scheduled_Updates::PLUGIN_CRON_HOOK );
@@ -94,12 +94,12 @@ protected function tear_down() {
* @covers ::add_is_managed_extension_field
*/
public function test_unmanaged_plugins() {
- // direct
+ // Direct.
$plugin_name = 'direct-plugin';
$this->wp_filesystem->mkdir( "$this->plugin_dir/$plugin_name" );
$this->populate_file_with_plugin_header( "$this->plugin_dir/$plugin_name/$plugin_name.php", 'direct-plugin' );
- // make sure the directory exists
+ // Make sure the directory exists.
$this->assertTrue( $this->wp_filesystem->is_dir( "$this->plugin_dir/direct-plugin" ) );
$request = new \WP_REST_Request( 'GET', '/wp/v2/plugins' );
@@ -117,7 +117,7 @@ public function test_unmanaged_plugins() {
* @covers ::add_is_managed_extension_field
*/
public function test_unmanaged_plugins_not_in_root_directory() {
- // we simulate a symlink to a subdirectory inside a wp directory
+ // We simulate a symlink to a subdirectory inside a wp directory.
$plugin_name = 'managed-plugin';
$target_dir = "$this->plugin_dir/wordpress";
$this->wp_filesystem->mkdir( $target_dir );
@@ -125,7 +125,7 @@ public function test_unmanaged_plugins_not_in_root_directory() {
$this->populate_file_with_plugin_header( "$target_dir/$plugin_name/$plugin_name.php", 'managed-plugin' );
symlink( "$target_dir/$plugin_name", "$this->plugin_dir/$plugin_name" );
- // make sure the symlink exists
+ // Make sure the symlink exists.
$this->assertFalse( $this->wp_filesystem->is_dir( "$this->plugin_dir/direct-plugin" ) );
$this->assertTrue( is_link( "$this->plugin_dir/managed-plugin" ) );
@@ -144,7 +144,7 @@ public function test_unmanaged_plugins_not_in_root_directory() {
* @covers ::add_is_managed_extension_field
*/
public function test_managed_plugins() {
- // we simulate a symlink to a subdirectory inside a wp directory
+ // We simulate a symlink to a subdirectory inside a wp directory.
$plugin_name = 'managed-plugin';
$target_dir = "$this->plugin_dir/wordpress";
$this->wp_filesystem->mkdir( $target_dir );
@@ -152,11 +152,11 @@ public function test_managed_plugins() {
$this->populate_file_with_plugin_header( "$target_dir/$plugin_name/$plugin_name.php", 'managed-plugin' );
symlink( "$target_dir/$plugin_name", "$this->plugin_dir/$plugin_name" );
- // make sure the symlink exists
+ // Make sure the symlink exists.
$this->assertFalse( $this->wp_filesystem->is_dir( "$this->plugin_dir/direct-plugin" ) );
$this->assertTrue( is_link( "$this->plugin_dir/managed-plugin" ) );
- // tweak realpath so that it returns `/wordpress/...`
+ // Tweak realpath so that it returns `/wordpress/...`.
$realpath = $this->getFunctionMock( __NAMESPACE__, 'realpath' );
$realpath->expects( $this->once() )->willReturn( "/wordpress/plugins/$plugin_name" );
@@ -554,6 +554,50 @@ public function test_delete_plugin_new_events_inherit_statuses() {
}
}
+ /**
+ * Test get_scheduled_update_text.
+ *
+ * @dataProvider update_text_provider
+ * @covers ::get_scheduled_update_text
+ *
+ * @param object $schedule The schedule object.
+ * @param string $expected The expected text.
+ */
+ public function test_get_scheduled_update_text( $schedule, $expected ) {
+ $this->assertSame( $expected, Scheduled_Updates::get_scheduled_update_text( $schedule ) );
+ }
+
+ /**
+ * Data provider for test_get_scheduled_update_text.
+ *
+ * @return array[]
+ */
+ public function update_text_provider() {
+ return array(
+ array(
+ (object) array(
+ 'timestamp' => strtotime( 'next Monday 00:00' ),
+ 'interval' => WEEK_IN_SECONDS,
+ ),
+ sprintf( 'Mondays at %s.', gmdate( get_option( 'time_format' ), strtotime( 'next Monday 8:00' ) ) ),
+ ),
+ array(
+ (object) array(
+ 'timestamp' => strtotime( 'next Tuesday 00:00' ),
+ 'interval' => DAY_IN_SECONDS,
+ ),
+ sprintf( 'Daily at %s.', gmdate( get_option( 'time_format' ), strtotime( 'next Tuesday 8:00' ) ) ),
+ ),
+ array(
+ (object) array(
+ 'timestamp' => strtotime( 'next Sunday 00:00' ),
+ 'interval' => WEEK_IN_SECONDS,
+ ),
+ sprintf( 'Sundays at %s.', gmdate( get_option( 'time_format' ), strtotime( 'next Sunday 8:00' ) ) ),
+ ),
+ );
+ }
+
/**
* Create a list of plugins to be deleted.
*
From eed6dfc7e3129c130885a1916e073b1231719550 Mon Sep 17 00:00:00 2001
From: Tim Broddin
Date: Fri, 22 Mar 2024 14:42:39 +0100
Subject: [PATCH 18/18] Changelog and readme.txt edits. (#36529)
---
projects/packages/connection/CHANGELOG.md | 5 +++++
.../connection/changelog/add-a4a-plugin-skeleton | 4 ----
.../packages/connection/src/class-package-version.php | 2 +-
projects/packages/jetpack-mu-wpcom/CHANGELOG.md | 10 ++++++++++
.../jetpack-mu-wpcom/changelog/add-verbum-settings | 4 ----
.../fix-start-page-options-modal-for-new-post | 4 ----
.../changelog/untangle-launchpad-newsletter | 4 ----
.../changelog/update-gutenberg-verbum-all-users | 4 ----
projects/packages/jetpack-mu-wpcom/package.json | 2 +-
.../jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php | 2 +-
projects/packages/scheduled-updates/CHANGELOG.md | 6 ++++++
.../scheduled-updates/changelog/fix-day-of-week | 4 ----
.../changelog/fix-plugin-update-mgr-edit-status | 4 ----
.../scheduled-updates/src/class-scheduled-updates.php | 2 +-
projects/packages/status/CHANGELOG.md | 5 +++++
.../changelog/add-a4a-source-to-jetpack-connect-url | 4 ----
projects/plugins/mu-wpcom-plugin/CHANGELOG.md | 4 ++++
.../mu-wpcom-plugin/changelog/add-verbum-settings | 5 -----
projects/plugins/mu-wpcom-plugin/composer.json | 2 +-
projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php | 2 +-
projects/plugins/mu-wpcom-plugin/package.json | 2 +-
21 files changed, 37 insertions(+), 44 deletions(-)
delete mode 100644 projects/packages/connection/changelog/add-a4a-plugin-skeleton
delete mode 100644 projects/packages/jetpack-mu-wpcom/changelog/add-verbum-settings
delete mode 100644 projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post
delete mode 100644 projects/packages/jetpack-mu-wpcom/changelog/untangle-launchpad-newsletter
delete mode 100644 projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users
delete mode 100644 projects/packages/scheduled-updates/changelog/fix-day-of-week
delete mode 100644 projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status
delete mode 100644 projects/packages/status/changelog/add-a4a-source-to-jetpack-connect-url
delete mode 100644 projects/plugins/mu-wpcom-plugin/changelog/add-verbum-settings
diff --git a/projects/packages/connection/CHANGELOG.md b/projects/packages/connection/CHANGELOG.md
index 0cfb80c61aae8..fad1a457194a5 100644
--- a/projects/packages/connection/CHANGELOG.md
+++ b/projects/packages/connection/CHANGELOG.md
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [2.6.1] - 2024-03-22
+### Changed
+- yUpdate Phan config. [#36353]
+
## [2.6.0] - 2024-03-20
### Added
- Add the 'remote_connect' REST endpoint. [#36329]
@@ -996,6 +1000,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Separate the connection library into its own package.
+[2.6.1]: https://github.com/Automattic/jetpack-connection/compare/v2.6.0...v2.6.1
[2.6.0]: https://github.com/Automattic/jetpack-connection/compare/v2.5.0...v2.6.0
[2.5.0]: https://github.com/Automattic/jetpack-connection/compare/v2.4.1...v2.5.0
[2.4.1]: https://github.com/Automattic/jetpack-connection/compare/v2.4.0...v2.4.1
diff --git a/projects/packages/connection/changelog/add-a4a-plugin-skeleton b/projects/packages/connection/changelog/add-a4a-plugin-skeleton
deleted file mode 100644
index ac545b7b59239..0000000000000
--- a/projects/packages/connection/changelog/add-a4a-plugin-skeleton
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-yUpdate Phan config.
diff --git a/projects/packages/connection/src/class-package-version.php b/projects/packages/connection/src/class-package-version.php
index 3a40946b92c0b..7a767c6775e0f 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.6.1-alpha';
+ const PACKAGE_VERSION = '2.6.1';
const PACKAGE_SLUG = 'connection';
diff --git a/projects/packages/jetpack-mu-wpcom/CHANGELOG.md b/projects/packages/jetpack-mu-wpcom/CHANGELOG.md
index b4aeee286c12b..a728333625d2e 100644
--- a/projects/packages/jetpack-mu-wpcom/CHANGELOG.md
+++ b/projects/packages/jetpack-mu-wpcom/CHANGELOG.md
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [5.19.0] - 2024-03-22
+### Changed
+- Added additional settings for commenting on simple sites [#36367]
+- Releasing Gutenberg to all Verbum users. [#36476]
+
+### Fixed
+- Block Patterns: The modal of the starter patterns isn't shown when you're creating a new post [#36516]
+- Untangle: update launchpad links for newsletter setting to go to Jetpack's [#36495]
+
## [5.18.0] - 2024-03-20
### Changed
- The GitHub deployments feature check has been removed. [#36383]
@@ -666,6 +675,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Testing initial package release.
+[5.19.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.18.0...v5.19.0
[5.18.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.17.0...v5.18.0
[5.17.0]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.16.1...v5.17.0
[5.16.1]: https://github.com/Automattic/jetpack-mu-wpcom/compare/v5.16.0...v5.16.1
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/add-verbum-settings b/projects/packages/jetpack-mu-wpcom/changelog/add-verbum-settings
deleted file mode 100644
index c4bdd7ec44632..0000000000000
--- a/projects/packages/jetpack-mu-wpcom/changelog/add-verbum-settings
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: changed
-
-Added additional settings for commenting on simple sites
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post b/projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post
deleted file mode 100644
index 295f1c4e6792a..0000000000000
--- a/projects/packages/jetpack-mu-wpcom/changelog/fix-start-page-options-modal-for-new-post
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-Block Patterns: The modal of the starter patterns isn't shown when you're creating a new post
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/untangle-launchpad-newsletter b/projects/packages/jetpack-mu-wpcom/changelog/untangle-launchpad-newsletter
deleted file mode 100644
index b612f4cb870b6..0000000000000
--- a/projects/packages/jetpack-mu-wpcom/changelog/untangle-launchpad-newsletter
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-Untangle: update launchpad links for newsletter setting to go to Jetpack's
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users b/projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users
deleted file mode 100644
index 477f71982f911..0000000000000
--- a/projects/packages/jetpack-mu-wpcom/changelog/update-gutenberg-verbum-all-users
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: changed
-
-Releasing Gutenberg to all Verbum users.
diff --git a/projects/packages/jetpack-mu-wpcom/package.json b/projects/packages/jetpack-mu-wpcom/package.json
index 0c0a0107df360..22374f6f53849 100644
--- a/projects/packages/jetpack-mu-wpcom/package.json
+++ b/projects/packages/jetpack-mu-wpcom/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom",
- "version": "5.19.0-alpha",
+ "version": "5.19.0",
"description": "Enhances your site with features powered by WordPress.com",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme",
"bugs": {
diff --git a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php
index 162f9b51be409..3dc557176d723 100644
--- a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php
+++ b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php
@@ -13,7 +13,7 @@
* Jetpack_Mu_Wpcom main class.
*/
class Jetpack_Mu_Wpcom {
- const PACKAGE_VERSION = '5.19.0-alpha';
+ const PACKAGE_VERSION = '5.19.0';
const PKG_DIR = __DIR__ . '/../';
const BASE_DIR = __DIR__ . '/';
const BASE_FILE = __FILE__;
diff --git a/projects/packages/scheduled-updates/CHANGELOG.md b/projects/packages/scheduled-updates/CHANGELOG.md
index aca6428280e70..91c8ef8b5b77a 100644
--- a/projects/packages/scheduled-updates/CHANGELOG.md
+++ b/projects/packages/scheduled-updates/CHANGELOG.md
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [0.5.1] - 2024-03-22
+### Fixed
+- Fixed a bug where the weekday index was not properly accounted for in list of weekdays. [#36524]
+- Transfer status when editing a schedule. [#36521]
+
## [0.5.0] - 2024-03-20
### Added
- Add a new plugin deletion hook that remove the plugin from the scheduled updates. [#36458]
@@ -81,6 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Generate initial package for Scheduled Updates [#35796]
+[0.5.1]: https://github.com/Automattic/scheduled-updates/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/Automattic/scheduled-updates/compare/v0.4.1...v0.5.0
[0.4.1]: https://github.com/Automattic/scheduled-updates/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/Automattic/scheduled-updates/compare/v0.3.4...v0.4.0
diff --git a/projects/packages/scheduled-updates/changelog/fix-day-of-week b/projects/packages/scheduled-updates/changelog/fix-day-of-week
deleted file mode 100644
index 7b15b591fb4db..0000000000000
--- a/projects/packages/scheduled-updates/changelog/fix-day-of-week
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-Fixed a bug where the weekday index was not properly accounted for in list of weekdays.
diff --git a/projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status b/projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status
deleted file mode 100644
index a156a2e74fd89..0000000000000
--- a/projects/packages/scheduled-updates/changelog/fix-plugin-update-mgr-edit-status
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-Transfer status when editing a schedule.
diff --git a/projects/packages/scheduled-updates/src/class-scheduled-updates.php b/projects/packages/scheduled-updates/src/class-scheduled-updates.php
index 8dd1076299bc6..9256db192e337 100644
--- a/projects/packages/scheduled-updates/src/class-scheduled-updates.php
+++ b/projects/packages/scheduled-updates/src/class-scheduled-updates.php
@@ -20,7 +20,7 @@ class Scheduled_Updates {
*
* @var string
*/
- const PACKAGE_VERSION = '0.5.1-alpha';
+ const PACKAGE_VERSION = '0.5.1';
/**
* The cron event hook for the scheduled plugins update.
*
diff --git a/projects/packages/status/CHANGELOG.md b/projects/packages/status/CHANGELOG.md
index 2f38f96192867..19d01b54aaa4c 100644
--- a/projects/packages/status/CHANGELOG.md
+++ b/projects/packages/status/CHANGELOG.md
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [2.2.0] - 2024-03-22
+### Added
+- Add support for A8C for Agencies source parameter. [#36491]
+
## [2.1.3] - 2024-03-20
### Changed
- Internal updates.
@@ -318,6 +322,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Packages: Introduce a status package
+[2.2.0]: https://github.com/Automattic/jetpack-status/compare/v2.1.3...v2.2.0
[2.1.3]: https://github.com/Automattic/jetpack-status/compare/v2.1.2...v2.1.3
[2.1.2]: https://github.com/Automattic/jetpack-status/compare/v2.1.1...v2.1.2
[2.1.1]: https://github.com/Automattic/jetpack-status/compare/v2.1.0...v2.1.1
diff --git a/projects/packages/status/changelog/add-a4a-source-to-jetpack-connect-url b/projects/packages/status/changelog/add-a4a-source-to-jetpack-connect-url
deleted file mode 100644
index d04dea953414a..0000000000000
--- a/projects/packages/status/changelog/add-a4a-source-to-jetpack-connect-url
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: added
-
-Add support for A8C for Agencies source parameter.
diff --git a/projects/plugins/mu-wpcom-plugin/CHANGELOG.md b/projects/plugins/mu-wpcom-plugin/CHANGELOG.md
index abc17aabd1e2e..6adfe6fed9083 100644
--- a/projects/plugins/mu-wpcom-plugin/CHANGELOG.md
+++ b/projects/plugins/mu-wpcom-plugin/CHANGELOG.md
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## 2.1.8 - 2024-03-22
+### Changed
+- Internal updates.
+
## 2.1.7 - 2024-03-20
### Changed
- Comment: Updated composer.lock. [#36458]
diff --git a/projects/plugins/mu-wpcom-plugin/changelog/add-verbum-settings b/projects/plugins/mu-wpcom-plugin/changelog/add-verbum-settings
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/mu-wpcom-plugin/changelog/add-verbum-settings
+++ /dev/null
@@ -1,5 +0,0 @@
-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 d99de8c1093b0..dac4422df7a7e 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_1_8_alpha"
+ "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_1_8"
}
}
diff --git a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php
index 48e4f401473d5..a8d54ad9633a6 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.1.8-alpha
+ * Version: 2.1.8
* 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 0c0433b4f181e..d26a03d7bf6d8 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.1.8-alpha",
+ "version": "2.1.8",
"description": "Test plugin for the jetpack-mu-wpcom package",
"homepage": "https://jetpack.com",
"bugs": {