Another simple fix
If you have an equal number of successful inclusion and exclusion filters for a rule, you will get a divide by zero error when the rule is calculated.
This comes from calculate_percentage(), which I updated as shown below to test for $pass_filt matching $exclude_filt
function calculate_percentage($pass_filt, $exclude_filt, $pass_targ, $rule, $source)
{
if ($pass_filt > 0) {
if ($pass_filt == $exclude_filt) // don't want to divide by zero
$perc = "0" . xl('%');
else
$perc = number_format(($pass_targ / ($pass_filt - $exclude_filt)) * 100, 4) . xl('%');
} else {
$perc = "0" . xl('%');
}
return $perc;
}