Support » Plugin: Simple History » Ability to limit event

  • Recently our server got a spike of traffic and WordPress to become really slow. after some investigation, I found that Simple History storing a ton of records in our database:

    wp_b7afed30c8_simple_history_contexts	7,338,922	643.5 MiB
    

    This even crashes our backup plugin (Duplicator) because this table is too large for our server. I hope there could be an option to limit how many records/events to store with Simple History.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m also finding that the fact it logs every login attempt is bloating our database.
    Is there a way to choose what gets logged?
    I would like to disable logging of user logins and attempted logins.

    Actually, I just read the readme file in the plugin source code and see that this is already possible:

    = Is it possible to exclude users from the log? =

    Yes, you exclude users by role or email using the filter simple_history/log/do_log.
    See the [examples file](https://github.com/bonny/WordPress-Simple-History/blob/master/examples/examples.php).

    The examples file shows the following code to filter out failed logins:

    // Don’t log failed logins
    add_filter(‘simple_history/simple_logger/log_message_key’, function ($doLog, $loggerSlug, $messageKey, $SimpleLoggerLogLevelsLevel, $context) {
    // Don’t log login attempts to non existing users
    if (‘SimpleUserLogger’ == $loggerSlug && ‘user_unknown_login_failed’ == $messageKey) {
    $doLog = false;
    }
    // Don’t log failed logins to existing users
    if (‘SimpleUserLogger’ == $loggerSlug && ‘user_login_failed’ == $messageKey) {
    $doLog = false;
    }
    return $doLog;
    }, 10, 5);

    • This reply was modified 1 year, 2 months ago by jgramp.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ability to limit event’ is closed to new replies.