Hi,
Can you paste here the content of your /wp-content/nfwlog/stats_2018-04.php file?
I don’t get any PHP error, it’s working as expected:
Blocked threats 3903
Critical: 0%
High: 43.79%
Medium: 56.21%
Which version of PHP are you running?
But the calculation of the dashboard widget is wrong. See the stats in these screenshots: https://cloudup.com/cYbs0l1AiKw
Current content of stats_2018-04.php: :2267:2143:::::::
PHP 7.1.11
Regarding the 2 error messages, can you try to edit the “dashboard_widget.php”?
Locate line 41 :
list($tmp, $medium, $high, $critical, $tmp, $upload, $tmp, $tmp, $tmp, $tmp) = explode(':', $nfw_stat . ':');
Right below, add those 4 lines of code:
$medium = (int) $medium;
$high = (int) $high;
$critical = (int) $critical;
$upload = (int) $upload;
Regarding the stats, the numbers look odd, but the widget relies on the /wp-content/nfwlog/stats_xxxxx.php files, while the stats page relies on the firewall logs (/wp-content/nfwlog/firewall_xxxxx.php).
If a user deletes the log, the stats_xxxxx.php will not be deleted, and thus numbers will be different. But in that case, I would expect the widget to display higher numbers than the stats page. Yours show the contrary.
This resolves the warning in the dashboard widget.
But the numbers still look odd.
Dashboard widget: 550
Stats page: 42385
I didn’t delete any logs.
-
This reply was modified 8 years, 1 month ago by
Matze Pabst.
I cannot reproduce the warning. I tried with PHP 5.3, 5.6, 7 and 7.2.
But I will add the code to NF anyway, just in case.
Regarding the numbers, maybe your stats_xxxxx.php was deleted/corrupted and a new one created?
In the next release, we will use the stats_xxxxx.php for both the widget and the “Satistics” page. The reason is because of the GDPR, we have many European customers who will likely use the new “Auto-delete log” option and that will affect the “Satistics” page as it relies on the firewall log (firewall_xxxxx.php).