Skip to content

Commit afe6cc8

Browse files
authored
Merge pull request #4337 from woocommerce/dev/PCP-6299-cannot-exit-branded-only-mode
fix(uninstall): clear `woocommerce_paypal_branded` flag on plugin uninstall (6299)
2 parents 12b69a1 + 40792d8 commit afe6cc8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

uninstall.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
$general_settings = $app_container->get( 'settings.data.general' );
4343
assert( $general_settings instanceof GeneralSettings );
4444

45+
/**
46+
* Delete the branded flag unconditionally so reinstalling from a different
47+
* source (e.g. WordPress.org) does not silently re-enter branded-only mode.
48+
* Unlike most settings, this flag must be cleared on every uninstall — even
49+
* when the full-reset filter is off — because keeping it prevents merchants
50+
* from ever escaping branded-only mode without direct DB intervention.
51+
*/
52+
delete_option( 'woocommerce_paypal_branded' );
53+
4554
if ( $general_settings->reset_installation_path( 'plugin_uninstall' ) ) {
4655
$general_settings->save();
4756
}

0 commit comments

Comments
 (0)