'active-twist-seo-files', 'tab' => 'robots', 'updated' => '1'], admin_url('admin.php'))); exit; } public function handle_reset() { if (!current_user_can('manage_options')) { wp_die('Unauthorized'); } check_admin_referer('at_seo_reset_robots', 'at_seo_min_nonce'); // Using different nonce name or same? Let's use specific action. $options = Options::get_all(); unset($options[self::OPTION_KEY_ROBOTS]); // Remove key to revert to default update_option(Options::OPTION_NAME, $options); wp_safe_redirect(add_query_arg(['page' => 'active-twist-seo-files', 'tab' => 'robots', 'reset' => '1'], admin_url('admin.php'))); exit; } public static function get_default_content() { $site_url = home_url(); $sitemap_url = home_url('/sitemap.xml'); return "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n\nSitemap: {$sitemap_url}"; } }