run(); } return self::$instance; } /** * Private constructor (use instance()). */ private function __construct() {} /** * Boot surfaces + controllers. * * @return void */ private function run() { // Move a pre-2.9 install's data onto the new `aisiteark_` names before anything reads it. Migrator::maybe_run(); self::maybe_upgrade(); if ( is_admin() ) { ( new Admin() )->register(); // What's New — in-dashboard release notes + post-update notice. if ( class_exists( '\\AtoZ\\SiteArk\\Modules\\Help\\Whats_New' ) ) { ( new \AtoZ\SiteArk\Modules\Help\Whats_New() )->register(); } } // Backup/restore controller (AJAX step-runner + admin-post handlers). Added // with the job engine; guarded so the scaffold loads before it exists. if ( class_exists( '\\AtoZ\\SiteArk\\Modules\\Backup\\Controller' ) ) { ( new \AtoZ\SiteArk\Modules\Backup\Controller() )->register(); } // WP-CLI commands (M2), only when running under WP-CLI. if ( defined( 'WP_CLI' ) && \WP_CLI && class_exists( '\\AtoZ\\SiteArk\\CLI\\CLI' ) ) { \AtoZ\SiteArk\CLI\CLI::register(); } // Pro add-on (self-hosted builds only). The free core never references a Pro class; // Pro attaches through the extension-point hooks the core fires. The WordPress.org // build ships without includes/pro/, so this simply does nothing there — no locked // code, no gating. See docs/FREE-PRO-SPLIT.md. if ( is_readable( AISITEARK_DIR . 'includes/pro/class-pro.php' ) && class_exists( '\\AtoZ\\SiteArk\\Pro\\Pro' ) ) { \AtoZ\SiteArk\Pro\Pro::boot(); } } /** * Run dbDelta when the DB version changes (upgrades add tables/columns). * * @return void */ private static function maybe_upgrade() { if ( get_option( 'aisiteark_db_version' ) === AISITEARK_DB_VERSION ) { return; } if ( is_admin() ) { Activator::activate(); } } }