hooks(); // Doors custom post type + meta boxes. $doors = new ADVK_Doors_CPT(); $doors->hooks(); // Settings page (tweaks + texts + today override). $settings = new ADVK_Settings(); $settings->hooks(); // Frontend shortcode + asset enqueue. $shortcode = new ADVK_Shortcode(); $shortcode->hooks(); // AJAX submission handler. $ajax = new ADVK_Ajax(); $ajax->hooks(); // Admin submissions view. $entries_admin = new ADVK_Admin_Entries(); $entries_admin->hooks(); // Winner drawing admin page. $winners = new ADVK_Winners(); $winners->hooks(); // Confirmation / notification e-mails. $emails = new ADVK_Emails(); $emails->hooks(); // Gutenberg block. $block = new ADVK_Block(); $block->hooks(); // DSGVO / GDPR tooling. $privacy = new ADVK_Privacy(); $privacy->hooks(); // Newsletter provider integration. $newsletter = new ADVK_Newsletter(); $newsletter->hooks(); // Reminder opt-in + daily cron. $reminders = new ADVK_Reminders(); $reminders->hooks(); // Run on both admin and front end so the schema is migrated before any // frontend entry is stored after an in-place update (the version check // makes this a no-op once migrated). add_action( 'admin_init', array( $this, 'maybe_upgrade_db' ) ); add_action( 'init', array( $this, 'maybe_upgrade_db' ) ); } /** * Run dbDelta when the stored schema version is behind the plugin version. * Keeps the entries table (e.g. the is_winner column) up to date after an * in-place update without requiring re-activation. */ public function maybe_upgrade_db() { $installed = get_option( 'advk_db_version' ); if ( ADVK_VERSION !== $installed ) { ADVK_Entries::create_table(); update_option( 'advk_db_version', ADVK_VERSION ); } } }