Plugin Directory

Changeset 3462382


Ignore:
Timestamp:
02/16/2026 10:23:29 AM (6 weeks ago)
Author:
turboaddons
Message:

Solved error with header/footer templates

Location:
header-footer-builder-for-elementor
Files:
280 added
3 edited

Legend:

Unmodified
Added
Removed
  • header-footer-builder-for-elementor/trunk/README.MD

    r3456366 r3462382  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.1.1
    88License: GPLv3 
    99License URI: https://opensource.org/licenses/GPL-3.0 
     
    170170
    171171== Changelog ==
     172== 1.1.1 ==
     173- Fix: Solved error with header/footer templates not rendering in Elementor preview mode—no more blank headers/footers when editing templates.
     174- Bug: Fixed Elementor preview mode rendering issue for header/footer templates in this version.
    172175
    173176== 1.1.0 ==
  • header-footer-builder-for-elementor/trunk/header-footer-builder-for-elementor.php

    r3456366 r3462382  
    44 * Plugin URI: https://wp-turbo.com/header-footer-builder-for-elementor/
    55 * Description: Header Footer Builder for Elementor & WooCommerce. Easy, customizable plugin for headers/footers with display rules, sticky header & include/exclude.
    6  * Version: 1.1.0
     6 * Version: 1.1.1
    77 * Requires Plugins: elementor
    88 * Author: turbo addons
     
    1919}
    2020
    21 if ( ! function_exists( 'hfbfe_fs' ) ) {
    22     // Create a helper function for easy SDK access.
    23     function hfbfe_fs() {
    24         global $hfbfe_fs;
    25 
    26         if ( ! isset( $hfbfe_fs ) ) {
    27             // Include Freemius SDK.
    28             require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
    29 
    30             $hfbfe_fs = fs_dynamic_init( array(
    31                 'id'                  => '22909',
    32                 'slug'                => 'header-footer-builder-for-elementor',
    33                 'type'                => 'plugin',
    34                 'public_key'          => 'pk_092670a4b0e91a5ad9dc497efbf71',
    35                 'is_premium'          => false,
    36                 'has_addons'          => false,
    37                 'has_paid_plans'      => false, // Must be false for WordPress.org
    38                 'menu'                => array(
    39                     'slug'           => 'edit.php?post_type=tahefobu_header',
    40                     // For WordPress.org, only these menu items are allowed:
    41                     'account'        => false, // Must be false on .org
    42                     'contact'        => false, // Must be false on .org
    43                     'support'        => false, // Must be false on .org
    44                     'pricing'        => false, // Must be false on .org
    45                     'addons'         => false, // Must be false on .org
    46                     'affiliation'    => false, // Must be false on .org
    47                 ),
    48                 // WordPress.org specific settings:
    49                 'is_live'             => true,
    50                 'is_org_compliant'    => true, // Important: Mark as .org compliant
    51             ) );
    52         }
    53 
    54         return $hfbfe_fs;
    55     }
    56 
    57     // Init Freemius - but with WordPress.org restrictions
    58     hfbfe_fs();
    59    
    60     // Optional: Add WordPress.org compliant opt-in message
    61     hfbfe_fs()->add_filter('connect_message', 'hfbfe_custom_connect_message', 10, 6);
    62     hfbfe_fs()->add_filter('connect_message_on_update', 'hfbfe_custom_connect_message_on_update', 10, 6);
    63     do_action( 'hfbfe_fs_loaded' );
    64 }
    65 
    6621// wp-pulse integration
    6722if ( ! class_exists( 'WPPulse_SDK' ) ) {
     
    11570     */
    11671    public function __construct() {
     72        if ( ! function_exists( 'hfbfe_fs' ) ) {
     73            // Create a helper function for easy SDK access.
     74            function hfbfe_fs() {
     75                global $hfbfe_fs;
     76
     77                if ( ! isset( $hfbfe_fs ) ) {
     78                    // Include Freemius SDK.
     79                    require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
     80
     81                    $hfbfe_fs = fs_dynamic_init( array(
     82                        'id'                  => '22909',
     83                        'slug'                => 'header-footer-builder-for-elementor',
     84                        'type'                => 'plugin',
     85                        'public_key'          => 'pk_092670a4b0e91a5ad9dc497efbf71',
     86                        'is_premium'          => false,
     87                        'has_addons'          => false,
     88                        'has_paid_plans'      => false, // Must be false for WordPress.org
     89                        'menu'                => array(
     90                            'slug'           => 'edit.php?post_type=tahefobu_header',
     91                            // For WordPress.org, only these menu items are allowed:
     92                            'account'        => false, // Must be false on .org
     93                            'contact'        => false, // Must be false on .org
     94                            'support'        => false, // Must be false on .org
     95                            'pricing'        => false, // Must be false on .org
     96                            'addons'         => false, // Must be false on .org
     97                            'affiliation'    => false, // Must be false on .org
     98                        ),
     99                        // WordPress.org specific settings:
     100                        'is_live'             => true,
     101                        'is_org_compliant'    => true, // Important: Mark as .org compliant
     102                    ) );
     103                }
     104
     105                return $hfbfe_fs;
     106            }
     107
     108            // Init Freemius - but with WordPress.org restrictions
     109            hfbfe_fs();
     110           
     111            // Optional: Add WordPress.org compliant opt-in message
     112            // hfbfe_fs()->add_filter('connect_message', 'hfbfe_custom_connect_message', 10, 6);
     113            // hfbfe_fs()->add_filter('connect_message_on_update', 'hfbfe_custom_connect_message_on_update', 10, 6);
     114           
     115            // function hfbfe_custom_connect_message($message, $user_first_name, $product_title, $user_login, $site_link, $freemius_link) {
     116            //     return sprintf(
     117            //         __( 'Hey %1$s', 'header-footer-builder-for-elementor' ) . ',<br>' .
     118            //         __( 'Never miss an important update! Opt-in to receive security & feature updates, educational content, and occasional deals.', 'header-footer-builder-for-elementor' ) . '<br>' .
     119            //         __( 'If you skip this, that\'s okay! %2$s will still work just fine.', 'header-footer-builder-for-elementor' ),
     120            //         $user_first_name,
     121            //         '<b>' . $product_title . '</b>'
     122            //     );
     123            // }
     124           
     125            // function hfbfe_custom_connect_message_on_update($message, $user_first_name, $product_title, $user_login, $site_link, $freemius_link) {
     126            //     return sprintf(
     127            //         __( 'Hey %1$s', 'header-footer-builder-for-elementor' ) . ',<br>' .
     128            //         __( 'Please help us improve %2$s by allowing tracking of usage data.', 'header-footer-builder-for-elementor' ) . '<br>' .
     129            //         __( 'This will help us make better decisions about future features.', 'header-footer-builder-for-elementor' ),
     130            //         $user_first_name,
     131            //         '<b>' . $product_title . '</b>'
     132            //     );
     133            // }
     134           
     135            // Signal that SDK was initiated.
     136            do_action( 'hfbfe_fs_loaded' );
     137        }
    117138        include_once plugin_dir_path(__FILE__) . 'helper/helper.php';
    118139        $this->define_constants();
     
    138159        define( 'TAHEFOBU_HEADER_FOOTER_BUILDER_FOR_ELEMENTOR_PLUGIN_URL', trailingslashit( plugins_url( '/', __FILE__ ) ) );
    139160        define( 'TAHEFOBU_HEADER_FOOTER_BUILDER_FOR_ELEMENTOR_PLUGIN_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
    140         define( 'TAHEFOBU_HEADER_FOOTER_BUILDER_FOR_ELEMENTOR_PLUGIN_VERSION', '1.1.0' );
     161        define( 'TAHEFOBU_HEADER_FOOTER_BUILDER_FOR_ELEMENTOR_PLUGIN_VERSION', '1.1.1' );
    141162    }
    142163
     
    250271                false, // no file, just for inline use
    251272                [],
    252                 '1.1.0'
     273                '1.1.1'
    253274            );
    254275            wp_enqueue_style( 'tahefobu-frontend' );
  • header-footer-builder-for-elementor/trunk/includes/class-hfb-recommend-turbo-addons.php

    r3406564 r3462382  
    11<?php
    22if ( ! defined( 'ABSPATH' ) ) {
    3     exit; // Exit if accessed directly
     3    exit;
    44}
    55
     
    1414
    1515    /**
    16      * Show admin notice suggesting Turbo Addons installation.
     16     * Check if Turbo Addons FREE is active
     17     */
     18    private function hfbfe_is_turbo_addons_free_version_active() {
     19        if ( ! function_exists( 'get_plugins' ) ) {
     20            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     21        }
     22
     23        $active_plugins = get_option( 'active_plugins', [] );
     24        $all_plugins    = get_plugins();
     25
     26        foreach ( $all_plugins as $plugin_file => $plugin_data ) {
     27            if (
     28                in_array( $plugin_file, $active_plugins, true ) &&
     29                isset( $plugin_data['Name'] ) &&
     30                $plugin_data['Name'] === 'Turbo Addons Elementor'
     31            ) {
     32                return true;
     33            }
     34        }
     35
     36        return false;
     37    }
     38
     39    /**
     40     * Show admin notice suggesting Turbo Addons installation
    1741     */
    1842    public function show_recommendation_notice() {
    19         include_once ABSPATH . 'wp-admin/includes/plugin.php';
    2043
    21         // If Elementor Pro is active, no need to suggest Turbo Addons.
    22         if ( is_plugin_active( 'elementor-pro/elementor-pro.php' ) ) {
     44        // 🔴 Turbo Addons active থাকলে → পুরো section hide
     45        if ( $this->hfbfe_is_turbo_addons_free_version_active() ) {
    2346            return;
    2447        }
    2548
    26         // If Turbo Addons is already active, no need to show notice.
    27         if ( is_plugin_active( 'turbo-addons-elementor/turbo-addons-elementor.php' ) ) {
    28             return;
    29         }
     49        include_once ABSPATH . 'wp-admin/includes/plugin.php';
    3050
    31         // Prepare Install or Activate URLs
     51        // Install & Activate URLs
    3252        $install_url = wp_nonce_url(
    3353            self_admin_url( 'update.php?action=install-plugin&plugin=turbo-addons-elementor' ),
     
    4060        );
    4161
    42         // Check if Turbo Addons is installed but inactive
    43         $is_installed = file_exists( WP_PLUGIN_DIR . '/turbo-addons-elementor/turbo-addons-elementor.php' );
     62        // Installed but inactive?
     63        $is_installed = file_exists(
     64            WP_PLUGIN_DIR . '/turbo-addons-elementor/turbo-addons-elementor.php'
     65        );
     66        ?>
    4467
    45         ?>
     68        <!-- ✅ NOTICE ONLY SHOWS WHEN TURBO ADDONS IS NOT ACTIVE -->
    4669        <div class="notice notice-info is-dismissible"
    4770            style="padding:20px; border-left:4px solid #ff8800;">
     
    106129            </div>
    107130        </div>
    108 
    109131        <?php
    110132    }
    111133}
    112134
    113 // Initialize class
    114135new HFB_Recommend_Turbo_Addons();
     136
Note: See TracChangeset for help on using the changeset viewer.