Use ? instead of {0,1} and {3} instead of {3,3} where applicable.
Number groups [ß-9] are left as is for readability, i.e. prefer
[1-9][0-9] over [1-9]\d.
The whole expression is evaluated case-insensitive now, so we can omit
the "a-fA-F" and simply use "a-f".
Unit-tests extended accordingly.
The user agent filer list is not flipped with the actual values as keys
like the lists for referrer and target. Hence the numeric keys are
compared against the actual user agent. We now flip the values in the
upgrade hook.
Referer, target and user agent filter share most of their logic
for different matching methods. We introduce a common routine for
all of them to not repeat ourselves. Passing a value extractor by
reference allows lazy evaluation (filter might be disabled) and
overrides for different cases (i.e. domain extractor for exact match).
The plugins purpose is to exclude or filter certain requests from
tracking by Statify. However the current name "Statify Blacklist" is not
actually inline with today's understanding of such terms. In WordPress
Core 5.5 the word "blacklist" among others has been replaced by more
precise wording where possible.
The term "filter" has been used in various places already and clearly
describes the behavior of this plugin. So we rename the plugin to
"Statify Filter" and rephrase front-end texts.
Plugin slug (permalink), textdomain and all public class and constant
names left untouched for now, to not introduce breaking changes at this
point. To be cleaned up with next major release.
Statify 1.7 changed the JS tacking endpoint to WP AJAX, so we must not
skip the complete initialization on AJAX calls anymore. The routine now
breaks after adding the filter (if necessary).
In addition to the pre-existing normal and regular expression filters a
keyword mode is added. This filter matches if the referer string
contains a given keyword (case insensitive).
With PHP 7.1 implicit conversion of non-trimmed strings to integer raises an error. Input value fpr IPv6 subnets is now trimmed and a check for numeric value is added.
All PHP classes have been reworked to match the WP coding standard. This includes mostly code styling, but also the use of wp_ functions instead of PHP builtins.