Exemple #1
0
 /**
  * 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.
         YMBESEO_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.', 'ymbeseo'), '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.
         YMBESEO_GSC_Settings::reload_issues();
         // Adding the notification.
         $this->add_notification(__('The issues have been successfully reloaded!', 'ymbeseo'), 'updated');
         // Directly output the notifications.
         Yoast_Notification_Center::get()->display_notifications();
     }
     // Catch bulk action request.
     new YMBESEO_GSC_Bulk_Action();
 }