Repository navigation
v2.1.1 — Phase 9.5 WPPB-style bootstrap decoupling
Phase 9.5 of the epic/refactor-april arc — bootstrap decoupling.
What changed
Five single-responsibility registrars extracted out of the 5,600-line god-class into dedicated classes under src/, following the WordPress Plugin Boilerplate layout.
dataflair-toplists.php shrank ~860 lines (15%). The main plugin file now owns only bootstrap constants, composer autoload, register_activation_hook / register_deactivation_hook, and \DataFlair\Toplists\Plugin::boot(__FILE__).
New classes under src/:
Admin\PluginInfoFilter—plugins_api'View details' popup (description, full changelog, banners).UpdateChecker\GithubUpdateChecker— YahnisElsts PUC v5 bootstrap +enableReleaseAssets(). Short-circuits cleanly when PUC orWP_PLUGIN_DIRis absent (e.g. unit tests).I18n—load_plugin_textdomainoninit. Fixes a latent bug: the textdomain header was declared but never actually loaded, so translations would have silently failed.Lifecycle\Activator+Deactivator— WPPB-style static entry points. Activator runs the schema migrator; Deactivator clears legacydataflair_sync_cron/dataflair_brands_sync_cronhooks (idempotent — they were removed in v1.11.0).Database\SchemaMigrator—checkDatabaseUpgrade(),createTables(),ensureTablesExist(),ensureBrandsExternalIdIndex(),ensureAlternativeToplistsTable(),supportsJsonType(),migrateToJsonType(). Preserves the H9 schema-ok transient short-circuit and the H1 legacy-cron clear gate.
Plugin::boot(?string $pluginFile = null) now accepts the plugin file path at boot time and exposes it via Plugin::pluginFile() so extracted registrars can wire hooks like plugin_basename($pluginFile) without hand-computing paths.
God-class methods (activate, deactivate, check_database_upgrade, ensure_alternative_toplists_table, supports_json_type, migrate_to_json_type) are now thin delegators. Signatures and visibility preserved so any downstream caller continues to resolve.
Upgrade impact
Zero behavioural change for end users. No operator action, no DB migration, no config change. Every hook, option, table, shortcode, block, REST route, and AJAX action is preserved byte-for-byte. The DataFlair_Toplists::get_instance() strict-deprecation contract from 2.1.0 is untouched.
Tests
Full suite: 412 tests, 946 assertions, all green.
AutoUpdateTestupdated to searchsrc/UpdateChecker/GithubUpdateChecker.phpfor the PUC bootstrap substrings.ClearTransientsChunkedTest::test_check_database_upgrade_uses_schema_ok_transientnow extracts fromSchemaMigrator::checkDatabaseUpgrade().CronRemovedTestappends SchemaMigrator source to its scan so the legacy-cron clear assertions still hit.
Why a patch bump
2.1.0 → 2.1.1 because there is zero public-API or behavioural change. This is internal refactoring — WPPB-style decoupling that sets the table for incremental extraction of the remaining ~80 god-class methods in future v2.1.x point releases before the eventual v3.0.0 class-symbol removal.