diff --git a/.github/files/generate-ci-matrix.php b/.github/files/generate-ci-matrix.php index 78b7074022c0d..d7531e8eea9a0 100755 --- a/.github/files/generate-ci-matrix.php +++ b/.github/files/generate-ci-matrix.php @@ -59,7 +59,7 @@ $matrix = array(); // Add PHP tests. -foreach ( array( '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ) as $php ) { +foreach ( array( '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ) as $php ) { $matrix[] = array( 'name' => "PHP tests: PHP $php WP latest", 'script' => 'test-php', diff --git a/.github/renovate.json5 b/.github/renovate.json5 index c2876d7829b45..2d9b3c1d3e837 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,7 +3,7 @@ labels: [ '[Type] Janitorial', '[Status] Needs Review' ], prHourlyLimit: 1, timezone: 'UTC', - schedule: [ 'before 3am on the first day of the month' ], + schedule: [ '* 0-2 1 * *' ], updateNotScheduled: false, semanticCommits: 'disabled', osvVulnerabilityAlerts: true, @@ -20,6 +20,9 @@ '**/test/**', '**/tests/!(e2e)/**', '**/__fixtures__/**', + // Old unused wpcomsh stuff that we're only keeping temporarily until we figure out how to properly replace it. + '**/projects/plugins/wpcomsh/.circleci/**', + '**/projects/plugins/wpcomsh/.github/**', ], packageRules: [ @@ -145,7 +148,7 @@ lockFileMaintenance: { enabled: true, - schedule: [ 'before 3:00 am on Monday on the 7th through 13th day of the month' ], + schedule: [ '* 0-2 7-13 * 1' ], }, dependencyDashboardTitle: 'Renovate Dependency Updates', dependencyDashboardLabels: [ 'Primary Issue', '[Type] Janitorial' ], diff --git a/.github/versions.sh b/.github/versions.sh index 961c6a050765e..439fc660f8607 100644 --- a/.github/versions.sh +++ b/.github/versions.sh @@ -6,4 +6,4 @@ PNPM_VERSION=9.3.0 # Other useful version numbers. MIN_PHP_VERSION=7.2 -MAX_PHP_VERSION=8.3 +MAX_PHP_VERSION=8.4 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index df0f263673272..6321df91924af 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -171,7 +171,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: [ '7.2', '7.4', '8.0', '8.1', '8.2', '8.3' ] + php-versions: [ '7.2', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] experimental: [ false ] steps: diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index b74a02ec8a13a..38b934326a2fd 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -39,12 +39,12 @@ jobs: TOKEN: ${{ secrets.RENOVATE_TOKEN }} run: | curl --no-progress-meter --header "Authorization: Bearer $TOKEN" https://api.github.com/rate_limit - - uses: renovatebot/github-action@v40.1.5 + - uses: renovatebot/github-action@v41.0.3 with: configurationFile: /tmp/monorepo/.github/renovate-config.js token: ${{ secrets.RENOVATE_TOKEN }} mount-docker-socket: true - renovate-version: 38.57.3 + renovate-version: 39.22.0 env: LOG_LEVEL: ${{ github.event.inputs.logLevel || 'debug' }} RENOVATE_DRY_RUN: ${{ github.event.inputs.dryRun == 'no' && 'null' || github.event.inputs.dryRun || 'null' }} diff --git a/.phan/stubs/akismet-stubs.php b/.phan/stubs/akismet-stubs.php index eff107a09a85b..74b8062fe05be 100644 --- a/.phan/stubs/akismet-stubs.php +++ b/.phan/stubs/akismet-stubs.php @@ -1,11 +1,16 @@ =7.4", "phpcompatibility/phpcompatibility-wp": "^2.1", "sirbrillig/phpcs-variable-analysis": "^2.10", @@ -239,32 +239,32 @@ }, { "name": "automattic/vipwpcs", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd" + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/1b8960ebff9ea3eb482258a906ece4d1ee1e25fd", - "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8", + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "sirbrillig/phpcs-variable-analysis": "^2.11.17", - "squizlabs/php_codesniffer": "^3.7.2", - "wp-coding-standards/wpcs": "^3.0" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.11", + "sirbrillig/phpcs-variable-analysis": "^2.11.18", + "squizlabs/php_codesniffer": "^3.9.2", + "wp-coding-standards/wpcs": "^3.1.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9", "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7 || ^8 || ^9" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -289,20 +289,20 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2023-09-05T11:01:05+00:00" + "time": "2024-05-10T20:31:09+00:00" }, { "name": "composer/pcre", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { @@ -312,8 +312,8 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.11.10", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", "phpunit/phpunit": "^8 || ^9" }, "type": "library", @@ -352,7 +352,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.1" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -368,28 +368,28 @@ "type": "tidelift" } ], - "time": "2024-08-27T18:44:43+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -433,7 +433,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -449,7 +449,7 @@ "type": "tidelift" } ], - "time": "2024-07-12T11:35:52+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/spdx-licenses", @@ -769,29 +769,30 @@ }, { "name": "mediawiki/mediawiki-codesniffer", - "version": "v44.0.0", + "version": "v45.0.0", "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-tools-codesniffer.git", - "reference": "86c56877214ad5216a0d1c6c0d3a9c72edce4c08" + "reference": "3ebb209514384d68ba52f16c26ba192a9027442d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-tools-codesniffer/zipball/86c56877214ad5216a0d1c6c0d3a9c72edce4c08", - "reference": "86c56877214ad5216a0d1c6c0d3a9c72edce4c08", + "url": "https://api.github.com/repos/wikimedia/mediawiki-tools-codesniffer/zipball/3ebb209514384d68ba52f16c26ba192a9027442d", + "reference": "3ebb209514384d68ba52f16c26ba192a9027442d", "shasum": "" }, "require": { - "composer/semver": "3.3.2 || 3.4.0 || 3.4.2", + "composer/semver": "3.4.2 || 3.4.3", "composer/spdx-licenses": "~1.5.2", "ext-json": "*", "ext-mbstring": "*", "php": ">=7.4.0", "phpcsstandards/phpcsextra": "1.2.1", - "squizlabs/php_codesniffer": "3.9.0", + "squizlabs/php_codesniffer": "3.10.3", "symfony/polyfill-php80": "^1.26.0" }, "require-dev": { + "ext-dom": "*", "mediawiki/mediawiki-phan-config": "0.14.0", "mediawiki/minus-x": "1.1.3", "php-parallel-lint/php-console-highlighter": "1.0.0", @@ -816,9 +817,9 @@ "mediawiki" ], "support": { - "source": "https://github.com/wikimedia/mediawiki-tools-codesniffer/tree/v44.0.0" + "source": "https://github.com/wikimedia/mediawiki-tools-codesniffer/tree/v45.0.0" }, - "time": "2024-08-10T11:11:32+00:00" + "time": "2024-10-29T17:38:15+00:00" }, { "name": "microsoft/tolerant-php-parser", @@ -1517,22 +1518,22 @@ }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.11", + "version": "1.0.12", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "c457da9dabb60eb7106dd5e3c05132b1a6539c6a" + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c457da9dabb60eb7106dd5e3c05132b1a6539c6a", - "reference": "c457da9dabb60eb7106dd5e3c05132b1a6539c6a", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.9.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", @@ -1601,7 +1602,7 @@ "type": "open_collective" } ], - "time": "2024-04-24T11:47:18+00:00" + "time": "2024-05-20T13:34:27+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1658,16 +1659,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.5.1", + "version": "5.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f" + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/0c70d2c566e899666f367ab7b80986beb3581e6f", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", "shasum": "" }, "require": { @@ -1676,7 +1677,7 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { @@ -1716,9 +1717,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.5.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" }, - "time": "2024-11-06T11:58:54+00:00" + "time": "2024-11-12T11:25:25+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1780,30 +1781,30 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -1821,9 +1822,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "psr/container", @@ -2108,16 +2109,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/Automattic/PHP_CodeSniffer", - "reference": "0ba28e73a426e908c0e910edc3924848ed263c56" + "reference": "003b725471d9b59e4654eb338fabb0bd12d24b0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/PHP_CodeSniffer/zipball/0ba28e73a426e908c0e910edc3924848ed263c56", - "reference": "0ba28e73a426e908c0e910edc3924848ed263c56", + "url": "https://api.github.com/repos/Automattic/PHP_CodeSniffer/zipball/003b725471d9b59e4654eb338fabb0bd12d24b0f", + "reference": "003b725471d9b59e4654eb338fabb0bd12d24b0f", "shasum": "" }, "require": { @@ -2201,16 +2202,16 @@ }, { "name": "symfony/console", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { @@ -2274,7 +2275,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.7" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -2290,7 +2291,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:55+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2842,16 +2843,16 @@ }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { @@ -2909,7 +2910,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -2925,7 +2926,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "tysonandre/var_representation_polyfill", diff --git a/docs/monorepo.md b/docs/monorepo.md index c2b2e150bfb47..ccb76d833e5a2 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -41,7 +41,7 @@ All GitHub Actions configuration for the monorepo, including CI, lives in `.gith ## Compatibility -All projects should be compatible with PHP versions WordPress supports. That's currently PHP 7.2 to 8.3. +All projects should be compatible with PHP versions WordPress supports. That's currently PHP 7.2 to 8.4. ## First Time @@ -266,7 +266,7 @@ If a project contains PHP tests (typically PHPUnit), it must define `.scripts.te A MySQL database is available if needed; credentials may be found in `~/.my.cnf`. Note that the host must be specified as `127.0.0.1`, as when passed `localhost` PHP will try to connect via a Unix domain socket which is not available in the Actions environment. -Tests are run with a variety of supported PHP versions from 7.2 to 8.3. If you have tests that only need to be run once, run them when `PHP_VERSION` matches that in `.github/versions.sh`. +Tests are run with a variety of supported PHP versions from 7.2 to 8.4. If you have tests that only need to be run once, run them when `PHP_VERSION` matches that in `.github/versions.sh`. #### PHP tests for non-plugins @@ -274,7 +274,7 @@ For all project types other than WordPress plugins, the necessary version of PHP We currently make use of the following packages in testing; it's encouraged to use these rather than introducing other tools that serve the same purpose. -* [yoast/phpunit-polyfills](https://packagist.org/packages/yoast/phpunit-polyfills) supplies polyfills for compatibility with PHPUnit 8.5 to 9.6, to support PHP 7.2 to 8.3. +* [yoast/phpunit-polyfills](https://packagist.org/packages/yoast/phpunit-polyfills) supplies polyfills for compatibility with PHPUnit 8.5 to 9.6, to support PHP 7.2 to 8.4. * Do not use `Yoast\PHPUnitPolyfills\TestCases\TestCase` or `Yoast\PHPUnitPolyfills\TestCases\XTestCase`. Just use the `@before`, `@after`, `@beforeClass`, and `@afterClass` annotations directly. * PHPUnit's built-in mocking is used for class mocks. * [brain/monkey](https://packagist.org/packages/brain/monkey) is used for mocking functions, and can also provide some functions for minimal WordPress compatibility. diff --git a/projects/github-actions/repo-gardening/CHANGELOG.md b/projects/github-actions/repo-gardening/CHANGELOG.md index 8cc61ee1ba393..9869dbaf9b7dc 100644 --- a/projects/github-actions/repo-gardening/CHANGELOG.md +++ b/projects/github-actions/repo-gardening/CHANGELOG.md @@ -32,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Boost: Fix [Boost Feature] labels [#35947] - Check description task: Handle empty PR body. [#36446] - Repo Gardening: fix workflow for adding [OSS Citizen] label. [#37252] -- WPCOM Commit Reminder rask: Fix detection of existing reminder comment. [#39042] +- WPCOM Commit Reminder task: Fix detection of existing reminder comment. [#39042] ## [5.0.0] - 2024-02-07 ### Added diff --git a/projects/github-actions/repo-gardening/README.md b/projects/github-actions/repo-gardening/README.md index 194b9f640b30c..174af439a2056 100644 --- a/projects/github-actions/repo-gardening/README.md +++ b/projects/github-actions/repo-gardening/README.md @@ -11,7 +11,6 @@ Here is the current list of tasks handled by this action: - Check Description (`checkDescription`): Checks the contents of a PR description, and ensure it matches our recommendations. - Add Labels (`addLabels`): Adds labels to PRs that touch specific features. - Clean Labels (`cleanLabels`): Removes Status labels once a PR or issue has been closed or merged. -- WordPress.com Commit Reminder (`wpcomCommitReminder`): Posts a comment on merged PRs to remind Automatticians to commit the matching WordPress.com change. - Notify Design (`notifyDesign`): Sends a Slack Notification to the Design team to request feedback, based on labels applied to a PR. - Notify Editorial (`notifyEditorial`): Sends a Slack Notification to the Editorial team to request feedback, based on labels applied to a PR. - Flag OSS (`flagOss`): flags entries by external contributors, adds an "OSS Citizen" label to the PR, and sends a Slack message. diff --git a/projects/github-actions/repo-gardening/changelog/rm-repo-gardening-wpcom-commit-reminder b/projects/github-actions/repo-gardening/changelog/rm-repo-gardening-wpcom-commit-reminder new file mode 100644 index 0000000000000..83f17148f7f98 --- /dev/null +++ b/projects/github-actions/repo-gardening/changelog/rm-repo-gardening-wpcom-commit-reminder @@ -0,0 +1,4 @@ +Significance: major +Type: removed + +WordPress.com Commit Reminder: remove this task as it is no longer used in the Jetpack monorepo. diff --git a/projects/github-actions/repo-gardening/src/index.js b/projects/github-actions/repo-gardening/src/index.js index 7c60a9ad74a83..dc0c042bf248e 100644 --- a/projects/github-actions/repo-gardening/src/index.js +++ b/projects/github-actions/repo-gardening/src/index.js @@ -11,7 +11,6 @@ const notifyDesign = require( './tasks/notify-design' ); const notifyEditorial = require( './tasks/notify-editorial' ); const replyToCustomersReminder = require( './tasks/reply-to-customers-reminder' ); const triageIssues = require( './tasks/triage-issues' ); -const wpcomCommitReminder = require( './tasks/wpcom-commit-reminder' ); const debug = require( './utils/debug' ); const ifNotClosed = require( './utils/if-not-closed' ); const ifNotFork = require( './utils/if-not-fork' ); @@ -57,10 +56,6 @@ const automations = [ action: [ 'labeled' ], task: ifNotClosed( notifyEditorial ), }, - { - event: 'push', - task: wpcomCommitReminder, - }, { event: 'pull_request_target', action: [ 'opened' ], diff --git a/projects/github-actions/repo-gardening/src/tasks/wpcom-commit-reminder/index.js b/projects/github-actions/repo-gardening/src/tasks/wpcom-commit-reminder/index.js deleted file mode 100644 index 308e95828826c..0000000000000 --- a/projects/github-actions/repo-gardening/src/tasks/wpcom-commit-reminder/index.js +++ /dev/null @@ -1,116 +0,0 @@ -const debug = require( '../../utils/debug' ); -const getAssociatedPullRequest = require( '../../utils/get-associated-pull-request' ); -const getComments = require( '../../utils/get-comments' ); - -/* global GitHub, WebhookPayloadPush */ - -/** - * Search for a previous comment from this task in our PR. - * If we find one, return its body. - * - * @param {GitHub} octokit - Initialized Octokit REST client. - * @param {string} owner - Repository owner. - * @param {string} repo - Repository name. - * @param {string} number - PR number. - * @return {Promise} Promise resolving to a string. - */ -async function getMatticBotComment( octokit, owner, repo, number ) { - let commentBody = ''; - - debug( `wpcom-commit-reminder: Looking for a comment from Matticbot on this PR.` ); - - const comments = await getComments( octokit, owner.login, repo, number ); - for ( const comment of comments ) { - if ( - comment.user.login === 'matticbot' && - comment.body.includes( 'This PR has changes that must be merged to WordPress.com' ) - ) { - commentBody = comment.body; - } - } - - return commentBody; -} - -/** - * Search for a previous comment from this task in our PR. - * - * @param {GitHub} octokit - Initialized Octokit REST client. - * @param {string} owner - Repository owner. - * @param {string} repo - Repository name. - * @param {string} number - PR number. - * @return {Promise} Promise resolving to boolean. - */ -async function hasReminderComment( octokit, owner, repo, number ) { - debug( `wpcom-commit-reminder: Looking for a previous comment from this task in our PR.` ); - - const comments = await getComments( octokit, owner.login, repo, number ); - for ( const comment of comments ) { - if ( - comment.user.login === 'github-actions[bot]' && - comment.body.includes( 'Great news! One last step' ) - ) { - return true; - } - } - - return false; -} - -/** - * Checks the contents of a PR description. - * - * @param {WebhookPayloadPush} payload - Push event payload. - * @param {GitHub} octokit - Initialized Octokit REST client. - */ -async function wpcomCommitReminder( payload, octokit ) { - const { commits, ref, repository } = payload; - const { name: repo, owner } = repository; - - // We should not get to that point as the action is triggered on pushes to trunk, but... - if ( ref !== 'refs/heads/trunk' ) { - debug( 'wpcom-commit-reminder: Commit is not to `trunk`. Aborting' ); - return; - } - - const prNumber = getAssociatedPullRequest( commits[ 0 ] ); - if ( ! prNumber ) { - debug( 'wpcom-commit-reminder: Commit is not a squashed PR. Aborting' ); - return; - } - - // Look for an existing check-description task comment. - const matticBotComment = await getMatticBotComment( octokit, owner, repo, prNumber ); - - // get diff id from comment body above. - const diffId = matticBotComment.match( /(D\d{5}-code)/ ); - - if ( ! diffId || 0 === diffId.length ) { - debug( 'wpcom-commit-reminder: We could not find a diff ID. Aborting' ); - return; - } - // Build our comment body. - const comment = ` -Great news! One last step: head over to your WordPress.com diff, ${ diffId[ 0 ] }, and deploy it. -Once you've done so, come back to this PR and add a comment with your SVN changeset ID (e.g. \`r12345-wpcom\`). - -**Thank you!** - `; - - // Look for an existing reminder comment. - const hasComment = await hasReminderComment( octokit, owner, repo, prNumber ); - - // If there is no comment yet, go ahead and comment. - if ( ! hasComment ) { - debug( `wpcom-commit-reminder: Posting comment to PR #${ prNumber }` ); - - await octokit.rest.issues.createComment( { - owner: owner.login, - repo, - issue_number: +prNumber, - body: comment, - } ); - } -} - -module.exports = wpcomCommitReminder; diff --git a/projects/github-actions/repo-gardening/src/tasks/wpcom-commit-reminder/readme.md b/projects/github-actions/repo-gardening/src/tasks/wpcom-commit-reminder/readme.md deleted file mode 100644 index 61135daa5f09c..0000000000000 --- a/projects/github-actions/repo-gardening/src/tasks/wpcom-commit-reminder/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# WordPress.com Commit Reminder - -Post a comment on merged PRs to remind Automatticians to commit the matching WordPress.com change. - -**Note:** this will only be useful if your repository uses Fusion. - -## Rationale - -When an Automattician merges a change to a file in Jetpack that also exists on WordPress.com, it's nice to bring that change to WordPress.com site owners as well. We offer tools to automate some of that work, but the actual commit is your responsibility. -Once you've merged your Jetpack PR, we'll comment to remind you to commit to WordPress.com. diff --git a/projects/js-packages/components/changelog/add-growth-upsells-to-social-and-stats-interstials b/projects/js-packages/components/changelog/add-growth-upsells-to-social-and-stats-interstials new file mode 100644 index 0000000000000..dda6e2d1a89aa --- /dev/null +++ b/projects/js-packages/components/changelog/add-growth-upsells-to-social-and-stats-interstials @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Add Stats icon diff --git a/projects/js-packages/components/components/icons/index.tsx b/projects/js-packages/components/components/icons/index.tsx index a390b8a3a3f6f..892e03dee4997 100644 --- a/projects/js-packages/components/components/icons/index.tsx +++ b/projects/js-packages/components/components/icons/index.tsx @@ -234,6 +234,18 @@ export const AiIcon: React.FC< BaseIconProps > = ( { ); }; +export const StatsIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => { + return ( + + + + ); +}; + const jetpackIcons = { 'anti-spam': AntiSpamIcon, backup: BackupIcon, @@ -249,6 +261,7 @@ const jetpackIcons = { jetpack: JetpackIcon, share: ShareIcon, ai: AiIcon, + stats: StatsIcon, }; const iconsMap = { diff --git a/projects/packages/assets/changelog/renovate-brain-monkey-2.x b/projects/packages/assets/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/assets/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/assets/composer.json b/projects/packages/assets/composer.json index 1908880c06d29..3cbe9bad4655e 100644 --- a/projects/packages/assets/composer.json +++ b/projects/packages/assets/composer.json @@ -8,7 +8,7 @@ "automattic/jetpack-constants": "@dev" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev", "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0" diff --git a/projects/packages/blocks/changelog/renovate-brain-monkey-2.x b/projects/packages/blocks/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/blocks/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/blocks/composer.json b/projects/packages/blocks/composer.json index b376679245876..e7809ddd76f6c 100644 --- a/projects/packages/blocks/composer.json +++ b/projects/packages/blocks/composer.json @@ -9,7 +9,7 @@ }, "require-dev": { "automattic/wordbless": "dev-master", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev" }, diff --git a/projects/packages/changelogger/changelog/add-ci-php-8.4 b/projects/packages/changelogger/changelog/add-ci-php-8.4 new file mode 100644 index 0000000000000..df3fd66d7ff39 --- /dev/null +++ b/projects/packages/changelogger/changelog/add-ci-php-8.4 @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Update a test for PHP 8.4 + + diff --git a/projects/packages/changelogger/tests/php/tests/src/SquashCommandTest.php b/projects/packages/changelogger/tests/php/tests/src/SquashCommandTest.php index 9f6e441ac20da..d71e40982ae89 100644 --- a/projects/packages/changelogger/tests/php/tests/src/SquashCommandTest.php +++ b/projects/packages/changelogger/tests/php/tests/src/SquashCommandTest.php @@ -222,7 +222,7 @@ public function provideExecute() { array(), array(), SquashCommand::FATAL_EXIT, - array( '{^Regex match failed: Delimiter must not be alphanumeric(?: or backslash|, backslash, or NUL)$}' ), + array( '{^Regex match failed: Delimiter must not be alphanumeric(?: or backslash|, backslash, or NUL(?: byte)?)$}' ), ), 'Squash by regex, regex matches nothing' => array( array( diff --git a/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-45.x b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-45.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-45.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/codesniffer/composer.json b/projects/packages/codesniffer/composer.json index 311e30b2ca441..93c7990c07a1b 100644 --- a/projects/packages/codesniffer/composer.json +++ b/projects/packages/codesniffer/composer.json @@ -14,7 +14,7 @@ "require": { "php": ">=7.4", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "mediawiki/mediawiki-codesniffer": "^44.0", + "mediawiki/mediawiki-codesniffer": "^45.0", "phpcompatibility/phpcompatibility-wp": "^2.1", "sirbrillig/phpcs-variable-analysis": "^2.10", "wp-coding-standards/wpcs": "^3.0", diff --git a/projects/packages/connection/changelog/renovate-brain-monkey-2.x b/projects/packages/connection/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/connection/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/connection/composer.json b/projects/packages/connection/composer.json index 60656d599adff..50367c81e0ac9 100644 --- a/projects/packages/connection/composer.json +++ b/projects/packages/connection/composer.json @@ -16,7 +16,7 @@ "require-dev": { "automattic/wordbless": "@dev", "yoast/phpunit-polyfills": "^1.1.1", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "automattic/jetpack-changelogger": "@dev", "automattic/jetpack-licensing": "@dev", "automattic/jetpack-sync": "@dev" diff --git a/projects/packages/constants/changelog/renovate-brain-monkey-2.x b/projects/packages/constants/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/constants/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/constants/composer.json b/projects/packages/constants/composer.json index 9c8a754c6c43d..023959332d568 100644 --- a/projects/packages/constants/composer.json +++ b/projects/packages/constants/composer.json @@ -7,7 +7,7 @@ "php": ">=7.2" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev" }, diff --git a/projects/packages/ip/changelog/renovate-brain-monkey-2.x b/projects/packages/ip/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/ip/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/ip/composer.json b/projects/packages/ip/composer.json index 2fde4db5c96a8..243f4a3849c93 100644 --- a/projects/packages/ip/composer.json +++ b/projects/packages/ip/composer.json @@ -7,7 +7,7 @@ "php": ">=7.2" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev" }, diff --git a/projects/packages/jitm/changelog/renovate-brain-monkey-2.x b/projects/packages/jitm/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/jitm/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/jitm/composer.json b/projects/packages/jitm/composer.json index 5382534544e64..351aa4d99324a 100644 --- a/projects/packages/jitm/composer.json +++ b/projects/packages/jitm/composer.json @@ -14,7 +14,7 @@ "automattic/jetpack-status": "@dev" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev" }, diff --git a/projects/packages/masterbar/changelog/renovate-brain-monkey-2.x b/projects/packages/masterbar/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/masterbar/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/masterbar/composer.json b/projects/packages/masterbar/composer.json index f522542634a60..dbdc8b7a0427b 100644 --- a/projects/packages/masterbar/composer.json +++ b/projects/packages/masterbar/composer.json @@ -16,7 +16,7 @@ "automattic/jetpack-status": "@dev" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev", "automattic/patchwork-redefine-exit": "@dev", diff --git a/projects/packages/my-jetpack/_inc/admin.jsx b/projects/packages/my-jetpack/_inc/admin.jsx index b7ddc9a0b331c..c636331b2eee2 100644 --- a/projects/packages/my-jetpack/_inc/admin.jsx +++ b/projects/packages/my-jetpack/_inc/admin.jsx @@ -17,7 +17,6 @@ import { BackupInterstitial, BoostInterstitial, CRMInterstitial, - CreatorInterstitial, ExtrasInterstitial, JetpackAiInterstitial, ProtectInterstitial, @@ -70,7 +69,6 @@ const MyJetpack = () => { } /> } /> } /> - } /> } diff --git a/projects/packages/my-jetpack/_inc/components/jetpack-manage-banner/index.jsx b/projects/packages/my-jetpack/_inc/components/jetpack-manage-banner/index.jsx index c3d0c519ac04b..656459cac0e0b 100644 --- a/projects/packages/my-jetpack/_inc/components/jetpack-manage-banner/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/jetpack-manage-banner/index.jsx @@ -12,7 +12,6 @@ import jetpackManageIcon from './jetpack-manage.svg'; * @return {object} The JetpackManageBanner component. */ const JetpackManageBanner = props => { - // eslint-disable-next-line no-unused-vars const { isAgencyAccount = false } = props; const { recordEvent } = useAnalytics(); @@ -37,6 +36,10 @@ const JetpackManageBanner = props => { trackClick( 'jp-agencies-register-interest' ); }, [ trackClick ] ); + if ( isAgencyAccount ) { + return null; + } + return ( { - return ; -}; - -CreatorCard.propTypes = { - admin: PropTypes.bool.isRequired, -}; - -export default CreatorCard; diff --git a/projects/packages/my-jetpack/_inc/components/product-cards-section/index.tsx b/projects/packages/my-jetpack/_inc/components/product-cards-section/index.tsx index 2d6427a2258af..855ba5e234b12 100644 --- a/projects/packages/my-jetpack/_inc/components/product-cards-section/index.tsx +++ b/projects/packages/my-jetpack/_inc/components/product-cards-section/index.tsx @@ -9,7 +9,6 @@ import AiCard from './ai-card'; import AntiSpamCard from './anti-spam-card'; import BackupCard from './backup-card'; import BoostCard from './boost-card'; -import CreatorCard from './creator-card'; import CrmCard from './crm-card'; import ProtectCard from './protect-card'; import SearchCard from './search-card'; @@ -27,13 +26,13 @@ type DisplayItemType = Record< // We don't have a card for Security or Extras, and scan is displayed as protect. // 'jetpack-ai' is the official slug for the AI module, so we also exclude 'ai'. // The backend still supports the 'ai' slug, so it is part of the JetpackModule type. - Exclude< JetpackModule, 'extras' | 'scan' | 'security' | 'ai' >, + Exclude< JetpackModule, 'extras' | 'scan' | 'security' | 'ai' | 'creator' | 'growth' >, FC< { admin: boolean } > >; const DisplayItems: FC< DisplayItemsProps > = ( { slugs } ) => { const { showFullJetpackStatsCard = false } = getMyJetpackWindowInitialState( 'myJetpackFlags' ); - const { isAtomic = false, userIsAdmin = false } = getMyJetpackWindowInitialState(); + const { userIsAdmin = false } = getMyJetpackWindowInitialState(); const items: DisplayItemType = { backup: BackupCard, @@ -44,7 +43,6 @@ const DisplayItems: FC< DisplayItemsProps > = ( { slugs } ) => { videopress: VideopressCard, stats: StatsCard, crm: CrmCard, - creator: ! isAtomic ? CreatorCard : null, social: SocialCard, 'jetpack-ai': AiCard, }; @@ -106,7 +104,12 @@ const ProductCardsSection: FC< ProductCardsSectionProps > = ( { noticeMessage } const filterProducts = ( products: JetpackModule[] ) => { return products.filter( product => { - if ( product === 'scan' || product === 'security' || product === 'extras' ) { + if ( + product === 'scan' || + product === 'security' || + product === 'growth' || + product === 'extras' + ) { return false; } return true; diff --git a/projects/packages/my-jetpack/_inc/components/product-interstitial/index.jsx b/projects/packages/my-jetpack/_inc/components/product-interstitial/index.jsx index 52177cf8c2e05..a2da42c2af781 100644 --- a/projects/packages/my-jetpack/_inc/components/product-interstitial/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/product-interstitial/index.jsx @@ -32,8 +32,6 @@ import boostImage from './boost.png'; import crmImage from './crm.png'; import extrasImage from './extras.png'; import searchImage from './search.png'; -import socialImage from './social.png'; -import statsImage from './stats.png'; import styles from './style.module.scss'; import videoPressImage from './videopress.png'; @@ -348,15 +346,6 @@ export function BoostInterstitial() { ); } -/** - * CreatorInterstitial component - * - * @return {object} CreatorInterstitial react component. - */ -export function CreatorInterstitial() { - return ; -} - /** * CRMInterstitial component * @@ -417,17 +406,7 @@ export function ScanInterstitial() { * @return {object} SocialInterstitial react component. */ export function SocialInterstitial() { - return ( - - { - - ); + return ; } /** @@ -471,15 +450,8 @@ export function StatsInterstitial() { directCheckout={ true } installsPlugin={ true } ctaButtonLabel={ __( 'Get Stats', 'jetpack-my-jetpack' ) } - > - { - + bundle="growth" + /> ); } diff --git a/projects/packages/my-jetpack/_inc/constants.ts b/projects/packages/my-jetpack/_inc/constants.ts index 92cc89c183dbf..d861145a4162c 100644 --- a/projects/packages/my-jetpack/_inc/constants.ts +++ b/projects/packages/my-jetpack/_inc/constants.ts @@ -11,7 +11,6 @@ export const MyJetpackRoutes = { AddBackup: '/add-backup', AddBoost: '/add-boost', AddCRM: '/add-crm', - AddCreator: '/add-creator', AddJetpackAI: '/add-jetpack-ai', AddExtras: '/add-extras', AddProtect: '/add-protect/:feature?', diff --git a/projects/packages/my-jetpack/_inc/data/constants.ts b/projects/packages/my-jetpack/_inc/data/constants.ts index c11217819409d..c55a4a6b24f61 100644 --- a/projects/packages/my-jetpack/_inc/data/constants.ts +++ b/projects/packages/my-jetpack/_inc/data/constants.ts @@ -51,4 +51,5 @@ export const PRODUCT_SLUGS = { PROTECT: 'protect', VIDEOPRESS: 'videopress', STATS: 'stats', + GROWTH: 'growth', } satisfies Record< string, JetpackModule >; diff --git a/projects/packages/my-jetpack/_inc/data/evaluation-recommendations/use-evaluation-recommendations.ts b/projects/packages/my-jetpack/_inc/data/evaluation-recommendations/use-evaluation-recommendations.ts index 95b8701e9197d..7d2b6214e7c15 100644 --- a/projects/packages/my-jetpack/_inc/data/evaluation-recommendations/use-evaluation-recommendations.ts +++ b/projects/packages/my-jetpack/_inc/data/evaluation-recommendations/use-evaluation-recommendations.ts @@ -41,7 +41,7 @@ const useEvaluationRecommendations = () => { // in zero(0) unownedRecommendedModules. const ownedProducts = ( process?.env?.NODE_ENV === 'development' - ? [ 'anti-spam', 'creator', 'extras', 'stats', 'jetpack-ai' ] + ? [ 'anti-spam', 'extras', 'stats', 'jetpack-ai' ] : getMyJetpackWindowInitialState( 'lifecycleStats' )?.ownedProducts || [] ) as JetpackModule[]; // We filter out owned modules, and return the top recommendations diff --git a/projects/packages/my-jetpack/changelog/add-growth-upsells-to-social-and-stats-interstials b/projects/packages/my-jetpack/changelog/add-growth-upsells-to-social-and-stats-interstials new file mode 100644 index 0000000000000..5d0c9263fc127 --- /dev/null +++ b/projects/packages/my-jetpack/changelog/add-growth-upsells-to-social-and-stats-interstials @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Add growth upsell to Stats and Social interstitials diff --git a/projects/packages/my-jetpack/changelog/update-manage-banner-agencies b/projects/packages/my-jetpack/changelog/update-manage-banner-agencies new file mode 100644 index 0000000000000..80016e06a10ca --- /dev/null +++ b/projects/packages/my-jetpack/changelog/update-manage-banner-agencies @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Notices: do not display the Jetpack Manage banners for accounts enrolled into our agency program. diff --git a/projects/packages/my-jetpack/changelog/update-remove-creator-card-and-handle-creator-card-on-applicable-product-classes b/projects/packages/my-jetpack/changelog/update-remove-creator-card-and-handle-creator-card-on-applicable-product-classes new file mode 100644 index 0000000000000..696faa92c210f --- /dev/null +++ b/projects/packages/my-jetpack/changelog/update-remove-creator-card-and-handle-creator-card-on-applicable-product-classes @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Remove creator card and update paid plan checks to account for growth diff --git a/projects/packages/my-jetpack/global.d.ts b/projects/packages/my-jetpack/global.d.ts index 49d4563fabc82..ec2870487c89d 100644 --- a/projects/packages/my-jetpack/global.d.ts +++ b/projects/packages/my-jetpack/global.d.ts @@ -39,7 +39,8 @@ type JetpackModule = | 'security' | 'protect' | 'videopress' - | 'stats'; + | 'stats' + | 'growth'; type ThreatItem = { // Protect API properties (free plan) diff --git a/projects/packages/my-jetpack/src/class-products.php b/projects/packages/my-jetpack/src/class-products.php index dcd3fcc28b3cd..7d17c464804cd 100644 --- a/projects/packages/my-jetpack/src/class-products.php +++ b/projects/packages/my-jetpack/src/class-products.php @@ -120,6 +120,7 @@ public static function get_products_classes() { 'videopress' => Products\Videopress::class, 'stats' => Products\Stats::class, 'ai' => Products\Jetpack_Ai::class, + 'growth' => Products\Growth::class, ); /** diff --git a/projects/packages/my-jetpack/src/products/class-growth.php b/projects/packages/my-jetpack/src/products/class-growth.php new file mode 100644 index 0000000000000..7478574449aa0 --- /dev/null +++ b/projects/packages/my-jetpack/src/products/class-growth.php @@ -0,0 +1,209 @@ + true, + 'wpcom_product_slug' => $product_slug, + ), + Wpcom_Products::get_product_pricing( $product_slug ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_growth_yearly'; + } + + /** + * Checks whether the Jetpack module is active + * + * This is a bundle and not a product. We should not use this information for anything + * + * @return bool + */ + public static function is_module_active() { + return false; + } + + /** + * Activates the product by installing and activating its plugin + * + * @param WP_Error|bool $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return bool|\WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + $product_activation = parent::do_product_specific_activation( $current_result ); + + // A bundle is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + return $product_activation; + } + + // At this point, Jetpack plugin is installed. Let's activate each individual product. + $activation = Social::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + $activation = Stats::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + return $activation; + } + + /** + * Checks whether the Product is active + * + * Growth is a bundle and not a module. Activation takes place on WPCOM. So lets consider it active if jetpack is active and has the plan. + * + * @return bool + */ + public static function is_active() { + return static::is_jetpack_plugin_active() && static::has_required_plan(); + } + + /** + * Checks whether the current plan (or purchase) of the site already supports the product + * + * @return bool + */ + public static function has_required_plan() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( + str_starts_with( $purchase->product_slug, 'jetpack_growth' ) || + str_starts_with( $purchase->product_slug, 'jetpack_complete' ) + ) { + return true; + } + } + } + return false; + } + + /** + * Checks whether the product is a bundle + * + * @return bool + */ + public static function is_bundle_product() { + return true; + } + + /** + * Returns all products it contains. + * + * @return array Product slugs + */ + public static function get_supported_products() { + return array( 'social', 'stats' ); + } + + /** + * Get the URL where the user manages the product + * + * @return string + */ + public static function get_manage_url() { + return ''; + } +} diff --git a/projects/packages/my-jetpack/src/products/class-security.php b/projects/packages/my-jetpack/src/products/class-security.php index 866899cb81223..7e7005ea9d034 100644 --- a/projects/packages/my-jetpack/src/products/class-security.php +++ b/projects/packages/my-jetpack/src/products/class-security.php @@ -69,7 +69,7 @@ public static function get_long_description() { /** * Get the internationalized features list * - * @return array Boost features list + * @return array Security features list */ public static function get_features() { return array( @@ -81,17 +81,18 @@ public static function get_features() { } /** - * Get the product princing details + * Get the product pricing details * * @return array Pricing details */ public static function get_pricing_for_ui() { + $product_slug = static::get_wpcom_product_slug(); return array_merge( array( 'available' => true, - 'wpcom_product_slug' => static::get_wpcom_product_slug(), + 'wpcom_product_slug' => $product_slug, ), - Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + Wpcom_Products::get_product_pricing( $product_slug ) ); } @@ -195,7 +196,7 @@ public static function is_bundle_product() { /** * Return all the products it contains. * - * @return Array Product slugs + * @return array Product slugs */ public static function get_supported_products() { return array( 'backup', 'scan', 'anti-spam' ); diff --git a/projects/packages/my-jetpack/src/products/class-social.php b/projects/packages/my-jetpack/src/products/class-social.php index 80913a97b7d66..ae1d3ee6f76c0 100644 --- a/projects/packages/my-jetpack/src/products/class-social.php +++ b/projects/packages/my-jetpack/src/products/class-social.php @@ -156,6 +156,7 @@ public static function has_paid_plan_for_product() { 'jetpack_business', 'jetpack_premium', 'jetpack_personal', + 'jetpack_growth', ); // For atomic sites, do a feature check to see if the republicize feature is available // This feature is available by default on all Jetpack sites @@ -196,4 +197,14 @@ public static function get_manage_url() { return admin_url( 'admin.php?page=jetpack#/settings?term=publicize' ); } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'growth' ); + } } diff --git a/projects/packages/my-jetpack/src/products/class-stats.php b/projects/packages/my-jetpack/src/products/class-stats.php index 6f1118cf6f4c2..c361bd6737f39 100644 --- a/projects/packages/my-jetpack/src/products/class-stats.php +++ b/projects/packages/my-jetpack/src/products/class-stats.php @@ -194,7 +194,10 @@ public static function is_upgradable() { if ( ! is_wp_error( $purchases_data ) && is_array( $purchases_data ) && ! empty( $purchases_data ) ) { foreach ( $purchases_data as $purchase ) { // Jetpack complete includes Stats commercial & cannot be upgraded - if ( str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + if ( + str_starts_with( $purchase->product_slug, 'jetpack_complete' ) || + str_starts_with( $purchase->product_slug, 'jetpack_growth' ) + ) { return false; } elseif ( // Stats commercial purchased with highest tier cannot be upgraded. @@ -229,7 +232,11 @@ public static function has_paid_plan_for_product() { if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { foreach ( $purchases_data as $purchase ) { // Stats is available as standalone product and as part of the Complete plan. - if ( strpos( $purchase->product_slug, 'jetpack_stats' ) !== false || str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + if ( + strpos( $purchase->product_slug, 'jetpack_stats' ) !== false || + str_starts_with( $purchase->product_slug, 'jetpack_complete' ) || + str_starts_with( $purchase->product_slug, 'jetpack_growth' ) + ) { return true; } } @@ -307,4 +314,14 @@ public static function get_purchase_url() { public static function get_manage_url() { return admin_url( 'admin.php?page=stats' ); } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'growth' ); + } } diff --git a/projects/packages/phan-plugins/changelog/add-ci-php-8.4 b/projects/packages/phan-plugins/changelog/add-ci-php-8.4 new file mode 100644 index 0000000000000..ddbb5f3179535 --- /dev/null +++ b/projects/packages/phan-plugins/changelog/add-ci-php-8.4 @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Work around microsoft/tolerant-php-parser not being 8.4-safe yet in test + + diff --git a/projects/packages/phan-plugins/tests/php/IntegrationTest.php b/projects/packages/phan-plugins/tests/php/IntegrationTest.php index 95cad2e73a2a6..86f4736023e93 100644 --- a/projects/packages/phan-plugins/tests/php/IntegrationTest.php +++ b/projects/packages/phan-plugins/tests/php/IntegrationTest.php @@ -101,12 +101,22 @@ private function runPhan( $dir, $usePolyfill = false, $analyzeTwice = false ) { $printer = new CapturingJSONPrinter(); Phan::setPrinter( $printer ); - Phan::analyzeFileList( - $this->codeBase, - static function () use ( $cli ) { - return $cli->getFileList(); + $old = error_reporting(); + try { + if ( $usePolyfill ) { + // microsoft/tolerant-php-parser raises PHP 8.4 deprecation warnings. + // @todo If it gets updated at some point, hopefully this can be removed. + error_reporting( $old & ~E_DEPRECATED ); } - ); + Phan::analyzeFileList( + $this->codeBase, + static function () use ( $cli ) { + return $cli->getFileList(); + } + ); + } finally { + error_reporting( $old ); + } $expectFile = $this->chooseFile( "$dir/expect.json", $usePolyfill, $analyzeTwice ); $expect = json_decode( file_get_contents( $expectFile ), true ); diff --git a/projects/packages/redirect/changelog/renovate-brain-monkey-2.x b/projects/packages/redirect/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/redirect/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/redirect/composer.json b/projects/packages/redirect/composer.json index 1a5e3e80aea9a..1f0607951f32a 100644 --- a/projects/packages/redirect/composer.json +++ b/projects/packages/redirect/composer.json @@ -8,7 +8,7 @@ "automattic/jetpack-status": "@dev" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev" }, diff --git a/projects/packages/roles/changelog/renovate-brain-monkey-2.x b/projects/packages/roles/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/roles/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/roles/composer.json b/projects/packages/roles/composer.json index 1779a623f5130..1bed9945117a9 100644 --- a/projects/packages/roles/composer.json +++ b/projects/packages/roles/composer.json @@ -7,7 +7,7 @@ "php": ">=7.2" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev" }, diff --git a/projects/packages/stats-admin/changelog/update-no-cache-for-purchases-and-usage b/projects/packages/stats-admin/changelog/update-no-cache-for-purchases-and-usage new file mode 100644 index 0000000000000..b2cf2e9f45137 --- /dev/null +++ b/projects/packages/stats-admin/changelog/update-no-cache-for-purchases-and-usage @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Stast: removed cache for purchases and usage endpoints diff --git a/projects/packages/stats-admin/src/class-rest-controller.php b/projects/packages/stats-admin/src/class-rest-controller.php index f0be6457146e3..230626c4e1817 100644 --- a/projects/packages/stats-admin/src/class-rest-controller.php +++ b/projects/packages/stats-admin/src/class-rest-controller.php @@ -710,7 +710,8 @@ public function get_site_plan_usage( $req ) { 'v2', array( 'timeout' => 5 ), null, - 'wpcom' + 'wpcom', + false ); } @@ -1186,7 +1187,12 @@ public function get_site_purchases( $req ) { $this->filter_and_build_query_string( $req->get_query_params() ) - ) + ), + 'v1.1', + array( 'timeout' => 10 ), + null, + 'rest', + false ); } diff --git a/projects/packages/status/changelog/renovate-brain-monkey-2.x b/projects/packages/status/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/status/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/status/composer.json b/projects/packages/status/composer.json index e642afa35e37f..f6510f57e2c96 100644 --- a/projects/packages/status/composer.json +++ b/projects/packages/status/composer.json @@ -8,7 +8,7 @@ "automattic/jetpack-constants": "@dev" }, "require-dev": { - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev", "automattic/jetpack-connection": "@dev", diff --git a/projects/packages/videopress/changelog/renovate-brain-monkey-2.x b/projects/packages/videopress/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/packages/videopress/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/packages/videopress/composer.json b/projects/packages/videopress/composer.json index e8efec22a869c..2076358f7c46e 100644 --- a/projects/packages/videopress/composer.json +++ b/projects/packages/videopress/composer.json @@ -15,7 +15,7 @@ "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev", "automattic/wordbless": "@dev", - "brain/monkey": "2.6.1" + "brain/monkey": "^2.6.2" }, "suggest": { "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." diff --git a/projects/plugins/automattic-for-agencies-client/changelog/renovate-brain-monkey-2.x b/projects/plugins/automattic-for-agencies-client/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/plugins/automattic-for-agencies-client/changelog/renovate-brain-monkey-2.x#2 b/projects/plugins/automattic-for-agencies-client/changelog/renovate-brain-monkey-2.x#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/renovate-brain-monkey-2.x#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/automattic-for-agencies-client/composer.json b/projects/plugins/automattic-for-agencies-client/composer.json index cf98450d7b0e2..4ac8a22093967 100644 --- a/projects/plugins/automattic-for-agencies-client/composer.json +++ b/projects/plugins/automattic-for-agencies-client/composer.json @@ -17,7 +17,7 @@ "yoast/phpunit-polyfills": "^1.1.1", "automattic/jetpack-changelogger": "@dev", "automattic/wordbless": "0.4.2", - "brain/monkey": "2.6.1" + "brain/monkey": "^2.6.2" }, "autoload": { "classmap": [ diff --git a/projects/plugins/automattic-for-agencies-client/composer.lock b/projects/plugins/automattic-for-agencies-client/composer.lock index 8958e1c8473bd..591226b189324 100644 --- a/projects/plugins/automattic-for-agencies-client/composer.lock +++ b/projects/plugins/automattic-for-agencies-client/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ff0eb6686ecd58efe192cea73aa8a89d", + "content-hash": "f92f3406e4ccd1aca7120aa9b8181360", "packages": [ { "name": "automattic/jetpack-a8c-mc-stats", @@ -130,7 +130,7 @@ "dist": { "type": "path", "url": "../../packages/assets", - "reference": "63138ef0df4e49622c104b8fee4000f72bd5354d" + "reference": "150864e98715bbe0f68332225843adb5920e166d" }, "require": { "automattic/jetpack-constants": "@dev", @@ -138,7 +138,7 @@ }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0", "yoast/phpunit-polyfills": "^1.1.1" }, @@ -399,7 +399,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "820d59441494360d9c71a08a7f72fd4cb8486bf6" + "reference": "39940d00321ffb2730bdef3408636788340c0443" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -416,7 +416,7 @@ "automattic/jetpack-licensing": "@dev", "automattic/jetpack-sync": "@dev", "automattic/wordbless": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -491,14 +491,14 @@ "dist": { "type": "path", "url": "../../packages/constants", - "reference": "903469d423a09a79c41b7f1d0904ebab6365b22c" + "reference": "e715b43a76eeb5847166871e7e0d192469ddeb32" }, "require": { "php": ">=7.2" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -545,14 +545,14 @@ "dist": { "type": "path", "url": "../../packages/ip", - "reference": "1526cc28c06e8677d928a4072b02f0dc9ecd7577" + "reference": "55173099d713a5a77463e99b6ceb212574712475" }, "require": { "php": ">=7.2" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -732,7 +732,7 @@ "dist": { "type": "path", "url": "../../packages/redirect", - "reference": "b472c2b14cdbc78377f5dd1181c8c28679b6c0fd" + "reference": "8c08601a206cf1cb8b62416a4b6613dd96c06704" }, "require": { "automattic/jetpack-status": "@dev", @@ -740,7 +740,7 @@ }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -787,14 +787,14 @@ "dist": { "type": "path", "url": "../../packages/roles", - "reference": "024e413907f91fb32d4db4cb35373100b276e756" + "reference": "3d127129f23b1a5bc796913ac009a40af8e663bd" }, "require": { "php": ">=7.2" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -841,7 +841,7 @@ "dist": { "type": "path", "url": "../../packages/status", - "reference": "ccc903c45eb5f4bd60a23c40ab65ab56340e459b" + "reference": "347a36e47e47f389682efc2a6d77b1f6ecfe2136" }, "require": { "automattic/jetpack-constants": "@dev", @@ -852,7 +852,7 @@ "automattic/jetpack-connection": "@dev", "automattic/jetpack-ip": "@dev", "automattic/jetpack-plans": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -1151,16 +1151,16 @@ }, { "name": "brain/monkey", - "version": "2.6.1", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb" + "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a31c84515bb0d49be9310f52ef1733980ea8ffbb", - "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/d95a9d895352c30f47604ad1b825ab8fa9d1a373", + "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373", "shasum": "" }, "require": { @@ -1177,7 +1177,7 @@ "extra": { "branch-alias": { "dev-version/1": "1.x-dev", - "dev-master": "2.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -1217,7 +1217,7 @@ "issues": "https://github.com/Brain-WP/BrainMonkey/issues", "source": "https://github.com/Brain-WP/BrainMonkey" }, - "time": "2021-11-11T15:53:55+00:00" + "time": "2024-08-29T20:15:04+00:00" }, { "name": "doctrine/instantiator", diff --git a/projects/plugins/backup/changelog/renovate-brain-monkey-2.x b/projects/plugins/backup/changelog/renovate-brain-monkey-2.x new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/backup/changelog/renovate-brain-monkey-2.x @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/backup/composer.lock b/projects/plugins/backup/composer.lock index fb420f18385d6..34681f18ede2b 100644 --- a/projects/plugins/backup/composer.lock +++ b/projects/plugins/backup/composer.lock @@ -130,7 +130,7 @@ "dist": { "type": "path", "url": "../../packages/assets", - "reference": "63138ef0df4e49622c104b8fee4000f72bd5354d" + "reference": "150864e98715bbe0f68332225843adb5920e166d" }, "require": { "automattic/jetpack-constants": "@dev", @@ -138,7 +138,7 @@ }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0", "yoast/phpunit-polyfills": "^1.1.1" }, @@ -693,7 +693,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "820d59441494360d9c71a08a7f72fd4cb8486bf6" + "reference": "39940d00321ffb2730bdef3408636788340c0443" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -710,7 +710,7 @@ "automattic/jetpack-licensing": "@dev", "automattic/jetpack-sync": "@dev", "automattic/wordbless": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -785,14 +785,14 @@ "dist": { "type": "path", "url": "../../packages/constants", - "reference": "903469d423a09a79c41b7f1d0904ebab6365b22c" + "reference": "e715b43a76eeb5847166871e7e0d192469ddeb32" }, "require": { "php": ">=7.2" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -967,14 +967,14 @@ "dist": { "type": "path", "url": "../../packages/ip", - "reference": "1526cc28c06e8677d928a4072b02f0dc9ecd7577" + "reference": "55173099d713a5a77463e99b6ceb212574712475" }, "require": { "php": ">=7.2" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -1025,7 +1025,7 @@ "dist": { "type": "path", "url": "../../packages/jitm", - "reference": "53bd1527e8cc69e0542c9572ca2b3896c4c9196b" + "reference": "6b2795ebf1c65e0a1a0bb9f0f1a9accaac0e22bf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -1039,7 +1039,7 @@ }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -1649,7 +1649,7 @@ "dist": { "type": "path", "url": "../../packages/redirect", - "reference": "b472c2b14cdbc78377f5dd1181c8c28679b6c0fd" + "reference": "8c08601a206cf1cb8b62416a4b6613dd96c06704" }, "require": { "automattic/jetpack-status": "@dev", @@ -1657,7 +1657,7 @@ }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -1704,14 +1704,14 @@ "dist": { "type": "path", "url": "../../packages/roles", - "reference": "024e413907f91fb32d4db4cb35373100b276e756" + "reference": "3d127129f23b1a5bc796913ac009a40af8e663bd" }, "require": { "php": ">=7.2" }, "require-dev": { "automattic/jetpack-changelogger": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -1758,7 +1758,7 @@ "dist": { "type": "path", "url": "../../packages/status", - "reference": "ccc903c45eb5f4bd60a23c40ab65ab56340e459b" + "reference": "347a36e47e47f389682efc2a6d77b1f6ecfe2136" }, "require": { "automattic/jetpack-constants": "@dev", @@ -1769,7 +1769,7 @@ "automattic/jetpack-connection": "@dev", "automattic/jetpack-ip": "@dev", "automattic/jetpack-plans": "@dev", - "brain/monkey": "2.6.1", + "brain/monkey": "^2.6.2", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { diff --git a/projects/plugins/boost/CHANGELOG.md b/projects/plugins/boost/CHANGELOG.md index 7c624122cdbcd..1869a57155fe7 100644 --- a/projects/plugins/boost/CHANGELOG.md +++ b/projects/plugins/boost/CHANGELOG.md @@ -5,22 +5,24 @@ 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.6.0-beta] - 2024-11-04 +## [3.6.0-beta2] - 2024-11-20 ### Added -- Cornerstone Pages: Added feature to allow selecting important pages. [#39863] +- Cornerstone Pages: Added setting to allow selecting important pages. [#39863] ### Changed -- Critical CSS: Improve logic that generates URLs for critical CSS generation. [#39862] -- Page Speed: Update speed scores to be based on first cornerstone page. [#39863] -- General: Improve compatibility with WordPress 6.7. [#39877] [#39786] -- General: Update badges used to show state of features. [#40031] +- Critical CSS: Improved logic that generates URLs for critical CSS generation. [#39862] +- General: Improved compatibility with WordPress 6.7. [#39877] [#39786] +- General: Updated badges used to show state of features. [#40031] +- Page Speed: Updated speed scores to be based on first cornerstone page. [#39863] ### Removed -- Image Guide: Remove URL parameter based override. [#39874] +- Image Guide: Removed URL parameter based override. [#39874] ### Fixed -- Page Speed: Fix typo in Overall Score tooltip. [#39974] +- Image Size Analysis: Fixed UI not properly reflecting current state after interaction. +- Page Speed: Fixed typo in Overall Score tooltip. [#39974] - Performance History: Fixed tooltip behavior. [#39879] +- UI: Fixed Boost's menu counter sometimes displaying incorrectly. ## [3.5.2] - 2024-10-15 ### Changed @@ -541,7 +543,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First public alpha release -[3.6.0-beta]: https://github.com/Automattic/jetpack-boost-production/compare/3.5.2...3.6.0-beta +[3.6.0-beta2]: https://github.com/Automattic/jetpack-boost-production/compare/3.5.2...3.6.0-beta [3.5.2]: https://github.com/Automattic/jetpack-boost-production/compare/3.5.1...3.5.2 [3.5.1]: https://github.com/Automattic/jetpack-boost-production/compare/3.5.0...3.5.1 [3.5.0]: https://github.com/Automattic/jetpack-boost-production/compare/3.4.9...3.5.0 diff --git a/projects/plugins/boost/app/assets/src/css/main/wp-admin.scss b/projects/plugins/boost/app/assets/src/css/main/wp-admin.scss index 720546d6669e2..09b4d649f72d7 100644 --- a/projects/plugins/boost/app/assets/src/css/main/wp-admin.scss +++ b/projects/plugins/boost/app/assets/src/css/main/wp-admin.scss @@ -20,7 +20,7 @@ p { // Jetpack component uses this variable --font-body-extra-small: 14px; - + --spacing-base: 8px; font-size: 16px; @@ -51,7 +51,7 @@ p { outline: 1px solid transparent; } - .components-button.is-link { + .components-button.is-link:not(:disabled) { color: var( --wp-admin-theme-link-color ); } @@ -102,6 +102,17 @@ p { color: $primary-black; } } + + // Override WP styles for panel header. + .components-panel__body-title .components-button:hover:not(:disabled,[aria-disabled=true]), + .components-panel__body-title .components-button[aria-expanded=true] { + color: inherit; + } + + .components-panel__body-toggle.components-button:focus { + border-radius: inherit; + box-shadow: none; + } } // Reset WP-Admin styles for boost dashboard diff --git a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.module.scss b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.module.scss new file mode 100644 index 0000000000000..4ddcc674ed848 --- /dev/null +++ b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.module.scss @@ -0,0 +1,16 @@ +.wrapper { + margin-bottom: 3em; + + .panel { + border-radius: 8px; + } + + :global(.components-panel__body-title > button) { + font-size: 14px; + font-weight: 400; + } + + .body { + border-color: transparent; + } +} diff --git a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.tsx b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.tsx index 4135e49b518f1..3436136c9ca88 100644 --- a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.tsx +++ b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/cornerstone-pages.tsx @@ -1,34 +1,81 @@ -import { __ } from '@wordpress/i18n'; +import { __, _n, sprintf } from '@wordpress/i18n'; import Meta from './meta/meta'; -import SettingsItem from '$features/ui/settings-item/settings-item'; -import Pill from '$features/ui/pill/pill'; +import { Panel, PanelBody, PanelRow } from '@wordpress/components'; import Upgraded from '$features/ui/upgraded/upgraded'; +import styles from './cornerstone-pages.module.scss'; import { usePremiumFeatures } from '$lib/stores/premium-features'; +import { recordBoostEvent } from '$lib/utils/analytics'; +import { useCornerstonePages } from './lib/stores/cornerstone-pages'; +import Pill from '$features/ui/pill/pill'; const CornerstonePages = () => { const premiumFeatures = usePremiumFeatures(); const isPremium = premiumFeatures.includes( 'cornerstone-10-pages' ); return ( - - { __( 'Cornerstone Pages', 'jetpack-boost' ) } - - { isPremium && } - - } - description={ -

- { __( - 'List the most important pages of your site. These pages will receive specially tailored optimizations, including targeted critical CSS. The Page Speed scores are based on the first cornerstone page.', - 'jetpack-boost' - ) } -

+
+ + +

+ { __( 'Cornerstone Pages', 'jetpack-boost' ) } + + { isPremium && } +

+ +
+ } + initialOpen={ false } + onToggle={ ( value: boolean ) => { + recordBoostEvent( 'cornerstone_pages_panel_toggle', { + status: value ? 'open' : 'close', + } ); + } } + className={ styles.body } + > + + + + + + + ); +}; + +const CornerstoneTitleSummary = () => { + const [ cornerstonePages ] = useCornerstonePages(); + if ( ! cornerstonePages.length ) { + return null; + } + return sprintf( + /* translators: %s is the number of pages in the cornerstone pages list apart from the homepage. */ + __( 'Added: %s', 'jetpack-boost' ), + () => { + const homepage = Jetpack_Boost.site.url.replace( /\/$/, '' ); + const hasHomepage = cornerstonePages.includes( homepage ); + + if ( hasHomepage ) { + if ( cornerstonePages.length > 1 ) { + return sprintf( + /* translators: %d is the number of pages in the cornerstone pages list apart from the homepage. */ + _n( + 'Homepage + %d page', + 'Homepage + %d pages', + cornerstonePages.length - 1, + 'jetpack-boost' + ), + cornerstonePages.length - 1 + ); + } + return __( 'Homepage', 'jetpack-boost' ); } - > - -
+ return sprintf( + /* translators: %d is the number of pages added to the cornerstone pages list. */ + _n( '%d page', '%d pages', cornerstonePages.length, 'jetpack-boost' ), + cornerstonePages.length + ); + } ); }; diff --git a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.module.scss b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.module.scss index 2c4b87a1db4c0..1f1443e56c33c 100644 --- a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.module.scss +++ b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.module.scss @@ -6,6 +6,10 @@ margin-left: 20px !important; } + & > p:first-child { + margin-top: 0; + } + .head { display: flex; flex-direction: row; diff --git a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.tsx b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.tsx index f73749d775ee4..af8073f3ba56b 100644 --- a/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.tsx +++ b/projects/plugins/boost/app/assets/src/js/features/cornerstone-pages/meta/meta.tsx @@ -1,7 +1,5 @@ -import { Button, Notice } from '@automattic/jetpack-components'; +import { Button, getRedirectUrl, Notice } from '@automattic/jetpack-components'; import { __, _n, sprintf } from '@wordpress/i18n'; -import ChevronDown from '$svg/chevron-down'; -import ChevronUp from '$svg/chevron-up'; import React, { useEffect, useState } from 'react'; import clsx from 'clsx'; import styles from './meta.module.scss'; @@ -14,27 +12,19 @@ import { recordBoostEvent } from '$lib/utils/analytics'; import getSupportLink from '$lib/utils/get-support-link'; import { useRegenerationReason } from '$features/critical-css/lib/stores/suggest-regenerate'; import { usePremiumFeatures } from '$lib/stores/premium-features'; -import { useNavigate } from 'react-router-dom'; import { useRegenerateCriticalCssAction } from '$features/critical-css/lib/stores/critical-css-state'; import { isSameSiteUrl } from '$lib/utils/is-same-site-url'; +import UpgradeCTA from '$features/upgrade-cta/upgrade-cta'; const Meta = () => { - const [ isExpanded, setIsExpanded ] = useState( false ); + const cornerstonePagesSupportLink = getRedirectUrl( 'jetpack-boost-cornerstone-pages' ); const [ cornerstonePages, setCornerstonePages ] = useCornerstonePages(); const cornerstonePagesProperties = useCornerstonePagesProperties(); const [ { refetch: refetchRegenerationReason } ] = useRegenerationReason(); const premiumFeatures = usePremiumFeatures(); const isPremium = premiumFeatures.includes( 'cornerstone-10-pages' ); - const navigate = useNavigate(); const regenerateAction = useRegenerateCriticalCssAction(); - const toggleExpanded = ( newValue: boolean ) => { - recordBoostEvent( 'cornerstone_pages_show_options_toggle', { - status: newValue ? 'open' : 'close', - } ); - setIsExpanded( newValue ); - }; - const updateCornerstonePages = ( newValue: string ) => { const newItems = newValue.split( '\n' ).map( line => line.trim() ); @@ -48,6 +38,8 @@ const Meta = () => { let content = null; + const listInputRows = isPremium ? 10 : 5; + if ( cornerstonePagesProperties !== undefined ) { content = ( { setItems={ updateCornerstonePages } maxItems={ cornerstonePagesProperties.max_pages } defaultValue={ cornerstonePagesProperties.default_pages.join( '\n' ) } + inputRows={ listInputRows } description={ <> { createInterpolateElement( @@ -70,36 +63,6 @@ const Meta = () => { b: , } ) } - { ! isPremium && ( - <> -
-
- - { createInterpolateElement( - sprintf( - /* translators: %d is the number of cornerstone pages. */ - __( - 'Premium users can add up to %d cornerstone pages. Upgrade now.', - 'jetpack-boost' - ), - cornerstonePagesProperties.max_pages_premium - ), - { - link: ( - // eslint-disable-next-line jsx-a11y/anchor-has-content - { - recordBoostEvent( 'cornerstone_pages_upgrade_link_clicked', {} ); - navigate( '/upgrade' ); - } } - /> - ), - } - ) } - - - ) } } /> @@ -138,30 +101,29 @@ const Meta = () => { return (
-
-
- { cornerstonePagesProperties && - sprintf( - /* translators: %1$d is the number of cornerstone pages added, %2$d is the maximum number allowed */ - __( '%1$d / %2$d added', 'jetpack-boost' ), - cornerstonePages.length, - cornerstonePagesProperties.max_pages - ) } -
-
- -
-
- { isExpanded &&
{ content }
} +

+ { createInterpolateElement( + __( + 'List the most important pages of your site. These pages will receive specially tailored optimizations, including targeted critical CSS. The Page Speed scores are based on the first cornerstone page. Learn More', + 'jetpack-boost' + ), + { + link: ( + // eslint-disable-next-line jsx-a11y/anchor-has-content + { + recordBoostEvent( 'clicked_cornerstone_pages_learn_more', {} ); + } } + /> + ), + b: , + } + ) } +

+
{ content }
); }; @@ -171,7 +133,8 @@ type ListProps = { setItems: ( newValue: string ) => void; maxItems: number; description: React.ReactNode | null; - defaultValue?: string; + defaultValue: string; + inputRows?: number; }; const List: React.FC< ListProps > = ( { @@ -179,14 +142,16 @@ const List: React.FC< ListProps > = ( { setItems, maxItems, description, - defaultValue, + defaultValue = '', + inputRows = 10, } ) => { const [ inputValue, setInputValue ] = useState( items ); // eslint-disable-next-line @typescript-eslint/no-unused-vars const [ inputInvalid, setInputInvalid ] = useState( false ); const [ validationError, setValidationError ] = useState< Error | null >( null ); - - const inputRows = Math.min( maxItems, 10 ); + const premiumFeatures = usePremiumFeatures(); + const isPremium = premiumFeatures.includes( 'cornerstone-10-pages' ); + const cornerstonePagesProperties = useCornerstonePagesProperties(); const validateInputValue = ( value: string ) => { setInputValue( value ); @@ -201,10 +166,7 @@ const List: React.FC< ListProps > = ( { }; const validateItems = ( value: string ) => { - const lines = value - .split( '\n' ) - .map( line => line.trim() ) - .filter( line => line.trim() !== '' ); + const lines = value.split( '\n' ).map( line => line.trim() ); if ( lines.length === 0 ) { throw new Error( __( 'You must add at least one URL.', 'jetpack-boost' ) ); @@ -257,39 +219,55 @@ const List: React.FC< ListProps > = ( { } function loadDefaultValue() { - setInputValue( defaultValue || '' ); + validateInputValue( defaultValue ); + recordBoostEvent( 'cornerstone_pages_load_default', {} ); } return ( -
-