Support » Plugin: amr users » cache log displays only the latest

  • Resolved muratgu


    The cache log page displays only onw row for the latest run report. This is probably because there is a bug in function log_cache_event($text) in ameta-cache.php, where it deletes old log records before adding the new one. It’s supposed to delete day-old records, but it deletes everything due to a bug in the where clause:

    /* clean up oldder log entries first  if there are any */
    $old = date_create();
    $old = clone $datetime;   // 20161011 don't use as a function, it's a keyword
    date_modify($old, '-1 day');
    $sql = "DELETE FROM " . $this->eventlog_table .
        " WHERE eventtime <= '%s'";
    $sql = $wpdb->prepare($sql,
        date_format($datetime,'Y-m-d H:i:s'));	

    The $datetime in where clause should have been $old.

    • This topic was modified 1 year, 7 months ago by muratgu. Reason: formatted the code
Viewing 1 replies (of 1 total)
  • Plugin Author anmari


    You’re correct. Thanks for looking into it. It’s weird. I wonder when that happened?
    I’ll put an update up. I had actually seen that something looked odd there but because I’m working on real time query version where that will fall away, didn’t come back to it.

Viewing 1 replies (of 1 total)
  • The topic ‘cache log displays only the latest’ is closed to new replies.