function __construct()
 {
     parent::__construct();
     global $epl_fields;
     $this->epl->load_config('event-fields');
     $this->epl->load_config('settings-fields');
     $this->fields = $epl_fields;
     add_action('admin_notices', array($this, 'settings_page'));
     add_action('admin_init', array($this, 'set_options'));
     epl_has_a_key();
 }
function __epl_pr_api_key($refresh = false)
{
    $next = null;
    $k = epl_has_a_key();
    if ($k == '') {
        add_action('admin_notices', 'epl_empty_api_key_msg', 100);
        epl_dg();
        return;
        $next = null;
    } elseif (epl_has_a_valid_key() !== true) {
        add_action('admin_notices', 'epl_empty_api_key_msg', 100);
        epl_dg();
        $next = 'check';
    }
    if (!$refresh) {
        $next = null;
    } else {
        $next = 'check';
    }
    switch ($next) {
        case null:
            break;
        case 'check':
            $cf = epl_get_remote_config();
            if (isset($cf->response_code)) {
                $v = $cf->response_code;
                $m = $cf->response_message;
                $a = $cf->atp_response_message;
                $b = $cf->mc_response_message;
                $c = $cf->us_response_message;
                $d = $cf->sc_response_message;
                update_option('_epl_key_valid', $v);
                update_option('_epl_key_message', $m);
                update_option('_epl_atp', $a);
                update_option('ASDFAWEEFADSF', $b);
                update_option('DASFERWEQREWE', $c);
                update_option('ETDFGWETSDFGR', $d);
                if (epl_has_a_valid_key($v) !== true) {
                    //add_action( 'admin_notices', 'epl_empty_api_key_msg', 100 );
                } else {
                    remove_action('admin_notices', 'epl_empty_api_key_msg', 100);
                }
            }
            break;
    }
}