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
+2 -2
View File
@@ -3490,7 +3490,7 @@ wpdo.getListings({ per_page: 3 }).then(r => console.log(r));'
<?php
// v2.12.1: Term + Comment garbage write-time filter toggle + status.
$tcg_enabled = (bool) get_option( 'wpdo_term_comment_garbage_filter_enabled', '1' );
$tcg_enabled = (bool) get_option( 'wpdo_term_comment_garbage_filter_enabled', '0' );
$tcg_drops_24h = class_exists( 'TMDO_Term_Comment_Garbage_Filter' )
? TMDO_Term_Comment_Garbage_Filter::get_drop_count_24h()
: 0;
@@ -3653,7 +3653,7 @@ wpdo.getListings({ per_page: 3 }).then(r => console.log(r));'
<?php
// v2.12.4: Term + Comment misc bucket toggle + status.
$misc_enabled = (bool) get_option( 'wpdo_term_comment_misc_bucket_enabled', '1' );
$misc_enabled = (bool) get_option( 'wpdo_term_comment_misc_bucket_enabled', '0' );
$term_misc_rows = class_exists( 'TMDO_Term_Comment_Misc_Bucket' )
? TMDO_Term_Comment_Misc_Bucket::count_rows( 'term' )
: 0;