Plugin Directory

Changeset 3374925


Ignore:
Timestamp:
10/08/2025 09:09:24 AM (4 months ago)
Author:
hellobar
Message:

Release 1.5.1: PHP 7.4+/8.x compatibility, modern callbacks, URL fixes.

Location:
hellobar/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • hellobar/trunk/hellobar.php

    r3374155 r3374925  
    88 *
    99 * @author  hellobar
    10  * @version 1.5
     10 * @version 1.5.1
    1111 */
    1212/*
     
    1414Plugin URI: http://www.hellobar.com/
    1515Description: The Original Popup Software (Top Bars, Exit Intents, Sliders, & More to Grow Your Email List!)
    16 Version: 1.5
     16Version: 1.5.1
    1717Tested up to: 6.8
    1818Requires at least: 5.0
     
    3333    var $shortname   =   "HelloBar";
    3434    var $namespace   =   'hellobar-for-wordpress';
    35     var $version     =   '1.5';
     35    var $version     =   '1.5.1';
    3636    var $defaults    =   array('hellobar_code'=>"",'load_hellobar_in'=>'footer');
     37    var $url_path;
     38    var $option_name;
     39    var $options;
    3740    public static function init()
    3841    {
     
    4245    function __construct()
    4346    {
    44         $this->url_path = WP_PLUGIN_URL . '/' . plugin_basename(dirname(__FILE__));
    45         if (isset($_SERVER['HTTPS'])) {
    46             if ((boolean) $_SERVER['HTTPS']===true) {
    47                 $this->url_path = str_replace('http://', 'https://', $this->url_path);
    48             }
    49         }
     47        $this->url_path = plugin_dir_url(__FILE__);
    5048        $this->option_name = '_'.$this->namespace.'--options';
    51         add_action('admin_menu', array(&$this,'admin_menu'));
     49        add_action('admin_menu', array($this,'admin_menu'));
    5250        if (is_admin()) {
    5351        } else {
    5452            if ($this->get_option('load_hellobar_in') == 'header') {
    55                 add_action('wp_head', array(&$this,'hellobar_print_script'));
    56                 add_action('wp_head', array(&$this,'hellobar_insert_tags'));
     53                add_action('wp_head', array($this,'hellobar_print_script'));
     54                add_action('wp_head', array($this,'hellobar_insert_tags'));
    5755            } else {
    5856                if (function_exists('wp_print_footer_scripts')) {
    59                     add_action('wp_print_footer_scripts', array(&$this,'hellobar_print_script'));
    60                     add_action('wp_print_footer_scripts', array(&$this,'hellobar_insert_tags'));
     57                    add_action('wp_print_footer_scripts', array($this,'hellobar_print_script'));
     58                    add_action('wp_print_footer_scripts', array($this,'hellobar_insert_tags'));
    6159                } else {
    62                     add_action('wp_footer', array(&$this,'hellobar_print_script'));
    63                     add_action('wp_footer', array(&$this,'hellobar_insert_tags'));
     60                    add_action('wp_footer', array($this,'hellobar_print_script'));
     61                    add_action('wp_footer', array($this,'hellobar_insert_tags'));
    6462                }
    6563            }
     
    113111    public function admin_menu()
    114112    {
    115         add_menu_page($this->shortname, $this->shortname, 'manage_options', basename(__FILE__), array(&$this,'admin_options_page'), ($this->url_path.'/images/icon.png'));
     113        add_menu_page($this->shortname, $this->shortname, 'manage_options', basename(__FILE__), array($this,'admin_options_page'), ($this->url_path.'/images/icon.png'));
    116114    }
    117115    public function admin_options_page()
     
    121119        }
    122120        if (isset($_POST) && !empty($_POST)) {
    123             if (wp_verify_nonce($_REQUEST[$this->namespace.'_update_wpnonce'], $this->namespace.'_options')) {
     121            if (isset($_REQUEST[$this->namespace.'_update_wpnonce']) && wp_verify_nonce($_REQUEST[$this->namespace.'_update_wpnonce'], $this->namespace.'_options')) {
    124122                $data = array();
    125123                foreach ($_POST as $key => $val) {
     
    130128                    $options = array(
    131129                       'hellobar_code'         => (string) $data['hellobar_code'],
    132                        'load_hellobar_in'     => (string) @$data['load_hellobar_in']
     130                       'load_hellobar_in'     => (string) (!empty($data['load_hellobar_in']) ? $data['load_hellobar_in'] : 'footer')
    133131                    );
    134132                    update_option($this->option_name, $options);
     
    173171        return $str;
    174172    }
    175     public function is_script()
    176     {
    177         $hellobar_code = html_entity_decode($this->get_option('hellobar_code'));
     173    public static function is_script()
     174    {
     175        $options = get_option('_hellobar-for-wordpress--options');
     176        $hellobar_code = '';
     177        if (is_array($options) && isset($options['hellobar_code'])) {
     178            $hellobar_code = html_entity_decode($options['hellobar_code']);
     179        }
    178180        if ($hellobar_code) {
    179181            $count = preg_match('/src=(["\'])(.*?)\1/', $hellobar_code, $match);
     
    194196        }
    195197    }
    196     public function get_api_code($path)
     198    public static function get_api_code($path)
    197199    {
    198200        $path1  =   str_replace('/', '', $path);
     
    200202        return $path2;
    201203    }
    202     public function reset_old_api($api)
     204    public static function reset_old_api($api)
    203205    {
    204206        update_option('hellobar_api_key', $api);
  • hellobar/trunk/readme.txt

    r3374214 r3374925  
    66Requires PHP: 7.4
    77Tested up to: 6.8
    8 Stable tag: 1.5
     8Stable tag: 1.5.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    135135
    136136== Changelog ==
     137= Hello bar Popup Builder 1.5.1 =
     138* PHP 7.4+ and PHP 8.x compatibility updates
     139* Modernized callbacks and removed deprecated patterns
     140* Enhanced security and URL handling
     141
    137142= Hello bar Popup Builder 1.5 =
    138143* Capability test with wordpress version 6.8 ready for WP 6.8
  • hellobar/trunk/views/options.php

    r2480832 r3374925  
    33    <input type="hidden" name="form_action" value="update_options">
    44    <div class="wrap" style="margin:0">
    5         <header><a href="javascript:void(0)" id="helloBasLogo"><img src="<?php echo WP_PLUGIN_URL."/hellobar"; ?>/images/logo.png"></a><br><br><span class="hbhdrTitle"><b>Convert</b> visitors into customers with Hello Bar</span></header>
     5        <header><a href="javascript:void(0)" id="helloBasLogo"><img src="<?php echo esc_url( $plugin_path . 'images/logo.png' ); ?>"></a><br><br><span class="hbhdrTitle"><b>Convert</b> visitors into customers with Hello Bar</span></header>
    66        <div class="tool-box">
    77            <p><a class="helloBarSiteLink" target="new" href="https://www.hellobar.com">Visit Site to Learn More or Sign Up</a></p>
     
    1010                ?>Congratulations! Hello Bar is now installed on your site.<?php
    1111            } else {
    12                 ?>Thanks for the install! Glad to have you in the Hello Bar community!<br><br>You’re just a hop and a skip away from converting your site visitors into customers.<br><br>To get Hello Bar live on your WordPress site, you’ll just do a quick and easy “copy and paste” to install the site snippet.<br><br><a href="<?php echo WP_PLUGIN_URL."/hellobar"; ?>/images/demo.png" class="hellobardemoanc open-lightbox"><img class="hellobardemoimg" src="<?php echo WP_PLUGIN_URL . "/hellobar"; ?>/images/demo.png"></a><span class="hellobarInstruct">Here’s how:<br><br>1. Log in to HelloBar.com<br>2. Click on your email address at the top right corner of the screen<br>3. Select “Installation Instructions” from the drop down menu<br>4. Select “I use Wordpress” then click the green “Copy” button.<br><br> Now, your site snipped will be saved and ready to paste into WordPress directly, down below!<br><br>And with that, you’re ready to collect emails, drive traffic, and grow your social community! Kiss those one-time visitors goodbye and say hello to your new conversions with Hello Bar!</span><?php
     12                ?>Thanks for the install! Glad to have you in the Hello Bar community!<br><br>You’re just a hop and a skip away from converting your site visitors into customers.<br><br>To get Hello Bar live on your WordPress site, you’ll just do a quick and easy “copy and paste” to install the site snippet.<br><br><a href="<?php echo esc_url( $plugin_path . 'images/demo.png' ); ?>" class="hellobardemoanc open-lightbox"><img class="hellobardemoimg" src="<?php echo esc_url( $plugin_path . 'images/demo.png' ); ?>"></a><span class="hellobarInstruct">Here’s how:<br><br>1. Log in to HelloBar.com<br>2. Click on your email address at the top right corner of the screen<br>3. Select “Installation Instructions” from the drop down menu<br>4. Select “I use Wordpress” then click the green “Copy” button.<br><br> Now, your site snipped will be saved and ready to paste into WordPress directly, down below!<br><br>And with that, you’re ready to collect emails, drive traffic, and grow your social community! Kiss those one-time visitors goodbye and say hello to your new conversions with Hello Bar!</span><?php
    1313            } ?></p><?php
    1414if ($hellobar_code) {
     
    1919                    <div class="hbarLl"></div>
    2020                    <div class="hbarLr"><a href="javascript:void(0)" class="hbarqtip1 hasTooltip">Locate my site snippet
    21                     <img src="<?php echo WP_PLUGIN_URL; ?>/hellobar/images/q.png"></a>
     21                    <img src="<?php echo esc_url( $plugin_path . 'images/q.png' ); ?>"></a>
    2222                <div class="hbarqtiptext1">Not quite sure how to follow the yellow brick road to Hello Bar installation? No worries, we’ve got your back! Just click your ruby red slippers together three times and shoot us a message at [email protected], and we’ll work our magic to take you from confusion to conversion!</div>
    2323                    </div>
Note: See TracChangeset for help on using the changeset viewer.