WordPress.org

Ready to get started?Download WordPress

Forums

Simple Login Log
[resolved] Clear logs? (12 posts)

  1. Stergos
    Member
    Posted 2 years ago #

    Hello, is there any way to clear all logs?

    Thanks in advance for this great plugin!

    http://wordpress.org/extend/plugins/simple-login-log/

  2. Stergos
    Member
    Posted 2 years ago #

    Also on general settings I set (Truncate Log Entries "1" days and older) but after 2 days the logs is still there, is this a bug or something?

    Thanks in advance!

  3. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    Hi there,

    You might be right. Could you please test it for me? In file simple-login-log.php line 177 which looks like this:

    $sql = $wpdb->prepare( "DELETE FROM {$this->table} WHERE time < DATE_SUB(CURDATE(),INTERVAL %d DAY)", array( $this->opt['log_duration']));

    substitute with this:

    $sql = $wpdb->prepare( "DELETE FROM {$this->table} WHERE time < DATE_SUB(CURDATE(),INTERVAL %d DAY)", array( (int)$this->opt['log_duration']));

    See if that clears your logs after 1 day.

  4. Stergos
    Member
    Posted 2 years ago #

    Hello Max, thanks for reply. I test your code but it doesn't work. Any other suggestion please?

  5. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    I committed an updated version 0.9.1. It should work. Thanks for pointing out the issue.

  6. Stergos
    Member
    Posted 2 years ago #

    I get the update but no the problem is still remain. I don't understand why I 'm the only who have this bug... any ideas would be appreciated, thank you!

  7. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    You need to deactivate and re-activate the plugin to clear old cron job, which was incorrect in the previous version. Sorry about not clearing this up earlier. I'm not sure if the truncation will happen right away (it might) and it will wait until the next iteration of the cron job happens (which is 24 hours).

  8. Stergos
    Member
    Posted 2 years ago #

    I will give it a try thanks in advance I let you know.

  9. Stergos
    Member
    Posted 2 years ago #

    Deactivate - reactivate waiting 1 day nothing change, same issue.

    After update to the last release I notice that the code in to "simple-login-log/simple-login-log.php" is not the same like the codes you post above. After update the plugin I did not change any code because I thought that this release has contain the fix of this issue. This is the code I have right now.
    "$sql = $wpdb->prepare( "DELETE FROM {$table} WHERE time < DATE_SUB(CURDATE(),INTERVAL %d DAY)", $log_duration);"

    Do you think I have to change it with the (fix) code you posted above?

    Thanks!

  10. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    No, no need to change anything. I just committed version 0.9.2 - I tested it multiple times and it works now.

  11. Stergos
    Member
    Posted 2 years ago #

    Yes is working. Thank you very much maxchirkov, appreciate your help!

  12. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    Awesome! Glad we got it resolved :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic