Commit 0bce032d3cd for woocommerce
commit 0bce032d3cd9621ce10f66db054f72e742cff30e
Author: Darren Ethier <darren@roughsmootheng.in>
Date: Mon Oct 5 16:22:15 2026 -0400
Prepare 4.0.0 Beta Tester Release (#69410)
* Prepare 4.0.0 Beta Tester release
Require install_plugins for WCA Test Helper REST routes, the Test Helper admin script and the Live Branches page, matching the Test Helper admin page. Bump version to 4.0.0 and compile changelog.
diff --git a/plugins/woocommerce-beta-tester/api/api.php b/plugins/woocommerce-beta-tester/api/api.php
index ae57ba45d83..4283249dfcc 100644
--- a/plugins/woocommerce-beta-tester/api/api.php
+++ b/plugins/woocommerce-beta-tester/api/api.php
@@ -22,10 +22,12 @@ function register_woocommerce_admin_test_helper_rest_route( $route, $callback, $
'methods' => 'POST',
'callback' => $callback,
'permission_callback' => function ( $request ) {
- if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
+ // Match the capability required by the Test Helper admin page.
+ if ( ! current_user_can( 'install_plugins' ) ) {
return new \WP_Error(
'woocommerce_rest_cannot_edit',
- __( 'Sorry, you cannot perform this action', 'woocommerce-beta-tester' )
+ __( 'Sorry, you cannot perform this action', 'woocommerce-beta-tester' ),
+ array( 'status' => rest_authorization_required_code() )
);
}
return true;
diff --git a/plugins/woocommerce-beta-tester/changelog.txt b/plugins/woocommerce-beta-tester/changelog.txt
index 45db3e7e24c..c0c35ddd3b3 100644
--- a/plugins/woocommerce-beta-tester/changelog.txt
+++ b/plugins/woocommerce-beta-tester/changelog.txt
@@ -1,5 +1,32 @@
*** WooCommerce Beta Tester Changelog ***
+2026-10-05 - version 4.0.0
+* Patch - Remove async product editor category field from live branch feature flags.
+* Patch - Implement hide shipping rates when free is available option
+* Patch - Monorepo: Webpack deps review and consolidation and a bit of deps grooming
+* Patch - Bump wireit dependency version to latest.
+* Patch - Beta Tester: Remove not necessary endpoints to reset CYS.
+* Patch - Monorepo: consolidate packages licenses to `GPL-2.0-or-later`.
+* Major [ **BREAKING CHANGE** ] - Updated all PHP dependencies.
+* Minor - Remove Legacy REST API settings section, admin notices, auto-install logic, and UI nudges from WooCommerce core. The Legacy REST API extension continues to work if manually installed.
+* Patch - Reset Customize Your Store: simplify the action to adjust to journey updates
+* Minor - Add template loading tool in beta tester
+* Patch - Remove the unused PHPUnit dev dependency and move symfony/process to a patched version.
+* Patch - Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
+* Patch - Fix TypeError when deleting the simulate WooCommerce JS error option
+* Patch - Fix live-branches api request body structure to use 'data' instead of 'body'
+* Patch - Restrict the WCA Test Helper REST API, its admin script, and the Live Branches page to users who can install plugins.
+* Patch - Deactivate an active Live Branch build before switching WooCommerce versions, preventing a fatal error.
+* Patch - Fix live-branches userscript broken by GitHub DOM changes: extract PR data from embedded JSON instead of removed CSS selectors, and fix checkbox change listeners that were never attached due to arrow function misuse.
+* Patch - Restore the main Beta Tester JavaScript bundle and correct asset version fallback paths.
+* Patch - Remove product editor devtools for the deprecated product block editor.
+* Minor - Remove reactify-classic-payments-settings flag as it was migrated to Core features
+* Patch - Update PHP development dependencies to versions that resolve reported security advisories.
+* Patch - Update @wordpress/* peerDependencies from dist-tags to semver ranges for pnpm 10 compatibility.
+* Minor - Added additional switch version button to the top of versions list
+* Major [ **BREAKING CHANGE** ] - Update @wordpress/* dependencies to wp-6.8 minimum.
+* Patch - Update woocommerce-sniffs to 1.0.1 / wp-coding-standards/wpcs to 3.4.1 (security release).
+
2025-02-20 - version 3.0.0
* Patch - Fix warnings on the Plugins page when a plugin requires another plugin
* Patch - Add tab navigation with URL state management in WooCommerce Admin Test Helper
diff --git a/plugins/woocommerce-beta-tester/changelog/49120-remove-async-product-editor-category-field b/plugins/woocommerce-beta-tester/changelog/49120-remove-async-product-editor-category-field
deleted file mode 100644
index b2078449090..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/49120-remove-async-product-editor-category-field
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: update
-
-Remove async product editor category field from live branch feature flags.
diff --git a/plugins/woocommerce-beta-tester/changelog/55796-add-54370-hide_flat_rate_when_free b/plugins/woocommerce-beta-tester/changelog/55796-add-54370-hide_flat_rate_when_free
deleted file mode 100644
index d41a2c40d43..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/55796-add-54370-hide_flat_rate_when_free
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: add
-
-Implement hide shipping rates when free is available option
diff --git a/plugins/woocommerce-beta-tester/changelog/56506-remove-wp-components-types b/plugins/woocommerce-beta-tester/changelog/56506-remove-wp-components-types
deleted file mode 100644
index 0ad65cfbb86..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/56506-remove-wp-components-types
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Remove deprecated `@types/wordpress__components`
-
diff --git a/plugins/woocommerce-beta-tester/changelog/56746-dev-webpack-deps-review b/plugins/woocommerce-beta-tester/changelog/56746-dev-webpack-deps-review
deleted file mode 100644
index e9a02f11994..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/56746-dev-webpack-deps-review
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Monorepo: Webpack deps review and consolidation and a bit of deps grooming
diff --git a/plugins/woocommerce-beta-tester/changelog/57299-fix-wireit-in-ci b/plugins/woocommerce-beta-tester/changelog/57299-fix-wireit-in-ci
deleted file mode 100644
index 64a516aab35..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/57299-fix-wireit-in-ci
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Bump wireit dependency version to latest.
diff --git a/plugins/woocommerce-beta-tester/changelog/57605-fix-wc-beta-tester-cys-reset b/plugins/woocommerce-beta-tester/changelog/57605-fix-wc-beta-tester-cys-reset
deleted file mode 100644
index 792cebae659..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/57605-fix-wc-beta-tester-cys-reset
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: tweak
-
-Beta Tester: Remove not necessary endpoints to reset CYS.
diff --git a/plugins/woocommerce-beta-tester/changelog/58755-dev-53714 b/plugins/woocommerce-beta-tester/changelog/58755-dev-53714
deleted file mode 100644
index 4851560475b..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/58755-dev-53714
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Bumped PHP version to 8.1
-
diff --git a/plugins/woocommerce-beta-tester/changelog/58941-dev-consolidate-packages-license-version b/plugins/woocommerce-beta-tester/changelog/58941-dev-consolidate-packages-license-version
deleted file mode 100644
index b4b0a7eaf67..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/58941-dev-consolidate-packages-license-version
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Monorepo: consolidate packages licenses to `GPL-2.0-or-later`.
diff --git a/plugins/woocommerce-beta-tester/changelog/61753-fix-support-composer-update b/plugins/woocommerce-beta-tester/changelog/61753-fix-support-composer-update
deleted file mode 100644
index 64159d14a56..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/61753-fix-support-composer-update
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: major
-Type: update
-
-Updated all PHP dependencies.
diff --git a/plugins/woocommerce-beta-tester/changelog/64076-remove-legacy-rest-api-options b/plugins/woocommerce-beta-tester/changelog/64076-remove-legacy-rest-api-options
deleted file mode 100644
index 515d9ab9ff6..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/64076-remove-legacy-rest-api-options
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: dev
-
-Remove Legacy REST API settings section, admin notices, auto-install logic, and UI nudges from WooCommerce core. The Legacy REST API extension continues to work if manually installed.
diff --git a/plugins/woocommerce-beta-tester/changelog/66078-dehoist-react b/plugins/woocommerce-beta-tester/changelog/66078-dehoist-react
deleted file mode 100644
index 7dbe37978f8..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/66078-dehoist-react
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Declare react/react-dom as devDependencies alongside the existing peerDependencies. Tooling only; no runtime change.
diff --git a/plugins/woocommerce-beta-tester/changelog/66097-bump-wp-env-and-playwright b/plugins/woocommerce-beta-tester/changelog/66097-bump-wp-env-and-playwright
deleted file mode 100644
index 94d555e5db3..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/66097-bump-wp-env-and-playwright
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Bump @wordpress/env to 11.9.0 and @playwright/test to 1.61.1 (dev dependencies; no merchant-facing change).
diff --git a/plugins/woocommerce-beta-tester/changelog/add-55908-beta-tester-ci-config b/plugins/woocommerce-beta-tester/changelog/add-55908-beta-tester-ci-config
deleted file mode 100644
index ef72afe9441..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/add-55908-beta-tester-ci-config
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Add CI configuration to the WooCommerce Beta Tester package.json so lint and JavaScript unit test jobs run when the package's code changes; the JavaScript test job additionally runs when a monorepo dependency changes.
diff --git a/plugins/woocommerce-beta-tester/changelog/add-simplify-cys-remove-unnecessary-code b/plugins/woocommerce-beta-tester/changelog/add-simplify-cys-remove-unnecessary-code
deleted file mode 100644
index e4927ce4edf..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/add-simplify-cys-remove-unnecessary-code
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: update
-
-Reset Customize Your Store: simplify the action to adjust to journey updates
diff --git a/plugins/woocommerce-beta-tester/changelog/add-woocommerce-beta-tester-template-load-tool b/plugins/woocommerce-beta-tester/changelog/add-woocommerce-beta-tester-template-load-tool
deleted file mode 100644
index 2bbd682f35f..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/add-woocommerce-beta-tester-template-load-tool
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Add template loading tool in beta tester
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-add-note-drop-image-layout b/plugins/woocommerce-beta-tester/changelog/dev-add-note-drop-image-layout
deleted file mode 100644
index 4371207cd8d..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/dev-add-note-drop-image-layout
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Remove the image and layout fields from the test "Add admin note" tool now that inbox notes no longer render images.
-
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-drop-phpunit-and-bump-symfony-process b/plugins/woocommerce-beta-tester/changelog/dev-drop-phpunit-and-bump-symfony-process
deleted file mode 100644
index ad2adeda1dc..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/dev-drop-phpunit-and-bump-symfony-process
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Remove the unused PHPUnit dev dependency and move symfony/process to a patched version.
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-eslint-no-floating-promises b/plugins/woocommerce-beta-tester/changelog/dev-eslint-no-floating-promises
deleted file mode 100644
index e1986b60836..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/dev-eslint-no-floating-promises
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/plugins/woocommerce-beta-tester/changelog/fix-beta-tester-delete-option-error b/plugins/woocommerce-beta-tester/changelog/fix-beta-tester-delete-option-error
deleted file mode 100644
index 73dcb65ed2b..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/fix-beta-tester-delete-option-error
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Fix TypeError when deleting the simulate WooCommerce JS error option
diff --git a/plugins/woocommerce-beta-tester/changelog/fix-beta-tester-live-branch b/plugins/woocommerce-beta-tester/changelog/fix-beta-tester-live-branch
deleted file mode 100644
index 6c027b82758..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/fix-beta-tester-live-branch
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Fix live-branches api request body structure to use 'data' instead of 'body'
diff --git a/plugins/woocommerce-beta-tester/changelog/fix-live-branches-github-selectors b/plugins/woocommerce-beta-tester/changelog/fix-live-branches-github-selectors
deleted file mode 100644
index 65c4cca0cda..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/fix-live-branches-github-selectors
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Fix live-branches userscript broken by GitHub DOM changes: extract PR data from embedded JSON instead of removed CSS selectors, and fix checkbox change listeners that were never attached due to arrow function misuse.
diff --git a/plugins/woocommerce-beta-tester/changelog/fix-missing-index-build b/plugins/woocommerce-beta-tester/changelog/fix-missing-index-build
deleted file mode 100644
index 440d345e809..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/fix-missing-index-build
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Restore the main Beta Tester JavaScript bundle and correct asset version fallback paths.
diff --git a/plugins/woocommerce-beta-tester/changelog/fix-wordpress-data-dependency b/plugins/woocommerce-beta-tester/changelog/fix-wordpress-data-dependency
deleted file mode 100644
index 0eceac67ceb..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/fix-wordpress-data-dependency
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Declare the WordPress data package used by the beta tester tools.
-
-
diff --git a/plugins/woocommerce-beta-tester/changelog/remove-product-editor-devtools b/plugins/woocommerce-beta-tester/changelog/remove-product-editor-devtools
deleted file mode 100644
index 2279d62f92d..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/remove-product-editor-devtools
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Remove product editor devtools for the deprecated product block editor.
diff --git a/plugins/woocommerce-beta-tester/changelog/update-migrate-reactify-feature-flag b/plugins/woocommerce-beta-tester/changelog/update-migrate-reactify-feature-flag
deleted file mode 100644
index 726cc6fa358..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/update-migrate-reactify-feature-flag
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: update
-
-Remove reactify-classic-payments-settings flag as it was migrated to Core features
diff --git a/plugins/woocommerce-beta-tester/changelog/update-php-dev-dependency-security-patches b/plugins/woocommerce-beta-tester/changelog/update-php-dev-dependency-security-patches
deleted file mode 100644
index f002b0c10a8..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/update-php-dev-dependency-security-patches
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Update PHP development dependencies to versions that resolve reported security advisories.
diff --git a/plugins/woocommerce-beta-tester/changelog/update-pnpm-10-upgrade b/plugins/woocommerce-beta-tester/changelog/update-pnpm-10-upgrade
deleted file mode 100644
index 06fa4b8bf68..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/update-pnpm-10-upgrade
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Update @wordpress/* peerDependencies from dist-tags to semver ranges for pnpm 10 compatibility.
diff --git a/plugins/woocommerce-beta-tester/changelog/update-switch-version-button-location b/plugins/woocommerce-beta-tester/changelog/update-switch-version-button-location
deleted file mode 100644
index c8a772c0a42..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/update-switch-version-button-location
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: enhancement
-
-Added additional switch version button to the top of versions list
diff --git a/plugins/woocommerce-beta-tester/changelog/update-wp-68-packages b/plugins/woocommerce-beta-tester/changelog/update-wp-68-packages
deleted file mode 100644
index 866d7f6ed70..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/update-wp-68-packages
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: major
-Type: update
-
-Update @wordpress/* dependencies to wp-6.8 minimum.
diff --git a/plugins/woocommerce-beta-tester/changelog/update-wpcs-3-4-1 b/plugins/woocommerce-beta-tester/changelog/update-wpcs-3-4-1
deleted file mode 100644
index 2542ffcb769..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/update-wpcs-3-4-1
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: dev
-
-Update woocommerce-sniffs to 1.0.1 / wp-coding-standards/wpcs to 3.4.1 (security release).
diff --git a/plugins/woocommerce-beta-tester/changelog/wooplug-5699-add-license-file-to-root b/plugins/woocommerce-beta-tester/changelog/wooplug-5699-add-license-file-to-root
deleted file mode 100644
index 2f331ea3f03..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/wooplug-5699-add-license-file-to-root
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Add a license file to the repository root and reference it from the README. Documentation only; no runtime change.
diff --git a/plugins/woocommerce-beta-tester/changelog/wooplug-6930-adopt-import-order b/plugins/woocommerce-beta-tester/changelog/wooplug-6930-adopt-import-order
deleted file mode 100644
index 6a2c44e8ef9..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/wooplug-6930-adopt-import-order
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Remove obsolete @woocommerce/dependency-group eslint-disable directives following the switch to import/order in @woocommerce/eslint-plugin.
diff --git a/plugins/woocommerce-beta-tester/changelog/wooplug-6930-eslint-v10-flat-config b/plugins/woocommerce-beta-tester/changelog/wooplug-6930-eslint-v10-flat-config
deleted file mode 100644
index 46bff620b47..00000000000
--- a/plugins/woocommerce-beta-tester/changelog/wooplug-6930-eslint-v10-flat-config
+++ /dev/null
@@ -1,3 +0,0 @@
-Significance: patch
-Type: dev
-Comment: Migrate to ESLint v10 Flat Config. Tooling only; no runtime change.
diff --git a/plugins/woocommerce-beta-tester/composer.json b/plugins/woocommerce-beta-tester/composer.json
index a6d1ef584d1..dd5f337e126 100644
--- a/plugins/woocommerce-beta-tester/composer.json
+++ b/plugins/woocommerce-beta-tester/composer.json
@@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"prefer-stable": true,
"minimum-stability": "dev",
- "version": "3.0.0",
+ "version": "4.0.0",
"require": {
"composer/installers": "~1.7"
},
diff --git a/plugins/woocommerce-beta-tester/composer.lock b/plugins/woocommerce-beta-tester/composer.lock
index 4f8c5c69b13..121d846bf6b 100644
--- a/plugins/woocommerce-beta-tester/composer.lock
+++ b/plugins/woocommerce-beta-tester/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": "d3694c9af970ec9bc673e6f81785ac2e",
+ "content-hash": "4e5cc42ed3e222c3f26a1b7fd98001df",
"packages": [
{
"name": "composer/installers",
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php
index bfc63fbd58e..541ebeb55f7 100644
--- a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php
@@ -36,7 +36,7 @@ class WC_Beta_Tester_Live_Branches {
return;
}
- if ( ! is_admin() ) {
+ if ( ! is_admin() || ! current_user_can( 'install_plugins' ) ) {
return;
}
@@ -79,7 +79,7 @@ class WC_Beta_Tester_Live_Branches {
'title' => __( 'Live Branches', 'woocommerce-beta-tester' ),
'path' => '/live-branches',
'parent' => 'woocommerce',
- 'capability' => 'read',
+ 'capability' => 'install_plugins',
)
);
}
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-version-picker.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-version-picker.php
index 6f5583136c2..c0a83252fa5 100644
--- a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-version-picker.php
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-version-picker.php
@@ -66,15 +66,53 @@ class WC_Beta_Tester_Version_Picker {
$upgrader = new WC_Beta_Tester_Plugin_Upgrader( $skin );
$result = $upgrader->switch_version( $plugin );
- // Try to reactivate.
- activate_plugin( $plugin, '', is_network_admin(), true );
+ require_once __DIR__ . '/class-wc-beta-tester-live-branches-installer.php';
+ $is_live_branch = function ( $active_plugin ) {
+ return str_contains( $active_plugin, LIVE_BRANCH_PLUGIN_PREFIX );
+ };
+ $live_branch_plugins = array_filter( (array) get_option( 'active_plugins', array() ), $is_live_branch );
+ $network_live_branch_plugins = is_multisite()
+ ? array_filter( array_keys( (array) get_site_option( 'active_sitewide_plugins', array() ) ), $is_live_branch )
+ : array();
+ $has_live_branch = ! empty( $live_branch_plugins ) || ! empty( $network_live_branch_plugins );
+
+ if ( ! $has_live_branch ) {
+ // Try to reactivate.
+ activate_plugin( $plugin, '', is_network_admin(), true );
+ } elseif ( true === $result && ! is_wp_error( $skin->result ) ) {
+ // An active Live Branch build is already loaded in this request, so activating WooCommerce
+ // here would declare it twice. Deactivate the build and activate WooCommerce in a new request.
+ // Only after a successful switch, so a failed one leaves the Live Branch build active.
+ if ( ! empty( $live_branch_plugins ) ) {
+ deactivate_plugins( $live_branch_plugins );
+ }
+ if ( ! empty( $network_live_branch_plugins ) ) {
+ deactivate_plugins( $network_live_branch_plugins, false, true );
+ }
+ }
if ( is_wp_error( $skin->result ) ) {
throw new Exception( $skin->result->get_error_message() );
- } elseif ( false === $result ) {
+ } elseif ( is_wp_error( $result ) ) {
+ throw new Exception( $result->get_error_message() );
+ } elseif ( true !== $result ) {
throw new Exception( __( 'Update failed', 'woocommerce-beta-tester' ) );
}
+ if ( $has_live_branch ) {
+ // Activate network-wide when the Live Branch build was network-active.
+ $activate_url = add_query_arg(
+ array(
+ 'action' => 'activate',
+ 'plugin' => rawurlencode( $plugin ),
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin ),
+ ),
+ empty( $network_live_branch_plugins ) ? self_admin_url( 'plugins.php' ) : network_admin_url( 'plugins.php' )
+ );
+ wp_safe_redirect( $activate_url );
+ exit;
+ }
+
wp_safe_redirect( admin_url( 'plugins.php?page=wc-beta-tester-version-picker&switched=' . rawurlencode( $version ) ) );
exit;
} catch ( Exception $e ) {
diff --git a/plugins/woocommerce-beta-tester/package.json b/plugins/woocommerce-beta-tester/package.json
index 7b97840aa96..67dde9cd312 100644
--- a/plugins/woocommerce-beta-tester/package.json
+++ b/plugins/woocommerce-beta-tester/package.json
@@ -8,7 +8,7 @@
"url": "git://github.com/woocommerce/woocommerce-beta-tester.git"
},
"title": "WooCommerce Beta Tester",
- "version": "3.0.0",
+ "version": "4.0.0",
"homepage": "http://github.com/woocommerce/woocommerce-beta-tester",
"devDependencies": {
"@types/react": "18.3.x",
diff --git a/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php b/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php
index 53af244dbad..edceb1a7916 100644
--- a/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php
+++ b/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php
@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Beta Tester
* Plugin URI: https://github.com/woocommerce/woocommerce-beta-tester
* Description: Run bleeding edge versions of WooCommerce. This will replace your installed version of WooCommerce with the latest tagged release - use with caution, and not on production sites.
- * Version: 3.0.0
+ * Version: 4.0.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Requires at least: 5.8
@@ -30,7 +30,7 @@ if ( ! defined( 'WC_BETA_TESTER_FILE' ) ) {
}
if ( ! defined( 'WC_BETA_TESTER_VERSION' ) ) {
- define( 'WC_BETA_TESTER_VERSION', '3.0.0' ); // WRCS: DEFINED_VERSION.
+ define( 'WC_BETA_TESTER_VERSION', '4.0.0' ); // WRCS: DEFINED_VERSION.
}
/**
@@ -81,7 +81,8 @@ add_action( 'plugins_loaded', '_wc_beta_tester_bootstrap' );
* Register the JS.
*/
function add_extension_register_script() {
- if ( ! defined( 'WC_ADMIN_APP' ) ) {
+ // The script calls the WCA Test Helper REST API, which requires install_plugins.
+ if ( ! defined( 'WC_ADMIN_APP' ) || ! current_user_can( 'install_plugins' ) ) {
return;
}
$script_path = '/build/index.js';