@mikeyott
Appreciate the effort but I think your neat plugin needs some extra context.
It seems to be doing a bit more than just purge the event log (which by the way is to be expected when reading the button text ‘Delete all security logs’).
In the last release (6.8.1) that the iTSec plugin still offered a Clear Logs button, it would only run this piece of code:
$wpdb->query( "DELETE FROM
” . $wpdb->base_prefix . “itsec_log;" );
Where your plugin seems to be doing:
$wpdb->query("TRUNCATE TABLE " . $lockouts_table);
$wpdb->query("TRUNCATE TABLE " . $log_table);
$wpdb->query("TRUNCATE TABLE " . $logs_table);
$wpdb->query("TRUNCATE TABLE " . $temp_table);
It seems to be clearing the lockouts and temp tables as well.
It’s also attempting to clear the old log table ($log_table) which probably no longer exists in the database for most people. So that can be left out.
Perhaps the plugin could be adapted to offer the option of clearing only the log table ($logs_table) or all (3) tables. That way it can also be used by people running the iTSec Pro plugin without losing the Dashboard Widget statistics …