init(); } return self::$instance; } /** * Private constructor — go through instance(). */ private function __construct() {} /** * Initialises the plugin: idempotent capability, one-time cleanup of * the former direct-download build, admin when relevant. * * Translations come from translate.wordpress.org (language packs). * * @return void */ private function init() { VEFMB_Capabilities::ensure_registered(); global $wpdb; VEFMB_DB_Installer::maybe_upgrade( $wpdb ); // One-time cleanup of the former direct-download build — admin // requests only (never on the front end). add_action( 'admin_init', array( 'VEFMB_Legacy_Cleanup', 'maybe_run' ) ); VEFMB_Cron::hooks(); VEFMB_Participants_Service::hooks(); VEFMB_I18n::hooks(); VEFMB_Style::hooks(); VEFMB_Free_License::hooks(); VEFMB_Support_Access::hooks(); VEFMB_Privacy::hooks(); add_action( 'rest_api_init', array( 'VEFMB_Webhook_Controller', 'register_routes' ) ); add_action( 'rest_api_init', array( 'VEFMB_Frontend_Controller', 'register_routes' ) ); VEFMB_Gutenberg::hooks(); VEFMB_Divi5::hooks(); VEFMB_Elementor::hooks(); VEFMB_Email_Service::hooks(); if ( is_admin() ) { VEFMB_Admin_Tabs::hooks(); VEFMB_Admin_Flow::hooks(); VEFMB_Free_License_Admin::hooks(); VEFMB_Support_Access_Admin::hooks(); VEFMB_Support_Chat::hooks(); VEFMB_Admin::instance(); VEFMB_Ajax_Controller::hooks(); } add_action( 'init', array( 'VEFMB_Renderer', 'register_assets' ), 5 ); /** * Signals that the VEFmultiBooking CORE is ready — hook * point for VEFmultiBooking Pro (a separate plugin that extends * this same CORE, never a copy of the engine) and for any future * extension plugin. */ do_action( 'vefmb_loaded' ); } }