diff --git a/includes/utils.php b/includes/utils.php index 9b5582fb..94338200 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -39,22 +39,6 @@ public static function is_elementor_installed(): bool { return $elementor_installed; } - public static function get_theme_builder_slug(): string { - if ( ! class_exists( 'Elementor\App\App' ) ) { - return ''; - } - - if ( self::has_pro() ) { - return App::PAGE_ID . '&ver=' . ELEMENTOR_VERSION . '#site-editor'; - } - - if ( self::is_elementor_active() ) { - return App::PAGE_ID . '&ver=' . ELEMENTOR_VERSION . '#site-editor/promotion'; - } - - return ''; - } - public static function get_theme_builder_url(): string { if ( ! class_exists( 'Elementor\App\App' ) ) { return 'https://go.elementor.com/hello-theme-builder'; @@ -79,10 +63,6 @@ public static function get_elementor_activation_link(): string { return add_query_arg( '_wpnonce', wp_create_nonce( 'activate-plugin_' . $plugin ), $url ); } - public static function get_ai_site_planner_url(): string { - return 'https://go.elementor.com/hello-site-planner'; - } - public static function get_plugin_install_url( $plugin_slug ): string { $action = 'install-plugin'; diff --git a/modules/admin-home/assets/js/hello-elementor-menu.js b/modules/admin-home/assets/js/hello-elementor-menu.js deleted file mode 100644 index e2e8a361..00000000 --- a/modules/admin-home/assets/js/hello-elementor-menu.js +++ /dev/null @@ -1,8 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - const links = document.querySelectorAll( - 'a[href="admin.php?page=hello-elementor-ai-site-planner"], a[href="admin.php?page=hello-elementor-theme-builder"]', - ); - links.forEach((link) => { - link.setAttribute('target', '_blank'); - }); -}); diff --git a/modules/admin-home/components/admin-menu-controller.php b/modules/admin-home/components/admin-menu-controller.php index a15e5f6e..12d751d6 100644 --- a/modules/admin-home/components/admin-menu-controller.php +++ b/modules/admin-home/components/admin-menu-controller.php @@ -6,15 +6,10 @@ exit; // Exit if accessed directly. } -use HelloTheme\Includes\Script; -use HelloTheme\Includes\Utils; - class Admin_Menu_Controller { const MENU_PAGE_ICON = 'dashicons-plus-alt'; const MENU_PAGE_POSITION = 59.9; - const AI_SITE_PLANNER_SLUG = '-ai-site-planner'; - const THEME_BUILDER_SLUG = '-theme-builder'; public function admin_menu(): void { add_menu_page( @@ -37,59 +32,13 @@ public function admin_menu(): void { ); do_action( 'hello-plus-theme/admin-menu', EHP_THEME_SLUG ); - - $theme_builder_slug = Utils::get_theme_builder_slug(); - add_submenu_page( - EHP_THEME_SLUG, - __( 'Theme Builder', 'hello-elementor' ), - __( 'Theme Builder', 'hello-elementor' ), - 'manage_options', - empty( $theme_builder_slug ) ? EHP_THEME_SLUG . self::THEME_BUILDER_SLUG : $theme_builder_slug, - [ $this, 'render_home' ] - ); - - add_submenu_page( - EHP_THEME_SLUG, - __( 'AI Site Planner', 'hello-elementor' ), - __( 'AI Site Planner', 'hello-elementor' ), - 'manage_options', - EHP_THEME_SLUG . self::AI_SITE_PLANNER_SLUG, - [ $this, 'render_home' ] - ); } public function render_home(): void { echo '
'; } - public function redirect_menus(): void { - $page = sanitize_key( filter_input( INPUT_GET, 'page', FILTER_UNSAFE_RAW ) ); - - switch ( $page ) { - case EHP_THEME_SLUG . self::AI_SITE_PLANNER_SLUG: - wp_redirect( Utils::get_ai_site_planner_url() ); - exit; - - case EHP_THEME_SLUG . self::THEME_BUILDER_SLUG: - wp_redirect( Utils::get_theme_builder_url() ); - exit; - - default: - break; - } - } - - public function admin_enqueue_scripts() { - $script = new Script( - 'hello-elementor-menu', - ); - - $script->enqueue(); - } - public function __construct() { add_action( 'admin_menu', [ $this, 'admin_menu' ] ); - add_action( 'admin_init', [ $this, 'redirect_menus' ] ); - add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] ); } } diff --git a/webpack.config.js b/webpack.config.js index 3fa0e909..db25b865 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -41,11 +41,6 @@ const entryPoints = { 'admin-home/assets/js', 'hello-elementor-admin.js', ), - 'js/hello-elementor-menu': path.resolve( - modulesDir, - 'admin-home/assets/js', - 'hello-elementor-menu.js', - ), 'js/hello-elementor-settings': path.resolve( modulesDir, 'admin-home/assets/js',