-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: delete old feature flags from DB #9263
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.31 MB ℹ️ View Unchanged
|
@@ -33,7 +33,6 @@ declare const global: { | |||
}; | |||
featureFlags: { | |||
isAuthAndCaptureEnabled: boolean; | |||
isRefundControlsEnabled: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag was only used in tests - likely missed during a cleanup task.
@@ -386,7 +367,6 @@ public static function to_array() { | |||
'woopayExpressCheckout' => self::is_woopay_express_checkout_enabled(), | |||
'isAuthAndCaptureEnabled' => self::is_auth_and_capture_enabled(), | |||
'isDisputeIssuerEvidenceEnabled' => self::is_dispute_issuer_evidence_enabled(), | |||
'isRefundControlsEnabled' => self::is_streamline_refunds_enabled(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag was only used in tests - likely missed during a cleanup task.
public static function is_streamline_refunds_enabled(): bool { | ||
return '1' === get_option( self::STREAMLINE_REFUNDS_FLAG_NAME, '0' ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was only used in tests - likely missed during a cleanup task.
public static function is_subscription_migration_enabled() { | ||
return '1' === get_option( '_wcpay_feature_allow_subscription_migrations', '0' ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was not used anywhere in the codebase.
@@ -54,8 +54,6 @@ function () { | |||
} | |||
); | |||
|
|||
update_option( '_wcpay_feature_allow_subscription_migrations', '1' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag was likely a leftover from a cleanup task
@@ -37,16 +37,6 @@ public function set_up() { | |||
|
|||
$this->order_service = new WC_Payments_Order_Service( $this->createMock( WC_Payments_API_Client::class ) ); | |||
$this->order = WC_Helper_Order::create_order(); | |||
|
|||
// Turn on fraud settings. | |||
update_option( 'wcpay_fraud_protection_settings_active', '1' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag was not checked anywhere in the codebase, just in tests. Likely a leftover from a cleanup task.
@@ -175,7 +175,6 @@ public function test_add_token_to_user_for_sepa() { | |||
* Test add SEPA token to user with deferred intent creation UPE. | |||
*/ | |||
public function test_add_token_to_user_for_sepa_deferred_intent_creation_upe() { | |||
$this->mock_cache->method( 'get' )->willReturn( [ 'is_deferred_intent_creation_upe_enabled' => true ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag was not checked anywhere in the codebase - likely a leftover from a cleanup task.
includes/migrations/class-erase-deprecated-flags-and-options.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Guilherme Pressutto <gpressutto5@gmail.com>
Changes proposed in this Pull Request
I created a migration to delete old feature flags from the DB.
I am creating it because it looks like they might have never been cleaned.
Some of the feature flags might have been internal/developer facing, but others might have been customer-facing (like the UPE ones).
Cleaning them all up.
To gather this list, I went through the history of the
includes/class-wc-payments-features.php
and all its changes.Testing instructions
I added som tests for the migration.
8.1.0
: https://github.com/Automattic/woocommerce-payments/blob/develop/woocommerce-payments.php#L14-L148.1.0
_wcpay_feature_client_secret_encryption
option no longer existsnpm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge