/** * Delete authentication and cached data on de-activation of the plugin * * @return void */ static function deactivate() { // Clear OAuth tokens delete_option('ctct_token_response'); delete_option('ctct_configured'); if (!class_exists('CTCT_Global')) { include_once plugin_dir_path(__FILE__) . 'classes/class.ctct_global.php'; } // CTCT_Settings is only loaded for 5.3+ // If they don't have 5.3, they never had the transients in the first place. if (class_exists('CTCT_Settings')) { // Flush stored transient data CTCT_Global::flush_transients(); } }
protected function processForms() { if (isset($_GET['error']) && isset($_GET['error_description'])) { $this->errors[] = new WP_Error($_GET['error'], $_GET['error_description']); } if (isset($_GET['de-authenticate']) && wp_verify_nonce($_GET['de-authenticate'], 'de-authenticate')) { $this->oauth->deleteToken(); delete_option('ccStats_ga_token'); delete_option('ccStats_ga_profile_id'); } if (isset($_GET['delete-settings']) && wp_verify_nonce($_GET['delete-settings'], 'delete-settings')) { CTCT_Global::flush_transients(); $this->oauth->deleteToken(); delete_option('ccStats_ga_token'); delete_option('ccStats_ga_profile_id'); delete_option('cc_form_increment'); delete_option('cc_form_design'); delete_option('ctct_configured'); delete_option('ctct_settings'); delete_option('cc_username'); delete_option('cc_password'); } }