Closed thefrosty closed 6 years ago
Thanks for the report! I'll take a look asap
@thefrosty I'm sorry it took so long to look at this. I cannot reproduce the problem right now and have never notices an error like this in projects where bot WP Stash and Query Monitor are active.
Query monitor basically does this:
$total = $this->data['stats']['cache_misses'] + $this->data['stats']['cache_hits'];
$this->data['cache_hit_percentage'] = ( 100 / $total ) * $this->data['stats']['cache_hits'];
So you'll get a division by zero if bot cache_misses
and cache_hits
evaluate to 0. QM grabs these values directly from the $wp_object_cache
object here https://github.com/johnbillion/query-monitor/blob/32ac837b8737b8e6dd965e72ea4ad905d4548603/collectors/cache.php#L24-L28
So while I would appreciate if QM could guard itself against division by zero in that spot, there are definetely things we can do here, namely implementing those 2 public variables. That would not only fix the errors you're seeing, but also make QM return useful information
@thefrosty If you're still following, can you check the master branch if it fixes the issue for you? I will happily create a new release then
Closed due to lack of activity. I'll just assume my changes fixed the issue as intended
I'm getting errors when the Query Monitor plugin is installed.