plugin_path( 'includes/modules/loader.php' ); $this->module_loader = new Jet_Tabs_CX_Loader( array( $this->plugin_path( 'includes/modules/vue-ui/cherry-x-vue-ui.php' ), $this->plugin_path( 'includes/modules/db-updater/cx-db-updater.php' ), $this->plugin_path( 'includes/modules/jet-dashboard/jet-dashboard.php' ), $this->plugin_path( 'includes/modules/jet-elementor-extension/jet-elementor-extension.php' ), $this->plugin_path( 'includes/modules/jet-cache/jet-cache.php' ), ) ); } /** * [jet_dashboard_init description] * @return [type] [description] */ public function jet_dashboard_init() { if ( is_admin() ) { $cx_ui_module_data = $this->module_loader->get_included_module_data( 'cherry-x-vue-ui.php' ); $jet_dashboard_module_data = $this->module_loader->get_included_module_data( 'jet-dashboard.php' ); $jet_dashboard = \Jet_Dashboard\Dashboard::get_instance(); $jet_dashboard->init( array( 'path' => $jet_dashboard_module_data['path'], 'url' => $jet_dashboard_module_data['url'], 'cx_ui_instance' => array( $this, 'jet_dashboard_ui_instance_init' ), 'plugin_data' => array( 'slug' => 'jet-tabs', 'file' => 'jet-tabs/jet-tabs.php', 'version' => $this->get_version(), 'plugin_links' => array( array( 'label' => esc_html__( 'Go to settings', 'jet-tricks' ), 'url' => add_query_arg( array( 'page' => 'jet-dashboard-settings-page', 'subpage' => 'jet-tabs-general-settings' ), admin_url( 'admin.php' ) ), 'target' => '_self', ), ), ), ) ); } } /** * [jet_dashboard_ui_instance_init description] * @return [type] [description] */ public function jet_dashboard_ui_instance_init() { $cx_ui_module_data = $this->module_loader->get_included_module_data( 'cherry-x-vue-ui.php' ); return new CX_Vue_UI( $cx_ui_module_data ); } /** * Returns plugin version * * @return string */ public function get_version() { return $this->version; } /** * Manually init required modules. * * @return void */ public function init() { if ( ! $this->has_elementor() ) { add_action( 'admin_notices', array( $this, 'required_plugins_notice' ) ); return; } $this->load_files(); jet_tabs_settings()->init(); jet_tabs_assets()->init(); jet_tabs_integration()->init(); jet_tabs_compatibility()->init(); // Init Jet Cache Module $cache_module_data = $this->module_loader->get_included_module_data( 'jet-cache.php' ); \Jet_Cache\Manager::get_instance( $cache_module_data ); // Init Elementor_Template new \Jet_Tabs\Endpoints\Elementor_Template(); //Init Rest Api new \Jet_Tabs\Rest_Api(); if ( is_admin() ) { //Init Rest Api new \Jet_Tabs\Settings(); // Init DB upgrader require $this->plugin_path( 'includes/db-upgrader.php' ); new Jet_Tabs_DB_Upgrader(); } do_action( 'jet-tabs/init', $this ); } /** * Show recommended plugins notice. * * @return void */ public function required_plugins_notice() { $screen = get_current_screen(); if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) { return; } $plugin = 'elementor/elementor.php'; $installed_plugins = get_plugins(); $is_elementor_installed = isset( $installed_plugins[ $plugin ] ); if ( $is_elementor_installed ) { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin ); $message = sprintf( '
%s
', esc_html__( 'JetTabs requires Elementor to be activated.', 'jet-tabs' ) ); $message .= sprintf( '', $activation_url, esc_html__( 'Activate Elementor Now', 'jet-tabs' ) ); } else { if ( ! current_user_can( 'install_plugins' ) ) { return; } $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); $message = sprintf( '%s
', esc_html__( 'JetTabs requires Elementor to be installed.', 'jet-tabs' ) ); $message .= sprintf( '', $install_url, esc_html__( 'Install Elementor Now', 'jet-tabs' ) ); } printf( '%s