From 46ba0f9d7b229430efcea8d150b62113736a25f5 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Wed, 20 Aug 2025 17:38:48 +0530 Subject: [PATCH 1/6] Promotion notice for preview page --- inc/class-header-footer-elementor.php | 356 ++++++++++++++++++++++++++ 1 file changed, 356 insertions(+) diff --git a/inc/class-header-footer-elementor.php b/inc/class-header-footer-elementor.php index bac35f56e..6e5f056fe 100644 --- a/inc/class-header-footer-elementor.php +++ b/inc/class-header-footer-elementor.php @@ -143,6 +143,9 @@ function () { add_action( 'astra_notice_before_markup_header-footer-elementor-rating', [ $this, 'rating_notice_css' ] ); + // Add Elementor preview notice + add_action( 'wp_footer', [ $this, 'elementor_preview_notice' ] ); + require_once HFE_DIR . 'inc/class-hfe-analytics.php'; } @@ -268,6 +271,359 @@ public function rating_notice_css() { wp_enqueue_style( 'hfe-admin-style', HFE_URL . 'assets/css/admin-header-footer-elementor.css', [], HFE_VER ); } + /** + * Display Elementor preview notice in footer when in preview mode. + * + * @since 2.4.9 + * @return void + */ + public function elementor_preview_notice() { + // Show notice only for page post type in preview mode + if ( $this->should_show_preview_notice() ) { + ?> + + +
+
+
+
πŸš€
+
+
Unlock More Elementor Widgets!
+
Get 50+ premium widgets, 200+ templates, and advanced features with Ultimate Addons Pro.
+
+ + Upgrade Now + +
+ +
+
+ + + is_elementor_page( $preview_id ) ) { + return false; + } + + // Optional: Allow filtering for custom conditions + return apply_filters( 'hfe_show_preview_notice', true, $preview_id ); + } + + /** + * Check if the page is built with Elementor. + * + * @since 2.4.9 + * @param int $post_id Post ID to check. + * @return bool + */ + private function is_elementor_page( $post_id ) { + if ( ! class_exists( '\Elementor\Plugin' ) ) { + return false; + } + + $elementor_data = get_post_meta( $post_id, '_elementor_data', true ); + return ! empty( $elementor_data ); + } + /** * Prints the admin notics when Elementor is not installed or activated or version outdated. * From 5549f64e30785dc8b4ac1ba0e0e31edf1049edb2 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Wed, 20 Aug 2025 20:07:35 +0530 Subject: [PATCH 2/6] Fixed html and css for notice --- inc/class-header-footer-elementor.php | 31 +++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/inc/class-header-footer-elementor.php b/inc/class-header-footer-elementor.php index 6e5f056fe..eb13115f3 100644 --- a/inc/class-header-footer-elementor.php +++ b/inc/class-header-footer-elementor.php @@ -309,9 +309,9 @@ public function elementor_preview_notice() { bottom: 0; left: 0; right: 0; - background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + background: #000; color: #ffffff; - padding: 16px 20px; + padding: 10px 20px; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; @@ -332,18 +332,15 @@ public function elementor_preview_notice() { } .hfe-promo-notice-container { - max-width: 1200px; - margin: 0 auto; display: flex; align-items: center; - justify-content: space-between; - position: relative; + justify-content: space-around; } .hfe-promo-notice-content { display: flex; align-items: center; - flex: 1; + /* flex: 1; */ } .hfe-promo-notice-icon { @@ -372,17 +369,17 @@ public function elementor_preview_notice() { .hfe-promo-notice-description { opacity: 0.9; - font-size: 13px; + font-size: 20px; } .hfe-promo-notice-cta { margin-left: 16px; padding: 8px 16px; - background: rgba(255, 255, 255, 0.2); - border: 1px solid rgba(255, 255, 255, 0.3); + background: #93003f; + border: 1px solid #93003f; color: #ffffff; text-decoration: none; - border-radius: 6px; + border-radius: 25px; font-size: 13px; font-weight: 600; transition: all 0.2s ease; @@ -390,13 +387,15 @@ public function elementor_preview_notice() { } .hfe-promo-notice-cta:hover { - background: rgba(255, 255, 255, 0.3); + background: #8f1a4c; color: #ffffff; text-decoration: none; } .hfe-promo-notice-close { margin-left: 16px; + position: absolute; + right:5px; background: none; border: none; color: rgba(255, 255, 255, 0.8); @@ -475,15 +474,15 @@ public function elementor_preview_notice() {
-
πŸš€
+
-
Unlock More Elementor Widgets!
-
Get 50+ premium widgets, 200+ templates, and advanced features with Ultimate Addons Pro.
+ +
Psst… want to save hours? Get 300+ professionally built templates.
- Upgrade Now + Unlock Now
From 31865cd374fb034483ac603618ef1cfae0bcee8b Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Wed, 20 Aug 2025 20:07:54 +0530 Subject: [PATCH 3/6] added check to show notice only if pro is not installed or activated --- inc/class-header-footer-elementor.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/class-header-footer-elementor.php b/inc/class-header-footer-elementor.php index eb13115f3..87bb2808e 100644 --- a/inc/class-header-footer-elementor.php +++ b/inc/class-header-footer-elementor.php @@ -567,6 +567,12 @@ class="hfe-promo-notice-cta"> * @return bool */ private function should_show_preview_notice() { + // Don't show if UAE Pro is already installed/activated + if ( is_plugin_active( 'ultimate-elementor/ultimate-elementor.php' ) || + file_exists( WP_PLUGIN_DIR . '/ultimate-elementor/ultimate-elementor.php' ) ) { + return false; + } + // Basic preview check if ( ! isset( $_GET['preview'] ) || $_GET['preview'] !== 'true' ) { return false; From c170d5af97d85225041926cba485c0e2358ee58c Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Mon, 29 Sep 2025 16:13:21 +0530 Subject: [PATCH 4/6] Fixed notice --- inc/class-header-footer-elementor.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/inc/class-header-footer-elementor.php b/inc/class-header-footer-elementor.php index 87bb2808e..441dcc232 100644 --- a/inc/class-header-footer-elementor.php +++ b/inc/class-header-footer-elementor.php @@ -279,8 +279,11 @@ public function rating_notice_css() { */ public function elementor_preview_notice() { // Show notice only for page post type in preview mode - if ( $this->should_show_preview_notice() ) { - ?> + if ( ! $this->should_show_preview_notice() ) { + return; + } + + ?>