/home/altere25/infinet.finance/wp-content/plugins/ninjafirewall/lib
Edit: /home/altere25/infinet.finance/wp-content/plugins/ninjafirewall/lib/dashboard_statistics.php (7349B)
', '', $nfw_stat );
} else {
$nfw_stat = '0:0:0:0:0:0:0:0:0:0';
goto NO_STATS;
}
// Look for the corresponding firewall log:
$log_file = NFW_LOG_DIR . "/nfwlog/firewall_{$statx}.php";
if ( file_exists( $log_file ) ) {
$fh = @fopen( $log_file, 'r', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES );
// Fetch processing times to output benchmarks:
while (! feof( $fh ) ) {
$line = fgets( $fh );
if ( preg_match( '/^\[.+?\]\s+\[(.+?)\]/', $line, $match ) ) {
if ( $match[1] == 0 ) { continue; }
if ( $match[1] > $slow ) {
$slow = $match[1];
}
if ( $match[1] < $fast ) {
$fast = $match[1];
}
$speed += $match[1];
++$tot_bench;
}
}
fclose( $fh );
}
NO_STATS:
list( $tmp, $medium, $high, $critical ) = explode( ':', $nfw_stat );
$medium = (int) $medium;
$high = (int) $high;
$critical = (int) $critical;
$total = $critical + $high + $medium;
$c = $critical; $h = $high; $m = $medium;
if ( $total == 1 ) { $fast = $slow; }
if (! $total ) {
echo '
' . esc_html__('You do not have any stats for the selected month yet.', 'ninjafirewall') . '
';
$fast = 0;
} else {
$coef = 100 / $total;
$critical = round( $critical * $coef, 2 );
$high = round( $high * $coef, 2 );
$medium = round( $medium * $coef, 2 );
// Avoid divide error :
if ($tot_bench) {
$speed = round( $speed / $tot_bench, 4 );
} else {
$fast = 0;
}
}
?>