"",'load_hellobar_in'=>'footer'); var $url_path; var $option_name; var $options; public static function init() { $class = __CLASS__; new $class; } function __construct() { $this->url_path = plugin_dir_url(__FILE__); $this->option_name = '_'.$this->namespace.'--options'; add_action('admin_menu', array($this,'admin_menu')); if (is_admin()) { } else { if ($this->get_option('load_hellobar_in') == 'header') { add_action('wp_head', array($this,'hellobar_print_script')); add_action('wp_head', array($this,'hellobar_insert_tags')); } else { if (function_exists('wp_print_footer_scripts')) { add_action('wp_print_footer_scripts', array($this,'hellobar_print_script')); add_action('wp_print_footer_scripts', array($this,'hellobar_insert_tags')); } else { add_action('wp_footer', array($this,'hellobar_print_script')); add_action('wp_footer', array($this,'hellobar_insert_tags')); } } } /* Loading Admin CSS only for Hellobar option page */ if (isset($_GET['page']) && $_GET['page']=='hellobar') { // phpcs:ignore WordPress.Security.NonceVerification.Recommended add_action('admin_enqueue_scripts', array($this,'add_css_in_admin')); add_action('admin_enqueue_scripts', array($this,'add_js_in_admin')); } } public function add_css_in_admin() { wp_register_style('hellobaradmincss', $this->url_path.'/assets/css/hellobar-admin.css', array(), $this->version); wp_enqueue_style('hellobaradmincss'); } public function add_js_in_admin() { wp_register_script('qtipjs', $this->url_path.'/assets/js/jquery.qtip.min.js', array('jquery'), '3.0.3', false); wp_enqueue_script('qtipjs'); } public function hellobar_insert_tags() { if (is_home()) { return; } $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo ''; } } } public function hellobar_print_script() { $hellobar_code = $this->get_option('hellobar_code'); $newapikey = get_option('hellobar_api_key', true); if ($newapikey) { echo ''; } else { if (!empty($hellobar_code)) { $hellobar_code = html_entity_decode($hellobar_code); if ($this->get_option('load_hellobar_in')=='header') { $output = preg_replace("/