function __construct() { //Construct parent class Woopra::__construct(); //Load configuration $this->config = array(); $this->woopra_config(); // Load PHP SDK $this->woopra = new WoopraTracker($this->config); // Load Event Processing $this->events = new WoopraEvents(); //Detect Wordpress user $this->user = array(); add_action('init', array(&$this, 'woopra_detect')); //If event tracking is turned on, process events if ($this->get_option('process_event')) { $this->register_events(); $this->register_woocommerce_events(); } if ($this->get_option('other_events')) { add_action("woopra_track", array(&$this->woopra, "track"), 10, 3); } //Register front-end tracking add_action('init', array(&$this, 'set_tracker')); }
/** * Frontend Contructor Class * @since 1.4.1 * @return none * @constructor */ function __construct() { Woopra::__construct(); // Should we be upgrading the options? if (version_compare($this->get_option('version'), $this->version, '!=') && !empty($this->options)) { $this->check_upgrade(); } // Store Plugin Location Information $this->plugin_file = dirname(dirname(__FILE__)) . '/woopra.php'; $this->plugin_basename = plugin_basename($this->plugin_file); // Load Transations File load_plugin_textdomain('woopra', false, '/woopra/locale'); // Run this when installed or upgraded. register_activation_hook($this->plugin_file, array(&$this, 'init')); register_deactivation_hook($this->plugin_file, array(&$this, 'init_deactivate')); // Only run if activated! if ($this->get_option('activated')) { // Admin Actions add_action('admin_enqueue_scripts', array(&$this, 'enqueue')); add_action('admin_menu', array(&$this, 'woopra_add_menu')); // AJAX Render add_action('wp_ajax_woopra', array(&$this, 'render_page')); } add_action('admin_menu', array(&$this, 'register_settings_page')); add_action('admin_init', array(&$this, 'admin_init')); // Process Events $this->event = new WoopraEvents(); }
/** * Events Contructor Class * @since 1.4.1 * @return * @constructor */ function __construct() { Woopra::__construct(); // Register Events! $this->register_events(); }