define_routes(); $this->set_current_route(); } /** * Define all available routes */ private function define_routes() { $this->routes = array( 'dashboard' => array( 'title' => __('Dashboard', '108wp-content-protector-lite'), 'view' => 'dashboard', 'icon' => 'dashboard', 'enabled' => false, // Disabled in Lite ), 'human-protection' => array( 'title' => __('Human Protection', '108wp-content-protector-lite'), 'view' => 'human-protection', 'icon' => 'admin-users', 'enabled' => true, // ENABLED - 4 basic features ), 'ai-protection' => array( 'title' => __('AI Bot Protection', '108wp-content-protector-lite'), 'view' => 'ai-protection', 'icon' => 'shield', 'enabled' => false, // Pro feature ), 'robots' => array( 'title' => __('Robots.txt Editor', '108wp-content-protector-lite'), 'view' => 'robots', 'icon' => 'media-code', 'enabled' => false, // Pro feature ), 'advanced' => array( 'title' => __('Advanced Settings', '108wp-content-protector-lite'), 'view' => 'advanced', 'icon' => 'admin-generic', 'enabled' => false, // Pro feature ), ); // License page removed from Lite } /** * Set current route based on URL parameter */ private function set_current_route() { $route = isset($_GET['route']) ? sanitize_text_field($_GET['route']) : 'dashboard'; if (array_key_exists($route, $this->routes)) { $this->current_route = $route; } } /** * Get current route */ public function get_current_route() { return $this->current_route; } /** * Get all routes */ public function get_routes() { return $this->routes; } /** * Get route info */ public function get_route_info($route) { return isset($this->routes[$route]) ? $this->routes[$route] : null; } /** * Check if route is enabled */ public function is_route_enabled($route) { $info = $this->get_route_info($route); return $info && isset($info['enabled']) ? $info['enabled'] : false; } /** * Get current route title */ public function get_current_title() { $info = $this->get_route_info($this->current_route); return $info ? $info['title'] : ''; } /** * Get current view file */ public function get_current_view() { $info = $this->get_route_info($this->current_route); return $info ? $info['view'] : 'dashboard'; } /** * Generate route URL */ public function get_route_url($route) { return admin_url('admin.php?page=108wp-content-protector-lite&route=' . $route); } /** * Check if route is current */ public function is_current($route) { return $this->current_route === $route; } }