/** * Plugin Name: Ultimate Addons for Elementor (UAE) * Plugin URI: https://wordpress.org/plugins/header-footer-elementor/ * Description: Ultimate Addons is a powerful plugin allows you to create custom headers and footers with Elementor and display them in selected locations. You can also create custom Elementor blocks and place them anywhere on your website using a shortcode. * Author: Brainstorm Force * Author URI: https://www.brainstormforce.com/ * Text Domain: header-footer-elementor * Domain Path: /languages * Version: 2.9.2 * Elementor tested up to: 4.2 * Elementor Pro tested up to: 4.2 * * @package header-footer-elementor */ define( 'HFE_VER', '2.9.2' ); define( 'HFE_FILE', __FILE__ ); define( 'HFE_DIR', plugin_dir_path( __FILE__ ) ); define( 'HFE_URL', plugins_url( '/', __FILE__ ) ); define( 'HFE_PATH', plugin_basename( __FILE__ ) ); define( 'HFE_DOMAIN', trailingslashit( 'https://ultimateelementor.com' ) ); define( 'UAE_LITE', true ); /** * Load the class loader. */ require_once HFE_DIR . '/inc/class-header-footer-elementor.php'; /** * Abilities API integration (WP 6.9+). * * Loaded immediately so the loader's add_action() hooks are in place before * the lazy WP_Abilities_Registry singleton fires wp_abilities_api_init. * Independent of Elementor so MCP discovery works in CLI context. */ if ( function_exists( 'wp_register_ability' ) ) { require_once HFE_DIR . 'inc/abilities/class-hfe-abilities-loader.php'; } /** * Load the Plugin Class. * * @return void */ function hfe_plugin_activation() { update_option( 'uae_lite_is_activated', 'yes' ); update_option( 'hfe_start_onboarding', true ); // Track plugin activation event. require_once HFE_DIR . 'inc/class-hfe-analytics-events.php'; $bsf_referrers = get_option( 'bsf_product_referers', [] ); $source = ! empty( $bsf_referrers['header-footer-elementor'] ) ? $bsf_referrers['header-footer-elementor'] : 'self'; HFE_Analytics_Events::track( 'plugin_activated', HFE_VER, [ 'source' => $source ] ); } register_activation_hook( HFE_FILE, 'hfe_plugin_activation' ); /** * Remove the Data not required. * * @return void */ function hfe_plugin_deactivation() { $timestamp = wp_next_scheduled( 'hfe_widgets_usage_cron' ); if ( $timestamp ) { wp_unschedule_event( $timestamp, 'hfe_widgets_usage_cron' ); } } // deActivation hook. register_deactivation_hook( HFE_FILE, 'hfe_plugin_deactivation' ); /** * Load the Plugin Class. * * @return void */ function hfe_init() { Header_Footer_Elementor::instance(); } add_action( 'plugins_loaded', 'hfe_init' ); /** Function for FA5, Social Icons, Icon List */ function hfe_enqueue_font_awesome() { if ( class_exists( 'Elementor\Plugin' ) ) { // Ensure Elementor Icons CSS is loaded. wp_enqueue_style( 'hfe-elementor-icons', plugins_url( '/elementor/assets/lib/eicons/css/elementor-icons.min.css', 'elementor' ), [], '5.34.0' ); wp_enqueue_style( 'hfe-icons-list', plugins_url( '/elementor/assets/css/widget-icon-list.min.css', 'elementor' ), [], '3.24.3' ); wp_enqueue_style( 'hfe-social-icons', plugins_url( '/elementor/assets/css/widget-social-icons.min.css', 'elementor' ), [], '3.24.0' ); wp_enqueue_style( 'hfe-social-share-icons-brands', plugins_url( '/elementor/assets/lib/font-awesome/css/brands.css', 'elementor' ), [], '5.15.3' ); wp_enqueue_style( 'hfe-social-share-icons-fontawesome', plugins_url( '/elementor/assets/lib/font-awesome/css/fontawesome.css', 'elementor' ), [], '5.15.3' ); wp_enqueue_style( 'hfe-nav-menu-icons', plugins_url( '/elementor/assets/lib/font-awesome/css/solid.css', 'elementor' ), [], '5.15.3' ); } if ( class_exists( '\ElementorPro\Plugin' ) ) { wp_enqueue_style( 'hfe-widget-blockquote', plugins_url( '/elementor-pro/assets/css/widget-blockquote.min.css', 'elementor' ), [], '3.25.0' ); wp_enqueue_style( 'hfe-mega-menu', plugins_url( '/elementor-pro/assets/css/widget-mega-menu.min.css', 'elementor' ), [], '3.26.2' ); wp_enqueue_style( 'hfe-nav-menu-widget', plugins_url( '/elementor-pro/assets/css/widget-nav-menu.min.css', 'elementor' ), [], '3.26.0' ); } } add_action( 'wp_enqueue_scripts', 'hfe_enqueue_font_awesome', 20 ); class Hostinger_Ai_Assistant_Chatbot_Endpoints { private Hostinger_Ai_Assistant_Helper $helper; private Hostinger_Ai_Assistant_Config $config_handler; public function init(): void { add_action( 'rest_api_init', array( $this, 'register_rest_routes' ) ); } public function website_data() { $this->helper = new Hostinger_Ai_Assistant_Helper(); $this->config_handler = new Hostinger_Ai_Assistant_Config(); $rest_url = rest_url( 'wp/v2/posts' ); $response_data = array( 'data' => array( 'domain' => implode( ' ', str_split( $this->helper->get_host_info() ) ), 'metadata' => array( 'environment_info' => array( 'wordpress_version' => get_bloginfo( 'version' ) ?? '', 'is_multisite' => is_multisite(), 'wp_debug' => defined( 'WP_DEBUG' ) && WP_DEBUG, 'web_server' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'Unknown', 'php_version' => phpversion() ?? '', ), 'site_settings' => array( 'website_url' => get_site_url() ?? '', 'site_title' => get_bloginfo( 'name' ) ?? get_site_url(), 'site_language' => get_locale() ?? '', 'permalink_mode' => ( str_contains( $rest_url, '?rest_route=' ) ) ? 'plain' : 'custom', ), 'plugin_info' => array( 'active_plugins' => get_option( 'active_plugins', array() ), ), 'theme_info' => array( 'active_theme' => wp_get_theme()->get( 'Name' ) ?? '', 'parent_theme' => wp_get_theme()->parent() ? wp_get_theme() ->parent() ->get( 'Name' ) : '', ), ), 'rest_api_endpoints' => array( 'base_rest_api' => HOSTINGER_AI_ASSISTANT_REST_API_BASE, 'base_rest_uri' => $this->config_handler->get_config_value( 'base_rest_uri', HOSTINGER_AI_ASSISTANT_REST_URI ), 'base_hpanel_uri' => $this->config_handler->get_config_value( 'base_hpanel_rest_uri', HOSTINGER_AI_ASSISTANT_HPANEL_REST_URI ), ), 'base_url' => $this->return_chatbot_base_url(), ), ); $response = new \WP_REST_Response( $response_data ); $response->set_headers( array( 'Cache-Control' => 'no-cache' ) ); $response->set_status( \WP_Http::OK ); return rest_ensure_response( $response ); } public function register_rest_routes(): void { register_rest_route( HOSTINGER_AI_ASSISTANT_REST_API_BASE, '/website', array( 'methods' => 'GET', 'callback' => array( $this, 'website_data' ), 'permission_callback' => array( $this, 'permission_check' ), ) ); } public function permission_check(): bool { if ( has_action( 'litespeed_control_set_nocache' ) ) { do_action( 'litespeed_control_set_nocache', 'Custom Rest API endpoint, not cacheable.' ); } if ( ! is_user_logged_in() ) { return false; } return current_user_can( 'manage_options' ); } private function return_chatbot_base_url(): string { if ( isset( $_SERVER['H_STAGING'] ) && filter_var( $_SERVER['H_STAGING'], FILTER_VALIDATE_BOOLEAN ) === true ) { return 'https://message-hub.hostinger.dev'; } return 'https://message-hub.hostinger.com'; } }
Coming Soon