fix(2meet-data-optimizer): default misc bucket and garbage filter to off

- Both term/comment filters now default to disabled for new installs, so
  activating the plugin no longer reroutes or drops other plugins' meta
- One-time maybe_upgrade() migration keeps the misc bucket on for sites
  that already hold misc rows and never set the toggle (data stays readable)
- Admin toggles show the same defaults as the filters

Verify: phpunit-integration --filter 'defaults_false|preserve_default';
  unit 600 OK, integration 420 OK
PR: PR-006
This commit is contained in:
2026-09-25 21:39:38 +08:00
parent d3b72bd1af
commit 151aadd661
6 changed files with 89 additions and 9 deletions
@@ -109,12 +109,12 @@ final class TMDO_Term_Comment_Garbage_Filter {
}
/**
* Check the admin toggle. Defaults to enabled.
* Check the admin toggle. Defaults to disabled.
*
* @return bool
*/
public static function is_enabled(): bool {
return (bool) get_option( self::OPT_ENABLED, '1' );
return (bool) get_option( self::OPT_ENABLED, '0' );
}
/**
@@ -95,12 +95,13 @@ final class TMDO_Term_Comment_Misc_Bucket {
}
/**
* Check the admin toggle. Defaults to enabled.
* Check the admin toggle. Defaults to disabled; sites that already hold misc
* rows keep it on via TMDO_Installer::maybe_preserve_misc_bucket_default().
*
* @return bool
*/
public static function is_enabled(): bool {
return (bool) get_option( self::OPT_ENABLED, '1' );
return (bool) get_option( self::OPT_ENABLED, '0' );
}
/**