init(); } return self::$instance; } /** * A dummy constructor. * * @since 3.3.0 */ private function __construct() { // Do nothing. } /** * Initializes the plugin. * * @since 3.3.0 */ private function init() { $this->language = new Frontend\Language_Handler(); $this->styles = new Frontend\Styles_Handler(); $this->counter = new Counter(); $this->tracker = new Tracker(); $this->shortcodes = new Frontend\Shortcodes(); $this->cron = new Cron(); if ( Feature_Manager::is_enabled( 'blocks' ) ) { $this->blocks = new Frontend\Blocks\Blocks(); } if ( Feature_Manager::is_enabled( 'feed' ) ) { $this->feed = new Frontend\Feed(); } new Hook_Loader(); // Initialize admin on init action to ensure translations are loaded. add_action( 'init', array( $this, 'init_admin' ) ); } /** * Initialize admin components. * * @since 4.2.0 */ public function init_admin(): void { if ( is_admin() ) { $this->admin = new Admin\Admin(); if ( is_multisite() ) { $this->network_admin = new Admin\Network\Admin(); } } } }