configure_hotjar_options = get_option('configure_hotjar_option_name'); ?>

Configure Hotjar (with Advanced Options)

Plugin by Jerome Paulos

', isset($this->configure_hotjar_options['hotjar_id']) ? esc_attr($this->configure_hotjar_options['hotjar_id']) : ''); } public function tracking_callback() { ?>
configure_hotjar_options['tracking']) && $this->configure_hotjar_options['tracking'] === 'everybody') ? 'checked' : ''; ?>
configure_hotjar_options['tracking']) && $this->configure_hotjar_options['tracking'] === 'admins') ? 'checked' : ''; ?>
configure_hotjar_options['tracking']) && $this->configure_hotjar_options['tracking'] === 'users') ? 'checked' : ''; ?>
%s', isset($this->configure_hotjar_options['ip_addresses']) ? esc_attr($this->configure_hotjar_options['ip_addresses']) : ''); } } if (is_admin()): $configure_hotjar = new ConfigureHotjar(); endif; add_action('init', 'hotjar_checker'); function hotjar_checker() { $configure_hotjar_options = get_option('configure_hotjar_option_name'); $status = $configure_hotjar_options['status']; $hotjar_id = $configure_hotjar_options['hotjar_id']; $tracking = $configure_hotjar_options['tracking']; if (!empty($configure_hotjar_options['ip_addresses'])) { $ip_addresses = explode("\n", $configure_hotjar_options['ip_addresses']); } else { $ip_addresses = array('disabled'); }; if ($status == 'enabled' && !empty($hotjar_id)) { if (!in_array($_SERVER['REMOTE_ADDR'], $ip_addresses)) { if ($tracking == 'admins' && !in_array('administrator', wp_get_current_user()->roles)) { add_action('wp_head', 'hotjar_script'); } else { if ($tracking == 'users' && !is_user_logged_in()) { add_action('wp_head', 'hotjar_script'); } else { if ($tracking == 'everybody') { add_action('wp_head', 'hotjar_script'); } } } } } } function hotjar_script() { ?>