/** * Handles the POST and GET requests */ private function request_handler() { // List the table search post to a get. $this->list_table_search_post_to_get(); // Catch the authorization code POST. $this->catch_authentication_post(); // Is there a reset post than we will remove the posts and data. if (filter_input(INPUT_GET, 'gsc_reset')) { // Clear the google data. WPSEO_GSC_Settings::clear_data($this->service); // Adding notification to the notification center. /* Translators: %1$s: expands to Google Search Console. */ $this->add_notification(sprintf(__('The %1$s data has been removed. You will have to reauthenticate if you want to retrieve the data again.', 'wordpress-seo'), 'Google Search Console'), 'updated'); // Directly output the notifications. wp_redirect(remove_query_arg('gsc_reset')); exit; } // Reloads al the issues. if (wp_verify_nonce(filter_input(INPUT_POST, 'reload-crawl-issues-nonce'), 'reload-crawl-issues') && filter_input(INPUT_POST, 'reload-crawl-issues')) { // Reloading all the issues. WPSEO_GSC_Settings::reload_issues(); // Adding the notification. $this->add_notification(__('The issues have been successfully reloaded!', 'wordpress-seo'), 'updated'); // Directly output the notifications. Yoast_Notification_Center::get()->display_notifications(); } // Catch bulk action request. new WPSEO_GSC_Bulk_Action(); }
/** * Clears all authorization data. */ public function clear_auth_code() { if (!$this->valid_nonce()) { wp_die('0'); } $service = $this->get_service(); WPSEO_GSC_Settings::clear_data($service); $this->get_profiles(); }