Purge All Logs'; echo '
Warning: This action is irreversible and will permanently delete all logs in Yourls. It is highly recommended to take a database snapshot before proceeding.
'; echo ''; echo ''; } // Function to purge all logs function purge_all_logs() { global $ydb; // Check if the user is authorized to perform this action (optional) // For example, you might check for admin privileges here // Purge all logs from the database $delete_logs = $ydb->query("DELETE FROM `" . YOURLS_DB_TABLE_LOG . "`"); // Check if the logs were successfully purged if ($delete_logs) { yourls_add_notice('success', 'Logs purged successfully!'); } else { yourls_add_notice('error', 'Failed to purge logs.'); } } ?>