From 9353a54fd512779de5f003dc0e018c108e013fdf Mon Sep 17 00:00:00 2001 From: Wesley Rosa Date: Thu, 2 Oct 2025 18:50:53 -0300 Subject: [PATCH 1/4] Hardcoding ECE feature flag to be always enabled --- changelog.txt | 1 + includes/class-wc-stripe-feature-flags.php | 16 +++++++++++++--- includes/connect/class-wc-stripe-connect.php | 14 -------------- readme.txt | 1 + 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/changelog.txt b/changelog.txt index 58f8e4c854..270e306a97 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ *** Changelog *** = 10.0.0 - xxxx-xx-xx = +* Update - Hardcodes the Express Checkout feature flag to be always enabled * Dev - Expands the Stripe Order Helper class to handle source ID, refund ID, intent ID, and setup intent ID metas * Update - Removing the `wc_stripe_is_upe_checkout_enabled` filter, as Legacy Checkout is no longer supported * Dev - Upgrades `jest` to version 29.7.0, `@wordpress/scripts` to 26.19.0, and adds `axios`(version 1.12.2) to the JavaScript development dependencies diff --git a/includes/class-wc-stripe-feature-flags.php b/includes/class-wc-stripe-feature-flags.php index a199a4b54e..11bce3b642 100644 --- a/includes/class-wc-stripe-feature-flags.php +++ b/includes/class-wc-stripe-feature-flags.php @@ -5,9 +5,18 @@ class WC_Stripe_Feature_Flags { const UPE_CHECKOUT_FEATURE_ATTRIBUTE_NAME = 'upe_checkout_experience_enabled'; - const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece'; const AMAZON_PAY_FEATURE_FLAG_NAME = '_wcstripe_feature_amazon_pay'; + /** + * Feature flag for Stripe ECE (Express Checkout Element). + * This feature flag controls whether the new Express Checkout Element (ECE) or the legacy Payment Request Button (PRB) is used to render express checkout buttons. + * + * @var string + * + * @deprecated This feature flag will be removed in version 10.0.0. ECE will be permanently enabled. + */ + const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece'; + /** * Feature flag for Optimized Checkout (OC). * @@ -25,7 +34,6 @@ class WC_Stripe_Feature_Flags { */ protected static $feature_flags = [ '_wcstripe_feature_upe' => 'yes', - self::ECE_FEATURE_FLAG_NAME => 'yes', self::AMAZON_PAY_FEATURE_FLAG_NAME => 'no', self::OC_FEATURE_FLAG_NAME => 'no', ]; @@ -65,9 +73,11 @@ public static function is_amazon_pay_available() { * Express checkout buttons are rendered with either ECE or PRB depending on this feature flag. * * @return bool + * + * @deprecated 10.0.0 ECE is always enabled. This method will be removed in a future release. */ public static function is_stripe_ece_enabled() { - return 'yes' === self::get_option_with_default( self::ECE_FEATURE_FLAG_NAME ); + return true; } /** diff --git a/includes/connect/class-wc-stripe-connect.php b/includes/connect/class-wc-stripe-connect.php index 5cfb53a48b..2945528fb3 100644 --- a/includes/connect/class-wc-stripe-connect.php +++ b/includes/connect/class-wc-stripe-connect.php @@ -177,9 +177,6 @@ private function save_stripe_keys( $result, $type = 'connect', $mode = 'live' ) unset( $options['account_id'] ); unset( $options['test_account_id'] ); - // Enable ECE for new connections. - $this->enable_ece_in_new_accounts(); - WC_Stripe_Database_Cache::delete( WC_Stripe_API::INVALID_API_KEY_ERROR_COUNT_CACHE_KEY ); WC_Stripe_Helper::update_main_stripe_settings( $options ); @@ -232,17 +229,6 @@ private function get_upe_checkout_experience_enabled() { return 'yes'; } - /** - * Enable Stripe express checkout element for new connections. - */ - private function enable_ece_in_new_accounts() { - $existing_stripe_settings = WC_Stripe_Helper::get_stripe_settings(); - - if ( empty( $existing_stripe_settings ) ) { - update_option( WC_Stripe_Feature_Flags::ECE_FEATURE_FLAG_NAME, 'yes' ); - } - } - /** * Gets default Stripe settings */ diff --git a/readme.txt b/readme.txt index 3cb827bad1..2f3d706de4 100644 --- a/readme.txt +++ b/readme.txt @@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o == Changelog == = 10.0.0 - xxxx-xx-xx = +* Update - Hardcodes the Express Checkout feature flag to be always enabled * Dev - Expands the Stripe Order Helper class to handle source ID, refund ID, intent ID, and setup intent ID metas * Update - Removing the `wc_stripe_is_upe_checkout_enabled` filter, as Legacy Checkout is no longer supported * Dev - Upgrades `jest` to version 29.7.0, `@wordpress/scripts` to 26.19.0, and adds `axios`(version 1.12.2) to the JavaScript development dependencies From 641120593e0f0d62899e14ed27e5fff359dcddb0 Mon Sep 17 00:00:00 2001 From: Wesley Rosa Date: Fri, 3 Oct 2025 07:28:55 -0300 Subject: [PATCH 2/4] Fix comment --- includes/class-wc-stripe-feature-flags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-stripe-feature-flags.php b/includes/class-wc-stripe-feature-flags.php index 11bce3b642..17a036c142 100644 --- a/includes/class-wc-stripe-feature-flags.php +++ b/includes/class-wc-stripe-feature-flags.php @@ -13,7 +13,7 @@ class WC_Stripe_Feature_Flags { * * @var string * - * @deprecated This feature flag will be removed in version 10.0.0. ECE will be permanently enabled. + * @deprecated This feature flag will be removed in version 10.1.0. ECE will be permanently enabled. */ const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece'; From ac680e644dc481ebe30d834986685cb2ed5999a1 Mon Sep 17 00:00:00 2001 From: Wesley Rosa Date: Mon, 6 Oct 2025 10:23:05 -0300 Subject: [PATCH 3/4] Update changelog.txt Co-authored-by: daledupreez --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index b6d5b321da..347cc6b0c6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ *** Changelog *** = 10.0.0 - xxxx-xx-xx = -* Update - Hardcodes the Express Checkout feature flag to be always enabled +* Update - Disable Payment Request Buttons and ensure Express Checkout is used when express checkout buttons are enabled * Dev - Expands the Stripe Order Helper class to handle source ID, refund ID, intent ID, and setup intent ID metas * Update - Removing the `wc_stripe_is_upe_checkout_enabled` filter, as Legacy Checkout is no longer supported * Dev - Upgrades `jest` to version 29.7.0, `@wordpress/scripts` to 26.19.0, and adds `axios`(version 1.12.2) to the JavaScript development dependencies From d3a0455f0ff45b4f3869f11fd300736c7bacc169 Mon Sep 17 00:00:00 2001 From: Wesley Rosa Date: Mon, 6 Oct 2025 10:24:03 -0300 Subject: [PATCH 4/4] Readme entry update --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index f40d42677a..b0141d6d40 100644 --- a/readme.txt +++ b/readme.txt @@ -111,7 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o == Changelog == = 10.0.0 - xxxx-xx-xx = -* Update - Hardcodes the Express Checkout feature flag to be always enabled +* Update - Disable Payment Request Buttons and ensure Express Checkout is used when express checkout buttons are enabled * Dev - Expands the Stripe Order Helper class to handle source ID, refund ID, intent ID, and setup intent ID metas * Update - Removing the `wc_stripe_is_upe_checkout_enabled` filter, as Legacy Checkout is no longer supported * Dev - Upgrades `jest` to version 29.7.0, `@wordpress/scripts` to 26.19.0, and adds `axios`(version 1.12.2) to the JavaScript development dependencies