Do this particular site have some differences in MySQL or PHP configurations?
Thread Starter
pier0
(@pier0)
Not that I’m aware off, should I look for anything in particular?
Could you please specify the MySQL and PHP version of that host? If you have SSH access to it, you can see it by typing:
mysql –version && php -v
I’m having the same issue. MySQL version 5.6.29 and PHP version 5.5.30.
Maybe it has something to do with a caching plugin? I use W3 total cache, and also Wordfence and Sucuri.
I started running another stats plugin in parallel wich doesn’t have this problem, and it shows many visits less than WP Power Stats. I like this plugin more since it’s so lightweight and simple, but I think it’s not working as it should.
Have you tried disabling the W3 total cache plugin for some time and check whether the WP Power Stats works?
I’m having this problem in just one of my sites. I checked the power_stats_visits table with PHPMyAdmin and apparently is being flushed for no reason although the Statistics Period setting is set to 150 days.
Any ideas?
I managed to fix this issue changing one line in the power_stats_purge() function in the wp-power-stats.php file:
Replace this:
self::$wpdb->query("DELETE FROM {$GLOBALS['wpdb']->prefix}power_stats_visits WHERE date < $days_ago");
with this:
self::$wpdb->query("DELETE FROM {$GLOBALS['wpdb']->prefix}power_stats_visits WHERE date < FROM_UNIXTIME($days_ago)");