- { props.priceBefore !== props.priceAfter && props.priceAfter > 0 ? (
+ { props.priceAfter === 0 &&
}
+ { props.priceBefore !== props.priceAfter && props.priceAfter > 0 && (
{ currencyObjectBefore.symbol }
@@ -71,8 +72,6 @@ const PricingCard: React.FC< PricingCardProps > = ( {
) }
- ) : (
-
) }
{ props.priceAfter > 0 && (
<>
diff --git a/projects/js-packages/components/components/threat-fixer-button/index.tsx b/projects/js-packages/components/components/threat-fixer-button/index.tsx
index 7c1c92fcc718a..cd15c0294c313 100644
--- a/projects/js-packages/components/components/threat-fixer-button/index.tsx
+++ b/projects/js-packages/components/components/threat-fixer-button/index.tsx
@@ -1,8 +1,13 @@
-import { Button, Text, ActionPopover } from '@automattic/jetpack-components';
-import { CONTACT_SUPPORT_URL, type Threat, fixerStatusIsStale } from '@automattic/jetpack-scan';
-import { ExternalLink } from '@wordpress/components';
-import { createInterpolateElement, useCallback, useMemo, useState } from '@wordpress/element';
-import { __, sprintf } from '@wordpress/i18n';
+import { Button } from '@automattic/jetpack-components';
+import {
+ type Threat,
+ fixerIsInError,
+ fixerIsInProgress,
+ fixerStatusIsStale,
+} from '@automattic/jetpack-scan';
+import { Tooltip } from '@wordpress/components';
+import { useCallback, useMemo } from '@wordpress/element';
+import { __ } from '@wordpress/i18n';
import styles from './styles.module.scss';
/**
@@ -24,119 +29,133 @@ export default function ThreatFixerButton( {
onClick: ( items: Threat[] ) => void;
className?: string;
} ): JSX.Element {
- const [ isPopoverVisible, setIsPopoverVisible ] = useState( false );
-
- const [ anchor, setAnchor ] = useState( null );
+ const fixerState = useMemo( () => {
+ const inProgress = threat.fixer && fixerIsInProgress( threat.fixer );
+ const error = threat.fixer && fixerIsInError( threat.fixer );
+ const stale = threat.fixer && fixerStatusIsStale( threat.fixer );
+ return { inProgress, error, stale };
+ }, [ threat.fixer ] );
- const children = useMemo( () => {
+ const tooltipText = useMemo( () => {
if ( ! threat.fixable ) {
return null;
}
- if ( threat.fixer && 'error' in threat.fixer && threat.fixer.error ) {
- return __( 'Error', 'jetpack' );
+
+ if ( fixerState.error ) {
+ return __( 'An error occurred auto-fixing this threat.', 'jetpack' );
}
- if ( threat.fixer && 'status' in threat.fixer && threat.fixer.status === 'in_progress' ) {
- return __( 'Fixing…', 'jetpack' );
+
+ if ( fixerState.stale ) {
+ return __( 'The auto-fixer is taking longer than expected.', 'jetpack' );
}
- if ( threat.fixable.fixer === 'delete' ) {
- return __( 'Delete', 'jetpack' );
+
+ if ( fixerState.inProgress ) {
+ return __( 'An auto-fixer is in progress.', 'jetpack' );
}
- if ( threat.fixable.fixer === 'update' ) {
- return __( 'Update', 'jetpack' );
+
+ switch ( threat.fixable.fixer ) {
+ case 'delete':
+ if ( threat.filename ) {
+ if ( threat.filename.endsWith( '/' ) ) {
+ return __( 'Deletes the directory that the infected file is in.', 'jetpack' );
+ }
+
+ if ( threat.signature === 'Core.File.Modification' ) {
+ return __( 'Deletes the unexpected file in a core WordPress directory.', 'jetpack' );
+ }
+
+ return __( 'Deletes the infected file.', 'jetpack' );
+ }
+
+ if ( threat.extension?.type === 'plugin' ) {
+ return __( 'Deletes the plugin directory to fix the threat.', 'jetpack' );
+ }
+
+ if ( threat.extension?.type === 'theme' ) {
+ return __( 'Deletes the theme directory to fix the threat.', 'jetpack' );
+ }
+ break;
+ case 'update':
+ return __( 'Upgrades the plugin or theme to a newer version.', 'jetpack' );
+ case 'replace':
+ case 'rollback':
+ if ( threat.filename ) {
+ return threat.signature === 'Core.File.Modification'
+ ? __(
+ 'Replaces the modified core WordPress file with the original clean version from the WordPress source code.',
+ 'jetpack'
+ )
+ : __(
+ 'Replaces the infected file with a previously backed up version that is clean.',
+ 'jetpack'
+ );
+ }
+
+ if ( threat.signature === 'php_hardening_WP_Config_NoSalts_001' ) {
+ return __(
+ 'Replaces the default salt keys in wp-config.php with unique ones.',
+ 'jetpack'
+ );
+ }
+ break;
+ default:
+ return __( 'An auto-fixer is available.', 'jetpack' );
}
- return __( 'Fix', 'jetpack' );
- }, [ threat.fixable, threat.fixer ] );
+ }, [ threat, fixerState ] );
- const errorMessage = useMemo( () => {
- if ( threat.fixer && fixerStatusIsStale( threat.fixer ) ) {
- return __( 'The fixer is taking longer than expected.', 'jetpack' );
+ const buttonText = useMemo( () => {
+ if ( ! threat.fixable ) {
+ return null;
}
- if ( threat.fixer && 'error' in threat.fixer && threat.fixer.error ) {
- return __( 'An error occurred auto-fixing this threat.', 'jetpack' );
+ if ( fixerState.error ) {
+ return __( 'Error', 'jetpack' );
}
- return null;
- }, [ threat.fixer ] );
+ switch ( threat.fixable.fixer ) {
+ case 'delete':
+ return __( 'Delete', 'jetpack' );
+ case 'update':
+ return __( 'Update', 'jetpack' );
+ case 'replace':
+ case 'rollback':
+ return __( 'Replace', 'jetpack' );
+ default:
+ return __( 'Fix', 'jetpack' );
+ }
+ }, [ threat.fixable, fixerState.error ] );
const handleClick = useCallback(
( event: React.MouseEvent ) => {
event.stopPropagation();
- if ( errorMessage && ! isPopoverVisible ) {
- setIsPopoverVisible( true );
- return;
- }
onClick( [ threat ] );
},
- [ onClick, errorMessage, isPopoverVisible, threat ]
+ [ onClick, threat ]
);
- const closePopover = useCallback( () => {
- setIsPopoverVisible( false );
- }, [] );
-
if ( ! threat.fixable ) {
return null;
}
return (
-
- { isPopoverVisible && (
-
+
- ) }
+ children={ buttonText }
+ className={ className }
+ isLoading={ fixerState.inProgress }
+ isDestructive={
+ ( threat.fixable && threat.fixable.fixer === 'delete' ) ||
+ fixerState.error ||
+ fixerState.stale
+ }
+ style={ { minWidth: '72px' } }
+ />
+
);
}
diff --git a/projects/js-packages/components/components/threat-fixer-button/stories/index.stories.tsx b/projects/js-packages/components/components/threat-fixer-button/stories/index.stories.tsx
index 6b378030a2d89..4f346d04d394b 100644
--- a/projects/js-packages/components/components/threat-fixer-button/stories/index.stories.tsx
+++ b/projects/js-packages/components/components/threat-fixer-button/stories/index.stories.tsx
@@ -3,12 +3,59 @@ import ThreatFixerButton from '../index.js';
export default {
title: 'JS Packages/Components/Threat Fixer Button',
component: ThreatFixerButton,
+ decorators: [
+ Story => (
+
+
+
+ ),
+ ],
+ parameters: {
+ layout: 'centered',
+ },
};
export const Default = args =>
;
Default.args = {
threat: { fixable: { fixer: 'edit' } },
- onClick: () => alert( 'Edit fixer callback triggered' ), // eslint-disable-line no-alert
+ onClick: () => alert( 'Fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const DeletePlugin = args =>
;
+DeletePlugin.args = {
+ threat: { fixable: { fixer: 'delete' }, extension: { type: 'plugin' } },
+ onClick: () => alert( 'Delete fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const DeleteTheme = args =>
;
+DeleteTheme.args = {
+ threat: { fixable: { fixer: 'delete' }, extension: { type: 'theme' } },
+ onClick: () => alert( 'Delete fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const DeleteDirectory = args =>
;
+DeleteDirectory.args = {
+ threat: { fixable: { fixer: 'delete' }, filename: '/var/www/html/wp-content/uploads/' },
+ onClick: () => alert( 'Delete fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const DeleteCoreFile = args =>
;
+DeleteCoreFile.args = {
+ threat: {
+ fixable: { fixer: 'delete' },
+ signature: 'Core.File.Modification',
+ filename: '/var/www/html/wp-admin/index.php',
+ },
+ onClick: () => alert( 'Delete fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const DeleteFile = args =>
;
+DeleteFile.args = {
+ threat: {
+ fixable: { fixer: 'delete' },
+ filename: '/var/www/html/wp-content/uploads/jptt_eicar.php',
+ },
+ onClick: () => alert( 'Delete fixer callback triggered' ), // eslint-disable-line no-alert
};
export const Update = args =>
;
@@ -17,14 +64,48 @@ Update.args = {
onClick: () => alert( 'Update fixer callback triggered' ), // eslint-disable-line no-alert
};
-export const Delete = args =>
;
-Delete.args = {
- threat: { fixable: { fixer: 'delete' } },
- onClick: () => alert( 'Delete fixer callback triggered' ), // eslint-disable-line no-alert
+export const ReplaceSaltKeys = args =>
;
+ReplaceSaltKeys.args = {
+ threat: { fixable: { fixer: 'replace' }, signature: 'php_hardening_WP_Config_NoSalts_001' },
+ onClick: () => alert( 'Replace fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const ReplaceCoreFile = args =>
;
+ReplaceCoreFile.args = {
+ threat: {
+ fixable: { fixer: 'replace' },
+ signature: 'Core.File.Modification',
+ filename: '/var/www/html/wp-admin/index.php',
+ },
+ onClick: () => alert( 'Replace fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const ReplaceFile = args =>
;
+ReplaceFile.args = {
+ threat: {
+ fixable: { fixer: 'replace' },
+ filename: '/var/www/html/wp-content/uploads/jptt_eicar.php',
+ },
+ onClick: () => alert( 'Replace fixer callback triggered' ), // eslint-disable-line no-alert
};
export const Loading = args =>
;
Loading.args = {
- threat: { fixable: { fixer: 'edit' }, fixer: { status: 'in_progress' } },
- onClick: () => alert( 'Fixer callback triggered' ), // eslint-disable-line no-alert
+ threat: { fixable: { fixer: 'update' }, fixer: { status: 'in_progress' } },
+ onClick: () => alert( 'In progress fixer callback triggered' ), // eslint-disable-line no-alert
+};
+
+export const StaleFixer = args =>
;
+StaleFixer.args = {
+ threat: {
+ fixable: { fixer: 'update' },
+ fixer: { status: 'in_progress', lastUpdated: new Date( '1999-01-01' ).toISOString() },
+ },
+ onClick: () => alert( 'Stale fixer callback triggered.' ), // eslint-disable-line no-alert
+};
+
+export const ErrorFixer = args =>
;
+ErrorFixer.args = {
+ threat: { fixable: { fixer: 'update' }, fixer: { error: 'error' } },
+ onClick: () => alert( 'Error fixer callback triggered.' ), // eslint-disable-line no-alert
};
diff --git a/projects/js-packages/components/components/threat-fixer-button/styles.module.scss b/projects/js-packages/components/components/threat-fixer-button/styles.module.scss
index 071761daff049..ec490b100f8a9 100644
--- a/projects/js-packages/components/components/threat-fixer-button/styles.module.scss
+++ b/projects/js-packages/components/components/threat-fixer-button/styles.module.scss
@@ -7,3 +7,10 @@
box-shadow: none;
}
}
+
+.tooltip {
+ margin-top: var( --spacing-base ) ;
+ max-width: 240px;
+ border-radius: 4px;
+ text-align: left;
+}
diff --git a/projects/js-packages/components/components/threats-data-views/index.tsx b/projects/js-packages/components/components/threats-data-views/index.tsx
index f141f223c07dc..aec1f1c3086a6 100644
--- a/projects/js-packages/components/components/threats-data-views/index.tsx
+++ b/projects/js-packages/components/components/threats-data-views/index.tsx
@@ -385,7 +385,7 @@ export default function ThreatsDataViews( {
? [
{
id: THREAT_FIELD_AUTO_FIX,
- label: __( 'Auto-Fix', 'jetpack' ),
+ label: __( 'Auto-fix', 'jetpack' ),
enableHiding: false,
elements: [
{
@@ -426,7 +426,7 @@ export default function ThreatsDataViews( {
if ( dataFields.includes( 'fixable' ) ) {
result.push( {
id: THREAT_ACTION_FIX,
- label: __( 'Auto-Fix', 'jetpack' ),
+ label: __( 'Auto-fix', 'jetpack' ),
isPrimary: true,
supportsBulk: true,
callback: onFixThreats,
diff --git a/projects/js-packages/components/components/threats-data-views/stories/index.stories.tsx b/projects/js-packages/components/components/threats-data-views/stories/index.stories.tsx
index 46ca286e1d13e..52afdded5ad24 100644
--- a/projects/js-packages/components/components/threats-data-views/stories/index.stories.tsx
+++ b/projects/js-packages/components/components/threats-data-views/stories/index.stories.tsx
@@ -30,7 +30,7 @@ Default.args = {
firstDetected: '2024-10-07T20:45:06.000Z',
fixedIn: null,
severity: 8,
- fixable: { fixer: 'rollback', target: 'January 26, 2024, 6:49 am', extensionStatus: '' },
+ fixable: { fixer: 'delete' },
fixer: { status: 'not_started' },
status: 'current',
filename: '/var/www/html/wp-content/index.php',
@@ -268,7 +268,7 @@ FixerStatuses.args = {
},
],
onFixThreats: () =>
- alert( 'Threat fix action callback triggered! This is handled by the component consumer.' ), // eslint-disable-line no-alert
+ alert( 'Fix threat action callback triggered! This is handled by the component consumer.' ), // eslint-disable-line no-alert
onIgnoreThreats: () =>
alert( 'Ignore threat action callback triggered! This is handled by the component consumer.' ), // eslint-disable-line no-alert
onUnignoreThreats: () =>
diff --git a/projects/js-packages/components/package.json b/projects/js-packages/components/package.json
index b72b16fac82ba..e7c140d4ccdf2 100644
--- a/projects/js-packages/components/package.json
+++ b/projects/js-packages/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
- "version": "0.59.0",
+ "version": "0.60.0",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
diff --git a/projects/js-packages/config/CHANGELOG.md b/projects/js-packages/config/CHANGELOG.md
index 7254514cbcdfc..78ee69440f057 100644
--- a/projects/js-packages/config/CHANGELOG.md
+++ b/projects/js-packages/config/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.1.27] - 2024-11-14
+### Changed
+- Update dependencies.
+
## [0.1.26] - 2024-11-04
### Added
- Enable test coverage. [#39961]
@@ -108,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- fixed and improved README
+[0.1.27]: https://github.com/Automattic/jetpack-config-js/compare/v0.1.26...v0.1.27
[0.1.26]: https://github.com/Automattic/jetpack-config-js/compare/v0.1.25...v0.1.26
[0.1.25]: https://github.com/Automattic/jetpack-config-js/compare/v0.1.24...v0.1.25
[0.1.24]: https://github.com/Automattic/jetpack-config-js/compare/v0.1.23...v0.1.24
diff --git a/projects/js-packages/config/package.json b/projects/js-packages/config/package.json
index 4cd11140b0056..efdac3ed4fdf9 100644
--- a/projects/js-packages/config/package.json
+++ b/projects/js-packages/config/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-config",
- "version": "0.1.26",
+ "version": "0.1.27",
"description": "Handles Jetpack global configuration shared across all packages",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/config/#readme",
"bugs": {
diff --git a/projects/js-packages/connection/CHANGELOG.md b/projects/js-packages/connection/CHANGELOG.md
index d0c9fa80f651e..ae3f00b71ad7d 100644
--- a/projects/js-packages/connection/CHANGELOG.md
+++ b/projects/js-packages/connection/CHANGELOG.md
@@ -2,6 +2,10 @@
### This is a list detailing changes for the Jetpack RNA Connection Component releases.
+## [0.35.17] - 2024-11-14
+### Changed
+- Update dependencies.
+
## [0.35.16] - 2024-11-11
### Changed
- Updated package dependencies. [#39999]
@@ -888,6 +892,7 @@
- `Main` and `ConnectUser` components added.
- `JetpackRestApiClient` API client added.
+[0.35.17]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.16...v0.35.17
[0.35.16]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.15...v0.35.16
[0.35.15]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.14...v0.35.15
[0.35.14]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.13...v0.35.14
diff --git a/projects/js-packages/connection/package.json b/projects/js-packages/connection/package.json
index 4f5ab6b6a9595..11f5abc8d61f3 100644
--- a/projects/js-packages/connection/package.json
+++ b/projects/js-packages/connection/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-connection",
- "version": "0.35.16",
+ "version": "0.35.17",
"description": "Jetpack Connection Component",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
"bugs": {
diff --git a/projects/js-packages/i18n-check-webpack-plugin/CHANGELOG.md b/projects/js-packages/i18n-check-webpack-plugin/CHANGELOG.md
index f9e0a7da5833a..9441d330c9b52 100644
--- a/projects/js-packages/i18n-check-webpack-plugin/CHANGELOG.md
+++ b/projects/js-packages/i18n-check-webpack-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.1.15] - 2024-11-14
+### Changed
+- Update dependencies.
+
## [1.1.14] - 2024-11-11
### Changed
- Updated package dependencies. [#40060]
@@ -230,6 +234,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release.
+[1.1.15]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.1.14...v1.1.15
[1.1.14]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.1.13...v1.1.14
[1.1.13]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.1.12...v1.1.13
[1.1.12]: https://github.com/Automattic/i18n-check-webpack-plugin/compare/v1.1.11...v1.1.12
diff --git a/projects/js-packages/i18n-check-webpack-plugin/package.json b/projects/js-packages/i18n-check-webpack-plugin/package.json
index e21a22ce22310..553257d5acfc9 100644
--- a/projects/js-packages/i18n-check-webpack-plugin/package.json
+++ b/projects/js-packages/i18n-check-webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/i18n-check-webpack-plugin",
- "version": "1.1.14",
+ "version": "1.1.15",
"description": "A Webpack plugin to check that WordPress i18n hasn't been mangled by Webpack optimizations.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/i18n-check-webpack-plugin/#readme",
"bugs": {
diff --git a/projects/js-packages/i18n-loader-webpack-plugin/CHANGELOG.md b/projects/js-packages/i18n-loader-webpack-plugin/CHANGELOG.md
index 7375df5d42593..c0e4b03790200 100644
--- a/projects/js-packages/i18n-loader-webpack-plugin/CHANGELOG.md
+++ b/projects/js-packages/i18n-loader-webpack-plugin/CHANGELOG.md
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [2.0.63] - 2024-11-14
+### Changed
+- Update dependencies.
+
## [2.0.62] - 2024-11-11
### Changed
- Updated package dependencies. [#39999]
@@ -277,6 +281,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release.
+[2.0.63]: https://github.com/Automattic/i18n-loader-webpack-plugin/compare/v2.0.62...v2.0.63
[2.0.62]: https://github.com/Automattic/i18n-loader-webpack-plugin/compare/v2.0.61...v2.0.62
[2.0.61]: https://github.com/Automattic/i18n-loader-webpack-plugin/compare/v2.0.60...v2.0.61
[2.0.60]: https://github.com/Automattic/i18n-loader-webpack-plugin/compare/v2.0.59...v2.0.60
diff --git a/projects/js-packages/i18n-loader-webpack-plugin/package.json b/projects/js-packages/i18n-loader-webpack-plugin/package.json
index d79ab672c93fd..08d150ec39041 100644
--- a/projects/js-packages/i18n-loader-webpack-plugin/package.json
+++ b/projects/js-packages/i18n-loader-webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/i18n-loader-webpack-plugin",
- "version": "2.0.62",
+ "version": "2.0.63",
"description": "A Webpack plugin to load WordPress i18n when Webpack lazy-loads a bundle.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/i18n-loader-webpack-plugin/#readme",
"bugs": {
diff --git a/projects/js-packages/idc/CHANGELOG.md b/projects/js-packages/idc/CHANGELOG.md
index c63961a7398c5..db9e166357f80 100644
--- a/projects/js-packages/idc/CHANGELOG.md
+++ b/projects/js-packages/idc/CHANGELOG.md
@@ -2,6 +2,10 @@
### This is a list detailing changes for the Jetpack RNA IDC package releases.
+## 0.11.19 - 2024-11-14
+### Changed
+- Update dependencies.
+
## 0.11.18 - 2024-11-11
### Changed
- Updated package dependencies. [#39999]
diff --git a/projects/js-packages/idc/package.json b/projects/js-packages/idc/package.json
index 2e9b612a7ebbf..f63f0920c6b8c 100644
--- a/projects/js-packages/idc/package.json
+++ b/projects/js-packages/idc/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-idc",
- "version": "0.11.18",
+ "version": "0.11.19",
"description": "Jetpack Connection Component",
"author": "Automattic",
"license": "GPL-2.0-or-later",
diff --git a/projects/js-packages/licensing/CHANGELOG.md b/projects/js-packages/licensing/CHANGELOG.md
index b014326d742ae..ba79474509581 100644
--- a/projects/js-packages/licensing/CHANGELOG.md
+++ b/projects/js-packages/licensing/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.13.8 - 2024-11-14
+### Changed
+- Update dependencies. [#37982]
+
## 0.13.7 - 2024-11-11
### Changed
- Updated package dependencies. [#39999] [#40060]
diff --git a/projects/js-packages/licensing/package.json b/projects/js-packages/licensing/package.json
index 33379ac2ee663..c0d45340659a8 100644
--- a/projects/js-packages/licensing/package.json
+++ b/projects/js-packages/licensing/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-licensing",
- "version": "0.13.7",
+ "version": "0.13.8",
"description": "Jetpack licensing flow",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/licensing/#readme",
"bugs": {
diff --git a/projects/plugins/migration/changelog/update-migrate-stats-counts-to-tanstack b/projects/js-packages/partner-coupon/changelog/force-a-release
similarity index 56%
rename from projects/plugins/migration/changelog/update-migrate-stats-counts-to-tanstack
rename to projects/js-packages/partner-coupon/changelog/force-a-release
index 8ae51dc5244cb..d4ad6c7cc3379 100644
--- a/projects/plugins/migration/changelog/update-migrate-stats-counts-to-tanstack
+++ b/projects/js-packages/partner-coupon/changelog/force-a-release
@@ -1,5 +1,4 @@
Significance: patch
Type: changed
-Comment: Update lockfiles
-
+Update dependencies.
diff --git a/projects/plugins/migration/changelog/update-stable-tags-vaultpress-migration b/projects/js-packages/react-data-sync-client/changelog/force-a-release
similarity index 55%
rename from projects/plugins/migration/changelog/update-stable-tags-vaultpress-migration
rename to projects/js-packages/react-data-sync-client/changelog/force-a-release
index 27b9b851f4e2a..d4ad6c7cc3379 100644
--- a/projects/plugins/migration/changelog/update-stable-tags-vaultpress-migration
+++ b/projects/js-packages/react-data-sync-client/changelog/force-a-release
@@ -1,5 +1,4 @@
Significance: patch
Type: changed
-Comment: Update stable tag
-
+Update dependencies.
diff --git a/projects/js-packages/remove-asset-webpack-plugin/changelog/force-a-release b/projects/js-packages/remove-asset-webpack-plugin/changelog/force-a-release
new file mode 100644
index 0000000000000..d4ad6c7cc3379
--- /dev/null
+++ b/projects/js-packages/remove-asset-webpack-plugin/changelog/force-a-release
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Update dependencies.
diff --git a/projects/js-packages/scan/CHANGELOG.md b/projects/js-packages/scan/CHANGELOG.md
index 0d3f00c37502b..a82ade642e116 100644
--- a/projects/js-packages/scan/CHANGELOG.md
+++ b/projects/js-packages/scan/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.0] - 2024-11-14
+### Added
+- Adds fixer utility functions [#40111]
+
## 0.1.0 - 2024-11-11
### Added
- Added threat and fixer types. [#39754]
@@ -52,3 +56,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- Updated dependencies. [#39754]
+
+[0.2.0]: https://github.com/Automattic/jetpack-scan/compare/v0.1.0...v0.2.0
diff --git a/projects/js-packages/scan/package.json b/projects/js-packages/scan/package.json
index feaf8f62a9cfa..1d90bc53bfa80 100644
--- a/projects/js-packages/scan/package.json
+++ b/projects/js-packages/scan/package.json
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@automattic/jetpack-scan",
- "version": "0.1.0",
+ "version": "0.2.0",
"description": "A JS client for consuming Jetpack Scan services",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/scan/#readme",
"bugs": {
diff --git a/projects/js-packages/scan/src/utils/index.ts b/projects/js-packages/scan/src/utils/index.ts
index 1c727460eff03..be4fe59047694 100644
--- a/projects/js-packages/scan/src/utils/index.ts
+++ b/projects/js-packages/scan/src/utils/index.ts
@@ -20,10 +20,18 @@ export const fixerTimestampIsStale = ( lastUpdatedTimestamp: string ) => {
return now.getTime() - lastUpdated.getTime() >= FIXER_IS_STALE_THRESHOLD;
};
+export const fixerIsInError = ( fixerStatus: ThreatFixStatus ) => {
+ return 'error' in fixerStatus && fixerStatus.error;
+};
+
+export const fixerIsInProgress = ( fixerStatus: ThreatFixStatus ) => {
+ return 'status' in fixerStatus && fixerStatus.status === 'in_progress';
+};
+
export const fixerStatusIsStale = ( fixerStatus: ThreatFixStatus ) => {
return (
- 'status' in fixerStatus &&
- fixerStatus.status === 'in_progress' &&
+ fixerIsInProgress( fixerStatus ) &&
+ 'lastUpdated' in fixerStatus &&
fixerTimestampIsStale( fixerStatus.lastUpdated )
);
};
diff --git a/projects/js-packages/script-data/CHANGELOG.md b/projects/js-packages/script-data/CHANGELOG.md
index 68df05d4debd7..085cf8745d76f 100644
--- a/projects/js-packages/script-data/CHANGELOG.md
+++ b/projects/js-packages/script-data/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.1.5] - 2024-11-14
+### Changed
+- Update dependencies.
+
## [0.1.4] - 2024-11-11
### Changed
- Added suffix to site data [#40032]
@@ -25,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added jetpack-script-data package to consolidate the logic for Jetpack Initial state [#38430]
+[0.1.5]: https://github.com/Automattic/jetpack-script-data/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/Automattic/jetpack-script-data/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/Automattic/jetpack-script-data/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/Automattic/jetpack-script-data/compare/v0.1.1...v0.1.2
diff --git a/projects/js-packages/script-data/package.json b/projects/js-packages/script-data/package.json
index b791de004b483..e4392315a29b1 100644
--- a/projects/js-packages/script-data/package.json
+++ b/projects/js-packages/script-data/package.json
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-script-data",
- "version": "0.1.4",
+ "version": "0.1.5",
"description": "A library to provide data for script handles and the corresponding utility functions for Jetpack.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/script-data/#readme",
"bugs": {
diff --git a/projects/js-packages/shared-extension-utils/changelog/force-a-release b/projects/js-packages/shared-extension-utils/changelog/force-a-release
new file mode 100644
index 0000000000000..d4ad6c7cc3379
--- /dev/null
+++ b/projects/js-packages/shared-extension-utils/changelog/force-a-release
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Update dependencies.
diff --git a/projects/js-packages/social-logos/CHANGELOG.md b/projects/js-packages/social-logos/CHANGELOG.md
index a7968893c30c0..5f729ce25d8dd 100644
--- a/projects/js-packages/social-logos/CHANGELOG.md
+++ b/projects/js-packages/social-logos/CHANGELOG.md
@@ -1,3 +1,7 @@
+## [3.1.12] - 2024-11-14
+### Changed
+- Update dependencies.
+
## [3.1.11] - 2024-11-11
### Added
- Added post-build tests. [#38224]
@@ -168,6 +172,7 @@
- Build: Refactored (aligned build system with Gridicons).
+[3.1.12]: https://github.com/Automattic/social-logos/compare/v3.1.11...v3.1.12
[3.1.11]: https://github.com/Automattic/social-logos/compare/v3.1.10...v3.1.11
[3.1.10]: https://github.com/Automattic/social-logos/compare/v3.1.9...v3.1.10
[3.1.9]: https://github.com/Automattic/social-logos/compare/v3.1.8...v3.1.9
diff --git a/projects/js-packages/social-logos/package.json b/projects/js-packages/social-logos/package.json
index 65b66f2047edd..8557caea08980 100644
--- a/projects/js-packages/social-logos/package.json
+++ b/projects/js-packages/social-logos/package.json
@@ -1,6 +1,6 @@
{
"name": "social-logos",
- "version": "3.1.11",
+ "version": "3.1.12",
"description": "A repository of all the social logos used on WordPress.com.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/social-logos/",
"bugs": {
diff --git a/projects/js-packages/webpack-config/CHANGELOG.md b/projects/js-packages/webpack-config/CHANGELOG.md
index 34afd641469cc..4ff1b241578db 100644
--- a/projects/js-packages/webpack-config/CHANGELOG.md
+++ b/projects/js-packages/webpack-config/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).
+## 3.5.2 - 2024-11-14
+### Changed
+- Update dependencies.
+
## 3.5.1 - 2024-11-11
### Changed
- Updated package dependencies. [#39999]
diff --git a/projects/js-packages/webpack-config/package.json b/projects/js-packages/webpack-config/package.json
index c5aa6138430e9..3f69859aabbad 100644
--- a/projects/js-packages/webpack-config/package.json
+++ b/projects/js-packages/webpack-config/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-webpack-config",
- "version": "3.5.1",
+ "version": "3.5.2",
"description": "Library of pieces for webpack config in Jetpack projects.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/webpack-config/#readme",
"bugs": {
diff --git a/projects/packages/a8c-mc-stats/CHANGELOG.md b/projects/packages/a8c-mc-stats/CHANGELOG.md
index 70575f5dc6040..09472b5616460 100644
--- a/projects/packages/a8c-mc-stats/CHANGELOG.md
+++ b/projects/packages/a8c-mc-stats/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).
+## [3.0.0] - 2024-11-14
+### Removed
+- General: Update minimum PHP version to 7.2. [#40147]
+
## [2.0.4] - 2024-11-04
### Added
- Enable test coverage. [#39961]
@@ -147,6 +151,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Creates the MC Stats package
+[3.0.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.4...v3.0.0
[2.0.4]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.3...v2.0.4
[2.0.3]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.1...v2.0.2
diff --git a/projects/packages/a8c-mc-stats/composer.json b/projects/packages/a8c-mc-stats/composer.json
index 0fbedf48ad2aa..dd799eaead555 100644
--- a/projects/packages/a8c-mc-stats/composer.json
+++ b/projects/packages/a8c-mc-stats/composer.json
@@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
- "php": ">=7.0"
+ "php": ">=7.2"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
@@ -47,7 +47,7 @@
"link-template": "https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "2.0.x-dev"
+ "dev-trunk": "3.0.x-dev"
}
}
}
diff --git a/projects/packages/admin-ui/CHANGELOG.md b/projects/packages/admin-ui/CHANGELOG.md
index 049d9595fd0a3..50ba8ec255339 100644
--- a/projects/packages/admin-ui/CHANGELOG.md
+++ b/projects/packages/admin-ui/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.5.0] - 2024-11-14
+### Removed
+- General: Update minimum PHP version to 7.2. [#40147]
+
## [0.4.6] - 2024-11-04
### Added
- Enable test coverage. [#39961]
@@ -164,6 +168,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixing menu visibility issues.
+[0.5.0]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.6...0.5.0
[0.4.6]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.5...0.4.6
[0.4.5]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.4...0.4.5
[0.4.4]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.3...0.4.4
diff --git a/projects/packages/admin-ui/composer.json b/projects/packages/admin-ui/composer.json
index 63caa0fe2cc9e..0d6827c29f080 100644
--- a/projects/packages/admin-ui/composer.json
+++ b/projects/packages/admin-ui/composer.json
@@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
- "php": ">=7.0"
+ "php": ">=7.2"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
@@ -52,7 +52,7 @@
"link-template": "https://github.com/Automattic/jetpack-admin-ui/compare/${old}...${new}"
},
"branch-alias": {
- "dev-trunk": "0.4.x-dev"
+ "dev-trunk": "0.5.x-dev"
},
"version-constants": {
"::PACKAGE_VERSION": "src/class-admin-menu.php"
diff --git a/projects/packages/admin-ui/package.json b/projects/packages/admin-ui/package.json
index 4ed9dcd2d4d74..31634692f1f95 100644
--- a/projects/packages/admin-ui/package.json
+++ b/projects/packages/admin-ui/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-admin-ui",
- "version": "0.4.6",
+ "version": "0.5.0",
"description": "Generic Jetpack wp-admin UI elements",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/admin-ui/#readme",
"bugs": {
diff --git a/projects/packages/admin-ui/src/class-admin-menu.php b/projects/packages/admin-ui/src/class-admin-menu.php
index f385ac42d37bb..6fccdb12187ea 100644
--- a/projects/packages/admin-ui/src/class-admin-menu.php
+++ b/projects/packages/admin-ui/src/class-admin-menu.php
@@ -13,7 +13,7 @@
*/
class Admin_Menu {
- const PACKAGE_VERSION = '0.4.6';
+ const PACKAGE_VERSION = '0.5.0';
/**
* Whether this class has been initialized
diff --git a/projects/packages/analyzer/changelog/update-bump_min_php_to_7.2 b/projects/packages/analyzer/changelog/update-bump_min_php_to_7.2
new file mode 100644
index 0000000000000..712ab5f494aaa
--- /dev/null
+++ b/projects/packages/analyzer/changelog/update-bump_min_php_to_7.2
@@ -0,0 +1,4 @@
+Significance: major
+Type: removed
+
+General: Update minimum PHP version to 7.2.
diff --git a/projects/packages/analyzer/composer.json b/projects/packages/analyzer/composer.json
index 1478edbe4c422..025c69c8ecb13 100644
--- a/projects/packages/analyzer/composer.json
+++ b/projects/packages/analyzer/composer.json
@@ -8,7 +8,7 @@
"static analysis"
],
"require": {
- "php": ">=7.0",
+ "php": ">=7.2",
"nikic/php-parser": "4.13.2"
},
"require-dev": {
diff --git a/projects/packages/assets/CHANGELOG.md b/projects/packages/assets/CHANGELOG.md
index a15ad50a2f37e..6c3fd3a68b2f8 100644
--- a/projects/packages/assets/CHANGELOG.md
+++ b/projects/packages/assets/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).
+## [3.0.0] - 2024-11-14
+### Removed
+- General: Update minimum PHP version to 7.2. [#40147]
+
## [2.3.14] - 2024-11-11
### Changed
- Updated package dependencies. [#39999]
@@ -525,6 +529,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Statically access asset tools
+[3.0.0]: https://github.com/Automattic/jetpack-assets/compare/v2.3.14...v3.0.0
[2.3.14]: https://github.com/Automattic/jetpack-assets/compare/v2.3.13...v2.3.14
[2.3.13]: https://github.com/Automattic/jetpack-assets/compare/v2.3.12...v2.3.13
[2.3.12]: https://github.com/Automattic/jetpack-assets/compare/v2.3.11...v2.3.12
diff --git a/projects/packages/assets/composer.json b/projects/packages/assets/composer.json
index d7d0211082f31..1908880c06d29 100644
--- a/projects/packages/assets/composer.json
+++ b/projects/packages/assets/composer.json
@@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
- "php": ">=7.0",
+ "php": ">=7.2",
"automattic/jetpack-constants": "@dev"
},
"require-dev": {
@@ -34,10 +34,7 @@
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
],
- "test-coverage": [
- "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"",
- "pnpm run test-coverage"
- ],
+ "test-coverage": "pnpm concurrently --names php,js 'php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"' 'pnpm:test-coverage'",
"test-js": [
"pnpm run test"
],
@@ -64,7 +61,7 @@
"link-template": "https://github.com/Automattic/jetpack-assets/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "2.3.x-dev"
+ "dev-trunk": "3.0.x-dev"
}
}
}
diff --git a/projects/packages/assets/package.json b/projects/packages/assets/package.json
index 56f7f5879ff8c..7acbd97685190 100644
--- a/projects/packages/assets/package.json
+++ b/projects/packages/assets/package.json
@@ -18,6 +18,7 @@
"devDependencies": {
"@automattic/jetpack-webpack-config": "workspace:*",
"@wordpress/browserslist-config": "6.11.0",
+ "concurrently": "7.6.0",
"jest": "29.7.0",
"md5-es": "1.8.2",
"webpack": "5.94.0",
diff --git a/projects/packages/assets/tests/php/test-assets.php b/projects/packages/assets/tests/php/test-assets.php
index 426fea7dc6cb0..a05ef64ad4b2a 100644
--- a/projects/packages/assets/tests/php/test-assets.php
+++ b/projects/packages/assets/tests/php/test-assets.php
@@ -343,9 +343,8 @@ public function test_register_script( $args, $expect, $extra = array() ) {
$this->expectExceptionMessage( $extra['exception']->getMessage() );
}
if ( isset( $extra['enqueue'] ) ) {
- // @phan-suppress-next-line PhanDeprecatedFunction -- Keep using setMethods until we drop PHP 7.0 support.
$obj = $this->getMockBuilder( \stdClass::class )
- ->setMethods( array( 'get_data' ) )
+ ->addMethods( array( 'get_data' ) )
->getMock();
$obj->method( 'get_data' )->with( ...$extra['enqueue'][0] )->willReturn( $extra['enqueue'][1] );
Functions\expect( 'wp_scripts' )->andReturn( $obj );
@@ -727,9 +726,8 @@ function ( $v ) {
$obj->andReturn( $options['filter'] );
}
- // @phan-suppress-next-line PhanDeprecatedFunction -- Keep using setMethods until we drop PHP 7.0 support.
$mock = $this->getMockBuilder( \stdClass::class )
- ->setMethods( array( 'add', 'add_inline_script', 'add_data' ) )
+ ->addMethods( array( 'add', 'add_inline_script', 'add_data' ) )
->getMock();
// Unfortunately PHPUnit deprecated withConsecutive with no replacement, so we have to roll our own version.
diff --git a/projects/packages/autoloader/CHANGELOG.md b/projects/packages/autoloader/CHANGELOG.md
index fac9e275722b0..670665ffc1345 100644
--- a/projects/packages/autoloader/CHANGELOG.md
+++ b/projects/packages/autoloader/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).
+## [4.0.0] - 2024-11-14
+### Removed
+- General: Update minimum PHP version to 7.2. [#40147]
+
## [3.1.3] - 2024-11-04
### Added
- Enable test coverage. [#39961]
@@ -389,6 +393,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add Custom Autoloader
+[4.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.3...v4.0.0
[3.1.3]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.2...v3.1.3
[3.1.2]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.1...v3.1.2
[3.1.1]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.0...v3.1.1
diff --git a/projects/packages/autoloader/composer.json b/projects/packages/autoloader/composer.json
index e4deacf03eee0..585c3de34be41 100644
--- a/projects/packages/autoloader/composer.json
+++ b/projects/packages/autoloader/composer.json
@@ -12,7 +12,7 @@
"wordpress"
],
"require": {
- "php": ">=7.0",
+ "php": ">=7.2",
"composer-plugin-api": "^1.1 || ^2.0"
},
"require-dev": {
@@ -62,7 +62,7 @@
"::VERSION": "src/AutoloadGenerator.php"
},
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "4.0.x-dev"
}
}
}
diff --git a/projects/packages/autoloader/src/AutoloadGenerator.php b/projects/packages/autoloader/src/AutoloadGenerator.php
index 9558a9c0bd2ea..af48a3762a91c 100644
--- a/projects/packages/autoloader/src/AutoloadGenerator.php
+++ b/projects/packages/autoloader/src/AutoloadGenerator.php
@@ -21,7 +21,7 @@
*/
class AutoloadGenerator {
- const VERSION = '3.1.3';
+ const VERSION = '4.0.0';
/**
* IO object.
diff --git a/projects/packages/autoloader/tests/php/tests/unit/PHPAutoloaderTest.php b/projects/packages/autoloader/tests/php/tests/unit/PHPAutoloaderTest.php
index 73d73faf2f4e3..1a73144fc6793 100644
--- a/projects/packages/autoloader/tests/php/tests/unit/PHPAutoloaderTest.php
+++ b/projects/packages/autoloader/tests/php/tests/unit/PHPAutoloaderTest.php
@@ -70,10 +70,9 @@ public function test_unregister_autoloader() {
* Tests that class files are loaded correctly.
*/
public function test_load_class() {
- // @phan-suppress-next-line PhanDeprecatedFunction -- Keep using setMethods until we drop PHP 7.0 support.
$loader = $this->getMockBuilder( Version_Loader::class )
->disableOriginalConstructor()
- ->setMethods( array( 'find_class_file' ) )
+ ->onlyMethods( array( 'find_class_file' ) )
->getMock();
global $jetpack_autoloader_loader;
@@ -91,10 +90,9 @@ public function test_load_class() {
* Tests that nothing happens when a class file isn't found.
*/
public function test_load_class_does_nothing_without_class() {
- // @phan-suppress-next-line PhanDeprecatedFunction -- Keep using setMethods until we drop PHP 7.0 support.
$loader = $this->getMockBuilder( Version_Loader::class )
->disableOriginalConstructor()
- ->setMethods( array( 'find_class_file' ) )
+ ->onlyMethods( array( 'find_class_file' ) )
->getMock();
global $jetpack_autoloader_loader;
diff --git a/projects/packages/backup-helper-script-manager/CHANGELOG.md b/projects/packages/backup-helper-script-manager/CHANGELOG.md
index 46886231ebe0a..2b3a02183ef50 100644
--- a/projects/packages/backup-helper-script-manager/CHANGELOG.md
+++ b/projects/packages/backup-helper-script-manager/CHANGELOG.md
@@ -5,6 +5,13 @@ 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.3.0] - 2024-11-14
+### Changed
+- Backup: added next daily backup schedule time on admin page [#39914]
+
+### Removed
+- General: Update minimum PHP version to 7.2. [#40147]
+
## [0.2.8] - 2024-11-04
### Added
- Enable test coverage. [#39961]
@@ -45,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Initial release (improved helper script installer logging). [#34297]
+[0.3.0]: https://github.com/Automattic/jetpack-backup-helper-script-manager/compare/v0.2.8...v0.3.0
[0.2.8]: https://github.com/Automattic/jetpack-backup-helper-script-manager/compare/v0.2.7...v0.2.8
[0.2.7]: https://github.com/Automattic/jetpack-backup-helper-script-manager/compare/v0.2.6...v0.2.7
[0.2.6]: https://github.com/Automattic/jetpack-backup-helper-script-manager/compare/v0.2.5...v0.2.6
diff --git a/projects/packages/backup-helper-script-manager/composer.json b/projects/packages/backup-helper-script-manager/composer.json
index 45272dfe82812..44d9f578f8076 100644
--- a/projects/packages/backup-helper-script-manager/composer.json
+++ b/projects/packages/backup-helper-script-manager/composer.json
@@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
- "php": ">=7.0"
+ "php": ">=7.2"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
@@ -50,7 +50,7 @@
"link-template": "https://github.com/Automattic/jetpack-backup-helper-script-manager/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "0.2.x-dev"
+ "dev-trunk": "0.3.x-dev"
}
},
"config": {
diff --git a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php
index adab13b8167bb..9cd06aa577197 100644
--- a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php
+++ b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager-impl.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use Exception;
use WP_Error;
diff --git a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php
index 5833abaffb662..650f2e3c368d1 100644
--- a/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php
+++ b/projects/packages/backup-helper-script-manager/src/class-helper-script-manager.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
/**
* Manage installation, deletion and cleanup of Helper Scripts to assist with backing up Jetpack Sites.
diff --git a/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php b/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php
index 1f59694f4c487..2b14f255b0669 100644
--- a/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php
+++ b/projects/packages/backup-helper-script-manager/src/class-throw-on-errors.php
@@ -8,7 +8,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use Exception;
use Throwable;
diff --git a/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php b/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php
index 7165a52ec8cb5..da7e02fe30473 100644
--- a/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php
+++ b/projects/packages/backup-helper-script-manager/tests/php/test-class-helper-script-manager-impl.php
@@ -4,7 +4,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use Exception;
use WorDBless\BaseTestCase;
diff --git a/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php b/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php
index fa0482c4de1dc..080556272a798 100644
--- a/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php
+++ b/projects/packages/backup-helper-script-manager/tests/php/test-class-throw-on-errors.php
@@ -8,7 +8,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use Exception;
use PHPUnit\Framework\TestCase;
diff --git a/projects/packages/backup/CHANGELOG.md b/projects/packages/backup/CHANGELOG.md
index 1805b2b640be1..905ea8291fc7e 100644
--- a/projects/packages/backup/CHANGELOG.md
+++ b/projects/packages/backup/CHANGELOG.md
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [4.0.0] - 2024-11-14
+### Added
+- Backup: added next daily backup schedule time on admin page [#39914]
+
+### Removed
+- General: Update minimum PHP version to 7.2. [#40147]
+
## [3.4.17] - 2024-11-11
### Changed
- Updated package dependencies. [#39999] [#40060]
@@ -730,6 +737,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add API endpoints and Jetpack Backup package for managing Help…
+[4.0.0]: https://github.com/Automattic/jetpack-backup/compare/v3.4.17...v4.0.0
[3.4.17]: https://github.com/Automattic/jetpack-backup/compare/v3.4.16...v3.4.17
[3.4.16]: https://github.com/Automattic/jetpack-backup/compare/v3.4.15...v3.4.16
[3.4.15]: https://github.com/Automattic/jetpack-backup/compare/v3.4.14...v3.4.15
diff --git a/projects/packages/backup/actions.php b/projects/packages/backup/actions.php
index 9c5f041de4da0..7608526a2af53 100644
--- a/projects/packages/backup/actions.php
+++ b/projects/packages/backup/actions.php
@@ -23,10 +23,10 @@
}
// Clean up expired Helper Scripts from a scheduled event.
-$add_action( 'jetpack_backup_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
+$add_action( 'jetpack_backup_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0005\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) );
// Register REST routes.
-$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0004\\REST_Controller', 'register_rest_routes' ) );
+$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0005\\REST_Controller', 'register_rest_routes' ) );
// Set up package version hook.
$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Backup\\Package_Version::send_package_version_to_tracker' );
diff --git a/projects/packages/backup/composer.json b/projects/packages/backup/composer.json
index 66b8922f23d54..9b71d9ade289f 100644
--- a/projects/packages/backup/composer.json
+++ b/projects/packages/backup/composer.json
@@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
- "php": ">=7.0",
+ "php": ">=7.2",
"automattic/jetpack-assets": "@dev",
"automattic/jetpack-admin-ui": "@dev",
"automattic/jetpack-autoloader": "@dev",
@@ -36,10 +36,7 @@
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
],
- "test-coverage": [
- "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"",
- "pnpm run test-coverage"
- ],
+ "test-coverage": "pnpm concurrently --names php,js 'php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"' 'pnpm:test-coverage'",
"test-js": [
"pnpm run test"
],
@@ -81,7 +78,7 @@
"link-template": "https://github.com/Automattic/jetpack-backup/compare/v${old}...v${new}"
},
"branch-alias": {
- "dev-trunk": "3.4.x-dev"
+ "dev-trunk": "4.0.x-dev"
}
},
"config": {
diff --git a/projects/packages/backup/package.json b/projects/packages/backup/package.json
index 9ca9d21581b5c..c8d2abb35fac6 100644
--- a/projects/packages/backup/package.json
+++ b/projects/packages/backup/package.json
@@ -32,12 +32,14 @@
"@automattic/jetpack-api": "workspace:*",
"@automattic/jetpack-components": "workspace:*",
"@automattic/jetpack-connection": "workspace:*",
+ "@tanstack/react-query": "5.20.5",
"@wordpress/api-fetch": "7.11.0",
"@wordpress/components": "28.11.0",
"@wordpress/data": "10.11.0",
"@wordpress/date": "5.11.0",
"@wordpress/element": "6.11.0",
"@wordpress/i18n": "5.11.0",
+ "moment": "2.29.4",
"prop-types": "^15.8.1",
"react": "18.3.1",
"react-dom": "18.3.1"
@@ -51,12 +53,14 @@
"@testing-library/dom": "10.4.0",
"@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
+ "@types/react": "18.3.3",
"@wordpress/browserslist-config": "6.11.0",
"concurrently": "7.6.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"sass": "1.64.1",
"sass-loader": "12.4.0",
+ "typescript": "5.0.4",
"webpack": "5.94.0",
"webpack-cli": "4.9.1"
}
diff --git a/projects/packages/backup/src/class-initial-state.php b/projects/packages/backup/src/class-initial-state.php
index 164c291f6a1da..98a508472166f 100644
--- a/projects/packages/backup/src/class-initial-state.php
+++ b/projects/packages/backup/src/class-initial-state.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use Automattic\Jetpack\Connection\Plugin_Storage as Connection_Plugin_Storage;
use Automattic\Jetpack\Status;
diff --git a/projects/packages/backup/src/class-jetpack-backup-upgrades.php b/projects/packages/backup/src/class-jetpack-backup-upgrades.php
index eddf0ba54ec24..be18aede8284a 100644
--- a/projects/packages/backup/src/class-jetpack-backup-upgrades.php
+++ b/projects/packages/backup/src/class-jetpack-backup-upgrades.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use function get_option;
use function update_option;
diff --git a/projects/packages/backup/src/class-jetpack-backup.php b/projects/packages/backup/src/class-jetpack-backup.php
index b6e0fd3bafad7..3468d85ea7310 100644
--- a/projects/packages/backup/src/class-jetpack-backup.php
+++ b/projects/packages/backup/src/class-jetpack-backup.php
@@ -9,7 +9,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
if ( ! defined( 'ABSPATH' ) ) {
exit;
@@ -17,7 +17,7 @@
use Automattic\Jetpack\Admin_UI\Admin_Menu;
use Automattic\Jetpack\Assets;
-use Automattic\Jetpack\Backup\V0004\Initial_State as Backup_Initial_State;
+use Automattic\Jetpack\Backup\V0005\Initial_State as Backup_Initial_State;
use Automattic\Jetpack\Config;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Initial_State as Connection_Initial_State;
@@ -341,6 +341,17 @@ public static function register_rest_routes() {
)
);
+ // Get backup schedule time
+ register_rest_route(
+ 'jetpack/v4',
+ '/site/backup/schedule',
+ array(
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => __CLASS__ . '::get_site_backup_schedule_time',
+ 'permission_callback' => __CLASS__ . '::backups_permissions_callback',
+ )
+ );
+
// Get site policies
register_rest_route(
'jetpack/v4',
@@ -785,6 +796,31 @@ public static function enqueue_backup() {
);
}
+ /**
+ * Get site backup schedule time
+ *
+ * @return string|WP_Error A JSON object with the backup schedule time if the request was successful, or a WP_Error otherwise.
+ */
+ public static function get_site_backup_schedule_time() {
+ $blog_id = Jetpack_Options::get_option( 'id' );
+
+ $response = Client::wpcom_json_api_request_as_user(
+ '/sites/' . $blog_id . '/rewind/scheduled',
+ 'v2',
+ array(),
+ null,
+ 'wpcom'
+ );
+
+ if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
+ return null;
+ }
+
+ return rest_ensure_response(
+ json_decode( $response['body'], true )
+ );
+ }
+
/**
* Removes plugin from the connection manager
* If it's the last plugin using the connection, the site will be disconnected.
diff --git a/projects/packages/backup/src/class-package-version.php b/projects/packages/backup/src/class-package-version.php
index e042fab9d6683..d2bddba75fb5b 100644
--- a/projects/packages/backup/src/class-package-version.php
+++ b/projects/packages/backup/src/class-package-version.php
@@ -16,7 +16,7 @@
*/
class Package_Version {
- const PACKAGE_VERSION = '3.4.17';
+ const PACKAGE_VERSION = '4.0.0';
const PACKAGE_SLUG = 'backup';
diff --git a/projects/packages/backup/src/class-rest-controller.php b/projects/packages/backup/src/class-rest-controller.php
index f0b4f30d855e2..02494c943de7f 100644
--- a/projects/packages/backup/src/class-rest-controller.php
+++ b/projects/packages/backup/src/class-rest-controller.php
@@ -10,7 +10,7 @@
// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
// are installed, or in some other cases).
-namespace Automattic\Jetpack\Backup\V0004;
+namespace Automattic\Jetpack\Backup\V0005;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Connection\Rest_Authentication;
diff --git a/projects/packages/backup/src/js/components/Backups.js b/projects/packages/backup/src/js/components/Backups.js
index bfe641cdb4f18..37d091508c355 100644
--- a/projects/packages/backup/src/js/components/Backups.js
+++ b/projects/packages/backup/src/js/components/Backups.js
@@ -25,6 +25,7 @@ import PostsIcon from './icons/posts.svg';
import ThemesIcon from './icons/themes.svg';
import UploadsIcon from './icons/uploads.svg';
import WarningIcon from './icons/warning.svg';
+import NextScheduledBackup from './next-scheduled-backup';
/* eslint react/react-in-jsx-scope: 0 */
export const Backups = () => {
@@ -157,7 +158,8 @@ const CompleteBackup = ( { latestTime, stats } ) => {
/>
{ __( 'Latest Backup', 'jetpack-backup-pkg' ) }
-