public function __construct()
 {
     parent::__construct();
     global $toplytics;
     $this->toplytics = $toplytics;
     add_action('admin_menu', array($this, 'admin_menu'));
     add_action('admin_init', array($this, 'connect'));
     add_action('admin_init', array($this, 'disconnect'));
 }
 public function __construct()
 {
     parent::__construct();
     global $toplytics;
     $this->toplytics = $toplytics;
     if (current_user_can('manage_options')) {
         add_action('admin_menu', array($this, 'admin_menu'));
         add_action('admin_init', array($this, 'get_authorization_key'));
         add_action('admin_init', array($this, 'request_token'));
         add_action('admin_init', array($this, 'upload_auth_config_file'));
         add_action('admin_init', array($this, 'reset_auth_config'));
         add_action('admin_enqueue_scripts', array($this, 'exchange_code_for_token'));
     }
 }