VaultPress::ui PHP Method

ui() public method

public ui ( )
    function ui()
    {
        if ($this->is_localhost()) {
            $this->update_option('connection', time());
            $this->update_option('connection_error_code', 'error_localhost');
            $this->update_option('connection_error_message', 'Hostnames such as localhost or 127.0.0.1 can not be reached by vaultpress.com and will not work with the service. Sites must be publicly accessible in order to work with VaultPress.');
            $this->error_notice();
            return;
        }
        if (!empty($_GET['error'])) {
            $this->error_notice();
            $this->clear_connection();
        }
        if (!$this->is_registered()) {
            $this->ui_register();
            return;
        }
        $status = $this->contact_service('status');
        if (!$status) {
            $error_code = $this->get_option('connection_error_code');
            if (0 == $error_code) {
                $this->ui_fatal_error();
            } else {
                $this->ui_register();
            }
            return;
        }
        $ticker = $this->contact_service('ticker');
        if (is_array($ticker) && isset($ticker['faultCode'])) {
            $this->error_notice();
            $this->ui_register();
            return;
        }
        $this->ui_main();
    }
VaultPress