diff --git a/projects/packages/videopress/src/client/admin/components/video-details/stories/index.tsx b/projects/packages/videopress/src/client/admin/components/video-details/stories/index.tsx
index 903d00e267641..ee3fa598212a6 100644
--- a/projects/packages/videopress/src/client/admin/components/video-details/stories/index.tsx
+++ b/projects/packages/videopress/src/client/admin/components/video-details/stories/index.tsx
@@ -16,6 +16,8 @@ const VideoDetailsTemplate: ComponentStory< typeof VideoDetails > = VideoDetails
export const Default = VideoDetailsTemplate.bind( {} );
Default.args = {
+ guid: 'ezoR6kzb',
filename: 'video-thumbnail.png',
src: 'https://videos.files.wordpress.com/fx123456B/video-thumbnail.mov',
+ isPrivate: false,
};
diff --git a/projects/packages/videopress/src/client/admin/components/video-details/types.ts b/projects/packages/videopress/src/client/admin/components/video-details/types.ts
index e2e7b156b489e..c3b6943162ed2 100644
--- a/projects/packages/videopress/src/client/admin/components/video-details/types.ts
+++ b/projects/packages/videopress/src/client/admin/components/video-details/types.ts
@@ -1,4 +1,11 @@
+import type { VideoGUID } from '../../../block-editor/blocks/video/types';
+
export type VideoDetailsProps = {
+ /**
+ * VideoPress GUID.
+ */
+ guid?: VideoGUID;
+
/**
* Video filename.
*/
@@ -7,7 +14,7 @@ export type VideoDetailsProps = {
/**
* Video source file URL.
*/
- src: string;
+ src?: string;
/**
* VideoPress embed shortcode.
@@ -22,5 +29,7 @@ export type VideoDetailsProps = {
/**
* Loading mode
*/
- loading: boolean;
+ loading?: boolean;
+
+ isPrivate?: boolean;
};
diff --git a/projects/packages/videopress/src/client/admin/components/video-thumbnail/index.tsx b/projects/packages/videopress/src/client/admin/components/video-thumbnail/index.tsx
index ae023f19c4424..623f5e62aa259 100644
--- a/projects/packages/videopress/src/client/admin/components/video-thumbnail/index.tsx
+++ b/projects/packages/videopress/src/client/admin/components/video-thumbnail/index.tsx
@@ -166,6 +166,7 @@ const VideoThumbnail = forwardRef< HTMLDivElement, VideoThumbnailProps >(
uploading = false,
processing = false,
deleting = false,
+ updating = false,
onUseDefaultThumbnail,
onSelectFromVideo,
onUploadImage,
@@ -175,11 +176,11 @@ const VideoThumbnail = forwardRef< HTMLDivElement, VideoThumbnailProps >(
ref
) => {
const [ isSmall ] = useBreakpointMatch( 'sm' );
- const busy = loading || uploading || deleting;
+ const busy = loading || uploading || deleting || updating;
// Mapping thumbnail (Ordered by priority)
let thumbnail = defaultThumbnail;
- thumbnail = loading || deleting ?
: thumbnail;
+ thumbnail = loading ?
: thumbnail;
thumbnail = uploading ? (
) : (
diff --git a/projects/packages/videopress/src/client/admin/components/video-thumbnail/types.ts b/projects/packages/videopress/src/client/admin/components/video-thumbnail/types.ts
index 69764504ddc74..016d1add98715 100644
--- a/projects/packages/videopress/src/client/admin/components/video-thumbnail/types.ts
+++ b/projects/packages/videopress/src/client/admin/components/video-thumbnail/types.ts
@@ -68,6 +68,11 @@ export type VideoThumbnailProps = VideoThumbnailDropdownProps & {
*/
deleting?: boolean;
+ /**
+ * True when in updating mode.
+ */
+ updating?: boolean;
+
/**
* The video upload progress from 0 to 1.
*/
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/index.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/index.tsx
index c953dbd4c408d..4b85e54f0dc57 100644
--- a/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/index.tsx
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/index.tsx
@@ -10,7 +10,7 @@ import type React from 'react';
import './style.scss';
-type BlockBannerProps = {
+export type BlockBannerProps = {
icon?: React.ReactNode;
action?: React.ReactNode;
children: React.ReactNode;
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/stories/Banner.mdx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/stories/Banner.mdx
new file mode 100644
index 0000000000000..5cdb6ff8d7a11
--- /dev/null
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/stories/Banner.mdx
@@ -0,0 +1,41 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs';
+import Banner from '../index';
+
+
+
+# Banner
+A banner to show a message, with loading state control and customizable icon and call-to-action.
+
+
+
+
+
+## API
+
+### children
+
+- type: `ReactNode`;
+
+Component to render into the banner.
+
+### isLoading
+
+- type: `boolean`
+
+It shows a spinner icon when true.
+
+### icon
+
+- type: `ReactNode`
+- default: `warning` core icon
+
+An optional icon.
+
+### action
+
+- type: `ReactNode`;
+
+Action component to render at the right of the banner. Usually, it's a button.
\ No newline at end of file
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/stories/index.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/stories/index.tsx
new file mode 100644
index 0000000000000..a746e55b56f4c
--- /dev/null
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/banner/stories/index.tsx
@@ -0,0 +1,64 @@
+/**
+ * External dependencies
+ */
+import { Button } from '@wordpress/components';
+import * as allIcons from '@wordpress/icons';
+import React from 'react';
+import Banner, { BlockBannerProps } from '..';
+/**
+ * Internal dependencies
+ */
+import Doc from './Banner.mdx';
+
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+const { Icon, ...icons } = allIcons;
+
+type BannerStoryProps = BlockBannerProps & {
+ icon: string;
+ children?: React.ReactNode;
+};
+
+export default {
+ title: 'Packages/VideoPress/Block Editor/Banner',
+ component: Banner,
+ parameters: {
+ docs: {
+ page: Doc,
+ },
+ },
+ argTypes: {
+ icon: {
+ control: {
+ type: 'select',
+ options: [ 'none', ...Object.keys( icons ) ],
+ },
+ },
+ action: {
+ table: {
+ disable: true,
+ },
+ },
+ },
+};
+
+const DefaultTemplate = ( args: BannerStoryProps ) => {
+ const props: BlockBannerProps = {
+ children: args.children,
+ isLoading: args.isLoading,
+ action: args.action,
+ };
+
+ const icon = args?.icon && args.icon !== 'none' ? icons[ args.icon ] : null;
+ if ( icon ) {
+ props.icon = icon;
+ }
+
+ return
;
+};
+
+export const _default = DefaultTemplate.bind( {} );
+_default.args = {
+ children: 'Connect your site to WordPress.com to upload videos.',
+ action:
Connect ,
+ isLoading: false,
+};
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/poster-panel/stories/PosterPanel.mdx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/poster-panel/stories/PosterPanel.mdx
new file mode 100644
index 0000000000000..42cda0f5a259a
--- /dev/null
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/poster-panel/stories/PosterPanel.mdx
@@ -0,0 +1,13 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs';
+import PosterPanel from '../index';
+
+
+
+# PosterPanel
+
+
+
+
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/poster-panel/stories/index.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/poster-panel/stories/index.tsx
new file mode 100644
index 0000000000000..58fc133f1cb45
--- /dev/null
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/poster-panel/stories/index.tsx
@@ -0,0 +1,39 @@
+/**
+ * External dependencies
+ */
+import React from 'react';
+/**
+ * Internal dependencies
+ */
+import PosterPanel from '..';
+import Doc from './PosterPanel.mdx';
+
+export default {
+ title: 'Packages/VideoPress/Block Editor/Poster Panel',
+ component: PosterPanel,
+ parameters: {
+ docs: {
+ page: Doc,
+ },
+ },
+ argTypes: {},
+};
+
+const DefaultTemplate = args => {
+ const [ attributes, setAttributes ] = React.useState( {
+ poster: args.poster,
+ videoRatio: args.videoRatio,
+ } );
+
+ const setAttributesHandler = newAttributes => {
+ setAttributes( { ...attributes, ...newAttributes } );
+ };
+
+ return
;
+};
+
+export const _default = DefaultTemplate.bind( {} );
+_default.args = {
+ poster: 'https://jetpackme.files.wordpress.com/2018/04/cropped-jetpack-favicon-2018.png',
+ videoRatio: 60,
+};
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/edit.native.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/edit.native.tsx
index 0eb997a24f8bf..25c58d7273855 100644
--- a/projects/packages/videopress/src/client/block-editor/blocks/video/edit.native.tsx
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/edit.native.tsx
@@ -1,12 +1,13 @@
/**
* WordPress dependencies
*/
-import { MediaPlaceholder } from '@wordpress/block-editor';
+import { MediaPlaceholder, InspectorControls } from '@wordpress/block-editor';
+import { PanelBody } from '@wordpress/components';
/**
* External dependencies
*/
import React from 'react';
-import { View } from 'react-native';
+import { View, Text } from 'react-native';
/**
* Internal dependencies
*/
@@ -20,9 +21,14 @@ import style from './style.scss';
* @param {object} props - Component props.
* @param {object} props.attributes - Block attributes.
* @param {Function} props.setAttributes - Function to set block attributes.
+ * @param {boolean} props.isSelected - Whether block is selected.
* @returns {React.ReactNode} - React component.
*/
-export default function VideoPressEdit( { attributes, setAttributes } ): React.ReactNode {
+export default function VideoPressEdit( {
+ attributes,
+ setAttributes,
+ isSelected,
+} ): React.ReactNode {
/**
* TODO: The current components are intended to act as placeholders while block is in development.
* They should eventually be edited or replaced to support VideoPress.
@@ -53,6 +59,13 @@ export default function VideoPressEdit( { attributes, setAttributes } ): React.R
return (
+ { isSelected && (
+
+
+ { 'Hello world!' }
+
+
+ ) }
);
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/edit.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/edit.tsx
index b4e3166172415..c465226fc622d 100644
--- a/projects/packages/videopress/src/client/block-editor/blocks/video/edit.tsx
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/edit.tsx
@@ -11,7 +11,7 @@ import {
import { createBlock } from '@wordpress/blocks';
import { Spinner, Placeholder, Button, withNotices, ToolbarButton } from '@wordpress/components';
import { store as coreStore } from '@wordpress/core-data';
-import { useSelect, useDispatch } from '@wordpress/data';
+import { useDispatch } from '@wordpress/data';
import { useEffect, useState, useCallback, useRef } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { caption as captionIcon } from '@wordpress/icons';
@@ -22,6 +22,7 @@ import debugFactory from 'debug';
*/
import { isStandaloneActive, isVideoPressActive } from '../../../lib/connection';
import { buildVideoPressURL, getVideoPressUrl } from '../../../lib/url';
+import { usePreview } from '../../hooks/use-preview';
import { useSyncMedia } from '../../hooks/use-video-data-update';
import ConnectBanner from './components/banner/connect-banner';
import ColorPanel from './components/color-panel';
@@ -155,24 +156,7 @@ export default function VideoPressEdit( {
const { filename, private_enabled_for_site: privateEnabledForSite } = videoData;
// Get video preview status.
- const defaultPreview = { html: null, scripts: [], width: null, height: null };
- const { preview, isRequestingEmbedPreview } = useSelect(
- select => {
- if ( ! videoPressUrl ) {
- return {
- preview: defaultPreview,
- isRequestingEmbedPreview: false,
- };
- }
-
- return {
- preview: select( coreStore ).getEmbedPreview( videoPressUrl ) || defaultPreview,
- isRequestingEmbedPreview:
- select( coreStore ).isRequestingEmbedPreview( videoPressUrl ) || false,
- };
- },
- [ videoPressUrl ]
- );
+ const { preview, isRequestingEmbedPreview } = usePreview( videoPressUrl );
// Pick video properties from preview.
const { html: previewHtml, scripts, width: previewWidth, height: previewHeight } = preview;
diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/types.ts b/projects/packages/videopress/src/client/block-editor/blocks/video/types.ts
index 3aae24d02c4e3..58541be24976d 100644
--- a/projects/packages/videopress/src/client/block-editor/blocks/video/types.ts
+++ b/projects/packages/videopress/src/client/block-editor/blocks/video/types.ts
@@ -96,3 +96,10 @@ export type DetailsPanelProps = VideoControlProps & {
updateError: object | null;
isRequestingVideoData: boolean;
};
+
+export type VideoPreview = {
+ html?: string;
+ scripts: Array< string >;
+ width?: number;
+ height?: number;
+};
diff --git a/projects/packages/videopress/src/client/block-editor/hooks/use-preview/Readme.md b/projects/packages/videopress/src/client/block-editor/hooks/use-preview/Readme.md
new file mode 100644
index 0000000000000..d1b4a208fce18
--- /dev/null
+++ b/projects/packages/videopress/src/client/block-editor/hooks/use-preview/Readme.md
@@ -0,0 +1,20 @@
+# usePreview()
+
+React custom hook to fetch the video preview data.
+Returns a `VideoPreview` object and the boolean `isRequestingEmbedPreview`
+
+
+```jsx
+
+function VideoComponent( { videoPressUrl } ) {
+ const [ preview, isRequestingEmbedPreview ] = usePreview( videoPressUrl );
+
+ if ( isRequestingEmbedPreview ) {
+ return null;
+ }
+
+ return (
+
+ )
+}
+```
\ No newline at end of file
diff --git a/projects/packages/videopress/src/client/block-editor/hooks/use-preview/index.ts b/projects/packages/videopress/src/client/block-editor/hooks/use-preview/index.ts
new file mode 100644
index 0000000000000..2c5fe5d1eda2e
--- /dev/null
+++ b/projects/packages/videopress/src/client/block-editor/hooks/use-preview/index.ts
@@ -0,0 +1,32 @@
+/*
+ * WordPress dependencies
+ */
+import { store as coreStore } from '@wordpress/core-data';
+import { useSelect } from '@wordpress/data';
+/*
+ * Types
+ */
+import type { VideoPreview } from '../../../block-editor/blocks/video/types';
+
+export type UsePreviewResult = {
+ preview: VideoPreview;
+ isRequestingEmbedPreview: boolean;
+};
+
+const defaultPreview: VideoPreview = { html: null, scripts: [], width: null, height: null };
+
+export const usePreview = ( videoPressUrl?: string ): UsePreviewResult => {
+ return useSelect(
+ select => {
+ if ( ! videoPressUrl ) {
+ return { preview: defaultPreview, isRequestingEmbedPreview: false };
+ }
+ return {
+ preview: select( coreStore ).getEmbedPreview( videoPressUrl ) || defaultPreview,
+ isRequestingEmbedPreview:
+ select( coreStore ).isRequestingEmbedPreview( videoPressUrl ) || false,
+ };
+ },
+ [ videoPressUrl ]
+ );
+};
diff --git a/projects/packages/videopress/src/client/components/timestamp-control/index.tsx b/projects/packages/videopress/src/client/components/timestamp-control/index.tsx
new file mode 100644
index 0000000000000..336846d16d6cc
--- /dev/null
+++ b/projects/packages/videopress/src/client/components/timestamp-control/index.tsx
@@ -0,0 +1,204 @@
+/**
+ * External dependencies
+ */
+// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
+import { __experimentalNumberControl as NumberControl, RangeControl } from '@wordpress/components';
+import { useDebounce } from '@wordpress/compose';
+import { useCallback } from '@wordpress/element';
+import classnames from 'classnames';
+/**
+ * Internal dependencies
+ */
+import styles from './style.module.scss';
+/**
+ * Types
+ */
+import { TimestampInputProps, TimestampControlProps } from './types';
+import type React from 'react';
+
+const TimeDivider = (): React.ReactElement => {
+ return
: ;
+};
+
+const CHANGE = 'CHANGE';
+const COMMIT = 'COMMIT';
+const PRESS_DOWN = 'PRESS_DOWN';
+const PRESS_UP = 'PRESS_UP';
+
+const buildPadInputStateReducer = ( pad: number ) => {
+ return ( state, action ) => {
+ const nextState = { ...state };
+ if (
+ action.type === COMMIT ||
+ action.type === PRESS_UP ||
+ action.type === PRESS_DOWN ||
+ action.type === CHANGE
+ ) {
+ if ( nextState.value !== undefined ) {
+ nextState.value = nextState.value.toString().padStart( pad, '0' );
+ }
+ }
+ return nextState;
+ };
+};
+
+/**
+ * Return the time data based on the given value.
+ *
+ * @param {number} value - The value to be converted.
+ * @returns {object} The time data.
+ */
+function getTimeDataByValue( value ) {
+ const valueIsNaN = isNaN( value );
+
+ return {
+ hh: valueIsNaN ? 0 : Math.floor( ( value / ( 1000 * 60 * 60 ) ) % 24 ),
+ mm: valueIsNaN ? 0 : Math.floor( ( value / ( 1000 * 60 ) ) % 60 ),
+ ss: valueIsNaN ? 0 : Math.floor( ( value / 1000 ) % 60 ),
+ };
+}
+
+export const TimestampInput = ( {
+ value,
+ max,
+ onChange,
+}: TimestampInputProps ): React.ReactElement => {
+ const time = {
+ value: getTimeDataByValue( value ),
+ };
+
+ // Check whether it should add hours input.
+ const hasHours = Math.floor( ( max / ( 1000 * 60 * 60 ) ) % 24 );
+
+ const computeTimeValue = ( unit: string ) => ( newValue: number ) => {
+ if ( typeof newValue === 'string' && ! isNaN( parseInt( newValue, 10 ) ) ) {
+ newValue = parseInt( newValue, 10 );
+ }
+
+ // Check if the newValue is valid
+ if (
+ ( unit === 'hh' && newValue > 99 ) ||
+ ( ( unit === 'mm' || unit === 'ss' ) && newValue > 59 )
+ ) {
+ return;
+ }
+
+ // Last check. If the newValue is not a number, bail out.
+ if ( typeof newValue === 'string' ) {
+ return;
+ }
+
+ // Update time object data.
+ time.value = { ...getTimeDataByValue( value ), [ unit ]: newValue };
+
+ // Call onChange callback.
+ onChange?.( ( time.value.hh * 3600 + time.value.mm * 60 + time.value.ss ) * 1000 );
+ };
+
+ return (
+
0,
+ } ) }
+ >
+ { hasHours > 0 && (
+ <>
+
+
+ >
+ ) }
+
+
+
+
+
+
+
+ );
+};
+
+/**
+ * TimestampControl component
+ *
+ * @param {TimestampControlProps} props - Component props.
+ * @returns {React.ReactElement} TimestampControl react component.
+ */
+export const TimestampControl = ( {
+ max,
+ value,
+ onChange,
+ onDebounceChange,
+ wait = 1000,
+}: TimestampControlProps ): React.ReactElement => {
+ const debouncedOnChangeHandler = onDebounceChange ? useDebounce( onDebounceChange, wait ) : null;
+
+ const onChangeHandler = useCallback(
+ ( newValue: number ) => {
+ debouncedOnChangeHandler && debouncedOnChangeHandler( newValue );
+ onChange( newValue );
+ },
+ [ onChange, debouncedOnChangeHandler ]
+ );
+
+ return (
+
+
+
+
+
+ );
+};
+
+export default TimestampControl;
diff --git a/projects/packages/videopress/src/client/components/timestamp-control/stories/TimestampControl.mdx b/projects/packages/videopress/src/client/components/timestamp-control/stories/TimestampControl.mdx
new file mode 100644
index 0000000000000..bf7e659dd7940
--- /dev/null
+++ b/projects/packages/videopress/src/client/components/timestamp-control/stories/TimestampControl.mdx
@@ -0,0 +1,50 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs';
+import TimestampControl from '../index';
+
+
+
+# Timestamp Control
+
+React component to set a timestamp value.
+
+
+
+
+
+## TimestampControl API
+
+### value
+
+- type `number`
+
+The timestamp value in milliseconds
+
+### onChange
+
+- type: `Function`
+
+Use this property to pass a callback function, where the API provides the selected time in milliseconds.
+
+### onDebounceChange
+
+- type: `Function`
+
+Similar to `onChange` property, but the call is debouncing in time according to the `wait` property value.
+
+### wait
+
+- type: `Number`
+
+Time, in milliseconds, that the `onDebounceChange` function will be debounced.
+
+###
+
+### max
+
+- type: `number`
+
+Maximum time value, in milliseconds, expected by the component.
+Also, if it's bigger than one hour, the hour input will be rendered into the Timestamp Input component.
diff --git a/projects/packages/videopress/src/client/components/timestamp-control/stories/index.tsx b/projects/packages/videopress/src/client/components/timestamp-control/stories/index.tsx
new file mode 100644
index 0000000000000..9b153a3a15505
--- /dev/null
+++ b/projects/packages/videopress/src/client/components/timestamp-control/stories/index.tsx
@@ -0,0 +1,52 @@
+/**
+ * External dependencies
+ */
+import { useState } from 'react';
+/**
+ * Internal dependencies
+ */
+import TimestampControl from '..';
+import Doc from './TimestampControl.mdx';
+/**
+ * Types
+ */
+import type { ComponentStory, ComponentMeta } from '@storybook/react';
+
+export default {
+ title: 'Packages/VideoPress/Timestamp Control',
+ component: TimestampControl,
+ parameters: {
+ docs: {
+ page: Doc,
+ },
+ },
+} as ComponentMeta< typeof TimestampControl >;
+
+const Template: ComponentStory< typeof TimestampControl > = args => {
+ const [ time, setTime ] = useState( args.value );
+ return (
+
{
+ setTime( newTime );
+ args?.onChange( newTime );
+ } }
+ />
+ );
+};
+
+export const _default = Template.bind( {} );
+_default.args = {
+ max: 3600 * 1000 * 2, // 2 hours
+ value: 236 * 1000, // 3:56
+ wait: 100,
+ onChange: ( newTime: number ) => {
+ console.log( { newTime } ); // eslint-disable-line no-console
+ },
+ onDebounceChange: ( newDebouncedTime: number ) => {
+ console.log( { newDebouncedTime } ); // eslint-disable-line no-console
+ },
+};
+
+_default.storyName = 'Timestamp Control';
diff --git a/projects/packages/videopress/src/client/components/timestamp-control/style.module.scss b/projects/packages/videopress/src/client/components/timestamp-control/style.module.scss
new file mode 100644
index 0000000000000..9a8c2fe122f51
--- /dev/null
+++ b/projects/packages/videopress/src/client/components/timestamp-control/style.module.scss
@@ -0,0 +1,43 @@
+.timestamp-input-wrapper {
+ display: flex;
+ align-items: center;
+ border-color: #949494;
+ border-style: solid;
+ justify-content: space-around;
+ border-width: 1px;
+ max-width: 58px;
+ padding: 0px;
+
+ &.has-hours {
+ max-width: 83px;
+ }
+
+ .timestamp-control-input {
+ width: 24px;
+ }
+
+ :global {
+ .components-input-control__input {
+ padding-left: 0 !important;
+ padding-right: 0 !important;
+ text-align: center;
+ }
+ .components-input-control__backdrop {
+ border-style: none !important;
+ }
+ }
+}
+
+.timestamp-control {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+
+ .timestamp-control-range {
+ flex-grow: 2;
+
+ :global .components-base-control__field {
+ margin-bottom: 0;
+ }
+ }
+}
diff --git a/projects/packages/videopress/src/client/components/timestamp-control/types.ts b/projects/packages/videopress/src/client/components/timestamp-control/types.ts
new file mode 100644
index 0000000000000..0b30a8c488662
--- /dev/null
+++ b/projects/packages/videopress/src/client/components/timestamp-control/types.ts
@@ -0,0 +1,10 @@
+export type TimestampInputProps = {
+ value: number;
+ max?: number;
+ onChange: ( ms: number ) => void;
+};
+
+export type TimestampControlProps = TimestampInputProps & {
+ wait: number;
+ onDebounceChange: ( ms: number ) => void;
+};
diff --git a/projects/packages/videopress/src/client/lib/url/index.ts b/projects/packages/videopress/src/client/lib/url/index.ts
index 7315c4e9b5a91..99046d15a6f01 100644
--- a/projects/packages/videopress/src/client/lib/url/index.ts
+++ b/projects/packages/videopress/src/client/lib/url/index.ts
@@ -141,3 +141,19 @@ export function buildVideoPressURL(
export const removeFileNameExtension = ( name: string ) => {
return name.replace( /\.[^/.]+$/, '' );
};
+
+/**
+ * Return the VideoPress video URL
+ * based on the privacy of the video.
+ *
+ * @param {VideoGUID} guid - The VideoPress GUID.
+ * @param {boolean} isPrivate - Whether the video is private or not.
+ * @returns {string} VideoPress URL.
+ */
+export function getVideoUrlBasedOnPrivacy( guid: VideoGUID, isPrivate: boolean ) {
+ if ( isPrivate ) {
+ return `https://video.wordpress.com/v/${ guid }`;
+ }
+
+ return `https://videopress.com/v/${ guid }`;
+}
diff --git a/projects/packages/waf/CHANGELOG.md b/projects/packages/waf/CHANGELOG.md
index adb85bcd44881..5899e8d3ac598 100644
--- a/projects/packages/waf/CHANGELOG.md
+++ b/projects/packages/waf/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).
+## [0.10.1] - 2023-03-08
+### Changed
+- Minor internal updates.
+
## [0.10.0] - 2023-02-28
### Added
- Added support for IP ranges in allow and block lists. [#29131]
@@ -159,6 +163,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Core: do not ship .phpcs.dir.xml in production builds.
+[0.10.1]: https://github.com/Automattic/jetpack-waf/compare/v0.10.0...v0.10.1
[0.10.0]: https://github.com/Automattic/jetpack-waf/compare/v0.9.3...v0.10.0
[0.9.3]: https://github.com/Automattic/jetpack-waf/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/Automattic/jetpack-waf/compare/v0.9.1...v0.9.2
diff --git a/projects/packages/waf/src/class-rest-controller.php b/projects/packages/waf/src/class-rest-controller.php
index 15fbce7c9c2b2..38e4d5615f463 100644
--- a/projects/packages/waf/src/class-rest-controller.php
+++ b/projects/packages/waf/src/class-rest-controller.php
@@ -17,6 +17,8 @@
class REST_Controller {
/**
* Register REST API endpoints.
+ *
+ * @return void
*/
public static function register_rest_routes() {
register_rest_route(
@@ -52,29 +54,29 @@ public static function register_rest_routes() {
/**
* Update rules endpoint
+ *
+ * @return WP_REST_Response|WP_Error
*/
public static function update_rules() {
- $success = true;
- $message = 'Rules updated succesfully';
-
try {
Waf_Rules_Manager::generate_automatic_rules();
Waf_Rules_Manager::generate_rules();
- } catch ( \Exception $e ) {
- $success = false;
- $message = $e->getMessage();
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
}
return rest_ensure_response(
array(
- 'success' => $success,
- 'message' => $message,
+ 'success' => true,
+ 'message' => __( 'Rules updated succesfully', 'jetpack-waf' ),
)
);
}
/**
* WAF Endpoint
+ *
+ * @return WP_REST_Response
*/
public static function waf() {
return rest_ensure_response( Waf_Runner::get_config() );
@@ -84,7 +86,8 @@ public static function waf() {
* Update WAF Endpoint
*
* @param WP_REST_Request $request The API request.
- * @return WP_REST_Response
+ *
+ * @return WP_REST_Response|WP_Error
*/
public static function update_waf( $request ) {
// Automatic Rules Enabled
@@ -112,7 +115,11 @@ public static function update_waf( $request ) {
update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, (bool) $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] );
}
- Waf_Runner::update_waf();
+ try {
+ Waf_Runner::update_waf();
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
+ }
return self::waf();
}
diff --git a/projects/packages/waf/src/class-waf-initializer.php b/projects/packages/waf/src/class-waf-initializer.php
index 3f3866506efe7..a119c9be7a41c 100644
--- a/projects/packages/waf/src/class-waf-initializer.php
+++ b/projects/packages/waf/src/class-waf-initializer.php
@@ -49,33 +49,37 @@ public static function init() {
}
/**
- * On module activation set up waf mode
+ * Activate the WAF on module activation.
*
- * @return bool|WP_Error True of the WAF activation was successful, WP_Error otherwise.
+ * @return bool|WP_Error True if the WAF activation is successful, WP_Error otherwise.
*/
public static function on_activation() {
update_option( Waf_Runner::MODE_OPTION_NAME, 'normal' );
add_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME, false );
- $waf_activated = Waf_Runner::activate();
- if ( is_wp_error( $waf_activated ) ) {
- return $waf_activated;
- }
-
try {
+ Waf_Runner::activate();
( new Waf_Standalone_Bootstrap() )->generate();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_activation_failed', $e->getMessage() );
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
}
return true;
}
/**
- * On module deactivation, unset waf mode
+ * Deactivate the WAF on module deactivation.
+ *
+ * @return bool|WP_Error True if the WAF deactivation is successful, WP_Error otherwise.
*/
public static function on_deactivation() {
- Waf_Runner::deactivate();
+ try {
+ Waf_Runner::deactivate();
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
+ }
+
+ return true;
}
/**
@@ -131,23 +135,22 @@ public static function check_for_waf_update() {
if ( ! method_exists( Waf_Constants::class, 'define_mode' ) ) {
try {
( new Waf_Standalone_Bootstrap() )->generate();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_update_failed', $e->getMessage() );
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
}
- return true;
}
Waf_Constants::define_mode();
if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) {
- return new WP_Error( 'waf_update_failed', 'Invalid firewall mode.' );
+ return new WP_Error( 'waf_mode_invalid', 'Invalid firewall mode.' );
}
try {
Waf_Rules_Manager::generate_ip_rules();
Waf_Rules_Manager::generate_rules();
( new Waf_Standalone_Bootstrap() )->generate();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_update_failed', $e->getMessage() );
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
}
}
diff --git a/projects/packages/waf/src/class-waf-rules-manager.php b/projects/packages/waf/src/class-waf-rules-manager.php
index 05fc2bfe1fe21..2c9f890179bf8 100644
--- a/projects/packages/waf/src/class-waf-rules-manager.php
+++ b/projects/packages/waf/src/class-waf-rules-manager.php
@@ -43,14 +43,14 @@ class Waf_Rules_Manager {
*/
public static function add_hooks() {
// Re-activate the WAF any time an option is added or updated.
- add_action( 'add_option_' . self::AUTOMATIC_RULES_ENABLED_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'update_option_' . self::AUTOMATIC_RULES_ENABLED_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'add_option_' . self::IP_LISTS_ENABLED_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'update_option_' . self::IP_LISTS_ENABLED_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'add_option_' . self::IP_ALLOW_LIST_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'update_option_' . self::IP_ALLOW_LIST_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'add_option_' . self::IP_BLOCK_LIST_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
- add_action( 'update_option_' . self::IP_BLOCK_LIST_OPTION_NAME, array( Waf_Runner::class, 'activate' ), 10, 0 );
+ add_action( 'add_option_' . self::AUTOMATIC_RULES_ENABLED_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'update_option_' . self::AUTOMATIC_RULES_ENABLED_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'add_option_' . self::IP_LISTS_ENABLED_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'update_option_' . self::IP_LISTS_ENABLED_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'add_option_' . self::IP_ALLOW_LIST_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'update_option_' . self::IP_ALLOW_LIST_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'add_option_' . self::IP_BLOCK_LIST_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
+ add_action( 'update_option_' . self::IP_BLOCK_LIST_OPTION_NAME, array( static::class, 'reactivate_on_rules_option_change' ), 10, 0 );
// Register the cron job.
add_action( 'jetpack_waf_rules_update_cron', array( static::class, 'update_rules_cron' ) );
}
@@ -58,12 +58,14 @@ public static function add_hooks() {
/**
* Schedule the cron job to update the WAF rules.
*
- * @return void
+ * @return bool|WP_Error True if the event is scheduled, WP_Error on failure.
*/
public static function schedule_rules_cron() {
if ( ! wp_next_scheduled( 'jetpack_waf_rules_update_cron' ) ) {
- wp_schedule_event( time(), 'twicedaily', 'jetpack_waf_rules_update_cron' );
+ return wp_schedule_event( time(), 'twicedaily', 'jetpack_waf_rules_update_cron', array(), true );
}
+
+ return true;
}
/**
@@ -74,59 +76,72 @@ public static function schedule_rules_cron() {
public static function update_rules_cron() {
Waf_Constants::define_mode();
if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) {
- return new WP_Error( 'waf_cron_update_failed', 'Invalid firewall mode.' );
+ return new WP_Error( 'waf_invalid_mode', 'Invalid firewall mode.' );
}
try {
self::generate_automatic_rules();
self::generate_ip_rules();
self::generate_rules();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_cron_update_failed', $e->getMessage() );
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
}
update_option( self::RULE_LAST_UPDATED_OPTION_NAME, time() );
return true;
}
+ /**
+ * Re-activate the WAF any time an option is added or updated.
+ *
+ * @return bool|WP_Error True if re-activation is successful, WP_Error on failure.
+ */
+ public static function reactivate_on_rules_option_change() {
+ try {
+ Waf_Runner::activate();
+ } catch ( Waf_Exception $e ) {
+ return $e->get_wp_error();
+ }
+
+ return true;
+ }
+
/**
* Updates the rule set if rules version has changed
*
- * @return bool|WP_Error True if rules update is successful, WP_Error on failure.
+ * @throws Waf_Exception If the firewall mode is invalid.
+ * @throws Waf_Exception If the rules update fails.
+ *
+ * @return void
*/
public static function update_rules_if_changed() {
Waf_Constants::define_mode();
if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) {
- return new WP_Error( 'waf_update_failed', 'Invalid firewall mode.' );
+ throw new Waf_Exception( 'Invalid firewall mode.' );
}
$version = get_option( self::VERSION_OPTION_NAME );
if ( self::RULES_VERSION !== $version ) {
- update_option( self::VERSION_OPTION_NAME, self::RULES_VERSION );
+ self::generate_automatic_rules();
+ self::generate_ip_rules();
+ self::generate_rules();
- try {
- self::generate_automatic_rules();
- self::generate_ip_rules();
- self::generate_rules();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_update_failed', $e->getMessage() );
- }
+ update_option( self::VERSION_OPTION_NAME, self::RULES_VERSION );
}
-
- return true;
}
/**
* Retrieve rules from the API
*
- * @throws \Exception If site is not registered.
- * @throws \Exception If API did not respond 200.
- * @throws \Exception If data is missing from response.
+ * @throws Waf_Exception If site is not registered.
+ * @throws Rules_API_Exception If API did not respond 200.
+ * @throws Rules_API_Exception If data is missing from response.
+ *
* @return array
*/
public static function get_rules_from_api() {
$blog_id = Jetpack_Options::get_option( 'id' );
if ( ! $blog_id ) {
- throw new \Exception( 'Site is not registered' );
+ throw new Waf_Exception( 'Site is not registered' );
}
$response = Client::wpcom_json_api_request_as_blog(
@@ -140,14 +155,14 @@ public static function get_rules_from_api() {
$response_code = wp_remote_retrieve_response_code( $response );
if ( 200 !== $response_code ) {
- throw new \Exception( 'API connection failed.', (int) $response_code );
+ throw new Rules_API_Exception( 'API connection failed.', (int) $response_code );
}
$rules_json = wp_remote_retrieve_body( $response );
$rules = json_decode( $rules_json, true );
if ( empty( $rules['data'] ) ) {
- throw new \Exception( 'Data missing from response.' );
+ throw new Rules_API_Exception( 'Data missing from response.' );
}
return $rules['data'];
@@ -158,6 +173,7 @@ public static function get_rules_from_api() {
*
* @param string $required_file The file to check if exists and require.
* @param string $return_code The PHP code to execute if the file require returns true. Defaults to 'return;'.
+ *
* @return string The wrapped require statement.
*/
private static function wrap_require( $required_file, $return_code = 'return;' ) {
@@ -167,17 +183,15 @@ private static function wrap_require( $required_file, $return_code = 'return;' )
/**
* Generates the rules.php script
*
- * @throws \Exception If file writing fails.
+ * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction.
+ *
+ * @throws File_System_Exception If file writing fails initializing rule files.
+ * @throws File_System_Exception If file writing fails writing to the rules entrypoint file.
+ *
* @return void
*/
public static function generate_rules() {
- /**
- * WordPress filesystem abstraction.
- *
- * @var \WP_Filesystem_Base $wp_filesystem
- */
global $wp_filesystem;
-
Waf_Runner::initialize_filesystem();
$rules = "is_file( $rule_file ) ) {
if ( ! $wp_filesystem->put_contents( $rule_file, "put_contents( $entrypoint_file_path, $rules ) ) {
- throw new \Exception( 'Failed writing rules file to: ' . $entrypoint_file_path );
+ throw new File_System_Exception( 'Failed writing rules file to: ' . $entrypoint_file_path );
}
}
/**
* Generates the automatic-rules.php script
*
- * @throws \Exception If rules cannot be generated and saved.
+ * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction.
+ *
+ * @throws Waf_Exception If rules cannot be fetched from the API.
+ * @throws File_System_Exception If file writing fails.
+ *
* @return void
*/
public static function generate_automatic_rules() {
- /**
- * WordPress filesystem abstraction.
- *
- * @var \WP_Filesystem_Base $wp_filesystem
- */
global $wp_filesystem;
-
Waf_Runner::initialize_filesystem();
$automatic_rules_file_path = Waf_Runner::get_waf_file_path( self::AUTOMATIC_RULES_FILE );
@@ -241,10 +253,10 @@ public static function generate_automatic_rules() {
try {
$rules = self::get_rules_from_api();
- } catch ( \Exception $exception ) {
+ } catch ( Waf_Exception $e ) {
// Do not throw API exceptions for users who do not have access
- if ( 401 !== $exception->getCode() ) {
- throw $exception;
+ if ( 401 !== $e->getCode() ) {
+ throw $e;
}
}
@@ -254,7 +266,7 @@ public static function generate_automatic_rules() {
}
if ( ! $wp_filesystem->put_contents( $automatic_rules_file_path, $rules ) ) {
- throw new \Exception( 'Failed writing automatic rules file to: ' . $automatic_rules_file_path );
+ throw new File_System_Exception( 'Failed writing automatic rules file to: ' . $automatic_rules_file_path );
}
update_option( self::AUTOMATIC_RULES_LAST_UPDATED_OPTION_NAME, time() );
@@ -263,18 +275,15 @@ public static function generate_automatic_rules() {
/**
* Generates the rules.php script
*
- * @throws \Exception If filesystem is not available.
- * @throws \Exception If file writing fails.
+ * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction.
+ *
+ * @throws File_System_Exception If writing to IP allow list file fails.
+ * @throws File_System_Exception If writing to IP block list file fails.
+ *
* @return void
*/
public static function generate_ip_rules() {
- /**
- * WordPress filesystem abstraction.
- *
- * @var \WP_Filesystem_Base $wp_filesystem
- */
global $wp_filesystem;
-
Waf_Runner::initialize_filesystem();
$allow_ip_file_path = Waf_Runner::get_waf_file_path( self::IP_ALLOW_RULES_FILE );
@@ -298,7 +307,7 @@ public static function generate_ip_rules() {
$allow_rules_content .= 'return $waf->is_ip_in_array( $waf_allow_list );' . "\n";
if ( ! $wp_filesystem->put_contents( $allow_ip_file_path, "is_ip_in_array( $waf_block_list );' . "\n";
if ( ! $wp_filesystem->put_contents( $block_ip_file_path, "activate( self::WAF_MODULE_NAME, false, false );
@@ -136,6 +139,8 @@ public static function enable() {
/**
* Disabled the WAF module on the site.
+ *
+ * @return bool
*/
public static function disable() {
return ( new Modules() )->deactivate( self::WAF_MODULE_NAME );
@@ -227,7 +232,7 @@ public static function run() {
// phpcs:ignore
include $rules_file_path;
}
-} catch ( \Exception $err ) { // phpcs:ignore
+ } catch ( \Exception $err ) { // phpcs:ignore
// Intentionally doing nothing.
}
@@ -253,8 +258,9 @@ public static function errorHandler( $code, $message, $file, $line ) { // phpcs:
/**
* Initializes the WP filesystem and WAF directory structure.
*
+ * @throws File_System_Exception If filesystem is unavailable.
+ *
* @return void
- * @throws \Exception If filesystem is unavailable.
*/
public static function initialize_filesystem() {
if ( ! function_exists( '\\WP_Filesystem' ) ) {
@@ -262,7 +268,7 @@ public static function initialize_filesystem() {
}
if ( ! \WP_Filesystem() ) {
- throw new \Exception( 'No filesystem available.' );
+ throw new File_System_Exception( 'No filesystem available.' );
}
self::initialize_waf_directory();
@@ -271,12 +277,15 @@ public static function initialize_filesystem() {
/**
* Activates the WAF by generating the rules script and setting the version
*
- * @return bool|WP_Error True if the WAF was activated sucessfully, WP_Error if not.
+ * @throws Waf_Exception If the firewall mode is invalid.
+ * @throws Waf_Exception If the activation fails.
+ *
+ * @return void
*/
public static function activate() {
Waf_Constants::define_mode();
if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) {
- new WP_Error( 'waf_activation_failed', 'Invalid firewall mode.' );
+ throw new Waf_Exception( 'Invalid firewall mode.' );
}
$version = get_option( Waf_Rules_Manager::VERSION_OPTION_NAME );
@@ -286,24 +295,22 @@ public static function activate() {
add_option( self::SHARE_DATA_OPTION_NAME, true );
- try {
- self::initialize_filesystem();
- Waf_Rules_Manager::generate_automatic_rules();
- Waf_Rules_Manager::generate_ip_rules();
- self::create_blocklog_table();
- Waf_Rules_Manager::generate_rules();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_activation_failed', $e->getMessage() );
- }
+ self::initialize_filesystem();
- return true;
+ Waf_Rules_Manager::generate_automatic_rules();
+ Waf_Rules_Manager::generate_ip_rules();
+ Waf_Rules_Manager::generate_rules();
+
+ self::create_blocklog_table();
}
/**
* Ensures that the waf directory is created.
*
+ * @throws File_System_Exception If filesystem is unavailable.
+ * @throws File_System_Exception If creating the directory fails.
+ *
* @return void
- * @throws \Exception In case there's a problem when creating the directory.
*/
public static function initialize_waf_directory() {
WP_Filesystem();
@@ -311,12 +318,12 @@ public static function initialize_waf_directory() {
global $wp_filesystem;
if ( ! $wp_filesystem ) {
- throw new \Exception( 'Can not work without the file system being initialized.' );
+ throw new File_System_Exception( 'Can not work without the file system being initialized.' );
}
if ( ! $wp_filesystem->is_dir( JETPACK_WAF_DIR ) ) {
if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) {
- throw new \Exception( 'Failed creating WAF file directory: ' . JETPACK_WAF_DIR );
+ throw new File_System_Exception( 'Failed creating WAF file directory: ' . JETPACK_WAF_DIR );
}
}
}
@@ -348,15 +355,15 @@ public static function create_blocklog_table() {
/**
* Deactivates the WAF by deleting the relevant options and emptying rules file.
*
+ * @throws File_System_Exception If file writing fails.
+ *
* @return void
- * @throws \Exception If file writing fails.
*/
public static function deactivate() {
delete_option( self::MODE_OPTION_NAME );
delete_option( Waf_Rules_Manager::VERSION_OPTION_NAME );
global $wp_filesystem;
-
self::initialize_filesystem();
// If the rules file doesn't exist, there's nothing else to do.
@@ -366,24 +373,21 @@ public static function deactivate() {
// Empty the rules entrypoint file.
if ( ! $wp_filesystem->put_contents( self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ), "generate();
- } catch ( \Exception $e ) {
- return new WP_Error( 'waf_update_failed', $e->getMessage() );
- }
-
- return true;
+ ( new Waf_Standalone_Bootstrap() )->generate();
}
/**
@@ -404,7 +408,7 @@ public static function automatic_rules_available() {
try {
self::initialize_filesystem();
- } catch ( \Exception $e ) {
+ } catch ( Waf_Exception $e ) {
return false;
}
diff --git a/projects/packages/waf/src/class-waf-standalone-bootstrap.php b/projects/packages/waf/src/class-waf-standalone-bootstrap.php
index 116ebcc734e4b..597e31688fd17 100644
--- a/projects/packages/waf/src/class-waf-standalone-bootstrap.php
+++ b/projects/packages/waf/src/class-waf-standalone-bootstrap.php
@@ -8,7 +8,6 @@
namespace Automattic\Jetpack\Waf;
use Composer\InstalledVersions;
-use Exception;
/**
* Handles the bootstrap.
@@ -17,6 +16,8 @@ class Waf_Standalone_Bootstrap {
/**
* Ensures that constants are initialized if this class is used.
+ *
+ * @return void
*/
public function __construct() {
$this->guard_against_missing_abspath();
@@ -26,13 +27,14 @@ public function __construct() {
/**
* Ensures that this class is not used unless we are in the right context.
*
+ * @throws Waf_Exception If we are outside of WordPress.
+ *
* @return void
- * @throws Exception If we are outside of WordPress.
*/
private function guard_against_missing_abspath() {
if ( ! defined( 'ABSPATH' ) ) {
- throw new Exception( 'Cannot generate the WAF bootstrap if we are not running in WordPress context.' );
+ throw new Waf_Exception( 'Cannot generate the WAF bootstrap if we are not running in WordPress context.' );
}
}
@@ -65,8 +67,9 @@ protected function initialize_filesystem() {
/**
* Finds the path to the autoloader, which can then be used to require the autoloader in the generated boostrap file.
*
+ * @throws Waf_Exception In case the autoloader file can not be found.
+ *
* @return string|null
- * @throws Exception In case the autoloader file can not be found.
*/
private function locate_autoloader_file() {
global $jetpack_autoloader_loader;
@@ -102,7 +105,7 @@ private function locate_autoloader_file() {
// Check that the determined file actually exists.
if ( ! file_exists( $autoload_file ) ) {
- throw new Exception( 'Can not find autoloader, and the WAF standalone boostrap will not work without it.' );
+ throw new Waf_Exception( 'Can not find autoloader, and the WAF standalone boostrap will not work without it.' );
}
return $autoload_file;
@@ -120,8 +123,11 @@ public function get_bootstrap_file_path() {
/**
* Generates the bootstrap file.
*
+ * @throws File_System_Exception If the filesystem is not available.
+ * @throws File_System_Exception If the WAF directory can not be created.
+ * @throws File_System_Exception If the bootstrap file can not be created.
+ *
* @return string Absolute path to the bootstrap file.
- * @throws Exception In case the file can not be written.
*/
public function generate() {
@@ -129,9 +135,11 @@ public function generate() {
global $wp_filesystem;
if ( ! $wp_filesystem ) {
- throw new Exception( 'Can not work without the file system being initialized.' );
+ throw new File_System_Exception( 'Can not work without the file system being initialized.' );
}
+ $autoloader_file = $this->locate_autoloader_file();
+
$bootstrap_file = $this->get_bootstrap_file_path();
$mode_option = get_option( Waf_Runner::MODE_OPTION_NAME, false );
$share_data_option = get_option( Waf_Runner::SHARE_DATA_OPTION_NAME, false );
@@ -144,18 +152,18 @@ public function generate() {
. sprintf( "define( 'JETPACK_WAF_SHARE_DATA', %s );\n", var_export( $share_data_option, true ) )
. sprintf( "define( 'JETPACK_WAF_DIR', %s );\n", var_export( JETPACK_WAF_DIR, true ) )
. sprintf( "define( 'JETPACK_WAF_WPCONFIG', %s );\n", var_export( JETPACK_WAF_WPCONFIG, true ) )
- . 'require_once ' . var_export( $this->locate_autoloader_file(), true ) . ";\n"
+ . 'require_once ' . var_export( $autoloader_file, true ) . ";\n"
. "Automattic\Jetpack\Waf\Waf_Runner::initialize();\n";
// phpcs:enable
if ( ! $wp_filesystem->is_dir( JETPACK_WAF_DIR ) ) {
if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) {
- throw new Exception( 'Failed creating WAF standalone bootstrap file directory: ' . JETPACK_WAF_DIR );
+ throw new File_System_Exception( 'Failed creating WAF standalone bootstrap file directory: ' . JETPACK_WAF_DIR );
}
}
if ( ! $wp_filesystem->put_contents( $bootstrap_file, $code ) ) {
- throw new Exception( 'Failed writing WAF standalone bootstrap file to: ' . $bootstrap_file );
+ throw new File_System_Exception( 'Failed writing WAF standalone bootstrap file to: ' . $bootstrap_file );
}
return $bootstrap_file;
diff --git a/projects/packages/waf/src/exceptions/class-file-system-exception.php b/projects/packages/waf/src/exceptions/class-file-system-exception.php
new file mode 100644
index 0000000000000..ba59b98628d86
--- /dev/null
+++ b/projects/packages/waf/src/exceptions/class-file-system-exception.php
@@ -0,0 +1,24 @@
+getMessage() );
+ }
+
+}
diff --git a/projects/packages/waf/tests/php/integration/test-waf-activation.php b/projects/packages/waf/tests/php/integration/test-waf-activation.php
index d87940c27522a..a88a02ef57930 100644
--- a/projects/packages/waf/tests/php/integration/test-waf-activation.php
+++ b/projects/packages/waf/tests/php/integration/test-waf-activation.php
@@ -49,6 +49,30 @@ public function return_sample_response() {
);
}
+ /**
+ * Return a 503 wpcom rules response.
+ *
+ * @return array
+ */
+ public function return_503_response() {
+ return array(
+ 'body' => '',
+ 'response' => array(
+ 'code' => 503,
+ 'message' => '',
+ ),
+ );
+ }
+
+ /**
+ * Return an invalid filesystem method.
+ *
+ * @return string
+ */
+ public function return_invalid_filesystem_method() {
+ return 'Code is poetry.';
+ }
+
/**
* Test WAF activation.
*/
@@ -80,4 +104,79 @@ public function testActivation() {
remove_filter( 'pre_http_request', array( $this, 'return_sample_response' ) );
}
+ /**
+ * Test WAF deactivation.
+ */
+ public function testDeactivation() {
+ $deactivated = Waf_Initializer::on_deactivation();
+
+ // Ensure the WAF was deactivated successfully.
+ $this->assertTrue( $deactivated );
+
+ // Ensure the options were deleted.
+ $this->assertSame( get_option( Waf_Runner::SHARE_DATA_OPTION_NAME ), false );
+ $this->assertSame( get_option( Waf_Runner::MODE_OPTION_NAME ), false );
+
+ // Ensure the rules entrypoint file was emptied.
+ $this->assertSame( file_get_contents( Waf_Runner::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ) ), "assertTrue( is_wp_error( $activated ) );
+ $this->assertSame( 'file_system_error', $activated->get_error_code() );
+
+ // Clean up.
+ remove_filter( 'pre_http_request', array( $this, 'return_sample_response' ) );
+ remove_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+ }
+
+ /**
+ * Test WAF deactivation when the filesystem is unavailable.
+ */
+ public function testDeactivationWhenFilesystemUnavailable() {
+ // Break the filesystem.
+ add_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+
+ // Deactivate the firewall.
+ $deactivated = Waf_Initializer::on_deactivation();
+
+ // Validate the error.
+ $this->assertTrue( is_wp_error( $deactivated ) );
+ $this->assertSame( 'file_system_error', $deactivated->get_error_code() );
+
+ // Clean up.
+ remove_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+ }
+
+ /**
+ * Test WAF activation when the rules API request fails.
+ */
+ public function testActivationReturnsWpErrorWhenRulesApiRequestFails() {
+ // Mock the WPCOM request for retrieving the automatic rules.
+ add_filter( 'pre_http_request', array( $this, 'return_503_response' ) );
+
+ // Initialize the firewall.
+ $activated = Waf_Initializer::on_activation();
+
+ // Validate the error.
+ $this->assertTrue( is_wp_error( $activated ) );
+ $this->assertSame( 'rules_api_error', $activated->get_error_code() );
+
+ // Clean up.
+ remove_filter( 'pre_http_request', array( $this, 'return_503_response' ) );
+ }
+
}
diff --git a/projects/packages/waf/tests/php/integration/test-waf-rest-api.php b/projects/packages/waf/tests/php/integration/test-waf-rest-api.php
new file mode 100644
index 0000000000000..15a2dbce5f367
--- /dev/null
+++ b/projects/packages/waf/tests/php/integration/test-waf-rest-api.php
@@ -0,0 +1,179 @@
+ " wp_json_encode( $sample_response ),
+ 'response' => array(
+ 'code' => 200,
+ 'message' => '',
+ ),
+ );
+ }
+
+ /**
+ * Return a 503 wpcom rules response.
+ *
+ * @return array
+ */
+ public function return_503_response() {
+ return array(
+ 'body' => '',
+ 'response' => array(
+ 'code' => 503,
+ 'message' => '',
+ ),
+ );
+ }
+
+ /**
+ * Return an invalid filesystem method.
+ *
+ * @return string
+ */
+ public function return_invalid_filesystem_method() {
+ return 'Code is poetry.';
+ }
+
+ /**
+ * Test /jetpack/v4/waf/update-rules.
+ */
+ public function testUpdateRulesEndpoint() {
+ // Mock the WPCOM request for retrieving the automatic rules.
+ add_filter( 'pre_http_request', array( $this, 'return_sample_response' ) );
+
+ // Call /jetpack/v4/waf/update-rules.
+ $response = REST_Controller::update_rules();
+
+ // Validate the response.
+ $this->assertTrue( $response->data['success'] );
+
+ // Clean up.
+ remove_filter( 'pre_http_request', array( $this, 'return_sample_response' ) );
+ }
+
+ /**
+ * Test /jetpack/v4/waf/update-rules when the filesystem is unavailable.
+ */
+ public function testUpdateRulesEndpointFilesystemUnavailable() {
+ // Mock the WPCOM request for retrieving the automatic rules.
+ add_filter( 'pre_http_request', array( $this, 'return_sample_response' ) );
+
+ // Break the filesystem.
+ add_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+
+ // Call /jetpack/v4/waf/update-rules.
+ $response = REST_Controller::update_rules();
+
+ // Validate the response.
+ $this->assertTrue( is_wp_error( $response ) );
+ $this->assertSame( 'file_system_error', $response->get_error_code() );
+
+ // Clean up.
+ remove_filter( 'pre_http_request', array( $this, 'return_sample_response' ) );
+ remove_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+ }
+
+ /**
+ * Test /jetpack/v4/waf/update-rules when the WPCOM request fails.
+ */
+ public function testUpdateRulesEndpointWpcomRequestFails() {
+ // Mock the WPCOM request for retrieving the automatic rules.
+ add_filter( 'pre_http_request', array( $this, 'return_503_response' ) );
+
+ // Call /jetpack/v4/waf/update-rules.
+ $response = REST_Controller::update_rules();
+
+ // Validate the response.
+ $this->assertTrue( is_wp_error( $response ) );
+ $this->assertSame( 'rules_api_error', $response->get_error_code() );
+
+ // Clean up.
+ remove_filter( 'pre_http_request', array( $this, 'return_503_response' ) );
+ }
+
+ /**
+ * Test /jetpack/v4/waf POST.
+ */
+ public function testUpdateWaf() {
+ // Mock the request.
+ $request = new WP_REST_Request( 'POST', '/jetpack/v4/waf' );
+ $request->set_header( 'content-type', 'application/json' );
+ $request->set_body(
+ wp_json_encode(
+ array(
+ 'jetpack_waf_automatic_rules_enabled' => true,
+ )
+ )
+ );
+
+ // Call the endpoint.
+ $response = REST_Controller::update_waf( $request );
+
+ // Validate the response.
+ $this->assertFalse( is_wp_error( $response ) );
+ }
+
+ /**
+ * Test /jetpack/v4/waf POST when filesystem is unavailable.
+ */
+ public function testUpdateWafFilesystemUnavailable() {
+ // Break the filesystem.
+ add_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+
+ // Mock the request.
+ $request = new WP_REST_Request( 'POST', '/jetpack/v4/waf' );
+ $request->set_header( 'content-type', 'application/json' );
+ $request->set_body(
+ wp_json_encode(
+ array(
+ 'jetpack_waf_automatic_rules_enabled' => true,
+ )
+ )
+ );
+
+ // Call the endpoint.
+ $response = REST_Controller::update_waf( $request );
+
+ // Validate the response.
+ $this->assertTrue( is_wp_error( $response ) );
+ $this->assertSame( 'file_system_error', $response->get_error_code() );
+
+ // Clean up.
+ remove_filter( 'filesystem_method', array( $this, 'return_invalid_filesystem_method' ) );
+ }
+}
diff --git a/projects/packages/wordads/CHANGELOG.md b/projects/packages/wordads/CHANGELOG.md
index 5cd75c1f13a66..ca60418fc231e 100644
--- a/projects/packages/wordads/CHANGELOG.md
+++ b/projects/packages/wordads/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).
+## [0.2.34] - 2023-03-08
+### Changed
+- Updated package dependencies. [#29216]
+
## [0.2.33] - 2023-02-28
### Changed
- Updated package dependencies.
@@ -165,6 +169,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput`
- Updated package dependencies.
+[0.2.34]: https://github.com/Automattic/jetpack-wordads/compare/v0.2.33...v0.2.34
[0.2.33]: https://github.com/Automattic/jetpack-wordads/compare/v0.2.32...v0.2.33
[0.2.32]: https://github.com/Automattic/jetpack-wordads/compare/v0.2.31...v0.2.32
[0.2.31]: https://github.com/Automattic/jetpack-wordads/compare/v0.2.30...v0.2.31
diff --git a/projects/packages/wordads/changelog/renovate-concurrently-7.x b/projects/packages/wordads/changelog/renovate-concurrently-7.x
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/packages/wordads/changelog/renovate-concurrently-7.x
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/packages/wordads/changelog/renovate-jest-monorepo b/projects/packages/wordads/changelog/renovate-jest-monorepo
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/packages/wordads/changelog/renovate-jest-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/packages/wordads/changelog/renovate-wordpress-monorepo b/projects/packages/wordads/changelog/renovate-wordpress-monorepo
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/packages/wordads/changelog/renovate-wordpress-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/packages/wordads/package.json b/projects/packages/wordads/package.json
index a5463d517444d..6385d6abb5629 100644
--- a/projects/packages/wordads/package.json
+++ b/projects/packages/wordads/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-wordads",
- "version": "0.2.34-alpha",
+ "version": "0.2.34",
"description": "Earn income by allowing Jetpack to display high quality ads.",
"main": "main.js",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/wordads/#readme",
diff --git a/projects/packages/wordads/src/class-package.php b/projects/packages/wordads/src/class-package.php
index 5c89072fc5b7f..9a2303e11cb0c 100644
--- a/projects/packages/wordads/src/class-package.php
+++ b/projects/packages/wordads/src/class-package.php
@@ -11,7 +11,7 @@
* WordAds package general information
*/
class Package {
- const VERSION = '0.2.34-alpha';
+ const VERSION = '0.2.34';
const SLUG = 'wordads';
/**
diff --git a/projects/plugins/backup/CHANGELOG.md b/projects/plugins/backup/CHANGELOG.md
index 9661f74746d08..252953f3373d0 100644
--- a/projects/plugins/backup/CHANGELOG.md
+++ b/projects/plugins/backup/CHANGELOG.md
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## 1.5-beta - 2023-02-28
+## 1.5 - 2023-03-07
### Changed
- Backup: Update description headline, add video [#28890]
- Updated package dependencies. [#28910]
diff --git a/projects/plugins/debug-helper/changelog/renovate-yoast-phpunit-polyfills-1.x b/projects/plugins/backup/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/debug-helper/changelog/renovate-yoast-phpunit-polyfills-1.x
rename to projects/plugins/backup/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/mu-wpcom-plugin/changelog/add-launchpad-rest-api-endpoint b/projects/plugins/backup/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/mu-wpcom-plugin/changelog/add-launchpad-rest-api-endpoint
rename to projects/plugins/backup/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/backup/changelog/update-backport-11.9-social-backup b/projects/plugins/backup/changelog/update-backport-11.9-social-backup
new file mode 100644
index 0000000000000..56edc9402397f
--- /dev/null
+++ b/projects/plugins/backup/changelog/update-backport-11.9-social-backup
@@ -0,0 +1,5 @@
+Significance: patch
+Type: changed
+Comment: Backport release changelog and stable tag
+
+
diff --git a/projects/plugins/backup/changelog/update-wp-tested-up-to b/projects/plugins/backup/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/backup/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/backup/composer.lock b/projects/plugins/backup/composer.lock
index 2e9bd649abce5..ee676ab0809d0 100644
--- a/projects/plugins/backup/composer.lock
+++ b/projects/plugins/backup/composer.lock
@@ -793,7 +793,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -820,7 +820,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/backup/readme.txt b/projects/plugins/backup/readme.txt
index a93c8a4215cf0..68045da428068 100644
--- a/projects/plugins/backup/readme.txt
+++ b/projects/plugins/backup/readme.txt
@@ -3,8 +3,8 @@ Contributors: automattic, bjorsch, fgiannar, initsogar, jeherve, jwebbdev, kraft
Tags: jetpack
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
-Stable tag: 1.4.4
+Tested up to: 6.2
+Stable tag: 1.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -162,10 +162,14 @@ No, Jetpack VaultPress Backup does not currently support split site or split hom
2. Your site backups are stored in multiple locations on our world-class cloud infrastructure so you can recover them at any moment.
== Changelog ==
-### 1.4.4 - 2023-02-07
+### 1.5 - 2023-03-07
#### Changed
+- Backup: Update description headline, add video
- Updated package dependencies.
+#### Fixed
+- Fixes the plugin's versioning so it actually uses WordPress versioning
+
--------
[See the previous changelogs here](https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/backup/CHANGELOG.md#changelog)
diff --git a/projects/plugins/boost/.phpcsignore b/projects/plugins/boost/.phpcsignore
deleted file mode 100644
index 4a50d6733770d..0000000000000
--- a/projects/plugins/boost/.phpcsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# For the time being, ignore page optimize refactor
-/app/features/optimizations/minify/
diff --git a/projects/plugins/boost/README.md b/projects/plugins/boost/README.md
index b0ec32c326b2e..89552ffafa725 100644
--- a/projects/plugins/boost/README.md
+++ b/projects/plugins/boost/README.md
@@ -6,6 +6,18 @@ Jetpack Boost gives your site the same performance advantages as the world’s l
**If you are not planning on developing with Jetpack Boost, you should install Jetpack Boost from pre-built sources.** Details on that may be found [on this page](https://github.com/Automattic/jetpack-boost-production).
+## Development
+
+### Live-reloading CSS
+
+The live-reload feature is configured to only reload CSS files. Currently the way our rollup/webpack combination is configured - every change results in a full rebuild of the JS files, so even style changes would trigger a full page refresh.
+
+If you want to use the live-reloading feature, you have to install the [Livereload extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en) (for Chrome) and then run
+
+```sh
+npm run devlive
+```
+
### Installation from Git repo
Please refer to the [Development guide](./docs/DEVELOPEMENT_GUIDE.md) section of Jetpack Boost documentation.
diff --git a/projects/plugins/boost/app/features/optimizations/minify/Concatenate_CSS.php b/projects/plugins/boost/app/features/optimizations/minify/Concatenate_CSS.php
index cb468c980180d..5d65c096332bc 100644
--- a/projects/plugins/boost/app/features/optimizations/minify/Concatenate_CSS.php
+++ b/projects/plugins/boost/app/features/optimizations/minify/Concatenate_CSS.php
@@ -4,13 +4,16 @@
use WP_Styles;
+// Disable complaints about enqueuing stylesheets, as this class alters the way enqueuing them works.
+// phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
+
class Concatenate_CSS extends WP_Styles {
private $dependency_path_mapping;
private $old_styles;
public $allow_gzip_compression;
- function __construct( $styles ) {
+ public function __construct( $styles ) {
if ( empty( $styles ) || ! ( $styles instanceof WP_Styles ) ) {
$this->old_styles = new WP_Styles();
} else {
@@ -32,7 +35,7 @@ function __construct( $styles ) {
);
}
- function do_items( $handles = false, $group = false ) {
+ public function do_items( $handles = false, $group = false ) {
$handles = false === $handles ? $this->queue : (array) $handles;
$stylesheets = array();
$siteurl = apply_filters( 'page_optimize_site_url', $this->base_url );
@@ -53,11 +56,11 @@ function do_items( $handles = false, $group = false ) {
// http://core.trac.wordpress.org/attachment/ticket/16827/colors-hacked-fixed.diff
// http://core.trac.wordpress.org/ticket/20729
$css_url = $obj->src;
- if ( 'colors' == $obj->handle && true === $css_url ) {
+ if ( 'colors' === $obj->handle && true === $css_url ) {
$css_url = wp_style_loader_src( $css_url, $obj->handle );
}
- $css_url_parsed = parse_url( $obj->src );
+ $css_url_parsed = wp_parse_url( $obj->src );
$extra = $obj->extra;
// Don't concat by default
@@ -141,9 +144,9 @@ function do_items( $handles = false, $group = false ) {
unset( $this->to_do[ $key ] );
}
- foreach ( $stylesheets as $idx => $stylesheets_group ) {
+ foreach ( $stylesheets as $_idx => $stylesheets_group ) {
foreach ( $stylesheets_group as $media => $css ) {
- if ( 'noconcat' == $media ) {
+ if ( 'noconcat' === $media ) {
foreach ( $css as $handle ) {
if ( $this->do_item( $handle, $group ) ) {
$this->done[] = $handle;
@@ -165,6 +168,7 @@ function do_items( $handles = false, $group = false ) {
$path_str = "$path_str?m=$mtime";
if ( $this->allow_gzip_compression ) {
+ // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
$path_64 = base64_encode( gzcompress( $path_str ) );
if ( strlen( $path_str ) > ( strlen( $path_64 ) + 1 ) ) {
$path_str = '-' . $path_64;
@@ -187,6 +191,7 @@ function do_items( $handles = false, $group = false ) {
$style_tag = apply_filters( 'page_optimize_style_loader_tag', $style_tag, $handles, $href, $media );
$style_tag = apply_filters( 'style_loader_tag', $style_tag, $handles, $href, $media );
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $style_tag . "\n";
array_map( array( $this, 'print_inline_style' ), array_keys( $css ) );
@@ -196,19 +201,19 @@ function do_items( $handles = false, $group = false ) {
return $this->done;
}
- function __isset( $key ) {
+ public function __isset( $key ) {
return isset( $this->old_styles->$key );
}
- function __unset( $key ) {
+ public function __unset( $key ) {
unset( $this->old_styles->$key );
}
- function &__get( $key ) {
+ public function &__get( $key ) {
return $this->old_styles->$key;
}
- function __set( $key, $value ) {
+ public function __set( $key, $value ) {
$this->old_styles->$key = $value;
}
}
diff --git a/projects/plugins/boost/app/features/optimizations/minify/Concatenate_JS.php b/projects/plugins/boost/app/features/optimizations/minify/Concatenate_JS.php
index 948a3994dc5ab..b9d023cd99533 100644
--- a/projects/plugins/boost/app/features/optimizations/minify/Concatenate_JS.php
+++ b/projects/plugins/boost/app/features/optimizations/minify/Concatenate_JS.php
@@ -4,13 +4,16 @@
use WP_Scripts;
+// Disable complaints about enqueuing scripts, as this class alters the way enqueuing them works.
+// phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedScript
+
class Concatenate_JS extends WP_Scripts {
private $dependency_path_mapping;
private $old_scripts;
public $allow_gzip_compression;
- function __construct( $scripts ) {
+ public function __construct( $scripts ) {
if ( empty( $scripts ) || ! ( $scripts instanceof WP_Scripts ) ) {
$this->old_scripts = new WP_Scripts();
} else {
@@ -52,7 +55,9 @@ protected function has_inline_content( $handle ) {
return false;
}
- function do_items( $handles = false, $group = false ) {
+ public function do_items( $handles = false, $group = false ) {
+ global $wp_filesystem;
+
$handles = false === $handles ? $this->queue : (array) $handles;
$javascripts = array();
$siteurl = apply_filters( 'page_optimize_site_url', $this->base_url );
@@ -62,7 +67,7 @@ function do_items( $handles = false, $group = false ) {
$using_strict = false;
foreach ( $this->to_do as $key => $handle ) {
$script_is_strict = false;
- if ( in_array( $handle, $this->done ) || ! isset( $this->registered[ $handle ] ) ) {
+ if ( in_array( $handle, $this->done, true ) || ! isset( $this->registered[ $handle ] ) ) {
continue;
}
@@ -85,7 +90,7 @@ function do_items( $handles = false, $group = false ) {
$obj = $this->registered[ $handle ];
$js_url = $obj->src;
- $js_url_parsed = parse_url( $js_url );
+ $js_url_parsed = wp_parse_url( $js_url );
// Don't concat by default
$do_concat = false;
@@ -131,7 +136,7 @@ function do_items( $handles = false, $group = false ) {
}
$do_concat = false;
$script_is_strict = true;
- } elseif ( $do_concat && preg_match_all( '/^[\',"]use strict[\',"];/Uims', file_get_contents( $js_realpath ), $matches ) ) {
+ } elseif ( $do_concat && preg_match_all( '/^[\',"]use strict[\',"];/Uims', $wp_filesystem->get_contents( $js_realpath ), $matches ) ) {
// Skip third-party scripts that use Strict Mode
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
echo sprintf( "\n\n", esc_html( $handle ) );
@@ -196,11 +201,11 @@ function do_items( $handles = false, $group = false ) {
}
foreach ( $javascripts as $js_array ) {
- if ( 'do_item' == $js_array['type'] ) {
+ if ( 'do_item' === $js_array['type'] ) {
if ( $this->do_item( $js_array['handle'], $group ) ) {
$this->done[] = $js_array['handle'];
}
- } elseif ( 'concat' == $js_array['type'] ) {
+ } elseif ( 'concat' === $js_array['type'] ) {
array_map( array( $this, 'print_extra_script' ), $js_array['handles'] );
if ( isset( $js_array['paths'] ) && count( $js_array['paths'] ) > 1 ) {
@@ -218,6 +223,7 @@ function do_items( $handles = false, $group = false ) {
$path_str = "$path_str?m=$mtime";
if ( $this->allow_gzip_compression ) {
+ // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
$path_64 = base64_encode( gzcompress( $path_str ) );
if ( strlen( $path_str ) > ( strlen( $path_64 ) + 1 ) ) {
$path_str = '-' . $path_64;
@@ -234,6 +240,7 @@ function do_items( $handles = false, $group = false ) {
// Print before/after scripts from wp_inline_scripts() and concatenated script tag
if ( isset( $js_array['extras']['before'] ) ) {
foreach ( $js_array['extras']['before'] as $inline_before ) {
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $inline_before;
}
}
@@ -257,11 +264,13 @@ function do_items( $handles = false, $group = false ) {
$tag = apply_filters( 'script_loader_tag', $tag, $js_array['handles'][0], $href );
}
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $tag;
}
if ( isset( $js_array['extras']['after'] ) ) {
foreach ( $js_array['extras']['after'] as $inline_after ) {
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $inline_after;
}
}
@@ -273,19 +282,19 @@ function do_items( $handles = false, $group = false ) {
return $this->done;
}
- function __isset( $key ) {
+ public function __isset( $key ) {
return isset( $this->old_scripts->$key );
}
- function __unset( $key ) {
+ public function __unset( $key ) {
unset( $this->old_scripts->$key );
}
- function &__get( $key ) {
+ public function &__get( $key ) {
return $this->old_scripts->$key;
}
- function __set( $key, $value ) {
+ public function __set( $key, $value ) {
$this->old_scripts->$key = $value;
}
}
diff --git a/projects/plugins/boost/app/features/optimizations/minify/Dependency_Path_Mapping.php b/projects/plugins/boost/app/features/optimizations/minify/Dependency_Path_Mapping.php
index 1c9de4f811c34..8adeede37d18a 100644
--- a/projects/plugins/boost/app/features/optimizations/minify/Dependency_Path_Mapping.php
+++ b/projects/plugins/boost/app/features/optimizations/minify/Dependency_Path_Mapping.php
@@ -2,8 +2,6 @@
namespace Automattic\Jetpack_Boost\Features\Optimizations\Minify;
-use Automattic\Jetpack_Boost\Features\Optimizations\Minify\Config;
-
/**
* This is a class to map script and style URLs to local filesystem paths.
* This is necessary when we are deciding what we can concatenate and when
@@ -21,7 +19,7 @@ class Dependency_Path_Mapping {
public $plugin_uri_path = null;
public $plugin_dir = null;
- function __construct(
+ public function __construct(
// Expose URLs and DIRs for unit test
$site_url = null, // default site URL is determined dynamically
$site_dir = null,
@@ -39,18 +37,18 @@ function __construct(
}
$site_url = trailingslashit( $site_url );
$this->site_url = $site_url;
- $this->site_uri_path = parse_url( $site_url, PHP_URL_PATH );
+ $this->site_uri_path = wp_parse_url( $site_url, PHP_URL_PATH );
$this->site_dir = trailingslashit( $site_dir );
// Only resolve content URLs if they are under the site URL
if ( $this->is_internal_uri( $content_url ) ) {
- $this->content_uri_path = parse_url( trailingslashit( $content_url ), PHP_URL_PATH );
+ $this->content_uri_path = wp_parse_url( trailingslashit( $content_url ), PHP_URL_PATH );
$this->content_dir = trailingslashit( $content_dir );
}
// Only resolve plugin URLs if they are under the site URL
if ( $this->is_internal_uri( $plugin_url ) ) {
- $this->plugin_uri_path = parse_url( trailingslashit( $plugin_url ), PHP_URL_PATH );
+ $this->plugin_uri_path = wp_parse_url( trailingslashit( $plugin_url ), PHP_URL_PATH );
$this->plugin_dir = trailingslashit( $plugin_dir );
}
}
@@ -58,14 +56,14 @@ function __construct(
/**
* Given the full URL of a script/style dependency, return its local filesystem path.
*/
- function dependency_src_to_fs_path( $src ) {
+ public function dependency_src_to_fs_path( $src ) {
if ( ! $this->is_internal_uri( $src ) ) {
// If a URI is not internal, we can have no confidence
// we are resolving to the correct file.
return false;
}
- $src_parts = parse_url( $src );
+ $src_parts = wp_parse_url( $src );
if ( false === $src_parts ) {
return false;
}
@@ -89,7 +87,7 @@ function dependency_src_to_fs_path( $src ) {
/**
* Given a URI path of a script/style resource, return its local filesystem path.
*/
- function uri_path_to_fs_path( $uri_path ) {
+ public function uri_path_to_fs_path( $uri_path ) {
if ( 1 === preg_match( '#(?:^|/)\.\.?(?:/|$)#', $uri_path ) ) {
// Reject relative paths
return false;
@@ -118,7 +116,7 @@ function uri_path_to_fs_path( $uri_path ) {
*
* This method helps ensure we only resolve to local FS paths.
*/
- function is_internal_uri( $uri ) {
+ public function is_internal_uri( $uri ) {
if ( jetpack_boost_page_optimize_starts_with( '/', $uri ) && ! jetpack_boost_page_optimize_starts_with( '//', $uri ) ) {
// Absolute paths are internal because they are based on the site dir (typically ABSPATH),
// and this looks like an absolute path.
@@ -135,7 +133,7 @@ function is_internal_uri( $uri ) {
*
* Does not handle relative paths.
*/
- static function is_descendant_uri( $dir_path, $candidate ) {
+ public static function is_descendant_uri( $dir_path, $candidate ) {
// Ensure a trailing slash to avoid false matches like
// "/wp-content/resource" being judged a descendant of "/wp".
$dir_path = trailingslashit( $dir_path );
diff --git a/projects/plugins/boost/app/features/optimizations/minify/Minify.php b/projects/plugins/boost/app/features/optimizations/minify/Minify.php
index 6011e8b220ec7..a54693d7547c7 100644
--- a/projects/plugins/boost/app/features/optimizations/minify/Minify.php
+++ b/projects/plugins/boost/app/features/optimizations/minify/Minify.php
@@ -3,16 +3,19 @@
namespace Automattic\Jetpack_Boost\Features\Optimizations\Minify;
use Automattic\Jetpack_Boost\Contracts\Feature;
-use Automattic\Jetpack_Boost\Features\Optimizations\Minify\Config;
+
+// Allow overriding WordPress globals, as that is necessary to taking over script output.
+// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
class Minify implements Feature {
// @todo - handle PHP constants.
public function setup() {
- require 'functions-helpers.php';
+ require __DIR__ . '/functions-helpers.php';
// TODO: Make concat URL dir configurable
- if ( isset( $_SERVER['REQUEST_URI'] ) && '/_static/' === substr( $_SERVER['REQUEST_URI'], 0, 9 ) ) {
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ if ( isset( $_SERVER['REQUEST_URI'] ) && '/_static/' === substr( wp_unslash( $_SERVER['REQUEST_URI'] ), 0, 9 ) ) {
require_once __DIR__ . '/service.php';
exit;
}
@@ -46,6 +49,8 @@ public function init_concatenate() {
return;
}
+ jetpack_boost_init_filesystem();
+
if ( jetpack_boost_page_optimize_should_concat_js() || jetpack_boost_page_optimize_load_mode_js() ) {
global $wp_scripts;
diff --git a/projects/plugins/boost/app/features/optimizations/minify/functions-helpers.php b/projects/plugins/boost/app/features/optimizations/minify/functions-helpers.php
index 0d4910ac68228..e69d20ace21a6 100644
--- a/projects/plugins/boost/app/features/optimizations/minify/functions-helpers.php
+++ b/projects/plugins/boost/app/features/optimizations/minify/functions-helpers.php
@@ -32,7 +32,7 @@ function jetpack_boost_page_optimize_cache_cleanup( $cache_folder = false, $file
}
if ( ( time() - $file_age ) > filemtime( $cache_file ) ) {
- unlink( $cache_file );
+ wp_delete_file( $cache_file );
}
}
}
@@ -43,7 +43,7 @@ function jetpack_boost_page_optimize_deactivate() {
jetpack_boost_page_optimize_cache_cleanup( $cache_folder, 0 /* max file age in seconds */ );
- wp_clear_scheduled_hook( Config::get_cron_cache_cleanup_hook(), [ $cache_folder ] );
+ wp_clear_scheduled_hook( Config::get_cron_cache_cleanup_hook(), array( $cache_folder ) );
}
function jetpack_boost_page_optimize_uninstall() {
@@ -57,17 +57,25 @@ function jetpack_boost_page_optimize_uninstall() {
// CSS
delete_option( 'page_optimize-css' );
delete_option( 'page_optimize-css-exclude' );
-
}
-function jetpack_boost_page_optimize_get_text_domain() {
- return 'page-optimize';
+/**
+ * Ensure that WP_Filesystem is ready to use.
+ */
+function jetpack_boost_init_filesystem() {
+ global $wp_filesystem;
+
+ if ( empty( $wp_filesystem ) ) {
+ require_once ABSPATH . 'wp-admin/includes/file.php';
+ \WP_Filesystem();
+ }
}
function jetpack_boost_page_optimize_should_concat_js() {
// Support query param for easy testing
- if ( isset( $_GET['concat-js'] ) ) {
- return $_GET['concat-js'] !== '0';
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
+ if ( isset( $_GET['concat-js'] ) && $_GET['concat-js'] !== '0' ) {
+ return true;
}
return (bool) get_option( 'page_optimize-js', jetpack_boost_page_optimize_js_default() );
@@ -75,20 +83,25 @@ function jetpack_boost_page_optimize_should_concat_js() {
// TODO: Support JS load mode regardless of whether concat is enabled
function jetpack_boost_page_optimize_load_mode_js() {
- // Support query param for easy testing
- if ( ! empty( $_GET['load-mode-js'] ) ) {
- $load_mode = jetpack_boost_page_optimize_sanitize_js_load_mode( $_GET['load-mode-js'] );
- } else {
- $load_mode = jetpack_boost_page_optimize_sanitize_js_load_mode( get_option( 'page_optimize-load-mode', jetpack_boost_page_optimize_js_load_mode_default() ) );
+ $load_mode_arg = jetpack_boost_page_optimize_sanitize_js_load_mode(
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
+ empty( $_GET['load-mode-js'] ) ? '' : filter_var( wp_unslash( $_GET['load-mode-js'] ) )
+ );
+
+ if ( ! empty( $load_mode_arg ) ) {
+ return $load_mode_arg;
}
- return $load_mode;
+ return jetpack_boost_page_optimize_sanitize_js_load_mode(
+ get_option( 'page_optimize-load-mode', jetpack_boost_page_optimize_js_load_mode_default() )
+ );
}
function jetpack_boost_page_optimize_should_concat_css() {
// Support query param for easy testing
- if ( isset( $_GET['concat-css'] ) ) {
- return $_GET['concat-css'] !== '0';
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
+ if ( isset( $_GET['concat-css'] ) && $_GET['concat-css'] !== '0' ) {
+ return true;
}
return (bool) get_option( 'page_optimize-css', jetpack_boost_page_optimize_css_default() );
@@ -225,7 +238,7 @@ function jetpack_boost_page_optimize_remove_concat_base_prefix( $original_fs_pat
function jetpack_boost_page_optimize_schedule_cache_cleanup() {
$cache_folder = Config::get_cache_dir_path();
- $args = array( $cache_folder );
+ $args = array( $cache_folder );
$cache_cleanup_hook = Config::get_cron_cache_cleanup_hook();
@@ -244,11 +257,13 @@ function jetpack_boost_page_optimize_bail() {
}
// Bail if Divi theme is active, and we're in the Divi Front End Builder
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( ! empty( $_GET['et_fb'] ) && 'Divi' === wp_get_theme()->get_template() ) {
return true;
}
// Bail if we're editing pages in Brizy Editor
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( class_exists( 'Brizy_Editor' ) && method_exists( 'Brizy_Editor', 'prefix' ) && ( isset( $_GET[ Brizy_Editor::prefix( '-edit-iframe' ) ] ) || isset( $_GET[ Brizy_Editor::prefix( '-edit' ) ] ) ) ) {
return true;
}
@@ -266,7 +281,7 @@ function jetpack_boost_page_optimize_cache_bust_mtime( $path, $siteurl ) {
return $url;
}
- $parts = parse_url( $url );
+ $parts = wp_parse_url( $url );
if ( ! isset( $parts['path'] ) || empty( $parts['path'] ) ) {
return $url;
}
diff --git a/projects/plugins/boost/app/features/optimizations/minify/service.php b/projects/plugins/boost/app/features/optimizations/minify/service.php
index 75774286da462..34493ba163ab0 100644
--- a/projects/plugins/boost/app/features/optimizations/minify/service.php
+++ b/projects/plugins/boost/app/features/optimizations/minify/service.php
@@ -12,45 +12,58 @@ function jetpack_boost_page_optimize_types() {
}
function jetpack_boost_page_optimize_service_request() {
+ global $wp_filesystem;
+
+ jetpack_boost_init_filesystem();
+
$cache_dir = Config::get_cache_dir_path();
$use_cache = ! empty( $cache_dir );
- if ( $use_cache && ! is_dir( $cache_dir ) && ! mkdir( $cache_dir, 0775, true ) ) {
+ if ( $use_cache && ! is_dir( $cache_dir ) && ! $wp_filesystem->mkdir( $cache_dir, 0775, true ) ) {
$use_cache = false;
- error_log(
- sprintf(
- /* translators: a filesystem path to a directory */
- __( "Disabling page-optimize cache. Unable to create cache directory '%s'.", jetpack_boost_page_optimize_get_text_domain() ),
- $cache_dir
- )
- );
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
+ error_log(
+ sprintf(
+ /* translators: a filesystem path to a directory */
+ __( "Disabling page-optimize cache. Unable to create cache directory '%s'.", 'jetpack-boost' ),
+ $cache_dir
+ )
+ );
+ }
}
- if ( $use_cache && ( ! is_dir( $cache_dir ) || ! is_writable( $cache_dir ) || ! is_executable( $cache_dir ) ) ) {
+ if ( $use_cache && ( ! is_dir( $cache_dir ) || ! $wp_filesystem->is_writable( $cache_dir ) || ! is_executable( $cache_dir ) ) ) {
$use_cache = false;
- error_log(
- sprintf(
- /* translators: a filesystem path to a directory */
- __( "Disabling page-optimize cache. Unable to write to cache directory '%s'.", jetpack_boost_page_optimize_get_text_domain() ),
- $cache_dir
- )
- );
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
+ error_log(
+ sprintf(
+ /* translators: a filesystem path to a directory */
+ __( "Disabling page-optimize cache. Unable to write to cache directory '%s'.", 'jetpack-boost' ),
+ $cache_dir
+ )
+ );
+ }
}
if ( $use_cache ) {
- $request_uri_hash = md5( $_SERVER['REQUEST_URI'] );
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? wp_unslash( $_SERVER['REQUEST_URI'] ) : '';
+ $request_uri_hash = md5( $request_uri );
$cache_file = $cache_dir . "/page-optimize-cache-$request_uri_hash";
$cache_file_meta = $cache_dir . "/page-optimize-cache-meta-$request_uri_hash";
if ( file_exists( $cache_file ) ) {
if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
- if ( strtotime( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) < filemtime( $cache_file ) ) {
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ if ( strtotime( wp_unslash( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) < filemtime( $cache_file ) ) {
header( 'HTTP/1.1 304 Not Modified' );
exit;
}
}
if ( file_exists( $cache_file_meta ) ) {
- $meta = json_decode( file_get_contents( $cache_file_meta ) );
+ $meta = json_decode( $wp_filesystem->get_contents( $cache_file_meta ) );
if ( null !== $meta && isset( $meta->headers ) ) {
foreach ( $meta->headers as $header ) {
header( $header );
@@ -58,13 +71,13 @@ function jetpack_boost_page_optimize_service_request() {
}
}
- $etag = '"' . md5( file_get_contents( $cache_file ) ) . '"';
+ $etag = '"' . md5( $wp_filesystem->get_contents( $cache_file ) ) . '"';
header( 'X-Page-Optimize: cached' );
header( 'Cache-Control: max-age=' . 31536000 );
header( 'ETag: ' . $etag );
- echo file_get_contents( $cache_file ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to trust this unfortunately.
+ echo $wp_filesystem->get_contents( $cache_file ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to trust this unfortunately.
die();
}
}
@@ -83,29 +96,35 @@ function jetpack_boost_page_optimize_service_request() {
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to trust this unfortunately.
if ( $use_cache ) {
- file_put_contents( $cache_file, $content );
- file_put_contents( $cache_file_meta, json_encode( array( 'headers' => $headers ) ) );
+ $wp_filesystem->put_contents( $cache_file, $content );
+ $wp_filesystem->put_contents( $cache_file_meta, wp_json_encode( array( 'headers' => $headers ) ) );
}
die();
}
function jetpack_boost_page_optimize_build_output() {
+ global $wp_filesystem;
+
$jetpack_boost_page_optimize_types = jetpack_boost_page_optimize_types();
- /* Config */
+ // Config
$concat_max_files = 150;
$concat_unique = true;
- /* Main() */
- if ( ! in_array( $_SERVER['REQUEST_METHOD'], array( 'GET', 'HEAD' ) ) ) {
+ // Main
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ $method = isset( $_SERVER['REQUEST_METHOD'] ) ? wp_unslash( $_SERVER['REQUEST_METHOD'] ) : 'GET';
+ if ( ! in_array( $method, array( 'GET', 'HEAD' ), true ) ) {
jetpack_boost_page_optimize_status_exit( 400 );
}
// /_static/??/foo/bar.css,/foo1/bar/baz.css?m=293847g
// or
// /_static/??-eJzTT8vP109KLNJLLi7W0QdyDEE8IK4CiVjn2hpZGluYmKcDABRMDPM=
- $args = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY );
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? wp_unslash( $_SERVER['REQUEST_URI'] ) : '';
+ $args = wp_parse_url( $request_uri, PHP_URL_QUERY );
if ( ! $args || false === strpos( $args, '?' ) ) {
jetpack_boost_page_optimize_status_exit( 400 );
}
@@ -115,7 +134,8 @@ function jetpack_boost_page_optimize_build_output() {
// /foo/bar.css,/foo1/bar/baz.css?m=293847g
// or
// -eJzTT8vP109KLNJLLi7W0QdyDEE8IK4CiVjn2hpZGluYmKcDABRMDPM=
- if ( '-' == $args[0] ) {
+ if ( '-' === $args[0] ) {
+ // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged,WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode
$args = @gzuncompress( base64_decode( substr( $args, 1 ) ) );
// Invalid data, abort!
@@ -136,15 +156,15 @@ function jetpack_boost_page_optimize_build_output() {
jetpack_boost_page_optimize_status_exit( 400 );
}
- // array( '/foo/bar.css', '/foo1/bar/baz.css' )
- if ( 0 == count( $args ) || count( $args ) > $concat_max_files ) {
+ // args contain something like array( '/foo/bar.css', '/foo1/bar/baz.css' )
+ if ( 0 === count( $args ) || count( $args ) > $concat_max_files ) {
jetpack_boost_page_optimize_status_exit( 400 );
}
// If we're in a subdirectory context, use that as the root.
// We can't assume that the root serves the same content as the subdir.
$subdir_path_prefix = '';
- $request_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
+ $request_path = wp_parse_url( $request_uri, PHP_URL_PATH );
$_static_index = strpos( $request_path, '/_static/' );
if ( $_static_index > 0 ) {
$subdir_path_prefix = substr( $request_path, 0, $_static_index );
@@ -169,7 +189,7 @@ function jetpack_boost_page_optimize_build_output() {
}
$mime_type = jetpack_boost_page_optimize_get_mime_type( $fullpath );
- if ( ! in_array( $mime_type, $jetpack_boost_page_optimize_types ) ) {
+ if ( ! in_array( $mime_type, $jetpack_boost_page_optimize_types, true ) ) {
jetpack_boost_page_optimize_status_exit( 400 );
}
@@ -178,7 +198,7 @@ function jetpack_boost_page_optimize_build_output() {
$last_mime_type = $mime_type;
}
- if ( $last_mime_type != $mime_type ) {
+ if ( $last_mime_type !== $mime_type ) {
jetpack_boost_page_optimize_status_exit( 400 );
}
}
@@ -192,21 +212,22 @@ function jetpack_boost_page_optimize_build_output() {
$last_modified = $stat['mtime'];
}
- $buf = file_get_contents( $fullpath );
+ $buf = $wp_filesystem->get_contents( $fullpath );
if ( false === $buf ) {
jetpack_boost_page_optimize_status_exit( 500 );
}
- if ( 'text/css' == $mime_type ) {
+ if ( 'text/css' === $mime_type ) {
$dirpath = '/' . ltrim( $subdir_path_prefix . dirname( $uri ), '/' );
// url(relative/path/to/file) -> url(/absolute/and/not/relative/path/to/file)
$buf = jetpack_boost_page_optimize_relative_path_replace( $buf, $dirpath );
- // AlphaImageLoader(...src='relative/path/to/file'...) -> AlphaImageLoader(...src='/absolute/path/to/file'...)
+ // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
+ // This regex changes things like AlphaImageLoader(...src='relative/path/to/file'...) to AlphaImageLoader(...src='/absolute/path/to/file'...)
$buf = preg_replace(
'/(Microsoft.AlphaImageLoader\s*\([^\)]*src=(?:\'|")?)([^\/\'"\s\)](?:(? url(/absolute/and/not/relative/path/to/file)
$buf = preg_replace(
'/(:?\s*url\s*\()\s*(?:\'|")?\s*([^\/\'"\s\)](?:(? $post->post_type ), 'objects' );
- if ( empty( $post_types ) || ! isset( $post_types['post'] ) || $post_types['post']->public !== true ) {
+ // Ignore changes to any post which is not published.
+ if ( 'publish' !== $post->post_status ) {
+ return;
+ }
+
+ // Ignore changes to post types which do not affect the front-end UI
+ if ( ! $this->is_post_type_invalidating( $post->post_type ) ) {
return;
}
@@ -55,4 +60,22 @@ public function handle_plugin_change() {
public function do_action( $is_major_change, $change_type ) {
do_action( 'handle_environment_change', $is_major_change, $change_type );
}
+
+ /**
+ * Given a post_type, return true if this post type affects the front end of
+ * the site - i.e.: should cause cached optimizations to be invalidated.
+ *
+ * @param string $post_type The post type to check
+ * @return bool True if this post type affects the front end of the site.
+ */
+ private function is_post_type_invalidating( $post_type ) {
+ // Special cases: items which are not viewable, but affect the UI.
+ if ( in_array( $post_type, array( 'wp_template', 'wp_template_part' ), true ) ) {
+ return true;
+ }
+
+ if ( is_post_type_viewable( $post_type ) ) {
+ return true;
+ }
+ }
}
diff --git a/projects/plugins/search/changelog/add-license-key-selector b/projects/plugins/boost/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/add-license-key-selector
rename to projects/plugins/boost/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/add-license-verification b/projects/plugins/boost/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/add-license-verification
rename to projects/plugins/boost/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/boost/changelog/boost-fix-minify-lint b/projects/plugins/boost/changelog/boost-fix-minify-lint
new file mode 100644
index 0000000000000..5706c66977552
--- /dev/null
+++ b/projects/plugins/boost/changelog/boost-fix-minify-lint
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: Cleaned up linting issues in Boost's new minify feature
+
+
diff --git a/projects/plugins/boost/changelog/boost-update-livereload b/projects/plugins/boost/changelog/boost-update-livereload
new file mode 100644
index 0000000000000..84e4b29d3481a
--- /dev/null
+++ b/projects/plugins/boost/changelog/boost-update-livereload
@@ -0,0 +1,5 @@
+Significance: patch
+Type: added
+Comment: Livereload for development
+
+
diff --git a/projects/plugins/boost/changelog/fix-react-to-all-visible-changes b/projects/plugins/boost/changelog/fix-react-to-all-visible-changes
new file mode 100644
index 0000000000000..f51b2e8e520ae
--- /dev/null
+++ b/projects/plugins/boost/changelog/fix-react-to-all-visible-changes
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Ensure changes to visible posts / other post types which affect the ui get caught
diff --git a/projects/plugins/boost/changelog/fix-safari-lazy-load b/projects/plugins/boost/changelog/fix-safari-lazy-load
new file mode 100644
index 0000000000000..4ac4ef322b7be
--- /dev/null
+++ b/projects/plugins/boost/changelog/fix-safari-lazy-load
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Fixed images sometimes failing to Lazy-load in Safari.
diff --git a/projects/plugins/boost/changelog/update-wp-tested-up-to b/projects/plugins/boost/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/boost/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/boost/composer.lock b/projects/plugins/boost/composer.lock
index 6ae690ac50e49..bd4700c119935 100644
--- a/projects/plugins/boost/composer.lock
+++ b/projects/plugins/boost/composer.lock
@@ -701,7 +701,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -728,7 +728,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/boost/package.json b/projects/plugins/boost/package.json
index 221e948f7a429..3936429801e40 100644
--- a/projects/plugins/boost/package.json
+++ b/projects/plugins/boost/package.json
@@ -31,6 +31,7 @@
"@types/jquery": "3.5.14",
"@wordpress/i18n": "4.28.0",
"concurrently": "7.6.0",
+ "livereload": "0.9.3",
"postcss": "8.4.21",
"prettier-plugin-svelte": "2.8.1",
"react": "18.2.0",
@@ -56,6 +57,7 @@
"compile-ts": "tsc --pretty",
"dev-serve": "rollup -c -w --environment SERVE",
"dev": "pnpm run clear-dist && rollup -c -w",
+ "devlive": "concurrently --kill-others 'pnpm run dev' 'livereload app/assets/dist --exts css'",
"reformat-files": "../../../tools/js-tools/node_modules/.bin/prettier --ignore-path .eslintignore --write --plugin-search-dir=. ./**/*.{svelte,js,ts,json}",
"lint": "pnpm run reformat-files && echo 'Running eslint...' && pnpm eslint app/assets/src/js tests/e2e --fix && echo '✔ prettier and eslint ran successfully.'",
"clear-dist": "rm -rf app/assets/dist/*",
diff --git a/projects/plugins/boost/readme.txt b/projects/plugins/boost/readme.txt
index 7eb506ce012df..7768c272414fa 100644
--- a/projects/plugins/boost/readme.txt
+++ b/projects/plugins/boost/readme.txt
@@ -3,7 +3,7 @@ Contributors: automattic, xwp, adnan007, bjorsch, danwalmsley, davidlonjon, ebin
Donate link: https://automattic.com
Tags: performance, speed, pagespeed, web vitals, critical css, optimize, defer
Requires at least: 5.5
-Tested up to: 6.1
+Tested up to: 6.2
Requires PHP: 7.0
Stable tag: 1.6.0
License: GPLv2 or later
diff --git a/projects/plugins/crm/changelog/fix-crm-edit-add-form-title b/projects/plugins/crm/changelog/fix-crm-edit-add-form-title
new file mode 100644
index 0000000000000..ceef242e0c77d
--- /dev/null
+++ b/projects/plugins/crm/changelog/fix-crm-edit-add-form-title
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+CRM: swapping edit and new form titles to correctly reflect page.
diff --git a/projects/plugins/crm/changelog/update-wp-tested-up-to b/projects/plugins/crm/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/crm/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/crm/includes/class-learn-menu.php b/projects/plugins/crm/includes/class-learn-menu.php
index d272073d424d0..e47a5606cf3b4 100644
--- a/projects/plugins/crm/includes/class-learn-menu.php
+++ b/projects/plugins/crm/includes/class-learn-menu.php
@@ -291,10 +291,10 @@ private function get_slug() {
}
// Forms
- if ( zeroBSCRM_is_form_new_page() ){
- $slug = 'editform';
- } elseif ( zeroBSCRM_is_form_edit_page() ){
+ if ( zeroBSCRM_is_form_new_page() ) {
$slug = 'formnew';
+ } elseif ( zeroBSCRM_is_form_edit_page() ) {
+ $slug = 'editform';
}
// profile page
diff --git a/projects/plugins/crm/readme.txt b/projects/plugins/crm/readme.txt
index c65225efe4d4c..7fb8c29d21ec2 100644
--- a/projects/plugins/crm/readme.txt
+++ b/projects/plugins/crm/readme.txt
@@ -1,7 +1,7 @@
=== Jetpack CRM - Clients, Leads, Invoices, Billing, Email Marketing, & Automation ===
Contributors: automattic, woodyhayday, mikemayhem3030
Tags: CRM, Invoice, Woocommerce CRM, Clients, Lead Generation, contacts, customers, billing, email marketing, Marketing Automation, contact form, automations
-Tested up to: 6.1
+Tested up to: 6.2
Stable tag: 5.5.3
Requires at least: 5.0
Requires PHP: 7.2
@@ -63,7 +63,7 @@ From reading this to understanding Jetpack CRM will probably take you 10 minutes
The Jetpack CRM plugin installs in seconds, (with a super-quick welcome wizard to get you started). Adding a contact is straightforward. Creating a quote, or invoice, even simpler. Give it a go, you'll see!
-= ⭐ Mastering Jetpack CRM =
+= ⭐ Mastering Jetpack CRM =
1. Install this WordPress CRM plugin
2. Step through the guided Welcome Wizard
3. Add your first contact (lead or customer)
@@ -82,7 +82,7 @@ Need a helping hand? No worries. Just Twilio (for SMS Sending)
Plus many more...
-
+
## 🥼 Try Jetpack CRM Today!
@@ -172,7 +172,7 @@ We've added so much value to our new v4.0 that it's hard to give you a list of a
* 🚀 **Modern. Lean. Accessible**
* [Mobile Ready](https://jetpackcrm.com/feature/mobile-ready/)
- * [International - Languages & Currencies](https://jetpackcrm.com/feature/multi-language-your-currency/): Translation ready
+ * [International - Languages & Currencies](https://jetpackcrm.com/feature/multi-language-your-currency/): Translation ready
* [DIY CRM](https://jetpackcrm.com/feature/diy-crm/)
* 🇪🇺 Make sure you are GDPR compliant by knowing where your data is stored!
@@ -201,7 +201,7 @@ We've added so much value to our new v4.0 that it's hard to give you a list of a
* 🛡️ **Backed by Automattic**
* Jetpack CRM is part of the Automattic family
* Superb as a WooCommerce CRM
- * Consistent development and improvements
+ * Consistent development and improvements
* 🏷️ **[White-Label CRM](https://jetpackcrm.com/reseller/)**
* [Rebranding Engine](https://jetpackcrm.com/feature/rebrandr/): Brand your CRM with your company name or a customers (and logo!)
@@ -216,7 +216,7 @@ We've added so much value to our new v4.0 that it's hard to give you a list of a
* See all customer activity at-a-glance from the customer record, (useful for accounting)
* **NEW:** [Automations](https://jetpackcrm.com/product/automations/) extension provides automatic actions on events!
-* ➕ **Too much more to mention here...**
+* ➕ **Too much more to mention here...**
* [PDF Invoicing](https://jetpackcrm.com/feature/invoices/), billing statements and more client tools
* Invoice builder with line items, hourly or item rates, email invoices and get paid via customer portal!
* Tax Table management - assign multiple local/national taxes to Invoices or Transactions
@@ -229,7 +229,7 @@ We've added so much value to our new v4.0 that it's hard to give you a list of a
* [See all features](https://jetpackcrm.com/features/#features)
## 👔 SME, Small Business, & WordPress Entrepreneurs
-Built for business managers and bootstrapped entrepreneurs, Jetpack CRM is the perfect start-up tool to manage your business essentials. We've added just enough billing and accounting for freelancers and small teams, without getting lost in the potential feature bloat of full accounting and erp software. We didn't add HR tools, but we do have user management. Customer Relationship Management is meant to make lead management easy. Start with a contact form builder and lead generation, track contacts through funnel analytics then use newsletters and email marketing to grow your profits by selling to contacts at companies.
+Built for business managers and bootstrapped entrepreneurs, Jetpack CRM is the perfect start-up tool to manage your business essentials. We've added just enough billing and accounting for freelancers and small teams, without getting lost in the potential feature bloat of full accounting and erp software. We didn't add HR tools, but we do have user management. Customer Relationship Management is meant to make lead management easy. Start with a contact form builder and lead generation, track contacts through funnel analytics then use newsletters and email marketing to grow your profits by selling to contacts at companies.
Jetpack CRM is the perfect first step to improving your small business. [Try it for free](https://jetpackcrm.com/download/)!
@@ -298,7 +298,7 @@ For more documentation, please see the CRM knowledge base: [https://kb.jetpackcr
There are absolutely no limits in Jetpack CRM, apart from the usual ones applied by your host (database size etc.), you can create as many clients or invoices as you'd like!
-= Is Jetpack CRM really free? =
+= Is Jetpack CRM really free? =
Totally. The core is a solid, useful, Customer Relationship Manager right out of the box. You don't need anything else to get started managing your leads, and customers. We do build extensions, (because we need them), but they're not at all essential. Further, they're cheap in comparison to the pay-per-month CRM options.
@@ -306,11 +306,11 @@ Totally. The core is a solid, useful, Customer Relationship Manager right out of
Of course. Please reach out to us via the in-plugin feedback page if you want to, we'll help you get started, or check out our [Developer resources](https://jetpackcrm.com/feature/developer-ready/).
-= What is next on the CRM roadmap? =
+= What is next on the CRM roadmap? =
We haven't published our roadmap since v3, but we may do in the future. You can vote on future extensions on our [Coming Soon](https://jetpackcrm.com/coming-soon/) page.
-= Where can I see the CRM extensions? =
+= Where can I see the CRM extensions? =
You can see all of the CRM power-ups here: https://jetpackcrm.com/extensions/
@@ -322,7 +322,7 @@ Yes, Jetpack CRM comes with a search feature that allows you to run a customer s
Data privacy, control, extensibility. GDPR compliance. You're probably already paying for hosting too, so you'll save there. SaaS has its place, but there's so much value in hosting your own (e.g. for GDPR rules you need to know where your customer data is kept)!
-= How do I get my existing customers into Jetpack CRM? =
+= How do I get my existing customers into Jetpack CRM? =
The free core is fully integrated with WooCommerce using the built-in WooSync module. It also has a basic CSV Importer which works well and allows you to import contacts and import customer data. You can also use our paid extensions for additional features: CSV Importer Pro, PayPal Sync, or Stripe Sync - these automatically pull up all your customer data (including transactions) and then keep it up to date for you!
@@ -330,11 +330,11 @@ The free core is fully integrated with WooCommerce using the built-in WooSync mo
Most CRM providers allow you to export customer data in CSV format, which can then be used to upload into Jetpack CRM. The CSV Importer Pro extension can then be used to import contacts and customer data. CRM is a very broad landscape, so each CRM may have different ways of storing data. See our [CRM Knowledgebase](https://kb.jetpackcrm.com) for more information, or ask in the forums!
-= Do you have a B2B mode? =
+= Do you have a B2B mode? =
Yes, Jetpack CRM has a [Business to Business mode](https://jetpackcrm.com/feature/b2b-mode/). Enabling the B2B CRM Extension adds a "Companies" layer, which lets you have contacts under a company.
-= How does B2B mode (Companies) work in Jetpack CRM? =
+= How does B2B mode (Companies) work in Jetpack CRM? =
Jetpack CRM allows you to manage contacts at companies from within the CRM. This adds a hierarchy to your CRM, letting you add a contact to a company using our contact manager. Currently you can bill (invoice) companies or contacts respectively, but in the future we want to make this much more integrated.
For now, this works as follows:
@@ -350,7 +350,7 @@ Yes, Jetpack CRM has a [Business to Business mode](https://jetpackcrm.com/featur
Jetpack CRM allows you to create and manage quotes , invoices , and transactions against contacts. While this setup may be used in some senses like an ecommerce platform, really the aim with Jetpack CRM is to effectively manage a contact list, including manually billing them (e.g. getting invoices paid online). This works well, via our client portal , but if you want a fuller ecommerce setup, we recommend using WooCommerce , which we integrate with, (it's really great).
-= Can I use this as a WooCommerce CRM? =
+= Can I use this as a WooCommerce CRM? =
Yes, Jetpack CRM is actually ideal for using with WooCommerce. You can read more about [Jetpack as a WooCommerce CRM here](https://jetpackcrm.com/woocommerce/).
@@ -363,11 +363,11 @@ Yes, Jetpack CRM is actually ideal for using with WooCommerce. You can read more
Yes, Jetpack CRM allows you to easily capture leads using our [lead capture forms](https://jetpackcrm.com/feature/forms/). These could be added into posts, pages or widgets - when leads fill them out their information goes straight into the CRM.
-= What are my options for lead generation forms? =
+= What are my options for lead generation forms? =
Jetpack CRM ships with its own form builder, which lets you insert forms into your posts and pages via shortcode forms or iframe forms. For users that need more advanced form features, we offer support for Jetpack Forms out of the box, and have integrations with Contact Form 7 and Gravity Forms via paid CRM extensions.
-= Can Jetpack CRM help me pay sales commissions? =
+= Can Jetpack CRM help me pay sales commissions? =
We occasionally get asked if Jetpack CRM can help calculate and pay sales commissions. We do have some users who are using the CRM for this, but there are no direct features out of the box which will provide this functionality, these users are simply totting up the transactions assigned to contacts based on their 'owners' in Jetpack CRM, then paying these commissions manually. We may in future expand our reporting to offer something along the lines of a sales summary per agent.
@@ -379,21 +379,21 @@ To send out email broadcasts such as newsletters or other email marketing you wi
Jetpack CRM has it's own [Automations extension](https://jetpackcrm.com/product/automations/) which uses Triggers, Conditions, and Actions to automate workflows based on CRM events. This can be used in lead generation, email marketing, or internal business admin. If you have an idea for a workflow or automation you'd like to see, please do [submit it as a feature request](https://kb.jetpackcrm.com/submit-a-ticket/).
-= What add-ons are available? =
+= What add-ons are available? =
We have over 30 premium extensions available in our CRM extension store . These are totally optional, but supercharge some aspects of the CRM, (e.g. StripeSync automatically pulls in your customer and transaction data from Stripe).
Most users tend to purchase bundles of extensions, which allows them to 'make their perfect CRM':View CRM Bundles
-= When do I need a license key? =
+= When do I need a license key? =
You can now add your license key into your Jetpack CRM settings page (under 'CRM License'). This is only required if you wish to use paid extensions. To get started with premium CRM extensions, please visit our extension store .
After you've purchased you'll be guided to your new license key and extension plugin download.
-= How do I purchase more than one license? =
+= How do I purchase more than one license? =
-We have many agencies using Jetpack CRM, so this is a common question.
+We have many agencies using Jetpack CRM, so this is a common question.
To get stared please see our bundles page - if you're likely to need 10~ licenses, the best bet is to get started with the Reseller package. If you want to build up more slowly, please purchase the Entrepreneur bundle and let us know via a support ticket if you would like to add additional licenses to your account.
-= What is the refund policy? =
+= What is the refund policy? =
We offer a full, no-hassle refund within 14 days. You can read more about that, and how to request a refund, on this page .
diff --git a/projects/plugins/debug-helper/CHANGELOG.md b/projects/plugins/debug-helper/CHANGELOG.md
index 7894db9574207..c8747ade86562 100644
--- a/projects/plugins/debug-helper/CHANGELOG.md
+++ b/projects/plugins/debug-helper/CHANGELOG.md
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.5.0] - 2023-03-08
+### Added
+- Add "Cookie State Faker" tool. [#28371]
+- Add a button to set the current primary user. [#26562]
+- Added a helper module for Jetpack Scan. [#25641]
+- Added threat descriptions. [#25266]
+- Mocker tool: add runner to add rows in the WAF log DB table for blocked requests [#25645]
+- Replace "XML-RPC errors" with "connection errors", add error type ("xml-rpc" or "rest") to generated errors. [#25694]
+
+### Changed
+- Remove pre-defined prefix in the REST API tool. [#26521]
+- Updated package dependencies.
+- Updated Protect Helper to use newly added data source constant. [#26069]
+
+### Fixed
+- Prevented the threat tester from being identified as a threat due to containing the Akismet suspicious link URL. [#26192]
+
## [1.4.0] - 2022-07-06
### Added
- Added the Autoloader debugger helper to the Debug tool. [#23726]
@@ -60,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial version.
+[1.5.0]: https://github.com/Automattic/jetpack-debug-helper/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/Automattic/jetpack-debug-helper/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/Automattic/jetpack-debug-helper/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/Automattic/jetpack-debug-helper/compare/v1.1.0...v1.2.0
diff --git a/projects/plugins/debug-helper/changelog/add-debug-helper-scan-results b/projects/plugins/debug-helper/changelog/add-debug-helper-scan-results
deleted file mode 100644
index b1fe85e5513e3..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-debug-helper-scan-results
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: added
-
-Added a helper module for Jetpack Scan.
diff --git a/projects/plugins/debug-helper/changelog/add-debug-helper-set-primary-user b/projects/plugins/debug-helper/changelog/add-debug-helper-set-primary-user
deleted file mode 100644
index 05a0f6c790be5..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-debug-helper-set-primary-user
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: added
-
-Add a button to set the current primary user.
diff --git a/projects/plugins/debug-helper/changelog/add-debug-helper-waf-mocker b/projects/plugins/debug-helper/changelog/add-debug-helper-waf-mocker
deleted file mode 100644
index 3cd9455ea72d0..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-debug-helper-waf-mocker
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: added
-
-Mocker tool: add runner to add rows in the WAF log DB table for blocked requests
diff --git a/projects/plugins/debug-helper/changelog/add-jetpack-debug-state b/projects/plugins/debug-helper/changelog/add-jetpack-debug-state
deleted file mode 100644
index 95caaf0a9b91e..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-jetpack-debug-state
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: added
-
-Add "Cookie State Faker" tool.
diff --git a/projects/plugins/debug-helper/changelog/add-protect-scan-api-data-source b/projects/plugins/debug-helper/changelog/add-protect-scan-api-data-source
deleted file mode 100644
index d8e1adf2c90a2..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-protect-scan-api-data-source
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: changed
-
-Updated Protect Helper to use newly added data source constant.
diff --git a/projects/plugins/debug-helper/changelog/add-protect-threat-descriptions b/projects/plugins/debug-helper/changelog/add-protect-threat-descriptions
deleted file mode 100644
index 6ce572a7cfeab..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-protect-threat-descriptions
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: added
-
-Added threat descriptions.
diff --git a/projects/plugins/debug-helper/changelog/add-verify-rest-api-errors b/projects/plugins/debug-helper/changelog/add-verify-rest-api-errors
deleted file mode 100644
index f4716f1a5db47..0000000000000
--- a/projects/plugins/debug-helper/changelog/add-verify-rest-api-errors
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: added
-
-Replace "XML-RPC errors" with "connection errors", add error type ("xml-rpc" or "rest") to generated errors.
diff --git a/projects/plugins/debug-helper/changelog/changelogger-merge b/projects/plugins/debug-helper/changelog/changelogger-merge
deleted file mode 100644
index 6eb3e9f9f8fa1..0000000000000
--- a/projects/plugins/debug-helper/changelog/changelogger-merge
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: added
-Comment: Minor update to changelog package that supports git merge strategy. Should not affect shipped code.
-
-
diff --git a/projects/plugins/debug-helper/changelog/fix-debug-helper-suspicious-link-concat b/projects/plugins/debug-helper/changelog/fix-debug-helper-suspicious-link-concat
deleted file mode 100644
index 43aecabc087e9..0000000000000
--- a/projects/plugins/debug-helper/changelog/fix-debug-helper-suspicious-link-concat
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-Prevented the threat tester from being identified as a threat due to containing the Akismet suspicious link URL.
diff --git a/projects/plugins/debug-helper/changelog/remove-remnants-of-automated-code-coverage b/projects/plugins/debug-helper/changelog/remove-remnants-of-automated-code-coverage
deleted file mode 100644
index 085e2e863ddb4..0000000000000
--- a/projects/plugins/debug-helper/changelog/remove-remnants-of-automated-code-coverage
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: removed
-Comment: Remove `test-coverage` scripts and other remnants of automated code coverage.
-
-
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#2 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#3 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#3
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#3
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#4 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#4
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#4
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#5 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#5
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#5
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#6 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#6
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#6
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#7 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#7
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#7
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#8 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#8
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#8
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#9 b/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#9
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-lock-file-maintenance#9
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/renovate-major-symfony b/projects/plugins/debug-helper/changelog/renovate-major-symfony
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/renovate-major-symfony
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/update-build-action-version-handling b/projects/plugins/debug-helper/changelog/update-build-action-version-handling
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/debug-helper/changelog/update-build-action-version-handling
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/debug-helper/changelog/update-rest-api-tester-prefix b/projects/plugins/debug-helper/changelog/update-rest-api-tester-prefix
deleted file mode 100644
index 43368482ae60b..0000000000000
--- a/projects/plugins/debug-helper/changelog/update-rest-api-tester-prefix
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: changed
-
-Remove pre-defined prefix in the REST API tool.
diff --git a/projects/plugins/debug-helper/changelog/update-wpcs b/projects/plugins/debug-helper/changelog/update-wpcs
deleted file mode 100644
index 211a1cc7d9e1d..0000000000000
--- a/projects/plugins/debug-helper/changelog/update-wpcs
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: fixed
-Comment: PHPCS fixes for new WPCS sniffs. Should be no user-visible changes.
-
-
diff --git a/projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf b/projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf
deleted file mode 100644
index 8ae821ee1a3df..0000000000000
--- a/projects/plugins/debug-helper/changelog/update-wpcs-pre-phpcbf
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: fixed
-Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
-
-
diff --git a/projects/plugins/debug-helper/plugin.php b/projects/plugins/debug-helper/plugin.php
index 714e9e7c5e05b..29e690b93d86f 100644
--- a/projects/plugins/debug-helper/plugin.php
+++ b/projects/plugins/debug-helper/plugin.php
@@ -3,7 +3,7 @@
* Plugin Name: Jetpack Debug Tools
* Description: Give me a Jetpack connection, and I'll break it every way possible.
* Author: Automattic - Jetpack Crew
- * Version: 1.5.0-alpha
+ * Version: 1.5.0
* Text Domain: jetpack
*
* @package automattic/jetpack-debug-helper.
@@ -33,7 +33,7 @@
* The plugin version.
* Increase that if you do any edits to ensure refreshing the cached assets.
*/
-define( 'JETPACK_DEBUG_HELPER_VERSION', '1.5.0-alpha' );
+define( 'JETPACK_DEBUG_HELPER_VERSION', '1.5.0' );
/**
* Include file names from the modules directory here.
diff --git a/projects/plugins/jetpack/CHANGELOG.md b/projects/plugins/jetpack/CHANGELOG.md
index d1e54bbfd86dd..8a91c4876e20c 100644
--- a/projects/plugins/jetpack/CHANGELOG.md
+++ b/projects/plugins/jetpack/CHANGELOG.md
@@ -2,33 +2,66 @@
### This is a list detailing changes for all Jetpack releases.
-## 11.9-beta - 2023-02-28
+## 12.0-a.1 - 2023-03-08
+### Enhancements
+- Admin: fix submenu positioning in admin menu. [#28355]
+- Blocks (beta): add a new beta Cookie Consent block to display a GDPR-compliant cookie consent widget on your site for your visitors. [#29197]
+- SSO: add message to logout notice when SSO is enabled that gives a heads up to also log out of WordPress.com if they are on a shared computer. [#29235]
+- Stats: updates the layout of the loading and some sections on the Stats page. [#29221]
+
+### Other changes
+- Allow getting posts by ids in GET /posts response using include array [#29149]
+- Blocks: register VideoPress video block based on the filtered extensions [#29207]
+- Forms: move search into state, fix double fetch on search and paging [#29336]
+- Forms: add form responses app and state into package [#29007]
+- Pre-escape the ampersand in the default content of the cookie consent block [#29251]
+- Adds basic ui to beta blogging-prompt block [#29189]
+- Jetpack Forms: Added week/monthly props to sent message tracking [#28999]
+- media summary: write to memo when no images found [#29326]
+- Paid newsletters access panel would disappear on posts that have been previously published. This fixes the issue. [#29247]
+- Removes unused conversation and dialogue blocks that never left beta [#29210]
+- Sharing: remove unused variable [#29275]
+- Shortcodes: removed jQuery dependency from Crowdsignal shortcodes [#29307]
+- Temp disable Gutenberg subscribe block test until #29113 is fixed [#29280]
+- Updated package dependencies. [#29216]
+- VideoPress: pick and convert core/video VideoPress instances also from inner blocks [#29339]
+- Writing prompts: marks prompt as answered when using a writing prompt block [#29214]
+
+## [11.9] - 2023-03-07
### Enhancements
- Assistant: add new card to highlight VaultPress Backup. [#28741]
- Form block: add form field style synchronization for input fields. [#28988]
- Related Posts: add support for font family in Related Posts block. [#29097]
- Sharing: add Mastodon sharing button. [#28694]
+- Stats: show new Jetpack Stats dashboard design by default.
### Improved compatibility
-- Stats: add upgrade notice for Odyssey Stats. [#28828]
+- Sharing: add spacebar as an option to open the "More" button overlay. [#29232]
- VideoPress: add support for the `preload` or `preloadcontent` attribute to the VideoPress shortcode. [#28865]
### Bug fixes
- Connection: revise Jetpack connection agreement text to comply with our User Agreement. [#28403]
- Custom CSS: ensure the link to enable Custom CSS works in all languages. [#29202]
+- Sharing: fix broken Tumblr button inside "More" button overlay. [#29231]
+- Sharing: fix a JS error and adjust margin on Pinterest official button. [#29279]
- Form block: increase form fields padding based on user-defined border-radius. [#28820]
+- Form block: improve multiple choice field styles for the Twenty Twenty theme. [#29325]
+- Form block: move field width settings, and remove placeholder field from multiple and single choice fields. [#29292]
- Form block: remove body font normalization in contact-form module and package. [#29166]
+- Form block: set defaults for Jetpack Forms CSS variables. [#29236]
+- Form block: update form-styles script to run in the context of the Form block. [#29178]
- Presentation shortcode: always add presentation container. [#29073]
- Recommendations: avoid applying coupon codes from the Assistant on products with trial prices. [#29139]
- Sharing buttons: fix display issues when choosing the icon-only option. [#29090]
### Other changes
-- API: add wpcom/v2/form-responses endpoint, mapped from .com [#29043]
-- API: fix a bug in list user endpoint when include_viewers is true. [#29068]
- Admin Page: update link in Jetpack App card to include external link icon. [#29048]
- Admin Page: use external icons for external links in support card. [#29050]
+- API: add wpcom/v2/form-responses endpoint, mapped from .com [#29043]
+- API: fix a bug in list user endpoint when include_viewers is true. [#29068]
- Blocks: update scaffolding. [#29201]
- Social: add groundwork for Social Image Generator. [#28737]
+- Social: show Jetpack Social Advanced products under My Plan. [#29276]
- Stats: moved new stats toggle logic to stats-admin. [#29064]
- Tests: adapted the Sync test to WordPress Core changes in post deletion mechanics. [#29154]
- Updated package dependencies. [#29117]
@@ -36,6 +69,7 @@
- VideoPress: tidy registering VideoPress video block. [#29084]
- Widget Visibility: switch to shared Analytics implementation. [#29181]
- WPcom: add `is_wpcom_staging_site`, `wpcom_production_blog_id`, and `wpcom_staging_blog_ids` attributes to the site object. [#29192]
+- WPcom: add wpcom/v3/blogging-prompts endpoint to support the upcoming writing prompts block. [#29182]
- WPcom: consolidate selector logic in the launchpad save modal. [#29134]
- WPcom: make sure the email field in the subscribe block is required. [#28995]
- WPcom: prevent launchpad modal from rendering on top of the first post published modal. [#28989]
@@ -7806,6 +7840,7 @@ Other bugfixes and enhancements at https://github.com/Automattic/jetpack/commits
- Initial release
[11.6]: https://wp.me/p1moTy-PLI
+[11.9]: https://wp.me/p1moTy-RdX
[11.8]: https://wp.me/p1moTy-QEM
[11.7]: https://wp.me/p1moTy-Q9t
[11.5]: https://wp.me/p1moTy-Ppq
diff --git a/projects/plugins/jetpack/_inc/blogging-prompts.php b/projects/plugins/jetpack/_inc/blogging-prompts.php
index 0690af331668c..3b3ce0d0fcc2a 100644
--- a/projects/plugins/jetpack/_inc/blogging-prompts.php
+++ b/projects/plugins/jetpack/_inc/blogging-prompts.php
@@ -47,6 +47,52 @@ function jetpack_setup_blogging_prompt_response( $post_id ) {
add_action( 'wp_insert_post', 'jetpack_setup_blogging_prompt_response' );
+/**
+ * When a published posts answers a blogging prompt, store the prompt id in the post meta.
+ *
+ * @param int $post_id Post ID.
+ * @param WP_Post $post Post object.
+ * @param bool $update Whether this is an existing post being updated.
+ * @param null|WP_Post $post_before Null for new posts, the WP_Post object prior
+ * to the update for updated posts.
+ */
+function jetpack_mark_if_post_answers_blogging_prompt( $post_id, $post, $update, $post_before ) {
+ if ( ! $post instanceof WP_Post ) {
+ return;
+ }
+
+ $post_type = isset( $post->post_type ) ? $post->post_type : null;
+ $post_content = isset( $post->post_content ) ? $post->post_content : null;
+
+ if ( 'post' !== $post_type || ! $post_content ) {
+ return;
+ }
+
+ $new_status = isset( $post->post_status ) ? $post->post_status : null;
+ $old_status = $post_before && isset( $post_before->post_status ) ? $post_before->post_status : null;
+
+ // Make sure we are publishing a post, and it's not already published.
+ if ( 'publish' !== $new_status || 'publish' === $old_status ) {
+ return;
+ }
+
+ $blocks = parse_blocks( $post->post_content );
+ foreach ( $blocks as $block ) {
+ if ( 'jetpack/blogging-prompt' === $block['blockName'] ) {
+ $prompt_id = isset( $block['attrs']['promptId'] ) ? absint( $block['attrs']['promptId'] ) : null;
+ $has_prompt_tag = has_tag( 'dailyprompt', $post ) || ( $prompt_id && has_tag( "dailyprompt-{$prompt_id}", $post ) );
+
+ if ( $prompt_id && $has_prompt_tag && count( $blocks ) > 1 ) {
+ update_post_meta( $post->ID, '_jetpack_blogging_prompt_key', $prompt_id );
+ }
+
+ break;
+ }
+ }
+}
+
+add_action( 'wp_after_insert_post', 'jetpack_mark_if_post_answers_blogging_prompt', 10, 4 );
+
/**
* Utility functions.
*/
diff --git a/projects/plugins/jetpack/_inc/crowdsignal-shortcode.js b/projects/plugins/jetpack/_inc/crowdsignal-shortcode.js
index 62daea8b5635e..798a7220914c5 100644
--- a/projects/plugins/jetpack/_inc/crowdsignal-shortcode.js
+++ b/projects/plugins/jetpack/_inc/crowdsignal-shortcode.js
@@ -1,18 +1,22 @@
-( function ( d, c, j ) {
- var crowdsignal_shortcode_options;
+( function ( w, d, c, j ) {
if (
- crowdsignal_shortcode_options &&
- crowdsignal_shortcode_options.script_url &&
+ w.crowdsignal_shortcode_options &&
+ w.crowdsignal_shortcode_options.script_url &&
! d.getElementById( j )
) {
var pd = d.createElement( c ),
s;
pd.id = j;
pd.async = true;
- pd.src = crowdsignal_shortcode_options.script_url;
+ pd.src = w.crowdsignal_shortcode_options.script_url;
s = d.getElementsByTagName( c )[ 0 ];
s.parentNode.insertBefore( pd, s );
- } else if ( typeof jQuery !== 'undefined' ) {
- jQuery( d.body ).trigger( 'pd-script-load' );
+ } else {
+ // In environments where jQuery is present, dispatch with jQuery.
+ if ( typeof w.jQuery !== 'undefined' ) {
+ w.jQuery( d.body ).trigger( 'pd-script-load' );
+ } else {
+ d.body.dispatchEvent( new Event( 'pd-script-load' ) );
+ }
}
-} )( document, 'script', 'pd-polldaddy-loader' );
+} )( window, document, 'script', 'pd-polldaddy-loader' );
diff --git a/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php b/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php
index 9f3f03c46d7ee..d968a77b34a70 100644
--- a/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php
+++ b/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php
@@ -21,7 +21,7 @@ class Jetpack_AI_Helper {
*
* @var int
*/
- public static $text_completion_cooldown_seconds = 60;
+ public static $text_completion_cooldown_seconds = 15;
/**
* Cache images for a prompt for a month.
@@ -154,14 +154,26 @@ public static function get_gpt_completion( $content, $post_id ) {
\require_lib( 'openai' );
}
- $result = ( new OpenAI( 'openai', array( 'post_id' => $post_id ) ) )->request_gpt_completion( $content );
+ // Set the content for chatGPT endpoint
+ $data = array(
+ array(
+ 'role' => 'user',
+ 'content' => $content,
+ ),
+ );
+
+ $result = ( new OpenAI( 'openai', array( 'post_id' => $post_id ) ) )->request_chat_completion( $data );
+
if ( is_wp_error( $result ) ) {
return $result;
}
+
+ $response = $result->choices[0]->message->content;
+
// In case of Jetpack we are setting a transient on the WPCOM and not the remote site. I think the 'get_current_user_id' may default for the connection owner at this point but we'll deal with this later.
- set_transient( self::transient_name_for_completion(), $result, self::$text_completion_cooldown_seconds );
+ set_transient( self::transient_name_for_completion(), $response, self::$text_completion_cooldown_seconds );
self::mark_post_as_ai_assisted( $post_id );
- return $result;
+ return $response;
}
$response = Client::wpcom_json_api_request_as_user(
diff --git a/projects/plugins/jetpack/_inc/lib/class.media-summary.php b/projects/plugins/jetpack/_inc/lib/class.media-summary.php
index 63af8c29bb498..f2bd152a52565 100644
--- a/projects/plugins/jetpack/_inc/lib/class.media-summary.php
+++ b/projects/plugins/jetpack/_inc/lib/class.media-summary.php
@@ -96,6 +96,7 @@ public static function get( $post_id, $blog_id = 0, $args = array() ) {
if ( $switched ) {
restore_current_blog();
}
+ self::$cache[ $cache_key ] = $return;
return $return;
}
diff --git a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v3-endpoint-blogging-prompts.php b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v3-endpoint-blogging-prompts.php
index 7471323daae7b..a84473edc7a0e 100644
--- a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v3-endpoint-blogging-prompts.php
+++ b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v3-endpoint-blogging-prompts.php
@@ -299,16 +299,14 @@ public function get_collection_params() {
),
);
- $args['categories'] = $parent_args['categories'];
- $args['categories_exclude'] = $parent_args['categories_exclude'];
- $args['exclude'] = $parent_args['exclude'];
- $args['include'] = $parent_args['include'];
- $args['page'] = $parent_args['page'];
- $args['per_page'] = $parent_args['per_page'];
- $args['order'] = $parent_args['order'];
- $args['order']['default'] = 'asc';
- $args['orderby'] = $parent_args['orderby'];
- $args['search'] = $parent_args['search'];
+ $args['exclude'] = $parent_args['exclude'];
+ $args['include'] = $parent_args['include'];
+ $args['page'] = $parent_args['page'];
+ $args['per_page'] = $parent_args['per_page'];
+ $args['order'] = $parent_args['order'];
+ $args['order']['default'] = 'asc';
+ $args['orderby'] = $parent_args['orderby'];
+ $args['search'] = $parent_args['search'];
return $args;
}
@@ -400,7 +398,16 @@ public function proxy_request_to_wpcom( $request, $path = '' ) {
return $response;
}
- return json_decode( wp_remote_retrieve_body( $response ) );
+ $response_status = wp_remote_retrieve_response_code( $response );
+ $response_body = json_decode( wp_remote_retrieve_body( $response ) );
+
+ if ( $response_status >= 400 ) {
+ $code = isset( $response_body->code ) ? $response_body->code : 'unknown_error';
+ $message = isset( $response_body->message ) ? $response_body->message : __( 'An unknown error occurred.', 'jetpack' );
+ return new WP_Error( $code, $message, array( 'status' => $response_status ) );
+ }
+
+ return $response_body;
}
/**
diff --git a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php
index b72143c64804b..3af51309109a5 100644
--- a/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php
+++ b/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php
@@ -49,7 +49,7 @@ public function register_routes() {
'type' => 'string',
'required' => false,
'validate_callback' => function ( $param ) {
- return in_array( $param, array( 'calypso', 'earn', 'gutenberg', 'gutenberg-wpcom' ), true );
+ return in_array( $param, array( 'calypso', 'earn', 'earn-newsletter', 'gutenberg', 'gutenberg-wpcom' ), true );
},
),
'is_editable' => array(
diff --git a/projects/plugins/jetpack/_inc/polldaddy-shortcode.js b/projects/plugins/jetpack/_inc/polldaddy-shortcode.js
index 73fc0e3a36ce5..204d6da2161af 100644
--- a/projects/plugins/jetpack/_inc/polldaddy-shortcode.js
+++ b/projects/plugins/jetpack/_inc/polldaddy-shortcode.js
@@ -1,74 +1,94 @@
-( function ( $ ) {
- window.polldaddyshortcode = {
+( function ( w, d ) {
+ w.polldaddyshortcode = {
render: function () {
- var ratings = $( 'div.pd-rating[data-settings]' );
- var polls = $( 'div.PDS_Poll[data-settings]' );
+ const ratings = d.querySelectorAll( 'div.pd-rating[data-settings]' );
+ const polls = d.querySelectorAll( 'div.PDS_Poll[data-settings]' );
- if ( polls ) {
- $.each( polls, function () {
- var poll = $( this ).data( 'settings' );
+ polls.forEach( pollEl => {
+ const isInitialized = pollEl.getAttribute( 'data-pd-init-done' );
- if ( poll ) {
- var poll_url = document.createElement( 'a' );
- poll_url.href = poll[ 'url' ];
- if (
- poll_url.hostname != 'secure.polldaddy.com' &&
- poll_url.hostname != 'static.polldaddy.com'
- ) {
- return false;
- }
- var pathname = poll_url.pathname;
- if ( ! /\/?p\/\d+\.js/.test( pathname ) ) {
- return false;
- }
- var wp_pd_js = document.createElement( 'script' );
- wp_pd_js.type = 'text/javascript';
- wp_pd_js.src = poll[ 'url' ];
- wp_pd_js.charset = 'utf-8';
- wp_pd_js.async = true;
- document.getElementsByTagName( 'head' )[ 0 ].appendChild( wp_pd_js );
+ if ( isInitialized ) {
+ return;
+ }
+
+ pollEl.setAttribute( 'data-pd-init-done', '1' );
+ const settings = pollEl.getAttribute( 'data-settings' );
+ const poll = settings ? JSON.parse( settings ) : null;
+
+ if ( poll ) {
+ let poll_url;
+ try {
+ poll_url = new URL( poll.url, 'https://invalid.tld' );
+ } catch ( error ) {
+ return false;
}
- } );
- }
+ if (
+ poll_url.hostname !== 'secure.polldaddy.com' &&
+ poll_url.hostname !== 'static.polldaddy.com'
+ ) {
+ return false;
+ }
+ const pathname = poll_url.pathname;
+ if ( ! /\/?p\/\d+\.js/.test( pathname ) ) {
+ return false;
+ }
+ const wp_pd_js = d.createElement( 'script' );
+ wp_pd_js.src = poll.url;
+ wp_pd_js.async = true;
+ d.head.appendChild( wp_pd_js );
+ }
+ } );
- if ( ratings ) {
- var script = '';
+ if ( ratings.length ) {
+ let scriptContents = '';
- $.each( ratings, function () {
- var rating = $( this ).data( 'settings' );
+ ratings.forEach( ratingEl => {
+ const isInitialized = ratingEl.getAttribute( 'data-pd-init-done' );
+
+ if ( isInitialized ) {
+ return;
+ }
+
+ ratingEl.setAttribute( 'data-pd-init-done', '1' );
+
+ const settings = ratingEl.getAttribute( 'data-settings' );
+ const rating = settings ? JSON.parse( settings ) : null;
if ( rating ) {
- script +=
- 'PDRTJS_settings_' +
- rating[ 'id' ] +
- rating[ 'item_id' ] +
- '=' +
- rating[ 'settings' ] +
- "; if ( typeof PDRTJS_RATING !== 'undefined' ){ if ( typeof PDRTJS_" +
- rating[ 'id' ] +
- rating[ 'item_id' ] +
- "=='undefined' ){PDRTJS_" +
- rating[ 'id' ] +
- rating[ 'item_id' ] +
- '= new PDRTJS_RATING( PDRTJS_settings_' +
- rating[ 'id' ] +
- rating[ 'item_id' ] +
- ' );}}';
+ scriptContents += `
+ PDRTJS_settings_${ rating.id }${ rating.item_id } = ${ rating.settings };
+ if ( typeof PDRTJS_RATING !== 'undefined' ) {
+ if ( typeof PDRTJS_${ rating.id }${ rating.item_id } === 'undefined' ) {
+ PDRTJS_${ rating.id }${ rating.item_id } =
+ new PDRTJS_RATING( PDRTJS_settings_${ rating.id }${ rating.item_id } );
+ }
+ }
+ `;
}
} );
- if ( script.length > 0 )
- $( '#polldaddyRatings' ).after(
- "'
- );
+ if ( scriptContents ) {
+ const anchorEl = d.querySelector( '#polldaddyRatings' );
+ if ( anchorEl ) {
+ const script = d.createElement( 'script' );
+ script.id = 'polldaddyDynamicRatings';
+ script.text = scriptContents;
+
+ anchorEl.after( script );
+ }
+ }
}
},
};
- $( 'body' ).on( 'post-load pd-script-load', function () {
- window.polldaddyshortcode.render();
- } );
- $( 'body' ).trigger( 'pd-script-load' );
-} )( jQuery );
+ d.body.addEventListener( 'is.post-load', () => w.polldaddyshortcode.render() );
+
+ // In environments where jQuery is present, listen and dispatch with jQuery.
+ if ( typeof w.jQuery !== 'undefined' ) {
+ w.jQuery( d.body ).on( 'pd-script-load', () => w.polldaddyshortcode.render() );
+ w.jQuery( d.body ).trigger( 'pd-script-load' );
+ } else {
+ d.body.addEventListener( 'pd-script-load', () => w.polldaddyshortcode.render() );
+ d.body.dispatchEvent( new Event( 'pd-script-load' ) );
+ }
+} )( window, document );
diff --git a/projects/plugins/jetpack/changelog/add-add-additional-string-param-for-newsletters b/projects/plugins/jetpack/changelog/add-add-additional-string-param-for-newsletters
new file mode 100644
index 0000000000000..4af5880b8a496
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/add-add-additional-string-param-for-newsletters
@@ -0,0 +1,4 @@
+Significance: minor
+Type: enhancement
+
+Add additonal valid param to membership status endpoint for paid newsletters
diff --git a/projects/plugins/jetpack/changelog/fix-out-of-bounds-submenu b/projects/plugins/jetpack/changelog/add-ai_use_chat_gpt
similarity index 50%
rename from projects/plugins/jetpack/changelog/fix-out-of-bounds-submenu
rename to projects/plugins/jetpack/changelog/add-ai_use_chat_gpt
index 8f1a8b1aab116..4801e63f88f56 100644
--- a/projects/plugins/jetpack/changelog/fix-out-of-bounds-submenu
+++ b/projects/plugins/jetpack/changelog/add-ai_use_chat_gpt
@@ -1,4 +1,4 @@
Significance: patch
Type: enhancement
-Fix submenus from being out of bounds
+USe chat GPT API
diff --git a/projects/plugins/jetpack/changelog/add-blogging-prompts-v3-endpoint b/projects/plugins/jetpack/changelog/add-blogging-prompts-v3-endpoint
deleted file mode 100644
index b64b995dca705..0000000000000
--- a/projects/plugins/jetpack/changelog/add-blogging-prompts-v3-endpoint
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Adds wpcom/v3/blogging-prompts endpoint to support the upcoming writing prompts block
diff --git a/projects/plugins/jetpack/changelog/add-cookie-consent-block b/projects/plugins/jetpack/changelog/add-cookie-consent-block
deleted file mode 100644
index 7916d41041c94..0000000000000
--- a/projects/plugins/jetpack/changelog/add-cookie-consent-block
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: enhancement
-
-Blocks: add a new Cookie Consent block. Display a GDPR-compliant cookie consent widget on your site for your visitors.
diff --git a/projects/plugins/jetpack/changelog/add-response-inbox-store-endpoint#2 b/projects/plugins/jetpack/changelog/add-jetpack-forms-dashboard-view-switch
similarity index 100%
rename from projects/plugins/jetpack/changelog/add-response-inbox-store-endpoint#2
rename to projects/plugins/jetpack/changelog/add-jetpack-forms-dashboard-view-switch
diff --git a/projects/plugins/jetpack/changelog/add-newsletter-prevent-visibility-caveats b/projects/plugins/jetpack/changelog/add-newsletter-prevent-visibility-caveats
new file mode 100644
index 0000000000000..2093f401043e7
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/add-newsletter-prevent-visibility-caveats
@@ -0,0 +1,5 @@
+Significance: patch
+Type: enhancement
+
+Add some UI to to prevent user to be confused when changing post visibility regarding Newsletter settings.
+Add an intro for users.
diff --git a/projects/plugins/jetpack/changelog/add-response-inbox-store-endpoint b/projects/plugins/jetpack/changelog/add-response-inbox-store-endpoint
deleted file mode 100644
index a11069ef3b537..0000000000000
--- a/projects/plugins/jetpack/changelog/add-response-inbox-store-endpoint
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Add form responses app and state into package (out of plugin)
diff --git a/projects/plugins/jetpack/changelog/add-social-advanced b/projects/plugins/jetpack/changelog/add-social-advanced
deleted file mode 100644
index 63a3ad633ec05..0000000000000
--- a/projects/plugins/jetpack/changelog/add-social-advanced
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-This change makes Jetpack Social Advanced products to be shown under my plans.
diff --git a/projects/plugins/jetpack/changelog/add-tracking_of_forms_csv_exports b/projects/plugins/jetpack/changelog/add-tracking_of_forms_csv_exports
new file mode 100644
index 0000000000000..eb3aac71ffbb9
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/add-tracking_of_forms_csv_exports
@@ -0,0 +1,4 @@
+Significance: minor
+Type: other
+
+Added tracking of Jetpack Forms exports to CSV files.
diff --git a/projects/plugins/jetpack/changelog/add-week_month_props_on_sent_tracks b/projects/plugins/jetpack/changelog/add-week_month_props_on_sent_tracks
deleted file mode 100644
index 403fb363fc341..0000000000000
--- a/projects/plugins/jetpack/changelog/add-week_month_props_on_sent_tracks
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: other
-
-Jetpack Forms: Added week/monthly props to sent message tracking
diff --git a/projects/plugins/search/changelog/update-move-delete-connection-owner-notice#2 b/projects/plugins/jetpack/changelog/add-zendesk-chat-module
similarity index 79%
rename from projects/plugins/search/changelog/update-move-delete-connection-owner-notice#2
rename to projects/plugins/jetpack/changelog/add-zendesk-chat-module
index 9aa70e3ec1f75..a1c1831fa1ef7 100644
--- a/projects/plugins/search/changelog/update-move-delete-connection-owner-notice#2
+++ b/projects/plugins/jetpack/changelog/add-zendesk-chat-module
@@ -1,5 +1,5 @@
Significance: patch
-Type: changed
+Type: other
Comment: Updated composer.lock.
diff --git a/projects/plugins/search/changelog/update-my-jetpack-remove-videopress-hybrid b/projects/plugins/jetpack/changelog/add-zendesk-chat-module#2
similarity index 79%
rename from projects/plugins/search/changelog/update-my-jetpack-remove-videopress-hybrid
rename to projects/plugins/jetpack/changelog/add-zendesk-chat-module#2
index 9aa70e3ec1f75..a1c1831fa1ef7 100644
--- a/projects/plugins/search/changelog/update-my-jetpack-remove-videopress-hybrid
+++ b/projects/plugins/jetpack/changelog/add-zendesk-chat-module#2
@@ -1,5 +1,5 @@
Significance: patch
-Type: changed
+Type: other
Comment: Updated composer.lock.
diff --git a/projects/plugins/jetpack/changelog/change-forms-actions-component b/projects/plugins/jetpack/changelog/change-forms-actions-component
new file mode 100644
index 0000000000000..a13265a55443d
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/change-forms-actions-component
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Move BulkActionsMenu component inside Inbox, too tailored to be reused
diff --git a/projects/plugins/jetpack/changelog/change-forms-responses-decouple-action-bar b/projects/plugins/jetpack/changelog/change-forms-responses-decouple-action-bar
new file mode 100644
index 0000000000000..9be9f1c129dd0
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/change-forms-responses-decouple-action-bar
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Move action bar components out of inbox
diff --git a/projects/plugins/jetpack/changelog/disable-subscribe-block-e2e b/projects/plugins/jetpack/changelog/disable-subscribe-block-e2e
deleted file mode 100644
index 01b62948cb146..0000000000000
--- a/projects/plugins/jetpack/changelog/disable-subscribe-block-e2e
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: other
-
-Temp disable Gutenberg subscribe block test until #29113 is fixed
diff --git a/projects/plugins/jetpack/changelog/enhancement-more-button-a11y b/projects/plugins/jetpack/changelog/enhancement-more-button-a11y
deleted file mode 100644
index dba3a6dafebf6..0000000000000
--- a/projects/plugins/jetpack/changelog/enhancement-more-button-a11y
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Added space bar as an option to open "More" button overlay
diff --git a/projects/plugins/jetpack/changelog/fix-blogging-prompt-multiple-requests b/projects/plugins/jetpack/changelog/fix-blogging-prompt-multiple-requests
new file mode 100644
index 0000000000000..854221ee252af
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/fix-blogging-prompt-multiple-requests
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Writing Prompt block: prevent multiple requests when fetching prompt or tags
diff --git a/projects/plugins/jetpack/changelog/fix-blogging-prompt-post-meta b/projects/plugins/jetpack/changelog/fix-blogging-prompt-post-meta
new file mode 100644
index 0000000000000..5a992213c44fa
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/fix-blogging-prompt-post-meta
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Fix writing prompt post meta not saving when post immediately published
diff --git a/projects/plugins/jetpack/changelog/fix-contact-form-style-defaults b/projects/plugins/jetpack/changelog/fix-contact-form-style-defaults
deleted file mode 100644
index a4aa7ec6f5b1c..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-contact-form-style-defaults
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: bugfix
-
-Added defaults for Jetpack Forms CSS variables.
diff --git a/projects/plugins/jetpack/changelog/fix-cookie-consent-block b/projects/plugins/jetpack/changelog/fix-cookie-consent-block
deleted file mode 100644
index 569af6c1a13c0..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-cookie-consent-block
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: bugfix
-
-Pre-escape the ampersand in the default content of the cookie consent block
diff --git a/projects/plugins/jetpack/changelog/fix-forms-inbox-empty-results b/projects/plugins/jetpack/changelog/fix-forms-inbox-empty-results
new file mode 100644
index 0000000000000..6e4f0c1e3043f
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/fix-forms-inbox-empty-results
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Better handling for loading state and empty results
diff --git a/projects/plugins/jetpack/changelog/fix-more-modal-spacing b/projects/plugins/jetpack/changelog/fix-more-modal-spacing
deleted file mode 100644
index c8d84ea40a6b7..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-more-modal-spacing
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: bugfix
-
-Removing awkward spacer after every second button within the sharing more button overlay
diff --git a/projects/plugins/jetpack/changelog/fix-more-tumblr-button b/projects/plugins/jetpack/changelog/fix-more-tumblr-button
deleted file mode 100644
index 7e07b08ceab8f..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-more-tumblr-button
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: bugfix
-
-Fix broken Tumblr button inside "More" button overlay
diff --git a/projects/plugins/jetpack/changelog/fix-notices-blogging-prompt b/projects/plugins/jetpack/changelog/fix-notices-blogging-prompt
new file mode 100644
index 0000000000000..ecfdf94232a60
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/fix-notices-blogging-prompt
@@ -0,0 +1,4 @@
+Significance: patch
+Type: bugfix
+
+Blogging Prompts: avoid PHP notices with non-existing REST query paarameters.
diff --git a/projects/plugins/jetpack/changelog/fix-pinterest-official-button b/projects/plugins/jetpack/changelog/fix-pinterest-official-button
deleted file mode 100644
index 60ae6bdffc93d..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-pinterest-official-button
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: bugfix
-
-Fix JS Error and adjust marginRight of Pinterest official button instead of width
diff --git a/projects/plugins/jetpack/changelog/fix-remove-settings-jetpack-submenu-atomic b/projects/plugins/jetpack/changelog/fix-remove-settings-jetpack-submenu-atomic
deleted file mode 100644
index b8148d687cae6..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-remove-settings-jetpack-submenu-atomic
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: bugfix
-Comment: Remove Jetpack submenu under Settings in Calypso on Atomic sites
diff --git a/projects/plugins/jetpack/changelog/fix-sharing-button-height b/projects/plugins/jetpack/changelog/fix-sharing-button-height
deleted file mode 100644
index a2ed68ac85158..0000000000000
--- a/projects/plugins/jetpack/changelog/fix-sharing-button-height
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: compat
-
-Update sharing button height from 34px to 32px
diff --git a/projects/plugins/jetpack/changelog/fix-slideshow-icon b/projects/plugins/jetpack/changelog/fix-slideshow-icon
new file mode 100644
index 0000000000000..1437647f9f74d
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/fix-slideshow-icon
@@ -0,0 +1,4 @@
+Significance: patch
+Type: bugfix
+
+Make slideshow block's play and pause icons visible.
diff --git a/projects/plugins/jetpack/changelog/init-release-cycle b/projects/plugins/jetpack/changelog/init-release-cycle
index f5388cc81140d..af3a48652f757 100644
--- a/projects/plugins/jetpack/changelog/init-release-cycle
+++ b/projects/plugins/jetpack/changelog/init-release-cycle
@@ -1,5 +1,5 @@
Significance: patch
Type: other
-Comment: Init 12.0-a.0
+Comment: Init 12.0-a.2
diff --git a/projects/plugins/jetpack/changelog/remove-conversation-dialogue-blocks b/projects/plugins/jetpack/changelog/remove-conversation-dialogue-blocks
deleted file mode 100644
index e2b793ccd6452..0000000000000
--- a/projects/plugins/jetpack/changelog/remove-conversation-dialogue-blocks
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: other
-
-Removes unused conversation and dialogue blocks that never left beta
diff --git a/projects/plugins/jetpack/changelog/renovate-concurrently-7.x b/projects/plugins/jetpack/changelog/renovate-concurrently-7.x
deleted file mode 100644
index 1eaea6a769e84..0000000000000
--- a/projects/plugins/jetpack/changelog/renovate-concurrently-7.x
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: other
-
-Updated package dependencies.
diff --git a/projects/plugins/jetpack/changelog/renovate-jest-monorepo b/projects/plugins/jetpack/changelog/renovate-jest-monorepo
deleted file mode 100644
index 1eaea6a769e84..0000000000000
--- a/projects/plugins/jetpack/changelog/renovate-jest-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: other
-
-Updated package dependencies.
diff --git a/projects/plugins/jetpack/changelog/stats-update-legacy-layouts b/projects/plugins/jetpack/changelog/stats-update-legacy-layouts
deleted file mode 100644
index a02c9a2e6383a..0000000000000
--- a/projects/plugins/jetpack/changelog/stats-update-legacy-layouts
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Updates the layout of the loading and "no JS" sections on the legacy Stats page.
diff --git a/projects/plugins/jetpack/changelog/update-blogging-prompts-block-ui b/projects/plugins/jetpack/changelog/update-blogging-prompts-block-ui
deleted file mode 100644
index cc6b3890ebede..0000000000000
--- a/projects/plugins/jetpack/changelog/update-blogging-prompts-block-ui
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: other
-
-Adds basic ui to beta blogging-prompt block
diff --git a/projects/plugins/jetpack/changelog/update-blogging-prompts-error-handling b/projects/plugins/jetpack/changelog/update-blogging-prompts-error-handling
new file mode 100644
index 0000000000000..7892b515cdc80
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-blogging-prompts-error-handling
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Adding better error handling to Writing Prompt block
diff --git a/projects/plugins/jetpack/changelog/renovate-wordpress-monorepo b/projects/plugins/jetpack/changelog/update-clean-jetpack12.0-a.1-readme
similarity index 52%
rename from projects/plugins/jetpack/changelog/renovate-wordpress-monorepo
rename to projects/plugins/jetpack/changelog/update-clean-jetpack12.0-a.1-readme
index 1eaea6a769e84..9bf5d54ac0c02 100644
--- a/projects/plugins/jetpack/changelog/renovate-wordpress-monorepo
+++ b/projects/plugins/jetpack/changelog/update-clean-jetpack12.0-a.1-readme
@@ -1,4 +1,4 @@
Significance: patch
Type: other
-Updated package dependencies.
+Readme fixup.
diff --git a/projects/plugins/jetpack/changelog/update-form-fields-sidebar b/projects/plugins/jetpack/changelog/update-form-fields-sidebar
deleted file mode 100644
index 58339601d1a44..0000000000000
--- a/projects/plugins/jetpack/changelog/update-form-fields-sidebar
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Forms: Move field width settings and remove placeholder field from MC/SC fields
diff --git a/projects/plugins/jetpack/changelog/update-form-styles-script b/projects/plugins/jetpack/changelog/update-form-styles-script
deleted file mode 100644
index 35175ef307af1..0000000000000
--- a/projects/plugins/jetpack/changelog/update-form-styles-script
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Forms: Update form-styles script to run in the context of the Form block
diff --git a/projects/plugins/jetpack/changelog/update-getting-posts-by-ids b/projects/plugins/jetpack/changelog/update-getting-posts-by-ids
deleted file mode 100644
index 27f2d87c4b952..0000000000000
--- a/projects/plugins/jetpack/changelog/update-getting-posts-by-ids
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Allowing getting posts by ids in GET /posts response using include array
diff --git a/projects/plugins/jetpack/changelog/update-jetpack-11.9-editorial b/projects/plugins/jetpack/changelog/update-jetpack-11.9-editorial
deleted file mode 100644
index 2cbb1c53512e3..0000000000000
--- a/projects/plugins/jetpack/changelog/update-jetpack-11.9-editorial
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: other
-Comment: Jetpack: 11.9-beta editorial
-
-
diff --git a/projects/plugins/jetpack/changelog/update-mutiple-single-choice-field b/projects/plugins/jetpack/changelog/update-mutiple-single-choice-field
new file mode 100644
index 0000000000000..5abdc617d3fa4
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-mutiple-single-choice-field
@@ -0,0 +1,4 @@
+Significance: minor
+Type: enhancement
+
+Forms: Multiple Choice and Single Choice fields redesign
diff --git a/projects/plugins/jetpack/changelog/update-sharing-rm-count-var b/projects/plugins/jetpack/changelog/update-sharing-rm-count-var
deleted file mode 100644
index 50608405e7b64..0000000000000
--- a/projects/plugins/jetpack/changelog/update-sharing-rm-count-var
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: other
-
-Sharing: remove unused variable
diff --git a/projects/plugins/jetpack/changelog/update-sso-logout-heads-up-warning-notice b/projects/plugins/jetpack/changelog/update-sso-logout-heads-up-warning-notice
deleted file mode 100644
index 24b5af55c0de6..0000000000000
--- a/projects/plugins/jetpack/changelog/update-sso-logout-heads-up-warning-notice
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-SSO: Add message to logout notice when SSO is enabled that gives a heads up to also log out of wpcom if they are on a shared computer.
diff --git a/projects/plugins/jetpack/changelog/update-videopress-register-videopress-video-based-on-filtered-extensions b/projects/plugins/jetpack/changelog/update-videopress-register-videopress-video-based-on-filtered-extensions
deleted file mode 100644
index 55a991fd9e4e4..0000000000000
--- a/projects/plugins/jetpack/changelog/update-videopress-register-videopress-video-based-on-filtered-extensions
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Jetpack: register VideoPress video block based on the filtered extensions
diff --git a/projects/plugins/jetpack/changelog/update-wp-tested-up-to b/projects/plugins/jetpack/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..c76fb2decd582
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: compat
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/jetpack/composer.json b/projects/plugins/jetpack/composer.json
index 5f7637ce4eb66..c851c572fcba3 100644
--- a/projects/plugins/jetpack/composer.json
+++ b/projects/plugins/jetpack/composer.json
@@ -100,7 +100,7 @@
"platform": {
"ext-intl": "0.0.0"
},
- "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ12_0_a_0",
+ "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ12_0_a_2",
"allow-plugins": {
"automattic/jetpack-autoloader": true,
"automattic/jetpack-composer-plugin": true
diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock
index e10ee13a9d898..e3f8562002d60 100644
--- a/projects/plugins/jetpack/composer.lock
+++ b/projects/plugins/jetpack/composer.lock
@@ -875,7 +875,7 @@
"dist": {
"type": "path",
"url": "../../packages/forms",
- "reference": "69b0956e664edfbbc78b45665c652462d9d3a8de"
+ "reference": "ec6c161155b3cef7e43d45c3d715e0ef0417f6a2"
},
"require": {
"automattic/jetpack-assets": "@dev",
@@ -897,7 +897,7 @@
"link-template": "https://github.com/automattic/jetpack-forms/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "0.7.x-dev"
+ "dev-trunk": "0.8.x-dev"
},
"textdomain": "jetpack-forms",
"version-constants": {
@@ -1065,7 +1065,7 @@
"dist": {
"type": "path",
"url": "../../packages/import",
- "reference": "dbd1e38ec065af14ccfc194b72d170f1aa90209a"
+ "reference": "37125a5f15779eea6046766a6a78b12d9de6b810"
},
"require": {
"automattic/jetpack-connection": "@dev"
@@ -1083,7 +1083,7 @@
},
"autotagger": true,
"branch-alias": {
- "dev-trunk": "0.1.x-dev"
+ "dev-trunk": "0.2.x-dev"
},
"textdomain": "jetpack-import",
"version-constants": {
@@ -1408,7 +1408,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -1435,7 +1435,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
@@ -2278,7 +2278,7 @@
"dist": {
"type": "path",
"url": "../../packages/videopress",
- "reference": "62b58b5e1fe678849ef0751ed05a6e71cedfa82a"
+ "reference": "94b32518050a387b8c926214809c806fd64d7dbb"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -2300,7 +2300,7 @@
"link-template": "https://github.com/Automattic/jetpack-videopress/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "0.11.x-dev"
+ "dev-trunk": "0.12.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-package-version.php"
diff --git a/projects/plugins/jetpack/extensions/blocks/ai-paragraph/edit.js b/projects/plugins/jetpack/extensions/blocks/ai-paragraph/edit.js
index 26bfafa884782..eba7e709b699c 100644
--- a/projects/plugins/jetpack/extensions/blocks/ai-paragraph/edit.js
+++ b/projects/plugins/jetpack/extensions/blocks/ai-paragraph/edit.js
@@ -10,7 +10,7 @@ import { sprintf, __ } from '@wordpress/i18n';
import { name as aiParagraphBlockName } from './index';
// Maximum number of characters we send from the content
-export const MAXIMUM_NUMBER_OF_CHARACTERS_SENT_FROM_CONTENT = 240;
+export const MAXIMUM_NUMBER_OF_CHARACTERS_SENT_FROM_CONTENT = 1024;
// Creates the prompt that will eventually be sent to OpenAI. It uses the current post title, content (before the actual AI block) - or a slice of it if too long, and tags + categories names
export const createPrompt = (
@@ -39,11 +39,11 @@ export const createPrompt = (
if ( postTitle ) {
prompt = sprintf(
/** translators: This will be the beginning of a prompt that will be sent to OpenAI based on the post title. */
- __( "This is a post titled '%1$s' ", 'jetpack' ),
+ __( "Please help me write a short piece of a blog post titled '%1$s'", 'jetpack' ),
postTitle
);
} else {
- prompt = __( 'This is a post', 'jetpack' );
+ prompt = __( 'Please help me write a short piece of a blog post', 'jetpack' );
}
if ( categoriesNames ) {
@@ -56,9 +56,11 @@ export const createPrompt = (
prompt += sprintf( __( " and tagged '%1$s'", 'jetpack' ), tagsNames );
}
+ prompt += __( '. Please only output generated content ready for publishing.', 'jetpack' );
+
if ( shorter_content ) {
/** translators: This will be the end of a prompt that will be sent to OpenAI with the last MAXIMUM_NUMBER_OF_CHARACTERS_SENT_FROM_CONTENT characters of content.*/
- prompt += sprintf( __( ':\n\n … %s', 'jetpack' ), shorter_content ); // eslint-disable-line @wordpress/i18n-no-collapsible-whitespace
+ prompt += sprintf( __( ' Please continue from here:\n\n … %s', 'jetpack' ), shorter_content ); // eslint-disable-line @wordpress/i18n-no-collapsible-whitespace
}
return prompt.trim();
@@ -207,7 +209,7 @@ export default function Edit( { attributes, setAttributes, clientId } ) {
data: data,
} )
.then( res => {
- const result = res.prompts[ 0 ].text.trim().replaceAll( '\n', ' ' );
+ const result = res.trim().replaceAll( '\n', ' ' );
setAttributes( { content: result } );
setIsLoadingCompletion( false );
} )
diff --git a/projects/plugins/jetpack/extensions/blocks/ai-paragraph/test/edit.js b/projects/plugins/jetpack/extensions/blocks/ai-paragraph/test/edit.js
index f94d27f7e7823..c73acbd2af05c 100644
--- a/projects/plugins/jetpack/extensions/blocks/ai-paragraph/test/edit.js
+++ b/projects/plugins/jetpack/extensions/blocks/ai-paragraph/test/edit.js
@@ -17,38 +17,42 @@ describe( 'AIParagraphEdit', () => {
expect( createPrompt( '', [], '', '' ) ).toBeFalsy();
// Test contents
- expect( createPrompt( 'title', [], '', '' ) ).toBe( "This is a post titled 'title'" );
+ expect( createPrompt( 'title', [], '', '' ) ).toBe(
+ "Please help me write a short piece of a blog post titled 'title'. Please only output generated content ready for publishing."
+ );
expect(
createPrompt( 'title', [ fakeBlock, { attributes: { whatever: 'content' } } ], '', '' )
- ).toBe( "This is a post titled 'title' :\n\n … content" );
+ ).toBe(
+ "Please help me write a short piece of a blog post titled 'title'. Please only output generated content ready for publishing. Please continue from here:\n\n … content"
+ );
// Test that are being translated. And content trimmed
expect( createPrompt( 'title', [ fakeBlockWithBr ], '', '' ) ).toBe(
- "This is a post titled 'title' :\n\n … content\ncontent2"
+ "Please help me write a short piece of a blog post titled 'title'. Please only output generated content ready for publishing. Please continue from here:\n\n … content\ncontent2"
);
expect( createPrompt( 'title', [ fakeBlock, fakeBlock ], 'cat 1', '' ) ).toBe(
- "This is a post titled 'title' , published in categories 'cat 1':\n\n … content\ncontent"
+ "Please help me write a short piece of a blog post titled 'title', published in categories 'cat 1'. Please only output generated content ready for publishing. Please continue from here:\n\n … content\ncontent"
);
// Test MAX content length
expect( createPrompt( 'title', [ fakeBlockWithVeryLongContent ] ) ).toBe(
- "This is a post titled 'title' :\n\n … " +
+ "Please help me write a short piece of a blog post titled 'title'. Please only output generated content ready for publishing. Please continue from here:\n\n … " +
longContent.slice( -MAXIMUM_NUMBER_OF_CHARACTERS_SENT_FROM_CONTENT )
);
// Test only cats
expect( createPrompt( '', [ fakeBlock ], 'cat1', 'tag1' ) ).toBe(
- "This is a post, published in categories 'cat1' and tagged 'tag1':\n\n … content"
+ "Please help me write a short piece of a blog post, published in categories 'cat1' and tagged 'tag1'. Please only output generated content ready for publishing. Please continue from here:\n\n … content"
);
expect( createPrompt( '', [ fakeBlock ], 'cat1, cat2', 'tag1' ) ).toBe(
- "This is a post, published in categories 'cat1, cat2' and tagged 'tag1':\n\n … content"
+ "Please help me write a short piece of a blog post, published in categories 'cat1, cat2' and tagged 'tag1'. Please only output generated content ready for publishing. Please continue from here:\n\n … content"
);
expect( createPrompt( '', [], 'cat1, cat2', 'tag1' ) ).toBe(
- "This is a post, published in categories 'cat1, cat2' and tagged 'tag1'"
+ "Please help me write a short piece of a blog post, published in categories 'cat1, cat2' and tagged 'tag1'. Please only output generated content ready for publishing."
);
expect( createPrompt( 'title', [], 'cat1, cat2', 'tag1' ) ).toBe(
- "This is a post titled 'title' , published in categories 'cat1, cat2' and tagged 'tag1'"
+ "Please help me write a short piece of a blog post titled 'title', published in categories 'cat1, cat2' and tagged 'tag1'. Please only output generated content ready for publishing."
);
} );
} );
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/attributes.js b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/attributes.js
index d90ba99f31f5a..23aa24a8666b8 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/attributes.js
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/attributes.js
@@ -2,7 +2,7 @@ export default {
gravatars: {
type: 'array',
source: 'query',
- selector: '.jetpack-blogging-prompts__answers-gravatar',
+ selector: '.jetpack-blogging-prompt__answers-gravatar',
query: {
url: {
type: 'string',
@@ -14,7 +14,7 @@ export default {
prompt: {
type: 'text',
source: 'html',
- selector: '.jetpack-blogging-prompts__prompt',
+ selector: '.jetpack-blogging-prompt__prompt',
},
promptId: {
type: 'number',
@@ -27,4 +27,8 @@ export default {
type: 'boolean',
default: true,
},
+ tagsAdded: {
+ type: 'boolean',
+ default: false,
+ },
};
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/blogging-prompt.php b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/blogging-prompt.php
index 45ece826b2c59..047648ab1ccf2 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/blogging-prompt.php
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/blogging-prompt.php
@@ -1,13 +1,13 @@
__NAMESPACE__ . '\load_assets' )
- );
+ if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || \Jetpack::is_connection_ready() ) {
+ Blocks::jetpack_register_block(
+ BLOCK_NAME,
+ array( 'render_callback' => __NAMESPACE__ . '\load_assets' )
+ );
+ }
}
add_action( 'init', __NAMESPACE__ . '\register_block' );
/**
- * Blogging Prompts block registration/dependency declaration.
+ * Blogging Prompt block registration/dependency declaration.
*
- * @param array $attr Array containing the Blogging Prompts block attributes.
- * @param string $content String containing the Blogging Prompts block content.
+ * @param array $attr Array containing the Blogging Prompt block attributes.
+ * @param string $content String containing the Blogging Prompt block content.
*
* @return string
*/
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/edit.js b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/edit.js
index 0b3a40954ef8a..4bf65ff75e0f5 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/edit.js
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/edit.js
@@ -1,22 +1,67 @@
import apiFetch from '@wordpress/api-fetch';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
-import { PanelBody, Spinner, ToggleControl, withNotices } from '@wordpress/components';
-import { useEffect, useState } from '@wordpress/element';
-import { __, _x } from '@wordpress/i18n';
+import { Button, PanelBody, Spinner, ToggleControl, withNotices } from '@wordpress/components';
+import { useEffect, useRef, useState } from '@wordpress/element';
+import { __, _x, sprintf } from '@wordpress/i18n';
import './editor.scss';
import icon from './icon';
+import { usePromptTags } from './use-prompt-tags';
-function BloggingPromptsBetaEdit( { attributes, noticeOperations, noticeUI, setAttributes } ) {
+function BloggingPromptEdit( { attributes, noticeOperations, noticeUI, setAttributes } ) {
+ const fetchedPromptRef = useRef( false );
const [ isLoading, setLoading ] = useState( true );
- const { gravatars, prompt, promptId, showLabel, showResponses } = attributes;
- const blockProps = useBlockProps( { className: 'jetpack-blogging-prompts' } );
+ const { gravatars, prompt, promptId, showLabel, showResponses, tagsAdded } = attributes;
+ const blockProps = useBlockProps( { className: 'jetpack-blogging-prompt' } );
+ const setTagsAdded = state => setAttributes( { tagsAdded: state } );
+
+ // Add the prompt tags to the post, if they haven't already been added.
+ usePromptTags( promptId, tagsAdded, setTagsAdded );
+
+ // Fetch the prompt by id, if present, otherwise the get the prompt for today.
useEffect( () => {
- // If not initially rendering the block, don't fetch new data.
- if ( ! isLoading ) {
+ // Only fetch the prompt once.
+ if ( fetchedPromptRef.current ) {
return;
}
+ const retryPrompt = () => {
+ setLoading( true );
+ fetchedPromptRef.current = false;
+ noticeOperations.removeAllNotices();
+ };
+
+ const resetPrompt = () => {
+ setAttributes( { promptId: null } );
+ retryPrompt();
+ };
+
+ const errorMessage = message => (
+ <>
+ { sprintf(
+ /* translators: %s is the error message. */
+ __( 'Error while fetching prompt: %s', 'jetpack' ),
+ message
+ ) }{ ' ' }
+
+ { __( 'Retry', 'jetpack' ) }
+
+ >
+ );
+
+ const notFoundMessage = pId => (
+ <>
+ { sprintf(
+ /* translators: %d is the prompt id. */
+ __( 'Prompt with id %d not found.', 'jetpack' ),
+ pId
+ ) }{ ' ' }
+
+ { __( 'Reset prompt', 'jetpack' ) }
+
+ >
+ );
+
let path = '/wpcom/v3/blogging-prompts';
if ( promptId ) {
@@ -31,6 +76,7 @@ function BloggingPromptsBetaEdit( { attributes, noticeOperations, noticeUI, setA
path += `?after=--${ month }-${ day }&order=desc`;
}
+ fetchedPromptRef.current = true;
apiFetch( { path } )
.then( prompts => {
const promptData = promptId ? prompts : prompts[ 0 ];
@@ -44,10 +90,14 @@ function BloggingPromptsBetaEdit( { attributes, noticeOperations, noticeUI, setA
} )
.catch( error => {
setLoading( false );
+ const message =
+ error.code === 'rest_post_invalid_id' && promptId
+ ? notFoundMessage( promptId )
+ : errorMessage( error.message );
noticeOperations.removeAllNotices();
- noticeOperations.createErrorNotice( error.message );
+ noticeOperations.createErrorNotice( message );
} );
- }, [ isLoading, noticeOperations, promptId, setAttributes, setLoading ] );
+ }, [ fetchedPromptRef, isLoading, noticeOperations, promptId, setAttributes, setLoading ] );
const onShowLabelChange = newValue => {
setAttributes( { showLabel: newValue } );
@@ -79,23 +129,23 @@ function BloggingPromptsBetaEdit( { attributes, noticeOperations, noticeUI, setA
const renderPrompt = () => (
<>
{ showLabel && (
-
+
{ icon }
{ __( 'Daily writing prompt', 'jetpack' ) }
) }
-
{ prompt }
+
{ prompt }
- { showResponses && (
-
+ { showResponses && promptId && (
+
{ gravatars &&
gravatars.slice( 0, 3 ).map( ( { url } ) => {
return (
url && (
// eslint-disable-next-line jsx-a11y/alt-text
{ __( 'View all responses', 'jetpack' ) }
@@ -123,7 +173,7 @@ function BloggingPromptsBetaEdit( { attributes, noticeOperations, noticeUI, setA
{ renderControls() }
{ isLoading ? (
-
+
) : (
@@ -133,4 +183,4 @@ function BloggingPromptsBetaEdit( { attributes, noticeOperations, noticeUI, setA
);
}
-export default withNotices( BloggingPromptsBetaEdit );
+export default withNotices( BloggingPromptEdit );
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.js b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.js
index 3a91269f534ec..715ef970e850a 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.js
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.js
@@ -1,6 +1,3 @@
-/**
- * Internal dependencies
- */
import registerJetpackBlock from '../../shared/register-jetpack-block';
import { name, settings } from '.';
import './style.scss';
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.scss b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.scss
index 60c36e56ab7e8..53c736624dd3b 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.scss
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/editor.scss
@@ -1,5 +1,5 @@
/**
- * Editor styles for Blogging Prompts
+ * Editor styles for Blogging Prompt block.
*/
-.wp-block-jetpack-blogging-prompts-beta { }
+.wp-block-jetpack-blogging-prompt { }
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/save.js b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/save.js
index 48ce1e5073e98..1716f5f2fa87d 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/save.js
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/save.js
@@ -2,27 +2,27 @@ import { useBlockProps } from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';
import icon from './icon';
-function BloggingPromptsSave( { attributes } ) {
+function BloggingPromptSave( { attributes } ) {
const { gravatars, prompt, promptId, showLabel, showResponses } = attributes;
- const blockProps = useBlockProps.save( { className: 'jetpack-blogging-prompts' } );
+ const blockProps = useBlockProps.save( { className: 'jetpack-blogging-prompt' } );
return (
{ showLabel && (
-
+
{ icon }
{ __( 'Daily writing prompt', 'jetpack' ) }
) }
-
{ prompt }
- { showResponses && (
-
+
{ prompt }
+ { showResponses && promptId && (
+
{ gravatars.map( ( { url } ) => {
return (
url && (
// eslint-disable-next-line jsx-a11y/alt-text
{ __( 'View all responses', 'jetpack' ) }
@@ -43,4 +45,4 @@ function BloggingPromptsSave( { attributes } ) {
);
}
-export default BloggingPromptsSave;
+export default BloggingPromptSave;
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/style.scss b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/style.scss
index 8430ff3765440..4502929b012a7 100644
--- a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/style.scss
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/style.scss
@@ -1,15 +1,17 @@
-.jetpack-blogging-prompts {
- border: 1px solid #dcdcde;
+@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
+
+.jetpack-blogging-prompt {
+ border: 1px solid $gray-300;
border-radius: 2px;
padding: 24px;
&__label {
font-size: 14px;
- margin-bottom: 16px;
+ margin-bottom: $grid-unit-20;
svg {
- height: 24px;
- width: 24px;
+ height: $icon-size;
+ width: $icon-size;
margin-right: 6px;
vertical-align: bottom;
}
@@ -27,11 +29,11 @@
&__answers {
font-size: 16px;
- margin-top: 16px;
+ margin-top: $grid-unit-20;
}
&__answers-gravatar {
- border: 2px solid white;
+ border: 2px solid $white;
border-radius: 50%;
height: 24px;
vertical-align: middle;
diff --git a/projects/plugins/jetpack/extensions/blocks/blogging-prompt/use-prompt-tags.js b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/use-prompt-tags.js
new file mode 100644
index 0000000000000..1ee9e8a3d0d19
--- /dev/null
+++ b/projects/plugins/jetpack/extensions/blocks/blogging-prompt/use-prompt-tags.js
@@ -0,0 +1,120 @@
+import apiFetch from '@wordpress/api-fetch';
+import { useDispatch, useSelect } from '@wordpress/data';
+import { useEffect, useRef } from '@wordpress/element';
+import { escapeHTML } from '@wordpress/escape-html';
+
+// Tries to create a tag or fetch it if it already exists.
+// @link https://github.com/WordPress/gutenberg/blob/98b58d9042eda7590659c6cce2cf7916ba99aaa1/packages/editor/src/components/post-taxonomies/flat-term-selector.js#L55
+function findOrCreateTag( tagName ) {
+ const escapedTagName = escapeHTML( tagName );
+
+ return apiFetch( {
+ path: `/wp/v2/tags`,
+ method: 'POST',
+ data: { name: escapedTagName },
+ } ).catch( error => {
+ if ( error.code !== 'term_exists' ) {
+ return Promise.reject( error );
+ }
+
+ return Promise.resolve( {
+ id: error.data.term_id,
+ name: tagName,
+ } );
+ } );
+}
+
+export function usePromptTags( promptId, tagsAdded, setTagsAdded ) {
+ const { editPost } = useDispatch( 'core/editor' );
+
+ // Track the status of requests to create or fetch tags.
+ // Statuses are 'not-started', 'pending', 'fulfilled', or 'rejected'.
+ const promptTagRequestStatus = useRef( 'not-started' );
+
+ // Get information about tags for the edited post.
+ const { postType, postsSupportTags, tags, tagIds, tagsHaveResolved } = useSelect( select => {
+ const { getEditedPostAttribute } = select( 'core/editor' );
+ const { getEntityRecords, getPostType, hasFinishedResolution } = select( 'core' );
+ const _termIds = getEditedPostAttribute( 'tags' );
+
+ const query = {
+ _fields: 'id,name',
+ context: 'view',
+ include: _termIds?.join( ',' ),
+ per_page: -1,
+ };
+
+ return {
+ postType: getEditedPostAttribute( 'type' ),
+ postsSupportTags: getPostType( 'post' )?.taxonomies.includes( 'post_tag' ),
+ tagIds: _termIds || [],
+ tags: _termIds && _termIds.length ? getEntityRecords( 'taxonomy', 'post_tag', query ) : [],
+ tagsHaveResolved:
+ _termIds && _termIds.length
+ ? hasFinishedResolution( 'getEntityRecords', [ 'taxonomy', 'post_tag', query ] )
+ : true,
+ };
+ }, [] );
+
+ // Add the related prompt tags, if we're able and they haven't been added already.
+ useEffect( () => {
+ if (
+ // We're only interested in tagging posts as writing prompt answers.
+ 'post' !== postType ||
+ // Make sure tag support hasn't been disabled for posts.
+ ! postsSupportTags ||
+ // Prompt tags are only added once (they can be removed by the user, if desired).
+ tagsAdded ||
+ // Tags for the post have resolved.
+ ! tagsHaveResolved ||
+ // We successfully fetched the prompt, otherwise there's no point in adding tags to the post.
+ ! promptId ||
+ ! Array.isArray( tags )
+ ) {
+ return;
+ }
+
+ // Make sure we only try fetch prompt tag ids one time, even though the hook reruns on every component render.
+ if ( promptTagRequestStatus.current === 'not-started' ) {
+ // Add the prompt tags, if any are missing.
+ if (
+ ! tags.some( t => t.name && t.name === 'dailyprompt' ) ||
+ ! tags.some( t => t.name && t.name === `dailyprompt-${ promptId }` )
+ ) {
+ promptTagRequestStatus.current = 'pending';
+
+ Promise.all( [
+ findOrCreateTag( 'dailyprompt' ),
+ findOrCreateTag( `dailyprompt-${ promptId }` ),
+ ] )
+ .then( tagResponses => {
+ const promptTagIds = tagResponses.map( tagResponse => tagResponse.id );
+ editPost( { tags: [ ...tagIds, ...promptTagIds ] } );
+ promptTagRequestStatus.current = 'fulfilled';
+ } )
+ .catch( error => {
+ console.error( error ); // eslint-disable-line no-console
+ promptTagRequestStatus.current = 'rejected';
+ } );
+ } else {
+ // Otherwise mark the tag request as finished.
+ promptTagRequestStatus.current = 'fulfilled';
+ }
+ }
+
+ if ( promptTagRequestStatus.current === 'fulfilled' ) {
+ setTagsAdded( true );
+ }
+ }, [
+ editPost,
+ postsSupportTags,
+ postType,
+ promptId,
+ promptTagRequestStatus,
+ setTagsAdded,
+ tags,
+ tagIds,
+ tagsAdded,
+ tagsHaveResolved,
+ ] );
+}
diff --git a/projects/plugins/jetpack/extensions/blocks/contact-form/child-blocks.js b/projects/plugins/jetpack/extensions/blocks/contact-form/child-blocks.js
index f7be51e816f98..4e8886b4f32f4 100644
--- a/projects/plugins/jetpack/extensions/blocks/contact-form/child-blocks.js
+++ b/projects/plugins/jetpack/extensions/blocks/contact-form/child-blocks.js
@@ -1,7 +1,9 @@
+import { InnerBlocks } from '@wordpress/block-editor';
import { createBlock, getBlockType } from '@wordpress/blocks';
import { Path } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { __, _x } from '@wordpress/i18n';
+import { filter, isEmpty, map, trim } from 'lodash';
import { getIconColor } from '../../shared/block-icons';
import renderMaterialIcon from '../../shared/render-material-icon';
import JetpackField from './components/jetpack-field';
@@ -9,6 +11,7 @@ import JetpackFieldCheckbox from './components/jetpack-field-checkbox';
import JetpackFieldConsent from './components/jetpack-field-consent';
import JetpackDropdown from './components/jetpack-field-dropdown';
import JetpackFieldMultiple from './components/jetpack-field-multiple';
+import { JetpackFieldOptionEdit } from './components/jetpack-field-option';
import JetpackFieldTextarea from './components/jetpack-field-textarea';
import { useFormWrapper } from './util/form';
@@ -32,7 +35,7 @@ const FieldDefaults = {
},
options: {
type: 'array',
- default: [ '' ],
+ default: [],
},
defaultValue: {
type: 'string',
@@ -161,6 +164,49 @@ const FieldDefaults = {
example: {},
};
+const OptionFieldDefaults = {
+ category: 'contact-form',
+ edit: JetpackFieldOptionEdit,
+ attributes: {
+ label: {
+ type: 'string',
+ },
+ fieldType: {
+ enum: [ 'checkbox', 'radio' ],
+ default: 'checkbox',
+ },
+ },
+ supports: {
+ reusable: false,
+ html: false,
+ },
+};
+
+const multiFieldV1 = fieldType => ( {
+ attributes: {
+ ...FieldDefaults.attributes,
+ label: {
+ type: 'string',
+ default: fieldType === 'checkbox' ? 'Choose several options' : 'Choose one option',
+ },
+ },
+ migrate: attributes => {
+ const blockName = `jetpack/field-option-${ fieldType }`;
+ const nonEmptyOptions = filter( attributes.options, o => ! isEmpty( trim( o ) ) );
+ const newInnerBlocks = map( nonEmptyOptions, option =>
+ createBlock( blockName, {
+ label: option,
+ } )
+ );
+
+ attributes.options = [];
+
+ return [ attributes, newInnerBlocks ];
+ },
+ isEligible: attr => attr.options && filter( attr.options, o => ! isEmpty( trim( o ) ) ).length,
+ save: () => null,
+} );
+
const getFieldLabel = ( { attributes, name: blockName } ) => {
return null === attributes.label ? getBlockType( blockName ).title : attributes.label;
};
@@ -508,6 +554,36 @@ export const childBlocks = [
edit: EditConsent,
},
},
+ {
+ name: 'field-option-checkbox',
+ settings: {
+ ...OptionFieldDefaults,
+ parent: [ 'jetpack/field-checkbox-multiple' ],
+ title: __( 'Multiple Choice Option', 'jetpack' ),
+ icon: renderMaterialIcon(
+ <>
+
+ >
+ ),
+ },
+ },
+ {
+ name: 'field-option-radio',
+ settings: {
+ ...OptionFieldDefaults,
+ parent: [ 'jetpack/field-radio' ],
+ title: __( 'Single Choice Option', 'jetpack' ),
+ icon: renderMaterialIcon(
+
+ ),
+ },
+ },
{
name: 'field-checkbox-multiple',
settings: {
@@ -525,6 +601,7 @@ export const childBlocks = [
/>
),
edit: editMultiField( 'checkbox' ),
+ save: () =>
,
attributes: {
...FieldDefaults.attributes,
label: {
@@ -532,6 +609,7 @@ export const childBlocks = [
default: 'Choose several options',
},
},
+ deprecated: [ multiFieldV1( 'checkbox' ) ],
},
},
{
@@ -553,6 +631,7 @@ export const childBlocks = [
),
edit: editMultiField( 'radio' ),
+ save: () =>
,
attributes: {
...FieldDefaults.attributes,
label: {
@@ -560,6 +639,7 @@ export const childBlocks = [
default: 'Choose one option',
},
},
+ deprecated: [ multiFieldV1( 'radio' ) ],
},
},
{
@@ -589,6 +669,10 @@ export const childBlocks = [
type: 'string',
default: null,
},
+ options: {
+ type: 'array',
+ default: [ '' ],
+ },
},
},
},
diff --git a/projects/plugins/jetpack/extensions/blocks/contact-form/components/jetpack-field-multiple.js b/projects/plugins/jetpack/extensions/blocks/contact-form/components/jetpack-field-multiple.js
index b5123fd49ac18..7ee3150cfc151 100644
--- a/projects/plugins/jetpack/extensions/blocks/contact-form/components/jetpack-field-multiple.js
+++ b/projects/plugins/jetpack/extensions/blocks/contact-form/components/jetpack-field-multiple.js
@@ -1,15 +1,15 @@
-import { Button } from '@wordpress/components';
+import { InnerBlocks } from '@wordpress/block-editor';
import { compose, withInstanceId } from '@wordpress/compose';
-import { useState } from '@wordpress/element';
-import { __ } from '@wordpress/i18n';
+import { useSelect } from '@wordpress/data';
import classnames from 'classnames';
import { useFormStyle } from '../util/form';
import { withSharedFieldAttributes } from '../util/with-shared-field-attributes';
import JetpackFieldControls from './jetpack-field-controls';
import JetpackFieldLabel from './jetpack-field-label';
-import JetpackOption from './jetpack-option';
import { useJetpackFieldStyles } from './use-jetpack-field-styles';
+const ALLOWED_BLOCKS = [ 'jetpack/field-option' ];
+
function JetpackFieldMultiple( props ) {
const {
clientId,
@@ -27,52 +27,19 @@ function JetpackFieldMultiple( props ) {
} = props;
const formStyle = useFormStyle( clientId );
+ const innerBlocks = useSelect(
+ select => {
+ return select( 'core/block-editor' ).getBlock( clientId ).innerBlocks;
+ },
+ [ clientId ]
+ );
+
const classes = classnames( 'jetpack-field jetpack-field-multiple', {
'is-selected': isSelected,
- 'has-placeholder': options.length,
+ 'has-placeholder': ( options && options.length ) || innerBlocks.length,
} );
- const [ inFocus, setInFocus ] = useState( null );
-
- const onChangeOption = ( key = null, option = null ) => {
- const newOptions = options.slice( 0 );
-
- if ( null === option ) {
- // Remove a key
- newOptions.splice( key, 1 );
- if ( key > 0 ) {
- setInFocus( key - 1 );
- }
- } else {
- // update a key
- newOptions.splice( key, 1, option );
- setInFocus( key ); // set the focus.
- }
- setAttributes( { options: newOptions } );
- };
-
- const addNewOption = ( key = null ) => {
- const newOptions = options.slice( 0 );
- let newInFocus = 0;
-
- if ( 'object' === typeof key ) {
- newOptions.push( '' );
- newInFocus = newOptions.length - 1;
- } else {
- newOptions.splice( key + 1, 0, '' );
- newInFocus = key + 1;
- }
-
- setInFocus( newInFocus );
- setAttributes( { options: newOptions } );
- };
-
- const { blockStyle, fieldStyle } = useJetpackFieldStyles( attributes );
- const optionStyle = {
- color: fieldStyle.color,
- fontSize: fieldStyle.fontSize,
- lineHeight: fieldStyle.lineHeight,
- };
+ const { blockStyle } = useJetpackFieldStyles( attributes );
return (
<>
@@ -87,40 +54,16 @@ function JetpackFieldMultiple( props ) {
label={ label }
setAttributes={ setAttributes }
isSelected={ isSelected }
- resetFocus={ () => setInFocus( null ) }
attributes={ attributes }
style={ formStyle }
/>
-
- { options.map( ( option, index ) => (
-
- ) ) }
- { isSelected && (
-
-
- { __( 'Add option', 'jetpack' ) }
-
-
- ) }
-
+
+
+
{
+ const { attributes, clientId, name, onReplace, setAttributes } = props;
+ const { removeBlock } = useDispatch( 'core/block-editor' );
+ const parentAttributes = useParentAttributes( clientId );
+ const { optionStyle } = useJetpackFieldStyles( parentAttributes );
+
+ const siblingsCount = useSelect(
+ select => {
+ const blockEditor = select( 'core/block-editor' );
+ const parentBlockId = first( blockEditor.getBlockParents( clientId, true ) );
+ return blockEditor.getBlock( parentBlockId ).innerBlocks.length;
+ },
+ [ clientId ]
+ );
+
+ const type = name.replace( 'jetpack/field-option-', '' );
+
+ const handleSplit = label =>
+ createBlock( name, {
+ ...attributes,
+ clientId: label && attributes.label.indexOf( label ) === 0 ? attributes.clientId : undefined,
+ label,
+ } );
+
+ const handleDelete = () => {
+ if ( siblingsCount <= 1 ) {
+ return;
+ }
+
+ removeBlock( clientId );
+ };
+
+ return (
+
+
+ {
+ setAttributes( { label: value } );
+ } }
+ onRemove={ handleDelete }
+ onSplit={ handleSplit }
+ onReplace={ onReplace }
+ placeholder={ __( 'Add option…', 'jetpack' ) }
+ preserveWhiteSpace={ false }
+ withoutInteractiveFormatting
+ value={ attributes.label }
+ style={ optionStyle }
+ />
+
+ );
+};
diff --git a/projects/plugins/jetpack/extensions/blocks/contact-form/components/use-jetpack-field-styles.js b/projects/plugins/jetpack/extensions/blocks/contact-form/components/use-jetpack-field-styles.js
index 96409b578d96a..432614c49831d 100644
--- a/projects/plugins/jetpack/extensions/blocks/contact-form/components/use-jetpack-field-styles.js
+++ b/projects/plugins/jetpack/extensions/blocks/contact-form/components/use-jetpack-field-styles.js
@@ -31,9 +31,16 @@ export const useJetpackFieldStyles = attributes => {
lineHeight: attributes.lineHeight,
};
+ const optionStyle = {
+ color: fieldStyle.color,
+ fontSize: fieldStyle.fontSize,
+ lineHeight: fieldStyle.lineHeight,
+ };
+
return {
blockStyle,
fieldStyle,
labelStyle,
+ optionStyle,
};
};
diff --git a/projects/plugins/jetpack/extensions/blocks/contact-form/edit.js b/projects/plugins/jetpack/extensions/blocks/contact-form/edit.js
index b7aaa6bd10896..91075ffe77c5b 100644
--- a/projects/plugins/jetpack/extensions/blocks/contact-form/edit.js
+++ b/projects/plugins/jetpack/extensions/blocks/contact-form/edit.js
@@ -21,7 +21,7 @@ import { withDispatch, withSelect } from '@wordpress/data';
import { Fragment, useEffect, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
-import { filter, get, map } from 'lodash';
+import { filter, get, isArray, map } from 'lodash';
import InspectorHint from '../../shared/components/inspector-hint';
import { childBlocks } from './child-blocks';
import CRMIntegrationSettings from './components/jetpack-crm-integration/jetpack-crm-integration-settings';
@@ -34,8 +34,16 @@ import SalesforceLeadFormSettings, {
import { withStyleVariables } from './util/with-style-variables';
import defaultVariations from './variations';
+const validFields = filter( childBlocks, ( { settings } ) => {
+ return (
+ ! settings.parent ||
+ settings.parent === 'jetpack/contact-form' ||
+ ( isArray( settings.parent ) && settings.parent.includes( 'jetpack/contact-form' ) )
+ );
+} );
+
const ALLOWED_BLOCKS = [
- ...map( childBlocks, block => `jetpack/${ block.name }` ),
+ ...map( validFields, block => `jetpack/${ block.name }` ),
'core/audio',
'core/columns',
'core/group',
diff --git a/projects/plugins/jetpack/extensions/blocks/contact-form/editor.scss b/projects/plugins/jetpack/extensions/blocks/contact-form/editor.scss
index 345e68c70901b..c57745b251848 100644
--- a/projects/plugins/jetpack/extensions/blocks/contact-form/editor.scss
+++ b/projects/plugins/jetpack/extensions/blocks/contact-form/editor.scss
@@ -321,7 +321,8 @@
height: 1rem;
border-color: currentColor;
opacity: 1;
- margin: 0 0.75rem 0 0
+ margin: 0 0.75rem 0 0;
+ pointer-events: none;
}
&.jetpack-field-multiple {
@@ -351,6 +352,20 @@
.jetpack-field-consent__checkbox + .jetpack-field-label {
line-height: normal;
}
+
+ .jetpack-field-option {
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+
+ > input {
+ margin: 0 5px 0 0;
+ }
+
+ > .rich-text {
+ line-height: 2;
+ }
+ }
}
:where(:not(.contact-form)) > .jetpack-field {
@@ -733,6 +748,10 @@
}
}
+ &.jetpack-field-checkbox {
+ margin-top: 0;
+ }
+
.jetpack-field-dropdown {
&__popover .rich-text {
padding-left: calc(var(--notch-width) + 4px);
diff --git a/projects/plugins/jetpack/extensions/blocks/contact-form/util/use-parent-attributes.js b/projects/plugins/jetpack/extensions/blocks/contact-form/util/use-parent-attributes.js
new file mode 100644
index 0000000000000..b841c37968aa8
--- /dev/null
+++ b/projects/plugins/jetpack/extensions/blocks/contact-form/util/use-parent-attributes.js
@@ -0,0 +1,9 @@
+import { useSelect } from '@wordpress/data';
+import { first } from 'lodash';
+
+export const useParentAttributes = clientId =>
+ useSelect( select => {
+ const blockEditor = select( 'core/block-editor' );
+
+ return blockEditor.getBlockAttributes( first( blockEditor.getBlockParents( clientId, true ) ) );
+ } );
diff --git a/projects/plugins/jetpack/extensions/blocks/cookie-consent/cookie-consent.php b/projects/plugins/jetpack/extensions/blocks/cookie-consent/cookie-consent.php
index c6670aa3b364e..ea4fcf7a02d97 100644
--- a/projects/plugins/jetpack/extensions/blocks/cookie-consent/cookie-consent.php
+++ b/projects/plugins/jetpack/extensions/blocks/cookie-consent/cookie-consent.php
@@ -2,7 +2,7 @@
/**
* Cookie-consent Block.
*
- * @since $$next-version$$
+ * @since 12.0
*
* @package automattic/jetpack
*/
@@ -20,7 +20,7 @@
* Should the block be registered?
* In wp-admin, we only want to show the block in the site editor.
*
- * @since $$next-version$$
+ * @since 12.0
*
* @return bool
*/
diff --git a/projects/plugins/jetpack/extensions/blocks/slideshow/style.scss b/projects/plugins/jetpack/extensions/blocks/slideshow/style.scss
index b55bd4c14632f..7b073c298b457 100644
--- a/projects/plugins/jetpack/extensions/blocks/slideshow/style.scss
+++ b/projects/plugins/jetpack/extensions/blocks/slideshow/style.scss
@@ -160,7 +160,7 @@
.wp-block-jetpack-slideshow_button-play,
.wp-block-jetpack-slideshow_button-pause {
- background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M6%2019h4V5H6v14zm8-14v14h4V5h-4z'%20fill='white'/%3E%3Cpath%20d='M0%200h24v24H0z'%20fill='none'/%3E%3C/svg%3E" );
+ background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M6%2019h4V5H6v14zm8-14v14h4V5h-4z'%20fill='black'/%3E%3Cpath%20d='M0%200h24v24H0z'%20fill='none'/%3E%3C/svg%3E" );
display: none;
margin-top: 0;
position: absolute;
@@ -171,7 +171,7 @@
.wp-block-jetpack-slideshow_button-play,
.wp-block-jetpack-slideshow_autoplay-paused .wp-block-jetpack-slideshow_button-pause {
- background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8%205v14l11-7z'%20fill='white'/%3E%3Cpath%20d='M0 0h24v24H0z'%20fill='none'/%3E%3C/svg%3E" );
+ background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8%205v14l11-7z'%20fill='black'/%3E%3Cpath%20d='M0 0h24v24H0z'%20fill='none'/%3E%3C/svg%3E" );
}
&[data-autoplay='true'] .wp-block-jetpack-slideshow_button-pause {
diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/panel.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/panel.js
index 570c7ed3b2038..3843eb0defc3f 100644
--- a/projects/plugins/jetpack/extensions/blocks/subscriptions/panel.js
+++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/panel.js
@@ -14,11 +14,25 @@ import InspectorNotice from '../../shared/components/inspector-notice';
import { getSubscriberCounts } from './api';
import './panel.scss';
import { META_NAME_FOR_POST_LEVEL_ACCESS_SETTINGS } from './constants';
-import { NewsletterAccess, accessOptions } from './settings';
+import { NewsletterAccess, accessOptions, MisconfigurationWarning } from './settings';
import { isNewsletterFeatureEnabled } from './utils';
+
+function AccessLevelSelectorPanel( { setPostMeta, accessLevel } ) {
+ if ( ! isNewsletterFeatureEnabled() ) {
+ return null;
+ }
+
+ return (
+
+
+
+ );
+}
+
export default function SubscribePanels() {
const [ subscriberCount, setSubscriberCount ] = useState( null );
- const [ postMeta = [], setPostMeta ] = useEntityProp( 'postType', 'post', 'meta' );
+ const postType = useSelect( select => select( editorStore ).getCurrentPostType(), [] );
+ const [ postMeta = [], setPostMeta ] = useEntityProp( 'postType', postType, 'meta' );
const accessLevel =
postMeta[ META_NAME_FOR_POST_LEVEL_ACCESS_SETTINGS ] ?? Object.keys( accessOptions )[ 0 ];
@@ -31,27 +45,34 @@ export default function SubscribePanels() {
} );
}, [] );
+ // Can be “private”, “password”, or “public”.
+ const postVisibility = useSelect( select => select( 'core/editor' ).getEditedPostVisibility() );
+ const showMisconfigurationMessage = postVisibility !== 'public' && accessLevel !== 'everybody';
+
// Only show this for posts for now (subscriptions are only available on posts).
- const postType = useSelect( select => select( editorStore ).getCurrentPostType(), [] );
const postWasEverPublished = useSelect(
select =>
select( editorStore ).getEditedPostAttribute( 'meta' )?.jetpack_post_was_ever_published,
[]
);
- if ( 'post' !== postType ) {
+ // Subscriptions will not be triggered on private sites (on WordPress.com simple and WoA),
+ // nor on sites that have not been launched yet.
+ if ( isPrivateSite() || isComingSoon() ) {
return null;
}
- // Subscriptions will not be triggered for a post that was already published in the past
- if ( postWasEverPublished ) {
+ // Subscriptions are only available for posts. Additionally, we will allow access level selector for pages.
+ // TODO: Make it available for pages later.
+ if ( postType !== 'post' ) {
return null;
}
- // Subscriptions will not be triggered on private sites (on WordPress.com simple and WoA),
- // nor on sites that have not been launched yet.
- if ( isPrivateSite() || isComingSoon() ) {
- return null;
+ // Subscriptions will not be triggered for a post that was already published in the past and the email was sent.
+ // We still need to render the access level selector, as historical posts need a way to edit their access level for people visiting them on the web.
+ // TODO: Additionally, pages also can be protected. They will not send an email, but can be a resource that needs the acces selector.
+ if ( postWasEverPublished ) {
+ return ;
}
// Do not show any panels when we have no info about the subscriber count, or it is too low.
@@ -63,14 +84,10 @@ export default function SubscribePanels() {
}
const showNotices = Number.isFinite( subscriberCount ) && subscriberCount > 0;
+
return (
<>
- { isNewsletterFeatureEnabled() && (
-
-
-
- ) }
-
+
}
>
- { showNotices && (
+ { isNewsletterFeatureEnabled() && showMisconfigurationMessage && (
+ <>
+
+
+ >
+ ) }
+ { ! showMisconfigurationMessage && showNotices && (
{ createInterpolateElement(
followerCount !== 0
diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.js
index df7f800616457..d489998a5e4c8 100644
--- a/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.js
+++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.js
@@ -1,11 +1,17 @@
+import { getRedirectUrl } from '@automattic/jetpack-components';
// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
-import { Button, PanelRow, Dropdown, VisuallyHidden, Flex, FlexBlock } from '@wordpress/components';
+import { Flex, FlexBlock, Button, PanelRow, Dropdown, VisuallyHidden } from '@wordpress/components';
import { useInstanceId } from '@wordpress/compose';
+import { useSelect } from '@wordpress/data';
import { PostVisibilityCheck } from '@wordpress/editor';
+import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
+import InspectorNotice from '../../shared/components/inspector-notice';
import { META_NAME_FOR_POST_LEVEL_ACCESS_SETTINGS } from './constants';
+import './settings.scss';
+
export const accessOptions = {
everybody: {
label: __( 'Everybody', 'jetpack' ),
@@ -21,6 +27,22 @@ export const accessOptions = {
},
};
+export function MisconfigurationWarning( { accessLevel } ) {
+ return (
+
+ { sprintf(
+ /* translators: %1$s: visibility label for the newsletter, %2$s: label for setting "everybody". this is a warning in the newsletter when posts have a private or password-protected visibility */
+ __(
+ 'Private or password-protected posts cannot be assigned a newsletter setting of "%1$s". Please update the setting to "%2$s", or update the post visibility setting.',
+ 'jetpack'
+ ),
+ accessOptions[ accessLevel ].label,
+ accessOptions.everybody.label
+ ) }
+
+ );
+}
+
function NewsletterAccessChoices( { accessLevel, onChange } ) {
const instanceId = useInstanceId( NewsletterAccessChoices );
return (
@@ -66,54 +88,105 @@ export function NewsletterAccess( { accessLevel, setPostMeta, withModal = true }
}
const accessLabel = accessOptions[ accessLevel ]?.label;
+ // Can be “private”, “password”, or “public”.
+ const postVisibility = useSelect( select => select( 'core/editor' ).getEditedPostVisibility() );
+ const postVisibilityIsPublic = postVisibility === 'public';
+
+ const showVisibilityRestrictedMessage = ! postVisibilityIsPublic && accessLevel === 'everybody';
+ const showMisconfigurationMessage = ! postVisibilityIsPublic && accessLevel !== 'everybody';
+
return (
(
-
- {
+
+ { canEdit && withModal && showVisibilityRestrictedMessage && (
- { __( 'Access', 'jetpack' ) }
+
+ {
+ /* translators: this is a warning in the newsletter when posts have a private or password-protected visibility */
+ __(
+ 'Private or password-protected posts cannot be assigned as Subscribers-only.',
+ 'jetpack'
+ )
+ }
+
- }
- { ! canEdit && { accessLabel } }
- { withModal && canEdit && (
+ ) }
+
+ { canEdit &&
+ withModal /* to prevent displaying in pre-publish panel */ &&
+ showMisconfigurationMessage && (
+
+
+
+ ) }
+
+
- (
-
- { accessLabel }
-
- ) }
- renderContent={ ( { onClose } ) => (
-
-
-
-
- ) }
- />
+ { __( 'Access', 'jetpack' ) }
- ) }
+ { ( ! canEdit || showVisibilityRestrictedMessage ) && { accessLabel } }
+ { ! showVisibilityRestrictedMessage && withModal && canEdit && (
+
+ (
+
+ { accessLabel }
+
+ ) }
+ renderContent={ ( { onClose } ) => (
+
+
+
+
+ ) }
+ />
+
+ ) }
- { ! withModal && canEdit && (
+ { ! showVisibilityRestrictedMessage && ! withModal && canEdit && (
+
+
+
+ ) }
+
+ { withModal && (
-
+
+ { createInterpolateElement(
+ /* translators: basic information about the newsletter visibility */
+ __( 'Restrict your post to subscribers. Learn more .', 'jetpack' ),
+ {
+ a: (
+
+ ),
+ }
+ ) }
+
) }
diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.scss b/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.scss
new file mode 100644
index 0000000000000..553484f83c027
--- /dev/null
+++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/settings.scss
@@ -0,0 +1,16 @@
+@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
+
+.jetpack-inspector-notice {
+ span.jetpack-subscribe-notice-visibility{
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ }
+}
+
+.jetpack-subscribe-notice-misconfiguration.warning {
+ color: $alert-red;
+ border: solid 1px $alert-red;
+ padding: 1em;
+ text-align: justify;
+}
diff --git a/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/components/transform-control/index.js b/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/components/transform-control/index.js
index c95b62c35a488..9014c476a581f 100644
--- a/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/components/transform-control/index.js
+++ b/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/components/transform-control/index.js
@@ -18,12 +18,58 @@ import { ReactElement } from 'react';
import { isVideoPressBlockBasedOnAttributes } from '../../../utils';
import styles from './styles.module.scss';
+const videoPressVideoBlocks = { instances: [] };
+
+// eslint-disable-next-line jsdoc/require-returns-check
+/**
+ * Recursively get all core/video VideoPress (aka v5) block instances
+ *
+ * @param {Array} blocks - Array of blocks
+ * @param {boolean} root - Whether it is the root block
+ * @param {number} level - Nesting level in the block tree
+ * @returns {Array} Array of VideoPress blocks
+ */
+const getAllCoreVideoVideoPressVideoBlocks = ( blocks = [], root = false, level = 0 ) => {
+ if ( root ) {
+ // Clear the instances when it's called from the root block.
+ videoPressVideoBlocks.instances = [];
+ }
+
+ blocks.forEach( block => {
+ if ( block.innerBlocks.length ) {
+ // Recursively call increasing the nesting level.
+ getAllCoreVideoVideoPressVideoBlocks( block.innerBlocks, false, level + 1 );
+ return;
+ }
+
+ const { clientId, name, attributes } = block;
+ if ( name === 'core/video' && isVideoPressBlockBasedOnAttributes( attributes ) ) {
+ videoPressVideoBlocks.instances.push( { clientId, name, attributes } );
+ }
+ } );
+
+ /*
+ * Level zero is the first call,
+ * but also is the last of the recursive calls.
+ * Return the collected block instances when it's the last one.
+ */
+ if ( level === 0 ) {
+ return videoPressVideoBlocks.instances;
+ }
+};
+
/**
* React component that renders a block conversion control
*
- * @returns {ReactElement} - Transform panel component.
+ * @param {object} props - Component props
+ * @param {string} props.clientId - Block client ID
+ * @param {object} props.attributes - Block attributes
+ * @returns {ReactElement} Transform panel component.
*/
-export default function TransformControl() {
+export default function TransformControl( {
+ clientId: currentBlockClientId,
+ attributes: currentBlockAttributes,
+} ) {
const postId = useSelect( select => select( editorStore ).getCurrentPostId() );
const { getBlocks } = useSelect( blockEditorStore );
@@ -31,9 +77,21 @@ export default function TransformControl() {
const { tracks } = useAnalytics();
const handleTransformAll = () => {
- const blocks = getBlocks();
+ const allV5Instances = getAllCoreVideoVideoPressVideoBlocks( getBlocks(), true );
+ if ( ! allV5Instances?.length ) {
+ return;
+ }
+
+ // Ensure the current block is included in the list.
+ if ( ! allV5Instances.find( block => block.clientId === currentBlockClientId ) ) {
+ allV5Instances.push( {
+ clientId: currentBlockClientId,
+ name: 'core/video',
+ currentBlockAttributes,
+ } );
+ }
- blocks.forEach( block => {
+ allV5Instances.forEach( block => {
const { clientId, name, attributes } = block;
if ( name === 'core/video' && isVideoPressBlockBasedOnAttributes( attributes ) ) {
replaceBlock( clientId, createBlock( 'videopress/video', attributes ) );
diff --git a/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/edit.js b/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/edit.js
index ce45fb1128eaf..aedbe12818534 100644
--- a/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/edit.js
+++ b/projects/plugins/jetpack/extensions/blocks/videopress/v6-transform/edit.js
@@ -18,7 +18,7 @@ const withV6TransformEdit = createHigherOrderComponent( BlockEdit => props => {
return (
<>
-
+
diff --git a/projects/plugins/jetpack/extensions/shared/components/inspector-notice/index.jsx b/projects/plugins/jetpack/extensions/shared/components/inspector-notice/index.jsx
index 7a4c3edbc237b..4a19b5cba20a8 100644
--- a/projects/plugins/jetpack/extensions/shared/components/inspector-notice/index.jsx
+++ b/projects/plugins/jetpack/extensions/shared/components/inspector-notice/index.jsx
@@ -1,9 +1,9 @@
import './style.scss';
-export default function InspectorNotice( { children } ) {
+export default function InspectorNotice( { children, spanClass } ) {
return (
- { children }
+ { children }
);
}
diff --git a/projects/plugins/jetpack/jetpack.php b/projects/plugins/jetpack/jetpack.php
index facd96e4aa230..d0577fbe2e191 100644
--- a/projects/plugins/jetpack/jetpack.php
+++ b/projects/plugins/jetpack/jetpack.php
@@ -4,7 +4,7 @@
* Plugin URI: https://jetpack.com
* Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things.
* Author: Automattic
- * Version: 12.0-a.0
+ * Version: 12.0-a.2
* Author URI: https://jetpack.com
* License: GPL2+
* Text Domain: jetpack
@@ -32,7 +32,7 @@
define( 'JETPACK__MINIMUM_WP_VERSION', '6.0' );
define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
-define( 'JETPACK__VERSION', '12.0-a.0' );
+define( 'JETPACK__VERSION', '12.0-a.2' );
/**
* Constant used to fetch the connection owner token
diff --git a/projects/plugins/jetpack/modules/contact-form/css/grunion.css b/projects/plugins/jetpack/modules/contact-form/css/grunion.css
index 4d710748a4d6d..4c49ae71d8855 100644
--- a/projects/plugins/jetpack/modules/contact-form/css/grunion.css
+++ b/projects/plugins/jetpack/modules/contact-form/css/grunion.css
@@ -44,7 +44,7 @@
height: 200px;
}
-.contact-form .grunion-field {
+.contact-form :where(.grunion-field[type="text"], .grunion-field.textarea) {
padding-left: max(var(--jetpack--contact-form--input-padding-left, 16px), var(--jetpack--contact-form--border-radius));
padding-right: max(var(--jetpack--contact-form--input-padding-left, 16px), var(--jetpack--contact-form--border-radius));
}
@@ -59,11 +59,14 @@
min-width: 150px;
}
-.contact-form input[type='radio'],
-.contact-form input[type='checkbox'] {
+.contact-form :where(input[type='radio'], input[type='checkbox']) {
width: 1rem;
height: 1rem;
float: none;
+}
+
+.contact-form input[type='radio'],
+.contact-form input[type='checkbox'] {
margin: 0 0.75rem 0 0;
}
@@ -99,14 +102,14 @@
font-weight: normal;
display: inline-flex;
align-items: center;
- line-height: 1.5;
+ line-height: 1;
}
.contact-form .grunion-checkbox-multiple-options,
.contact-form .grunion-radio-options {
display: flex;
flex-direction: column;
- gap: 0.25em
+ gap: 12px;
}
.contact-form label span {
@@ -340,6 +343,12 @@
padding: 0;
line-height: normal;
box-shadow: 0 2px 6px rgb(0 0 0 / 5%);
+ list-style: none;
+ margin: 0;
+}
+
+.contact-form .contact-form-dropdown__menu .ui-menu-item {
+ margin: 0;
}
.contact-form .contact-form-dropdown__menu .ui-menu {
@@ -377,7 +386,7 @@
.contact-form .is-style-animated .grunion-field-wrap .grunion-radio-options
{
padding: var(--jetpack--contact-form--input-padding, 16px);
- padding-top: calc(var(--jetpack--contact-form--input-padding, 16px) + 4px);
+ padding-top: calc(var(--jetpack--contact-form--input-padding-top, 16px) + 4px);
flex-grow: 1;
}
diff --git a/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php b/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php
index 7e2c45e23a02c..a89a45e6288bd 100644
--- a/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php
+++ b/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php
@@ -480,12 +480,24 @@ private static function register_contact_form_blocks() {
'render_callback' => array( __CLASS__, 'gutenblock_render_field_checkbox_multiple' ),
)
);
+ Blocks::jetpack_register_block(
+ 'jetpack/field-option-checkbox',
+ array(
+ 'render_callback' => array( __CLASS__, 'gutenblock_render_field_option' ),
+ )
+ );
Blocks::jetpack_register_block(
'jetpack/field-radio',
array(
'render_callback' => array( __CLASS__, 'gutenblock_render_field_radio' ),
)
);
+ Blocks::jetpack_register_block(
+ 'jetpack/field-option-radio',
+ array(
+ 'render_callback' => array( __CLASS__, 'gutenblock_render_field_option' ),
+ )
+ );
Blocks::jetpack_register_block(
'jetpack/field-select',
array(
@@ -662,6 +674,19 @@ public static function gutenblock_render_field_checkbox_multiple( $atts, $conten
return Grunion_Contact_Form::parse_contact_field( $atts, $content );
}
+ /**
+ * Render the multiple choice field option.
+ *
+ * @param array $atts - the block attributes.
+ * @param string $content - html content.
+ *
+ * @return string HTML for the contact form field.
+ */
+ public static function gutenblock_render_field_option( $atts, $content ) {
+ $atts = self::block_attributes_to_shortcode_attributes( $atts, 'field-option' );
+ return Grunion_Contact_Form::parse_contact_field( $atts, $content );
+ }
+
/**
* Render the radio button field.
*
@@ -1003,6 +1028,10 @@ public function insert_feedback_filter( $data, $postarr ) {
public function add_shortcode() {
add_shortcode( 'contact-form', array( 'Grunion_Contact_Form', 'parse' ) );
add_shortcode( 'contact-field', array( 'Grunion_Contact_Form', 'parse_contact_field' ) );
+
+ // We need 'contact-field-option' to be registered, so it's included to the get_shortcode_regex() method
+ // But we don't need a callback because we're handling contact-field-option manually
+ add_shortcode( 'contact-field-option', '__return_null' );
}
/**
@@ -1974,9 +2003,58 @@ public function download_feedback_as_csv() {
}
fclose( $output ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
+
+ $this->record_tracks_event( 'forms_export_responses', array( 'format' => 'csv' ) );
exit();
}
+ /**
+ * Send an event to Tracks
+ *
+ * @param string $event_name - the name of the event.
+ * @param array $event_props - event properties to send.
+ *
+ * @return null|void
+ */
+ private function record_tracks_event( $event_name, $event_props ) {
+ /*
+ * Event details.
+ */
+ $event_user = wp_get_current_user();
+
+ /*
+ * Record event.
+ * We use different libs on wpcom and Jetpack.
+ */
+ if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
+ $event_name = 'wpcom_' . $event_name;
+ $event_props['blog_id'] = get_current_blog_id();
+ // logged out visitor, record event with blog owner.
+ if ( empty( $event_user->ID ) ) {
+ $event_user_id = wpcom_get_blog_owner( $event_props['blog_id'] );
+ $event_user = get_userdata( $event_user_id );
+ }
+
+ require_lib( 'tracks/client' );
+ tracks_record_event( $event_user, $event_name, $event_props );
+ } else {
+ $user_connected = ( new \Automattic\Jetpack\Connection\Manager( 'jetpack-forms' ) )->is_user_connected( get_current_user_id() );
+ if ( ! $user_connected ) {
+ return;
+ }
+ // logged out visitor, record event with Jetpack master user.
+ if ( empty( $event_user->ID ) ) {
+ $master_user_id = Jetpack_Options::get_option( 'master_user' );
+ if ( ! empty( $master_user_id ) ) {
+ $event_user = get_userdata( $master_user_id );
+ }
+ }
+
+ $tracking = new \Automattic\Jetpack\Tracking();
+ $tracking->record_user_event( $event_name, $event_props, $event_user );
+ }
+ }
+
/**
* Escape a string to be used in a CSV context
*
@@ -3200,11 +3278,27 @@ private static function esc_shortcode_val( $val ) {
public static function parse_contact_field( $attributes, $content ) {
// Don't try to parse contact form fields if not inside a contact form
if ( ! Grunion_Contact_Form_Plugin::$using_contact_form_field ) {
- $att_strs = array();
+ $type = isset( $attributes['type'] ) ? $attributes['type'] : null;
+
+ if ( $type === 'checkbox-multiple' || $type === 'radio' ) {
+ preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches );
+
+ if ( ! empty( $matches[0] ) ) {
+ $options = array();
+ foreach ( $matches[0] as $shortcode ) {
+ $attr = shortcode_parse_atts( $shortcode );
+ $options[] = $attr['label'];
+ }
+
+ $attributes['options'] = $options;
+ }
+ }
+
if ( ! isset( $attributes['label'] ) ) {
- $type = isset( $attributes['type'] ) ? $attributes['type'] : null;
$attributes['label'] = self::get_default_label_from_type( $type );
}
+
+ $att_strs = array();
foreach ( $attributes as $att => $val ) {
if ( is_numeric( $att ) ) { // Is a valueless attribute
$att_strs[] = self::esc_shortcode_val( $val );
@@ -3223,7 +3317,12 @@ public static function parse_contact_field( $attributes, $content ) {
}
}
- $html = '[contact-field ' . implode( ' ', $att_strs );
+ $shortcode_type = 'contact-field';
+ if ( $type === 'field-option' ) {
+ $shortcode_type = 'contact-field-option';
+ }
+
+ $html = '[' . $shortcode_type . ' ' . implode( ' ', $att_strs );
if ( isset( $content ) && ! empty( $content ) ) { // If there is content, let's add a closing tag
$html .= ']' . esc_html( $content ) . '[/contact-field]';
@@ -5268,7 +5367,7 @@ function jetpack_tracks_record_grunion_pre_message_sent( $post_id, $all_values,
}
}
- $tracking = new Automattic\Jetpack\Tracking();
+ $tracking = new \Automattic\Jetpack\Tracking();
$tracking->record_user_event( $event_name, $event_props, $event_user );
}
}
diff --git a/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php b/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php
index 794a964aeea86..8f1b4f8cb8bdc 100644
--- a/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php
+++ b/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php
@@ -9,6 +9,7 @@
use Automattic\Jetpack\My_Jetpack\Products\Backup;
use Automattic\Jetpack\Redirect;
+use Automattic\Jetpack\Status\Host;
use Jetpack_Core_Json_Api_Endpoints;
/**
@@ -135,12 +136,12 @@ private function should_show_link() {
/**
* Check if we should display the Scan menu item.
*
- * It will only be displayed if site has Scan enabled and the stand-alone Protect plugin is not active, because it will have a menu item of its own.
+ * It will only be displayed if site has Scan enabled, is not an Atomic site, and the stand-alone Protect plugin is not active, because it will have a menu item of its own.
*
* @return boolean
*/
private function should_show_scan() {
- return $this->has_scan() && ! $this->has_protect_plugin();
+ return $this->has_scan() && ! $this->has_protect_plugin() && ! ( new Host() )->is_woa_site();
}
/**
diff --git a/projects/plugins/jetpack/modules/shortcodes/crowdsignal.php b/projects/plugins/jetpack/modules/shortcodes/crowdsignal.php
index 63f03d8f65e86..ea0b1539cba5b 100644
--- a/projects/plugins/jetpack/modules/shortcodes/crowdsignal.php
+++ b/projects/plugins/jetpack/modules/shortcodes/crowdsignal.php
@@ -57,7 +57,6 @@ public function __construct() {
add_shortcode( 'polldaddy', array( $this, 'polldaddy_shortcode' ) );
add_filter( 'pre_kses', array( $this, 'crowdsignal_embed_to_shortcode' ) );
- add_action( 'wp_enqueue_scripts', array( $this, 'check_infinite' ) );
add_action( 'infinite_scroll_render', array( $this, 'crowdsignal_shortcode_infinite' ), 11 );
}
@@ -68,7 +67,7 @@ public static function register_scripts() {
wp_register_script(
'crowdsignal-shortcode',
Assets::get_file_url_for_environment( '_inc/build/crowdsignal-shortcode.min.js', '_inc/crowdsignal-shortcode.js' ),
- array( 'jquery' ),
+ array(),
JETPACK__VERSION,
true
);
@@ -687,19 +686,6 @@ public function generate_scripts() {
self::$scripts = false;
}
- /**
- * If the theme uses infinite scroll, include jquery at the start
- */
- public function check_infinite() {
- if (
- current_theme_supports( 'infinite-scroll' )
- && class_exists( 'The_Neverending_Home_Page' )
- && The_Neverending_Home_Page::archive_supports_infinity()
- ) {
- wp_enqueue_script( 'jquery' );
- }
- }
-
/**
* Dynamically load the .js, if needed
*
diff --git a/projects/plugins/jetpack/package.json b/projects/plugins/jetpack/package.json
index ab5d05c584a74..fb55073bc24bc 100644
--- a/projects/plugins/jetpack/package.json
+++ b/projects/plugins/jetpack/package.json
@@ -1,6 +1,6 @@
{
"name": "Jetpack",
- "version": "12.0.0-a.0",
+ "version": "12.0.0-a.2",
"private": true,
"description": "[Jetpack](https://jetpack.com/) is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of [WordPress.com](https://wordpress.com).",
"homepage": "https://jetpack.com",
diff --git a/projects/plugins/jetpack/readme.txt b/projects/plugins/jetpack/readme.txt
index 38561e79509ce..415e8fb4ed083 100644
--- a/projects/plugins/jetpack/readme.txt
+++ b/projects/plugins/jetpack/readme.txt
@@ -1,10 +1,10 @@
=== Jetpack - WP Security, Backup, Speed, & Growth ===
Contributors: automattic, adamkheckler, adrianmoldovanwp, aduth, akirk, allendav, alternatekev, andy, annamcphee, annezazu, apeatling, arcangelini, azaozz, batmoo, barry, beaulebens, bindlegirl, biskobe, blobaugh, bjorsch, brbrr, cainm, cena, cfinke, chaselivingston, chellycat, clickysteve, csonnek, danielbachhuber, davoraltman, daniloercoli, delawski, designsimply, dllh, drawmyface, dsmart, dzver, ebinnion, egregor, eliorivero, enej, eoigal, erania-pinnera, ethitter, fgiannar, gcorne, georgestephanis, gibrown, goldsounds, hew, hugobaeta, hypertextranch, iammattthomas, iandunn, jblz, jasmussen, jeffgolenski, jeherve, jenhooks, jenia, jessefriedman, jgs, jkudish, jmdodd, joanrho, johnjamesjacoby, jshreve, kbrownkd, keoshi, koke, kraftbj, lancewillett, leogermani, lschuyler, macmanx, martinremy, matt, matveb, mattwiebe, maverick3x6, mcsf, mdawaffe, mdbitz, MichaelArestad, migueluy, mikeyarce, mkaz, nancythanki, nickmomrik, obenland, oskosk, pento, professor44, rachelsquirrel, rdcoll, ryancowles, richardmuscat, richardmtl, robertbpugh, roccotripaldi, samhotchkiss, samiff, scarstocea, scottsweb, sdixon194, sdquirk, sermitr, simison, stephdau, tmoorewp, tyxla, Viper007Bond, westi, wpkaren, yoavf, zinigor
Tags: Security, backup, Woo, malware, scan, spam, CDN, search, social
-Stable tag: 11.8.4
+Stable tag: 11.9
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
+Tested up to: 6.2
Improve your WP security with powerful one-click tools like backup and malware scan. Get essential free tools including stats, CDN and social sharing.
@@ -197,7 +197,7 @@ Blocks are the individual sections that make up a page. There are many block typ
* Related Posts Block - The Related Posts feature scans all of your posts' contents, analyzes it, and uses that to display contextual posts your visitors might be interested in reading after they're finished with the current post.
* Repeat Visitor Block - The Repeat Visitor block enables the author to control the visibility of its nested block(s) depending on how many times a visitor has previously visited the page.
* Revue Block - The Revue block creates a simple signup form for readers to opt-in to receive your newsletter.
-* Slideshow Block - The Slideshow block lets you insert an image slideshow into a post or page.
+* Slideshow Block - The Slideshow block lets you insert an image slideshow into a post or page.
* Star Rating Block - The Ratings block allows any site author to add reviews to the site.
* Subscription Form Block - The Subscription Form Block allows you to insert a subscription form within the content area of any post or page, enabling your readers to get notifications when you publish new posts.
* Tiled Gallery Block - With Tiled Galleries you can display your image galleries in four styles: tiled mosaic, circular grid, square tiles, and tiled columns.
@@ -244,25 +244,12 @@ Jetpack Backup can do a full website migration to a new host, migrate theme file
4. Promote your newest posts, pages, and products across your social media channels.
== Changelog ==
-### 11.9-beta - 2023-02-28
+### 12.0-a.1 - 2023-03-08
#### Enhancements
-- Assistant: add new card to highlight VaultPress Backup.
-- Form block: add form field style synchronization for input fields.
-- Related Posts: add support for font family in Related Posts block.
-- Sharing: add Mastodon sharing button.
-
-#### Improved compatibility
-- Stats: add upgrade notice for Odyssey Stats.
-- VideoPress: add support for the `preload` or `preloadcontent` attribute to the VideoPress shortcode.
-
-#### Bug fixes
-- Connection: revise Jetpack connection agreement text to comply with our User Agreement.
-- Custom CSS: ensure the link to enable Custom CSS works in all languages.
-- Form block: increase form fields padding based on user-defined border-radius.
-- Form block: remove body font normalization in contact-form module and package.
-- Presentation shortcode: always add presentation container.
-- Recommendations: avoid applying coupon codes from the Assistant on products with trial prices.
-- Sharing buttons: fix display issues when choosing the icon-only option.
+- Admin: fix submenu positioning in admin menu.
+- Blocks: add a new Cookie Consent block to display a GDPR-compliant cookie consent widget on your site for your visitors.
+- SSO: add message to logout notice when SSO is enabled that gives a heads up to also log out of WordPress.com if they are on a shared computer.
+- Stats: updates the layout of the loading and some sections on the Stats page.
--------
diff --git a/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php b/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php
index 3280f292811cf..50e2ccf7ab9f8 100644
--- a/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php
+++ b/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php
@@ -1303,7 +1303,7 @@ public function provider_jetpack_published_post_no_action() {
*/
public function test_sync_jetpack_published_post_no_action( $post_ID, $post ) {
$this->server_event_storage->reset();
- do_action( 'wp_after_insert_post', $post_ID, $post, false );
+ do_action( 'wp_after_insert_post', $post_ID, $post, false, null );
$this->sender->do_sync();
diff --git a/projects/plugins/search/changelog/add-new-wpcom-subscription-emails-use-excerpt-option b/projects/plugins/migration/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/add-new-wpcom-subscription-emails-use-excerpt-option
rename to projects/plugins/migration/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/add-promoted-posts-post-publish-panel b/projects/plugins/migration/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/add-promoted-posts-post-publish-panel
rename to projects/plugins/migration/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/migration/changelog/update-wp-tested-up-to b/projects/plugins/migration/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/migration/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/migration/composer.lock b/projects/plugins/migration/composer.lock
index e29ed584c59b8..c6bb0bc157b7f 100644
--- a/projects/plugins/migration/composer.lock
+++ b/projects/plugins/migration/composer.lock
@@ -711,7 +711,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -738,7 +738,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/migration/readme.txt b/projects/plugins/migration/readme.txt
index 4e2d3f2ae9847..7f6970bc40566 100644
--- a/projects/plugins/migration/readme.txt
+++ b/projects/plugins/migration/readme.txt
@@ -3,7 +3,7 @@ Contributors: automattic
Tags: migrate, migration, backup, restore, transfer, move, copy, wordpress.com, automattic, import, importer, hosting
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
+Tested up to: 6.2
Stable tag: 0.1.0-alpha
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
diff --git a/projects/plugins/mu-wpcom-plugin/CHANGELOG.md b/projects/plugins/mu-wpcom-plugin/CHANGELOG.md
index bf9e9d4b15b15..c1a6e2bd4ae05 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).
+## 1.0.7 - 2023-03-08
+### Changed
+- Minor internal updates.
+
## 1.0.6 - 2023-02-28
### Changed
- Minor internal updates.
diff --git a/projects/plugins/mu-wpcom-plugin/changelog/init-release-cycle b/projects/plugins/mu-wpcom-plugin/changelog/init-release-cycle
index a9493d8b91def..57daddf2f6f3c 100644
--- a/projects/plugins/mu-wpcom-plugin/changelog/init-release-cycle
+++ b/projects/plugins/mu-wpcom-plugin/changelog/init-release-cycle
@@ -1,5 +1,5 @@
Significance: patch
Type: changed
-Comment: Init 1.0.7-alpha
+Comment: Init 1.0.8-alpha
diff --git a/projects/plugins/mu-wpcom-plugin/composer.json b/projects/plugins/mu-wpcom-plugin/composer.json
index d6f647ad9543a..ca4bce33b4914 100644
--- a/projects/plugins/mu-wpcom-plugin/composer.json
+++ b/projects/plugins/mu-wpcom-plugin/composer.json
@@ -42,6 +42,6 @@
"release-branch-prefix": "jetpack"
},
"config": {
- "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ1_0_7_alpha"
+ "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ1_0_8_alpha"
}
}
diff --git a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php
index b4800f541bee0..f3aa58abb8066 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: 1.0.7-alpha
+ * Version: 1.0.8-alpha
* Author: Automattic
* License: GPLv2 or later
* Text Domain: jetpack-mu-wpcom-plugin
diff --git a/projects/plugins/mu-wpcom-plugin/package.json b/projects/plugins/mu-wpcom-plugin/package.json
index a6940419711dc..e08ce12afb12e 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": "1.0.7-alpha",
+ "version": "1.0.8-alpha",
"description": "Test plugin for the jetpack-mu-wpcom package",
"homepage": "https://jetpack.com",
"bugs": {
diff --git a/projects/plugins/search/changelog/add-shared-get-blog-id b/projects/plugins/protect/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/add-shared-get-blog-id
rename to projects/plugins/protect/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/add-status-private-coming-soon-site b/projects/plugins/protect/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/add-status-private-coming-soon-site
rename to projects/plugins/protect/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/protect/changelog/fix-all-1-threats-title b/projects/plugins/protect/changelog/fix-all-1-threats-title
new file mode 100644
index 0000000000000..2c67d2e2794c1
--- /dev/null
+++ b/projects/plugins/protect/changelog/fix-all-1-threats-title
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fixed
+Comment: Fixed awkward phrasing in a title, no significant changes.
+
+
diff --git a/projects/plugins/protect/changelog/more-descriptive-error-messages b/projects/plugins/protect/changelog/more-descriptive-error-messages
new file mode 100644
index 0000000000000..9610037d6750d
--- /dev/null
+++ b/projects/plugins/protect/changelog/more-descriptive-error-messages
@@ -0,0 +1,5 @@
+Significance: patch
+Type: changed
+Comment: Minor improvement to error messages on the firewall settings screen.
+
+
diff --git a/projects/plugins/protect/changelog/update-wp-tested-up-to b/projects/plugins/protect/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/protect/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/protect/composer.lock b/projects/plugins/protect/composer.lock
index a6031b2399937..64ab168a7960a 100644
--- a/projects/plugins/protect/composer.lock
+++ b/projects/plugins/protect/composer.lock
@@ -760,7 +760,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -787,7 +787,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/protect/readme.txt b/projects/plugins/protect/readme.txt
index 968ba9c4ea97e..6350720f45827 100644
--- a/projects/plugins/protect/readme.txt
+++ b/projects/plugins/protect/readme.txt
@@ -3,7 +3,7 @@ Contributors: automattic, retrofox, leogermani, renatoagds, bjorsch, ebinnion, f
Tags: jetpack, protect, security, malware, scan
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
+Tested up to: 6.2
Stable tag: 1.2.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -14,7 +14,7 @@ Free daily malware scanning and WordPress site security. Jetpack Protect leverag
== TOTAL SITE SECURITY FROM WORDPRESS EXPERTS ==
-Jetpack Protect is a free and essential WordPress security plugin that scans your site and warns you about vulnerabilities, keeping your site one step ahead of security threats. It’s easy to use; setup requires just a few clicks!
+Jetpack Protect is a free and essential WordPress security plugin that scans your site and warns you about vulnerabilities, keeping your site one step ahead of security threats. It’s easy to use; setup requires just a few clicks!
By upgrading Protect, you also unlock malware scanning with one-click fixes for most issues and instant notifications when threats are detected. Our automated Web Application Firewall (WAF) also protects your site from bad actors around the clock.
@@ -28,7 +28,7 @@ Jetpack Protect scans your site on a daily basis and warns you about:
- What themes are installed, and any associated vulnerabilities
= What are vulnerabilities? Why do I need to scan my site regularly? =
-Site vulnerabilities are flaws in a website's code that weaken the site's overall security. These can be introduced to a site in various ways, in most cases unintentionally.
+Site vulnerabilities are flaws in a website's code that weaken the site's overall security. These can be introduced to a site in various ways, in most cases unintentionally.
Some of the ways vulnerabilities can be introduced to a site are:
- Poorly written site code
@@ -36,7 +36,7 @@ Some of the ways vulnerabilities can be introduced to a site are:
- WordPress version bugs
- System misconfigurations
-If a bad actor detects a vulnerability on your site, they can exploit it to access sensitive information, update your site, and more to damage your business or brand.
+If a bad actor detects a vulnerability on your site, they can exploit it to access sensitive information, update your site, and more to damage your business or brand.
That’s why it’s essential to use a reputable and reliable vulnerability & malware site scanner like Jetpack Protect to safeguard your site.
@@ -56,9 +56,9 @@ Similar to the vulnerabilities listed above, bad actors can use malware to captu
Jetpack Protect instantly notifies you of any threats detected, with one-click fixes for most issues.
= What is a Web Application Firewall (WAF)? =
-A web application firewall blocks traffic and malicious requests to your site from known bad actors.
+A web application firewall blocks traffic and malicious requests to your site from known bad actors.
-As threats are detected, new rules are added to Jetpack Protect’s firewall, which provides around-the-clock protection for your WordPress site.
+As threats are detected, new rules are added to Jetpack Protect’s firewall, which provides around-the-clock protection for your WordPress site.
== OVER 38,393 REGISTERED VULNERABILITIES IN OUR DATABASE ==
@@ -94,7 +94,7 @@ Protect is a free WordPress security and malware scanner plugin that scans your
The free plan scans your site for WordPress version, plugin, and theme vulnerabilities from our extensive vulnerability database (38,393) that is powered by WPScan.
-By upgrading Protect, you gain access to WordPress malware scanning with one-click fixes, instant threat notifications, and our Web application Firewall (WAF) that protects your site around the clock.
+By upgrading Protect, you gain access to WordPress malware scanning with one-click fixes, instant threat notifications, and our Web application Firewall (WAF) that protects your site around the clock.
= Does this plugin require the Jetpack plugin to work? =
@@ -110,7 +110,7 @@ If you are already a Jetpack Scan, Jetpack Security, or Jetpack Complete custome
WPScan is an enterprise vulnerability scanning solution. It is not recommended for small to medium-sized businesses. If you are an enterprise company looking for custom WordPress site protection solutions, please visit: https://wpscan.com/
-For small to medium-sized businesses, you can access our vulnerability scanning solution in the Jetpack Protect plugin.
+For small to medium-sized businesses, you can access our vulnerability scanning solution in the Jetpack Protect plugin.
= Will Jetpack Protect work on my local site?
@@ -122,7 +122,7 @@ You can visit Jetpack Protect dashboard in your WordPress admin panel to see the
= What do I do if Jetpack Protect finds a security threat? =
-When the vulnerability scanner finds a security threat, you can view the recommended actions on the Jetpack Protect dashboard to secure your sites.
+When the vulnerability scanner finds a security threat, you can view the recommended actions on the Jetpack Protect dashboard to secure your sites.
If you have upgraded Protect, your site will also be automatically scanned for malware each day, and you will be notified instantly via email if any threats are detected. You will be able to fix most issues in one click.
diff --git a/projects/plugins/protect/src/class-rest-controller.php b/projects/plugins/protect/src/class-rest-controller.php
index 04b8598ef54d9..465f679d8a651 100644
--- a/projects/plugins/protect/src/class-rest-controller.php
+++ b/projects/plugins/protect/src/class-rest-controller.php
@@ -254,7 +254,7 @@ public static function api_clear_scan_cache() {
*/
public static function api_ignore_threat( $request ) {
if ( ! $request['threat_id'] ) {
- return new WP_REST_RESPONSE( 'Missing threat ID.', 400 );
+ return new WP_REST_Response( 'Missing threat ID.', 400 );
}
$threat_ignored = Threats::ignore_threat( $request['threat_id'] );
@@ -275,7 +275,7 @@ public static function api_ignore_threat( $request ) {
*/
public static function api_fix_threats( $request ) {
if ( empty( $request['threat_ids'] ) ) {
- return new WP_REST_RESPONSE( 'Missing threat IDs.', 400 );
+ return new WP_REST_Response( 'Missing threat IDs.', 400 );
}
$threats_fixed = Threats::fix_threats( $request['threat_ids'] );
@@ -296,7 +296,7 @@ public static function api_fix_threats( $request ) {
*/
public static function api_fix_threats_status( $request ) {
if ( empty( $request['threat_ids'] ) ) {
- return new WP_REST_RESPONSE( 'Missing threat IDs.', 400 );
+ return new WP_REST_Response( 'Missing threat IDs.', 400 );
}
$threats_fixed = Threats::fix_threats_status( $request['threat_ids'] );
@@ -341,16 +341,32 @@ public static function api_scan() {
/**
* Toggles the WAF module on or off for the API endpoint
*
- * @return WP_REST_Response
+ * @return WP_REST_Response|WP_Error
*/
public static function api_toggle_waf() {
if ( Waf_Runner::is_enabled() ) {
- Waf_Runner::disable();
- return rest_ensure_response( true, 200 );
+ $disabled = Waf_Runner::disable();
+ if ( ! $disabled ) {
+ return new WP_Error(
+ 'waf_disable_failed',
+ __( 'An error occured disabling the firewall.', 'jetpack-protect' ),
+ array( 'status' => 500 )
+ );
+ }
+
+ return rest_ensure_response( true );
+ }
+
+ $enabled = Waf_Runner::enable();
+ if ( ! $enabled ) {
+ return new WP_Error(
+ 'waf_enable_failed',
+ __( 'An error occured enabling the firewall.', 'jetpack-protect' ),
+ array( 'status' => 500 )
+ );
}
- Waf_Runner::enable();
- return rest_ensure_response( true, 200 );
+ return rest_ensure_response( true );
}
/**
diff --git a/projects/plugins/protect/src/js/components/firewall-page/index.jsx b/projects/plugins/protect/src/js/components/firewall-page/index.jsx
index 117ca967c7b47..629d86834afde 100644
--- a/projects/plugins/protect/src/js/components/firewall-page/index.jsx
+++ b/projects/plugins/protect/src/js/components/firewall-page/index.jsx
@@ -33,16 +33,6 @@ import styles from './styles.module.scss';
const ADMIN_URL = window?.jetpackProtectInitialState?.adminUrl;
const SUCCESS_NOTICE_DURATION = 5000;
-const errorMessage = createInterpolateElement(
- __(
- 'An error ocurred. Please try again or contact support .',
- 'jetpack-protect'
- ),
- {
- supportLink: ,
- }
-);
-
const FirewallPage = () => {
const [ isSmall ] = useBreakpointMatch( [ 'sm', 'lg' ], [ null, '<' ] );
const notice = useSelect( select => select( STORE_ID ).getNotice() );
@@ -110,6 +100,52 @@ const FirewallPage = () => {
*/
const [ showManualRules, setShowManualRules ] = useState( false );
+ /**
+ * Get a custom error message based on the error code.
+ *
+ * @param {object} error - Error object.
+ * @returns string|bool Custom error message or false if no custom message exists.
+ */
+ const getCustomErrorMessage = useCallback( error => {
+ switch ( error.code ) {
+ case 'file_system_error':
+ return __( 'A filesystem error occurred.', 'jetpack-protect' );
+ case 'rules_api_error':
+ return __(
+ 'An error occurred retrieving the latest firewall rules from Jetpack.',
+ 'jetpack-protect'
+ );
+ default:
+ return false;
+ }
+ }, [] );
+
+ /**
+ * Handle errors returned by the API.
+ */
+ const handleApiError = useCallback(
+ error => {
+ const errorMessage =
+ getCustomErrorMessage( error ) || __( 'An error occurred.', 'jetpack-protect' );
+ const supportMessage = createInterpolateElement(
+ __( 'Please try again or contact support .', 'jetpack-protect' ),
+ {
+ supportLink: ,
+ }
+ );
+
+ setNotice( {
+ type: 'error',
+ message: (
+ <>
+ { errorMessage } { supportMessage }
+ >
+ ),
+ } );
+ },
+ [ getCustomErrorMessage, setNotice ]
+ );
+
/**
* Get Scan
*
@@ -137,14 +173,9 @@ const FirewallPage = () => {
message: __( 'Changes saved.', 'jetpack-protect' ),
} )
)
- .catch( () => {
- setNotice( {
- type: 'error',
- message: errorMessage,
- } );
- } )
+ .catch( handleApiError )
.finally( () => setFormIsSubmitting( false ) );
- }, [ formState, updateConfig, setNotice ] );
+ }, [ updateConfig, formState, handleApiError, setNotice ] );
/**
* Handle Change
@@ -197,15 +228,19 @@ const FirewallPage = () => {
API.wafUpgradeSeen();
}
} )
- .catch( () => {
+ .catch( error => {
setAutomaticRulesInstallationError( true );
- setNotice( {
- type: 'error',
- message: errorMessage,
- } );
+ handleApiError( error );
} )
.finally( () => setFormIsSubmitting( false ) );
- }, [ formState, toggleAutomaticRules, setNotice, upgradeIsSeen, setWafUpgradeIsSeen ] );
+ }, [
+ formState,
+ toggleAutomaticRules,
+ setNotice,
+ upgradeIsSeen,
+ setWafUpgradeIsSeen,
+ handleApiError,
+ ] );
/**
* Handle Manual Rules Change
@@ -232,14 +267,9 @@ const FirewallPage = () => {
),
} )
)
- .catch( () => {
- setNotice( {
- type: 'error',
- message: errorMessage,
- } );
- } )
+ .catch( handleApiError )
.finally( () => setFormIsSubmitting( false ) );
- }, [ formState, toggleManualRules, setNotice ] );
+ }, [ formState, toggleManualRules, handleApiError, setNotice ] );
/**
* Handle Show Manual Rules Click
@@ -432,7 +462,8 @@ const FirewallPage = () => {
variant={ 'body-small' }
mt={ 2 }
>
- { __( 'Failed to install automatic rules.', 'jetpack-protect' ) }
+ { __( 'Failed to update automatic rules.', 'jetpack-protect' ) }{ ' ' }
+ { getCustomErrorMessage( automaticRulesInstallationError ) }
diff --git a/projects/plugins/protect/src/js/components/threats-list/index.jsx b/projects/plugins/protect/src/js/components/threats-list/index.jsx
index e1e76f98fc4ee..72fff66147bb6 100644
--- a/projects/plugins/protect/src/js/components/threats-list/index.jsx
+++ b/projects/plugins/protect/src/js/components/threats-list/index.jsx
@@ -41,8 +41,11 @@ const ThreatsList = () => {
const getTitle = useCallback( () => {
switch ( selected ) {
case 'all':
+ if ( list.length === 1 ) {
+ return __( 'All threats', 'jetpack-protect' );
+ }
return sprintf(
- /* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
+ /* translators: placeholder is the amount of threats found on the site. */
__( 'All %s threats', 'jetpack-protect' ),
list.length
);
diff --git a/projects/plugins/search/CHANGELOG.md b/projects/plugins/search/CHANGELOG.md
index de3f1dfc6a2aa..623b86fbcbd5a 100644
--- a/projects/plugins/search/CHANGELOG.md
+++ b/projects/plugins/search/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.4.1] - 2023-03-08
+### Changed
+- Remove `ci.targets` from package.json. Better scoping of e2e tests. [#28913]
+- Update playwright dependency. [#28094]
+- Updated package dependencies.
+
## [1.4.0] - 2022-12-12
### Added
- Search: port Search plugin 1.3.1 changelog and plugin description [#27399]
@@ -115,6 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.1.0-beta]: https://github.com/Automattic/jetpack-search-plugin/compare/1.0.0...1.1.0-beta
[1.2.0-beta]: https://github.com/Automattic/jetpack-search-plugin/compare/1.1.0...1.2.0-beta
+[1.4.1]: https://github.com/Automattic/jetpack-search-plugin/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/Automattic/jetpack-search-plugin/compare/1.3.1...1.4.0
[1.3.1]: https://github.com/Automattic/jetpack-search-plugin/compare/1.3.0...1.3.1
[1.3.0]: https://github.com/Automattic/jetpack-search-plugin/compare/1.2.0...1.3.0
diff --git a/projects/plugins/search/changelog/add-e2e-tiled-gallery-block-test b/projects/plugins/search/changelog/add-e2e-tiled-gallery-block-test
deleted file mode 100644
index 4335a97f6ea09..0000000000000
--- a/projects/plugins/search/changelog/add-e2e-tiled-gallery-block-test
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Update playwright dependency
diff --git a/projects/plugins/search/changelog/add-store-enable-disable-time-for-odyssey b/projects/plugins/search/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/add-store-enable-disable-time-for-odyssey
rename to projects/plugins/search/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/add-woo-sync-whitelist b/projects/plugins/search/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/add-woo-sync-whitelist
rename to projects/plugins/search/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/search/changelog/changelogger-merge b/projects/plugins/search/changelog/changelogger-merge
deleted file mode 100644
index 6eb3e9f9f8fa1..0000000000000
--- a/projects/plugins/search/changelog/changelogger-merge
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: added
-Comment: Minor update to changelog package that supports git merge strategy. Should not affect shipped code.
-
-
diff --git a/projects/plugins/search/changelog/e2e-better_scoping b/projects/plugins/search/changelog/e2e-better_scoping
deleted file mode 100644
index f5862e906e9be..0000000000000
--- a/projects/plugins/search/changelog/e2e-better_scoping
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Remove `ci.targets` from package.json. Better scoping of e2e tests.
diff --git a/projects/plugins/search/changelog/init-release-cycle b/projects/plugins/search/changelog/init-release-cycle
deleted file mode 100644
index 2950a911c548b..0000000000000
--- a/projects/plugins/search/changelog/init-release-cycle
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Init 1.5.0-alpha
-
-
diff --git a/projects/plugins/search/changelog/remove-placeholder-blogging-prompts b/projects/plugins/search/changelog/remove-placeholder-blogging-prompts
deleted file mode 100644
index d37dc4136062b..0000000000000
--- a/projects/plugins/search/changelog/remove-placeholder-blogging-prompts
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: composer.lock file change
-
-
diff --git a/projects/plugins/search/changelog/remove-remnants-of-automated-code-coverage b/projects/plugins/search/changelog/remove-remnants-of-automated-code-coverage
deleted file mode 100644
index 085e2e863ddb4..0000000000000
--- a/projects/plugins/search/changelog/remove-remnants-of-automated-code-coverage
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: removed
-Comment: Remove `test-coverage` scripts and other remnants of automated code coverage.
-
-
diff --git a/projects/plugins/search/changelog/renovate-eslint-packages b/projects/plugins/search/changelog/renovate-eslint-packages
deleted file mode 100644
index fab7a20fde13d..0000000000000
--- a/projects/plugins/search/changelog/renovate-eslint-packages
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: fixed
-Comment: Fix new eslint sniffs. Should be no change to the project itself.
-
-
diff --git a/projects/plugins/search/changelog/renovate-lock-file-maintenance b/projects/plugins/search/changelog/renovate-lock-file-maintenance
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/search/changelog/renovate-lock-file-maintenance
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/search/changelog/renovate-lock-file-maintenance#2 b/projects/plugins/search/changelog/renovate-lock-file-maintenance#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/search/changelog/renovate-lock-file-maintenance#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/search/changelog/update-node-to-v18 b/projects/plugins/search/changelog/update-node-to-v18
deleted file mode 100644
index 1288d434eb45a..0000000000000
--- a/projects/plugins/search/changelog/update-node-to-v18
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Update tooling node version to 18.13.0. Should be no change to the project.
-
-
diff --git a/projects/plugins/search/changelog/update-search-add-category-classnames b/projects/plugins/search/changelog/update-search-add-category-classnames
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/search/changelog/update-search-add-category-classnames
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/search/changelog/update-wp-tested-up-to b/projects/plugins/search/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/search/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/search/composer.json b/projects/plugins/search/composer.json
index 2680f956783f2..ddc7602bbfd86 100644
--- a/projects/plugins/search/composer.json
+++ b/projects/plugins/search/composer.json
@@ -64,7 +64,7 @@
},
"config": {
"sort-packages": true,
- "autoloader-suffix": "b462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ1_4_1_alpha",
+ "autoloader-suffix": "b462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ1_4_2_alpha",
"allow-plugins": {
"automattic/jetpack-autoloader": true,
"automattic/jetpack-composer-plugin": true,
diff --git a/projects/plugins/search/composer.lock b/projects/plugins/search/composer.lock
index b50e48a5355b1..1a0a57b110f34 100644
--- a/projects/plugins/search/composer.lock
+++ b/projects/plugins/search/composer.lock
@@ -711,7 +711,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -738,7 +738,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/search/jetpack-search.php b/projects/plugins/search/jetpack-search.php
index 18bdd97d84ebb..5c0b39098e342 100644
--- a/projects/plugins/search/jetpack-search.php
+++ b/projects/plugins/search/jetpack-search.php
@@ -4,7 +4,7 @@
* Plugin Name: Jetpack Search
* Plugin URI: https://jetpack.com/search/
* Description: Easily add cloud-powered instant search and filters to your website or WooCommerce store with advanced algorithms that boost your search results based on traffic to your site.
- * Version: 1.4.1-alpha
+ * Version: 1.4.2-alpha
* Author: Automattic - Jetpack Search team
* Author URI: https://jetpack.com/
* License: GPLv2 or later
@@ -26,7 +26,7 @@
define( 'JETPACK_SEARCH_PLUGIN__FILE', __FILE__ );
define( 'JETPACK_SEARCH_PLUGIN__FILE_RELATIVE_PATH', plugin_basename( __FILE__ ) );
define( 'JETPACK_SEARCH_PLUGIN__SLUG', 'jetpack-search' );
-define( 'JETPACK_SEARCH_PLUGIN__VERSION', '1.4.1-alpha' );
+define( 'JETPACK_SEARCH_PLUGIN__VERSION', '1.4.2-alpha' );
defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) || define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' );
diff --git a/projects/plugins/search/readme.txt b/projects/plugins/search/readme.txt
index f0d562e1460ca..99ac27114fbf9 100644
--- a/projects/plugins/search/readme.txt
+++ b/projects/plugins/search/readme.txt
@@ -3,8 +3,8 @@ Contributors: automattic, annamcphee, bluefuton, kangzj, jsnmoon, robfelty, gibr
Tags: search, filter, woocommerce search, ajax search, product search, free cloud-based search
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
-Stable tag: 1.3.1
+Tested up to: 6.2
+Stable tag: 1.4.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -122,13 +122,10 @@ If you are using the Jetpack Search free option, and you have more than 5000 rec
5. Manage all of your Jetpack products, including Search, in a single place.
== Changelog ==
-### 1.4.0 - 2022-12-12
-#### Added
-- Search: port Search plugin 1.3.1 changelog and plugin description
-
+### 1.4.1 - 2023-03-08
#### Changed
-- My Jetpack: Requires connection only if needed
-- My Jetpack: Show My Jetpack even if site is disconnected
+- Remove `ci.targets` from package.json. Better scoping of e2e tests.
+- Update playwright dependency.
- Updated package dependencies.
== Testimonials ==
diff --git a/projects/plugins/social/CHANGELOG.md b/projects/plugins/social/CHANGELOG.md
index 292fb73587129..68e90d66e72e4 100644
--- a/projects/plugins/social/CHANGELOG.md
+++ b/projects/plugins/social/CHANGELOG.md
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## 1.8.0-beta - 2023-02-28
+## 1.8.0 - 2023-03-07
### Added
- Add Social Image Generator editor panel to post sidebar [#28737]
- Add Social Image Generator feature flag to Jetpack Social [#29001]
diff --git a/projects/plugins/search/changelog/renovate-automattic-wordbless-0.x b/projects/plugins/social/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/renovate-automattic-wordbless-0.x
rename to projects/plugins/social/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/renovate-composer-composer-2.x b/projects/plugins/social/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/renovate-composer-composer-2.x
rename to projects/plugins/social/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/social/changelog/update-backport-11.9-social-backup b/projects/plugins/social/changelog/update-backport-11.9-social-backup
new file mode 100644
index 0000000000000..56edc9402397f
--- /dev/null
+++ b/projects/plugins/social/changelog/update-backport-11.9-social-backup
@@ -0,0 +1,5 @@
+Significance: patch
+Type: changed
+Comment: Backport release changelog and stable tag
+
+
diff --git a/projects/plugins/social/changelog/update-wp-tested-up-to b/projects/plugins/social/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/social/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock
index 41d18573514a6..13463b6f2bd94 100644
--- a/projects/plugins/social/composer.lock
+++ b/projects/plugins/social/composer.lock
@@ -711,7 +711,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -738,7 +738,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/social/readme.txt b/projects/plugins/social/readme.txt
index 4e51fc114c727..c743b7f851e98 100644
--- a/projects/plugins/social/readme.txt
+++ b/projects/plugins/social/readme.txt
@@ -3,8 +3,8 @@ Contributors: automattic, pabline, danielpost, siddarthan, gmjuhasz
Tags: social-media, publicize, social-media-manager, social-networking, social marketing, social, social share, social media scheduling, social media automation, auto post, auto- publish, social share
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
-Stable tag: 1.7.0
+Tested up to: 6.2
+Stable tag: 1.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -91,13 +91,19 @@ The easiest way is to use the Custom Message option in the publishing options bo
4. Manage your Jetpack Social and other Jetpack plugins from My Jetpack.
== Changelog ==
-### 1.7.0 - 2023-02-07
+### 1.8.0 - 2023-03-07
#### Added
-- Added Advanced Social plan to pricing table
+- Add Social Image Generator editor panel to post sidebar
+- Add Social Image Generator feature flag to Jetpack Social
#### Changed
-- Moved resharing to be available in the free plan
+- Changed remaining shares phrasing
+- Remove `ci.targets` from package.json. Better scoping of e2e tests.
+- Update billing language
- Updated package dependencies.
-- Update playwright dependency
-- Use `flex-end` instead of `end` for better browser compatibility.
+- Update to React 18.
+
+#### Fixed
+- Revise Jetpack connection agreement text to comply with our User Agreement
+- Use External Link icons for external links
diff --git a/projects/plugins/starter-plugin/CHANGELOG.md b/projects/plugins/starter-plugin/CHANGELOG.md
index 351722cec6e4d..729a000444168 100644
--- a/projects/plugins/starter-plugin/CHANGELOG.md
+++ b/projects/plugins/starter-plugin/CHANGELOG.md
@@ -5,6 +5,28 @@ 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.2.0 - 2023-03-08
+### Added
+- Add support for JITMs to starter plugin [#25880]
+- E2E tests: use CI build artifacts in e2e tests [#26278]
+- My Jetpack includes JITMs [#22452]
+- Starter Plugin: Add basic JS and PHP test setup [#27729]
+- Use ThemeProvider when rendering Starter Plugin AdminPage [#25870]
+
+### Changed
+- Compatibility: WordPress 6.1 compatibility [#27084]
+- E2E tests: bump dependencies [#25725]
+- Updated package dependencies.
+- Update playwright dependency [#28094]
+- Update to React 18. [#28710]
+
+### Removed
+- E2E tests: removed deprecated Slack notification code [#26215]
+
+### Fixed
+- E2E tests: fixed pretest cleanup script not running [#25051]
+- Plugin activation: Only redirect when activating from Plugins page in the browser [#25711]
+
## 0.1.0 - 2022-07-06
### Added
- Add activation and deactivation hooks. [#24250]
diff --git a/projects/plugins/starter-plugin/changelog/add-add-jitms-to-jetpack-social b/projects/plugins/starter-plugin/changelog/add-add-jitms-to-jetpack-social
deleted file mode 100644
index c69d138a67c69..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-add-jitms-to-jetpack-social
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: added
-
-Add support for JITMs to starter plugin
diff --git a/projects/plugins/starter-plugin/changelog/add-backup-disclaimer-text-to-product-card b/projects/plugins/starter-plugin/changelog/add-backup-disclaimer-text-to-product-card
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-backup-disclaimer-text-to-product-card
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-connection-verified-errors-react-initial-state b/projects/plugins/starter-plugin/changelog/add-connection-verified-errors-react-initial-state
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-connection-verified-errors-react-initial-state
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-custom-taxonomy-slugs b/projects/plugins/starter-plugin/changelog/add-custom-taxonomy-slugs
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-custom-taxonomy-slugs
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-db-post-type-breakdown b/projects/plugins/starter-plugin/changelog/add-db-post-type-breakdown
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-db-post-type-breakdown
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-e2e-tiled-gallery-block-test b/projects/plugins/starter-plugin/changelog/add-e2e-tiled-gallery-block-test
deleted file mode 100644
index 4335a97f6ea09..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-e2e-tiled-gallery-block-test
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Update playwright dependency
diff --git a/projects/plugins/starter-plugin/changelog/add-free-search-product-support-my-jetpack b/projects/plugins/starter-plugin/changelog/add-free-search-product-support-my-jetpack
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-free-search-product-support-my-jetpack
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-icon_tooltip b/projects/plugins/starter-plugin/changelog/add-icon_tooltip
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-icon_tooltip
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-jetpack-connect-error-notice-react-component b/projects/plugins/starter-plugin/changelog/add-jetpack-connect-error-notice-react-component
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-jetpack-connect-error-notice-react-component
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-jetpack-connection-errors-react-vars b/projects/plugins/starter-plugin/changelog/add-jetpack-connection-errors-react-vars
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-jetpack-connection-errors-react-vars
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-jetpack-connection-errors-react-vars#2 b/projects/plugins/starter-plugin/changelog/add-jetpack-connection-errors-react-vars#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-jetpack-connection-errors-react-vars#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-jetpack-social-add-share-meter b/projects/plugins/starter-plugin/changelog/add-jetpack-social-add-share-meter
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-jetpack-social-add-share-meter
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-jetpack-social-panel-save-attached-media b/projects/plugins/starter-plugin/changelog/add-jetpack-social-panel-save-attached-media
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-jetpack-social-panel-save-attached-media
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-jitm-my-jetpack b/projects/plugins/starter-plugin/changelog/add-jitm-my-jetpack
deleted file mode 100644
index c4da693c5f111..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-jitm-my-jetpack
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: added
-
-My Jetpack includes JITMs
diff --git a/projects/plugins/starter-plugin/changelog/add-license-key-selector b/projects/plugins/starter-plugin/changelog/add-license-key-selector
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-license-key-selector
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-license-verification b/projects/plugins/starter-plugin/changelog/add-license-verification
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-license-verification
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-new-wpcom-subscription-emails-use-excerpt-option b/projects/plugins/starter-plugin/changelog/add-new-wpcom-subscription-emails-use-excerpt-option
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-new-wpcom-subscription-emails-use-excerpt-option
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-pricing-table-component b/projects/plugins/starter-plugin/changelog/add-pricing-table-component
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-pricing-table-component
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-promoted-posts-post-publish-panel b/projects/plugins/starter-plugin/changelog/add-promoted-posts-post-publish-panel
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-promoted-posts-post-publish-panel
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-reconnect-notice-restore b/projects/plugins/starter-plugin/changelog/add-reconnect-notice-restore
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-reconnect-notice-restore
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-record-meter-donut-chart b/projects/plugins/starter-plugin/changelog/add-record-meter-donut-chart
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-record-meter-donut-chart
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-scan-in-protect b/projects/plugins/starter-plugin/changelog/add-scan-in-protect
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-scan-in-protect
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-scan-in-protect#2 b/projects/plugins/starter-plugin/changelog/add-scan-in-protect#2
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-scan-in-protect#2
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-shared-get-blog-id b/projects/plugins/starter-plugin/changelog/add-shared-get-blog-id
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-shared-get-blog-id
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-starter-plugin-js-php-tests b/projects/plugins/starter-plugin/changelog/add-starter-plugin-js-php-tests
deleted file mode 100644
index 5e3f0645d0c89..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-starter-plugin-js-php-tests
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: added
-
-Starter Plugin: Add basic JS and PHP test setup
diff --git a/projects/plugins/starter-plugin/changelog/add-status-private-coming-soon-site b/projects/plugins/starter-plugin/changelog/add-status-private-coming-soon-site
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-status-private-coming-soon-site
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-super-cache-measurement b/projects/plugins/starter-plugin/changelog/add-super-cache-measurement
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-super-cache-measurement
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-sync-request-full-response-logging b/projects/plugins/starter-plugin/changelog/add-sync-request-full-response-logging
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-sync-request-full-response-logging
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-sync-request-full-response-logging#2 b/projects/plugins/starter-plugin/changelog/add-sync-request-full-response-logging#2
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-sync-request-full-response-logging#2
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-sync-sl-insta-media-to-blacklist b/projects/plugins/starter-plugin/changelog/add-sync-sl-insta-media-to-blacklist
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-sync-sl-insta-media-to-blacklist
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-upgrade-trigger-in-jetpack-social b/projects/plugins/starter-plugin/changelog/add-upgrade-trigger-in-jetpack-social
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-upgrade-trigger-in-jetpack-social
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-upgraded_tooltips b/projects/plugins/starter-plugin/changelog/add-upgraded_tooltips
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-upgraded_tooltips
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/add-verify-rest-api-errors b/projects/plugins/starter-plugin/changelog/add-verify-rest-api-errors
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-verify-rest-api-errors
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-verify-rest-api-errors#2 b/projects/plugins/starter-plugin/changelog/add-verify-rest-api-errors#2
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-verify-rest-api-errors#2
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-woo-sync-whitelist b/projects/plugins/starter-plugin/changelog/add-woo-sync-whitelist
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-woo-sync-whitelist
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/add-wpcom-platform b/projects/plugins/starter-plugin/changelog/add-wpcom-platform
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/add-wpcom-platform
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/search/changelog/update-add-date-to-search-results b/projects/plugins/starter-plugin/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/update-add-date-to-search-results
rename to projects/plugins/starter-plugin/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/update-blaze-package-todos b/projects/plugins/starter-plugin/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/update-blaze-package-todos
rename to projects/plugins/starter-plugin/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/starter-plugin/changelog/bump-wp6.0-to-6.1 b/projects/plugins/starter-plugin/changelog/bump-wp6.0-to-6.1
deleted file mode 100644
index 8e38530d25bc9..0000000000000
--- a/projects/plugins/starter-plugin/changelog/bump-wp6.0-to-6.1
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Compatibility: WordPress 6.1 compatibility
diff --git a/projects/plugins/starter-plugin/changelog/change-move-sharing-limits-to-publicize-package b/projects/plugins/starter-plugin/changelog/change-move-sharing-limits-to-publicize-package
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/change-move-sharing-limits-to-publicize-package
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/changelogger-merge b/projects/plugins/starter-plugin/changelog/changelogger-merge
deleted file mode 100644
index 6eb3e9f9f8fa1..0000000000000
--- a/projects/plugins/starter-plugin/changelog/changelogger-merge
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: added
-Comment: Minor update to changelog package that supports git merge strategy. Should not affect shipped code.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/e2e-bump-dependencies b/projects/plugins/starter-plugin/changelog/e2e-bump-dependencies
deleted file mode 100644
index 661dffbaecd41..0000000000000
--- a/projects/plugins/starter-plugin/changelog/e2e-bump-dependencies
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-E2E tests: bump dependencies
diff --git a/projects/plugins/starter-plugin/changelog/e2e-fix-pre-scripts b/projects/plugins/starter-plugin/changelog/e2e-fix-pre-scripts
deleted file mode 100644
index 97905f4777a4b..0000000000000
--- a/projects/plugins/starter-plugin/changelog/e2e-fix-pre-scripts
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-E2E tests: fixed pretest cleanup script not running
diff --git a/projects/plugins/starter-plugin/changelog/e2e-slack-notifications-cleanup b/projects/plugins/starter-plugin/changelog/e2e-slack-notifications-cleanup
deleted file mode 100644
index 4cc72ab4eb433..0000000000000
--- a/projects/plugins/starter-plugin/changelog/e2e-slack-notifications-cleanup
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: removed
-
-E2E tests: removed deprecated Slack notification code
diff --git a/projects/plugins/starter-plugin/changelog/e2e-use-built-artefacts-in-ci b/projects/plugins/starter-plugin/changelog/e2e-use-built-artefacts-in-ci
deleted file mode 100644
index daba65809566a..0000000000000
--- a/projects/plugins/starter-plugin/changelog/e2e-use-built-artefacts-in-ci
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: added
-
-E2E tests: use CI build artifacts in e2e tests
diff --git a/projects/plugins/starter-plugin/changelog/fix-check-intra-monorepo-deps-for-plugin-release-branches b/projects/plugins/starter-plugin/changelog/fix-check-intra-monorepo-deps-for-plugin-release-branches
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/fix-check-intra-monorepo-deps-for-plugin-release-branches
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/fix-user-token-after-restore-error b/projects/plugins/starter-plugin/changelog/fix-user-token-after-restore-error
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/fix-user-token-after-restore-error
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/modify-backup-review-request-logic b/projects/plugins/starter-plugin/changelog/modify-backup-review-request-logic
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/modify-backup-review-request-logic
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/modify-connection-react-component-connection-error-notice b/projects/plugins/starter-plugin/changelog/modify-connection-react-component-connection-error-notice
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/modify-connection-react-component-connection-error-notice
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/modify-connection-react-component-connection-error-notice#2 b/projects/plugins/starter-plugin/changelog/modify-connection-react-component-connection-error-notice#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/modify-connection-react-component-connection-error-notice#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/remove-connection-ui-package b/projects/plugins/starter-plugin/changelog/remove-connection-ui-package
deleted file mode 100644
index 386164f9bd899..0000000000000
--- a/projects/plugins/starter-plugin/changelog/remove-connection-ui-package
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: removed
-Comment: This is a cleanup task
-
-
diff --git a/projects/plugins/starter-plugin/changelog/remove-placeholder-blogging-prompts b/projects/plugins/starter-plugin/changelog/remove-placeholder-blogging-prompts
deleted file mode 100644
index d37dc4136062b..0000000000000
--- a/projects/plugins/starter-plugin/changelog/remove-placeholder-blogging-prompts
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: composer.lock file change
-
-
diff --git a/projects/plugins/starter-plugin/changelog/remove-remnants-of-automated-code-coverage b/projects/plugins/starter-plugin/changelog/remove-remnants-of-automated-code-coverage
deleted file mode 100644
index 085e2e863ddb4..0000000000000
--- a/projects/plugins/starter-plugin/changelog/remove-remnants-of-automated-code-coverage
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: removed
-Comment: Remove `test-coverage` scripts and other remnants of automated code coverage.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/renovate-automattic-wordbless-0.x b/projects/plugins/starter-plugin/changelog/renovate-automattic-wordbless-0.x
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-automattic-wordbless-0.x
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#2 b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#3 b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#3
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#3
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#4 b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#4
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#4
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#5 b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#5
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#5
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#6 b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#6
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#6
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#7 b/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#7
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-babel-monorepo#7
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-composer-composer-2.x b/projects/plugins/starter-plugin/changelog/renovate-composer-composer-2.x
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-composer-composer-2.x
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/renovate-concurrently-7.x b/projects/plugins/starter-plugin/changelog/renovate-concurrently-7.x
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-concurrently-7.x
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-jest-monorepo b/projects/plugins/starter-plugin/changelog/renovate-jest-monorepo
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-jest-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-js-unit-testing-packages b/projects/plugins/starter-plugin/changelog/renovate-js-unit-testing-packages
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-js-unit-testing-packages
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-js-unit-testing-packages#2 b/projects/plugins/starter-plugin/changelog/renovate-js-unit-testing-packages#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-js-unit-testing-packages#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#2 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#3 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#3
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#3
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#4 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#4
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#4
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#5 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#5
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#5
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#6 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#6
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#6
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#7 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#7
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#7
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#8 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#8
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#8
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#9 b/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#9
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-lock-file-maintenance#9
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-major-symfony b/projects/plugins/starter-plugin/changelog/renovate-major-symfony
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-major-symfony
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-playwright-monorepo b/projects/plugins/starter-plugin/changelog/renovate-playwright-monorepo
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-playwright-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-renovatebot-github-action-34.x b/projects/plugins/starter-plugin/changelog/renovate-renovatebot-github-action-34.x
deleted file mode 100644
index 68f8089f5730a..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-renovatebot-github-action-34.x
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Make "jetpack-e2e-commons" dep explicitly "workspace:*"
-
-
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#2 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#3 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#3
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#3
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#4 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#4
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#4
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#5 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#5
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#5
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#6 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#6
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#6
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#7 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#7
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#7
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#8 b/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#8
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-wordpress-monorepo#8
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/renovate-yoast-phpunit-polyfills-1.x b/projects/plugins/starter-plugin/changelog/renovate-yoast-phpunit-polyfills-1.x
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/renovate-yoast-phpunit-polyfills-1.x
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/sync-add-reset-endpoint b/projects/plugins/starter-plugin/changelog/sync-add-reset-endpoint
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/sync-add-reset-endpoint
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-auto-redirect-after-install-condition b/projects/plugins/starter-plugin/changelog/update-auto-redirect-after-install-condition
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-auto-redirect-after-install-condition
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-blaze-package-todos b/projects/plugins/starter-plugin/changelog/update-blaze-package-todos
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-blaze-package-todos
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-build-action-version-handling b/projects/plugins/starter-plugin/changelog/update-build-action-version-handling
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-build-action-version-handling
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-components-apply-icon-button-styles b/projects/plugins/starter-plugin/changelog/update-components-apply-icon-button-styles
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-components-apply-icon-button-styles
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-connection-deprecated-method-cleanup b/projects/plugins/starter-plugin/changelog/update-connection-deprecated-method-cleanup
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-connection-deprecated-method-cleanup
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-connection-deprecated-soft-disconnect-cleanup b/projects/plugins/starter-plugin/changelog/update-connection-deprecated-soft-disconnect-cleanup
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-connection-deprecated-soft-disconnect-cleanup
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign b/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign#2 b/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign#3 b/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign#3
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-connection-error-notice-redesign#3
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-icon-tooltip-component b/projects/plugins/starter-plugin/changelog/update-icon-tooltip-component
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-icon-tooltip-component
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-import-package b/projects/plugins/starter-plugin/changelog/update-import-package
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-import-package
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-init-with-config-package b/projects/plugins/starter-plugin/changelog/update-init-with-config-package
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-init-with-config-package
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-integrate-stats-pkg-in-jetpack-plugin b/projects/plugins/starter-plugin/changelog/update-integrate-stats-pkg-in-jetpack-plugin
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-integrate-stats-pkg-in-jetpack-plugin
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-jitm-style b/projects/plugins/starter-plugin/changelog/update-jitm-style
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-jitm-style
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-move-delete-connection-owner-notice b/projects/plugins/starter-plugin/changelog/update-move-delete-connection-owner-notice
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-move-delete-connection-owner-notice
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-move-delete-connection-owner-notice#2 b/projects/plugins/starter-plugin/changelog/update-move-delete-connection-owner-notice#2
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-move-delete-connection-owner-notice#2
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-move-restore-connection b/projects/plugins/starter-plugin/changelog/update-move-restore-connection
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-move-restore-connection
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-move-restore-connection#2 b/projects/plugins/starter-plugin/changelog/update-move-restore-connection#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-move-restore-connection#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-my-jetpack-add-scroll-to-top b/projects/plugins/starter-plugin/changelog/update-my-jetpack-add-scroll-to-top
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-my-jetpack-add-scroll-to-top
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-my-jetpack-remove-videopress-hybrid b/projects/plugins/starter-plugin/changelog/update-my-jetpack-remove-videopress-hybrid
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-my-jetpack-remove-videopress-hybrid
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-my-jetpack-show-while-disconnected b/projects/plugins/starter-plugin/changelog/update-my-jetpack-show-while-disconnected
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-my-jetpack-show-while-disconnected
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-node-to-v18 b/projects/plugins/starter-plugin/changelog/update-node-to-v18
deleted file mode 100644
index 1288d434eb45a..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-node-to-v18
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Update tooling node version to 18.13.0. Should be no change to the project.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-pnpm-7.5.0 b/projects/plugins/starter-plugin/changelog/update-pnpm-7.5.0
deleted file mode 100644
index 0c477303afc05..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-pnpm-7.5.0
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: removed
-Comment: Remove `.engines.pnpm` from `package.json`. It's not needed, as pnpm always checks the monorepo root `package.json` anyway. Further, `.engines` is stripped from the mirror repos.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-pricing-table-design b/projects/plugins/starter-plugin/changelog/update-pricing-table-design
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-pricing-table-design
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-react-18 b/projects/plugins/starter-plugin/changelog/update-react-18
deleted file mode 100644
index b2e46f796d3bb..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-react-18
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Update to React 18.
diff --git a/projects/plugins/starter-plugin/changelog/update-refactor_upgrade_tooltips b/projects/plugins/starter-plugin/changelog/update-refactor_upgrade_tooltips
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-refactor_upgrade_tooltips
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-search-require-only-site-connection b/projects/plugins/starter-plugin/changelog/update-search-require-only-site-connection
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-search-require-only-site-connection
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-search-support-woo-brands-plugin b/projects/plugins/starter-plugin/changelog/update-search-support-woo-brands-plugin
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-search-support-woo-brands-plugin
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-starter-plugin-activation b/projects/plugins/starter-plugin/changelog/update-starter-plugin-activation
deleted file mode 100644
index f18c3c1f5cd19..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-starter-plugin-activation
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fixed
-
-Plugin activation: Only redirect when activating from Plugins page in the browser
diff --git a/projects/plugins/starter-plugin/changelog/update-starter-plugin-use-theme-provider b/projects/plugins/starter-plugin/changelog/update-starter-plugin-use-theme-provider
deleted file mode 100644
index a5c7d72304bd1..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-starter-plugin-use-theme-provider
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: added
-
-Use ThemeProvider when rendering Starter Plugin AdminPage
diff --git a/projects/plugins/starter-plugin/changelog/update-sync-debug-info b/projects/plugins/starter-plugin/changelog/update-sync-debug-info
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-sync-debug-info
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-sync-minimal-config-add-updates-module b/projects/plugins/starter-plugin/changelog/update-sync-minimal-config-add-updates-module
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-sync-minimal-config-add-updates-module
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/starter-plugin/changelog/update-wordbless b/projects/plugins/starter-plugin/changelog/update-wordbless
deleted file mode 100644
index 6518e28c198ba..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-wordbless
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated a dev dependency. No functional change.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-wordbless#2 b/projects/plugins/starter-plugin/changelog/update-wordbless#2
deleted file mode 100644
index 9aa70e3ec1f75..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-wordbless#2
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: changed
-Comment: Updated composer.lock.
-
-
diff --git a/projects/plugins/starter-plugin/changelog/update-wp-tested-up-to b/projects/plugins/starter-plugin/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/starter-plugin/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/starter-plugin/changelog/update-wpcs-pre-phpcbf b/projects/plugins/starter-plugin/changelog/update-wpcs-pre-phpcbf
deleted file mode 100644
index 8ae821ee1a3df..0000000000000
--- a/projects/plugins/starter-plugin/changelog/update-wpcs-pre-phpcbf
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: fixed
-Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
-
-
diff --git a/projects/plugins/starter-plugin/composer.json b/projects/plugins/starter-plugin/composer.json
index 3579d7913b661..556f19195ff96 100644
--- a/projects/plugins/starter-plugin/composer.json
+++ b/projects/plugins/starter-plugin/composer.json
@@ -68,6 +68,6 @@
"automattic/jetpack-autoloader": true,
"automattic/jetpack-composer-plugin": true
},
- "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_starter_pluginⓥ0_2_0_alpha"
+ "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_starter_pluginⓥ0_2_1_alpha"
}
}
diff --git a/projects/plugins/starter-plugin/composer.lock b/projects/plugins/starter-plugin/composer.lock
index cbf7ad635d5b4..6b8a55e87cfc4 100644
--- a/projects/plugins/starter-plugin/composer.lock
+++ b/projects/plugins/starter-plugin/composer.lock
@@ -711,7 +711,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -738,7 +738,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
diff --git a/projects/plugins/starter-plugin/jetpack-starter-plugin.php b/projects/plugins/starter-plugin/jetpack-starter-plugin.php
index ad4c64f759580..ba9bafb876246 100644
--- a/projects/plugins/starter-plugin/jetpack-starter-plugin.php
+++ b/projects/plugins/starter-plugin/jetpack-starter-plugin.php
@@ -4,7 +4,7 @@
* Plugin Name: Jetpack Starter Plugin
* Plugin URI: https://wordpress.org/plugins/jetpack-starter-plugin
* Description: plugin--description.
- * Version: 0.2.0-alpha
+ * Version: 0.2.1-alpha
* Author: Automattic
* Author URI: https://jetpack.com/
* License: GPLv2 or later
diff --git a/projects/plugins/starter-plugin/readme.txt b/projects/plugins/starter-plugin/readme.txt
index f54376476216a..1919cea1c4ede 100644
--- a/projects/plugins/starter-plugin/readme.txt
+++ b/projects/plugins/starter-plugin/readme.txt
@@ -3,7 +3,7 @@ Contributors: automattic,
Tags: jetpack, stuff
Requires at least: 6.0
Requires PHP: 5.6
-Tested up to: 6.1
+Tested up to: 6.2
Stable tag: 0.1.0-alpha
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
diff --git a/projects/plugins/super-cache/changelog/update-wp-tested-up-to b/projects/plugins/super-cache/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/super-cache/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/super-cache/readme.txt b/projects/plugins/super-cache/readme.txt
index 17b7ad2e91a35..35582531962b9 100644
--- a/projects/plugins/super-cache/readme.txt
+++ b/projects/plugins/super-cache/readme.txt
@@ -3,7 +3,7 @@ Contributors: donncha, automattic, adnan007, mikemayhem3030, ppetrov2c, pyronaur
Tags: performance, caching, wp-cache, wp-super-cache, cache
Requires at least: 5.9
Requires PHP: 5.6
-Tested up to: 6.1
+Tested up to: 6.2
Stable tag: 1.9.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
diff --git a/projects/plugins/vaultpress/CHANGELOG.md b/projects/plugins/vaultpress/CHANGELOG.md
index 2e021733ddbb0..728471a63186a 100644
--- a/projects/plugins/vaultpress/CHANGELOG.md
+++ b/projects/plugins/vaultpress/CHANGELOG.md
@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
+## 2.2.3 - 2023-03-08
+### Changed
+- Add a note to README (visible in wordpress.org) that Jetpack VaultPress is deprecated. [#27465]
+- Compatibility: WordPress 6.1 compatibility [#27084]
+- Updated package dependencies.
+- Update README references from VaultPress to Jetpack VaultPress [#27412]
+
## 2.2.2 - 2022-07-06
### Changed
- Build: do not ship PHPCS configuration file. [#22604]
diff --git a/projects/plugins/vaultpress/changelog/bump-wp6.0-to-6.1 b/projects/plugins/vaultpress/changelog/bump-wp6.0-to-6.1
deleted file mode 100644
index 8e38530d25bc9..0000000000000
--- a/projects/plugins/vaultpress/changelog/bump-wp6.0-to-6.1
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Compatibility: WordPress 6.1 compatibility
diff --git a/projects/plugins/vaultpress/changelog/changelogger-merge b/projects/plugins/vaultpress/changelog/changelogger-merge
deleted file mode 100644
index 6eb3e9f9f8fa1..0000000000000
--- a/projects/plugins/vaultpress/changelog/changelogger-merge
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: added
-Comment: Minor update to changelog package that supports git merge strategy. Should not affect shipped code.
-
-
diff --git a/projects/plugins/vaultpress/changelog/fix-check-intra-monorepo-deps-for-plugin-release-branches b/projects/plugins/vaultpress/changelog/fix-check-intra-monorepo-deps-for-plugin-release-branches
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/fix-check-intra-monorepo-deps-for-plugin-release-branches
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/remove-remnants-of-automated-code-coverage b/projects/plugins/vaultpress/changelog/remove-remnants-of-automated-code-coverage
deleted file mode 100644
index 085e2e863ddb4..0000000000000
--- a/projects/plugins/vaultpress/changelog/remove-remnants-of-automated-code-coverage
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: removed
-Comment: Remove `test-coverage` scripts and other remnants of automated code coverage.
-
-
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#2 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#2
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#2
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#3 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#3
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#3
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#4 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#4
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#4
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#5 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#5
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#5
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#6 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#6
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#6
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#7 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#7
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#7
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#8 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#8
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#8
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#9 b/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#9
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-lock-file-maintenance#9
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-major-symfony b/projects/plugins/vaultpress/changelog/renovate-major-symfony
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-major-symfony
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/renovate-yoast-phpunit-polyfills-1.x b/projects/plugins/vaultpress/changelog/renovate-yoast-phpunit-polyfills-1.x
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/renovate-yoast-phpunit-polyfills-1.x
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/update-build-action-version-handling b/projects/plugins/vaultpress/changelog/update-build-action-version-handling
deleted file mode 100644
index c47cb18e82997..0000000000000
--- a/projects/plugins/vaultpress/changelog/update-build-action-version-handling
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Updated package dependencies.
diff --git a/projects/plugins/vaultpress/changelog/update-vp-plugin-depreciation-notice b/projects/plugins/vaultpress/changelog/update-vp-plugin-depreciation-notice
deleted file mode 100644
index 5705f56dc80e6..0000000000000
--- a/projects/plugins/vaultpress/changelog/update-vp-plugin-depreciation-notice
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Add a note to README (visible in wordpress.org) that Jetpack VaultPress is deprecated.
diff --git a/projects/plugins/vaultpress/changelog/update-vp-plugin-rebranding-readme b/projects/plugins/vaultpress/changelog/update-vp-plugin-rebranding-readme
deleted file mode 100644
index 075f7c8cb6f13..0000000000000
--- a/projects/plugins/vaultpress/changelog/update-vp-plugin-rebranding-readme
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: changed
-
-Update README references from VaultPress to Jetpack VaultPress
diff --git a/projects/plugins/vaultpress/changelog/update-wp-tested-up-to b/projects/plugins/vaultpress/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/vaultpress/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf b/projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf
deleted file mode 100644
index 8ae821ee1a3df..0000000000000
--- a/projects/plugins/vaultpress/changelog/update-wpcs-pre-phpcbf
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: fixed
-Comment: PHPCS: Fix most auto-fixable sniffs coming in new WPCS snapshot. No user-visible change to the project.
-
-
diff --git a/projects/plugins/vaultpress/composer.json b/projects/plugins/vaultpress/composer.json
index b02148c121938..864a12a375645 100644
--- a/projects/plugins/vaultpress/composer.json
+++ b/projects/plugins/vaultpress/composer.json
@@ -35,7 +35,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
- "autoloader-suffix": "9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_3_alpha",
+ "autoloader-suffix": "9559eef123208b7d1b9c15b978567267_vaultpressⓥ2_2_4_alpha",
"allow-plugins": {
"automattic/jetpack-autoloader": true
}
diff --git a/projects/plugins/vaultpress/readme.txt b/projects/plugins/vaultpress/readme.txt
index b539a4500e728..007fc06736620 100644
--- a/projects/plugins/vaultpress/readme.txt
+++ b/projects/plugins/vaultpress/readme.txt
@@ -2,8 +2,8 @@
Contributors: automattic, annezazu, apokalyptik, bjorsch, briancolinger, dsmart, georgestephanis, initsogar, jeherve, josephscott, miguelxavierpenha, rachelsquirrel, rdcoll, sdixon194, shaunandrews, thingalon, viper007bond, williamvianas, xknown
Tags: security, malware, virus, archive, back up, back ups, backup, backups, scanning, restore, wordpress backup, site backup, website backup
Requires at least: 5.2
-Tested up to: 6.1
-Stable tag: 2.2.0
+Tested up to: 6.2
+Stable tag: 2.2.2
Requires PHP: 5.6
License: GPLv2
@@ -11,8 +11,8 @@ License: GPLv2
== Description ==
-**Please note:** This plugin is no longer actively supported for new customers.
-
+**Please note:** This plugin is no longer actively supported for new customers.
+
For the next generation of VaultPress technology, **we recommend** [Jetpack Security](https://jetpack.com/features/security/). It includes real-time backups, malware scanning, anti-spam comment protection, and a new Web Application Firewall (WAF) for ultimate WordPress site security.
== Installation ==
@@ -29,16 +29,15 @@ View our full list of FAQs at [http://help.vaultpress.com/faq/](http://help.vaul
= How many sites can I protect with VaultPress? =
-A Jetpack VaultPress subscription is for a single WordPress site.
+A Jetpack VaultPress subscription is for a single WordPress site.
== Changelog ==
-### 2.2.2 - 2022-07-06
+### 2.2.3 - 2023-03-08
#### Changed
-- Build: do not ship PHPCS configuration file.
-- Janitorial: require a more recent version of WordPress now that WP 6.0 is coming out.
-- Renaming `master` references to `trunk`.
-- Updated composer.lock
+- Add a note to README (visible in wordpress.org) that Jetpack VaultPress is deprecated.
+- Compatibility: WordPress 6.1 compatibility
- Updated package dependencies.
+- Update README references from VaultPress to Jetpack VaultPress
--------
diff --git a/projects/plugins/vaultpress/vaultpress.php b/projects/plugins/vaultpress/vaultpress.php
index e6d0bf8d39f5d..bc53e95d14c1a 100644
--- a/projects/plugins/vaultpress/vaultpress.php
+++ b/projects/plugins/vaultpress/vaultpress.php
@@ -3,7 +3,7 @@
* Plugin Name: VaultPress
* Plugin URI: http://vaultpress.com/?utm_source=plugin-uri&utm_medium=plugin-description&utm_campaign=1.0
* Description: Protect your content, themes, plugins, and settings with realtime backup and automated security scanning from VaultPress . Activate, enter your registration key, and never worry again. Need some help?
- * Version: 2.2.3-alpha
+ * Version: 2.2.4-alpha
* Author: Automattic
* Author URI: http://vaultpress.com/?utm_source=author-uri&utm_medium=plugin-description&utm_campaign=1.0
* License: GPL2+
@@ -17,7 +17,7 @@
defined( 'ABSPATH' ) || die();
define( 'VAULTPRESS__MINIMUM_PHP_VERSION', '5.6' );
-define( 'VAULTPRESS__VERSION', '2.2.3-alpha' );
+define( 'VAULTPRESS__VERSION', '2.2.4-alpha' );
define( 'VAULTPRESS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
/**
diff --git a/projects/plugins/search/changelog/update-import-package b/projects/plugins/videopress/changelog/add-use-preview-hook
similarity index 100%
rename from projects/plugins/search/changelog/update-import-package
rename to projects/plugins/videopress/changelog/add-use-preview-hook
diff --git a/projects/plugins/search/changelog/update-jitm-style b/projects/plugins/videopress/changelog/add-zendesk-chat-module
similarity index 100%
rename from projects/plugins/search/changelog/update-jitm-style
rename to projects/plugins/videopress/changelog/add-zendesk-chat-module
diff --git a/projects/plugins/search/changelog/update-move-delete-connection-owner-notice b/projects/plugins/videopress/changelog/add-zendesk-chat-module#2
similarity index 100%
rename from projects/plugins/search/changelog/update-move-delete-connection-owner-notice
rename to projects/plugins/videopress/changelog/add-zendesk-chat-module#2
diff --git a/projects/plugins/videopress/changelog/update-wp-tested-up-to b/projects/plugins/videopress/changelog/update-wp-tested-up-to
new file mode 100644
index 0000000000000..ad53b760f90b2
--- /dev/null
+++ b/projects/plugins/videopress/changelog/update-wp-tested-up-to
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: indicate full compatibility with the latest version of WordPress, 6.2.
diff --git a/projects/plugins/videopress/composer.lock b/projects/plugins/videopress/composer.lock
index bb33ee2a40a7f..54036e0f25f89 100644
--- a/projects/plugins/videopress/composer.lock
+++ b/projects/plugins/videopress/composer.lock
@@ -711,7 +711,7 @@
"dist": {
"type": "path",
"url": "../../packages/my-jetpack",
- "reference": "5c154d90af8faaf107ce35a8aedbe1025e2313d4"
+ "reference": "d8bfc30fbd87ba4b6ba30c604bc551ea88f9234f"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -738,7 +738,7 @@
"link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "2.7.x-dev"
+ "dev-trunk": "2.8.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-initializer.php"
@@ -1216,7 +1216,7 @@
"dist": {
"type": "path",
"url": "../../packages/videopress",
- "reference": "62b58b5e1fe678849ef0751ed05a6e71cedfa82a"
+ "reference": "94b32518050a387b8c926214809c806fd64d7dbb"
},
"require": {
"automattic/jetpack-admin-ui": "@dev",
@@ -1238,7 +1238,7 @@
"link-template": "https://github.com/Automattic/jetpack-videopress/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "0.11.x-dev"
+ "dev-trunk": "0.12.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-package-version.php"
diff --git a/projects/plugins/videopress/readme.txt b/projects/plugins/videopress/readme.txt
index 700a1233290e4..a91c4a9b352df 100644
--- a/projects/plugins/videopress/readme.txt
+++ b/projects/plugins/videopress/readme.txt
@@ -3,7 +3,7 @@ Contributors: automattic, retrofox, oskosk, thehenridev, renatoagds, lhkowalski,
Tags: video, video-hosting, video-player, cdn, vimeo, youtube, video-streaming, mobile-video, jetpack
Requires at least: 6.0
-Tested up to: 6.1
+Tested up to: 6.2
Stable tag: 1.4.0
Requires PHP: 5.6
License: GPLv2 or later
@@ -27,7 +27,7 @@ Tired of video companies sending your customers to their app to view videos? Or
High-quality, lightning-fast video hosting
-Take the complexity out of self-hosting videos. VideoPress offers fully-hosted videos and a CDN to ensure instant video speed for your audience around the globe. With our powerful and reliable hosting infrastructure, you can provide your audience with fast-motion videos with 60 FPS and full 4K resolution.
+Take the complexity out of self-hosting videos. VideoPress offers fully-hosted videos and a CDN to ensure instant video speed for your audience around the globe. With our powerful and reliable hosting infrastructure, you can provide your audience with fast-motion videos with 60 FPS and full 4K resolution.
== Installation ==
diff --git a/tools/cli/commands/generate.js b/tools/cli/commands/generate.js
index 60b43b9c13292..51c9165c01eb9 100644
--- a/tools/cli/commands/generate.js
+++ b/tools/cli/commands/generate.js
@@ -747,7 +747,7 @@ function createReadMeTxt( answers ) {
'Tags: jetpack, stuff\n' +
'Requires at least: 6.0\n' +
'Requires PHP: 5.6\n' +
- 'Tested up to: 6.1\n' +
+ 'Tested up to: 6.2\n' +
`Stable tag: ${ answers.version }\n` +
'License: GPLv2 or later\n' +
'License URI: http://www.gnu.org/licenses/gpl-2.0.html\n' +
diff --git a/tools/eslint-excludelist.json b/tools/eslint-excludelist.json
index 53637ee562517..e1b19b472c310 100644
--- a/tools/eslint-excludelist.json
+++ b/tools/eslint-excludelist.json
@@ -58,7 +58,6 @@
"projects/plugins/jetpack/_inc/jetpack-deactivate-dialog.js",
"projects/plugins/jetpack/_inc/jetpack-modules.js",
"projects/plugins/jetpack/_inc/lib/debugger/jetpack-debugger-site-health.js",
- "projects/plugins/jetpack/_inc/polldaddy-shortcode.js",
"projects/plugins/jetpack/_inc/twitter-timeline.js",
"projects/plugins/jetpack/extensions/blocks/donations/edit.js",
"projects/plugins/jetpack/extensions/blocks/eventbrite/index.js",