From 06a7b1677a26edfa65937cbb29df5e4732fbd623 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sun, 9 Aug 2020 11:49:29 +0200 Subject: [PATCH] rename plugin to "Statify Filter" 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. --- README.md | 26 +++++++++++----------- RoboFile.php | 2 +- composer.json | 6 ++--- inc/class-statifyblacklist-admin.php | 6 ++--- inc/class-statifyblacklist-system.php | 4 ++-- inc/class-statifyblacklist.php | 32 +++++++++++++-------------- package.json | 4 ++-- statify-blacklist.php | 16 +++++++------- test/statifyblacklist-test.php | 30 ++++++++++++------------- views/settings-page.php | 16 +++++++------- 10 files changed, 70 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 98750b3..8c49e04 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Packagist Version](https://img.shields.io/packagist/v/stklcode/statify-blacklist.svg)](https://packagist.org/packages/stklcode/statify-blacklist) [![License](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://github.com/stklcode/statify-blacklist/blob/master/LICENSE.md) -# Statify Blacklist # +# Statify Filter # * Contributors: Stefan Kalscheuer * Requires at least: 4.7 * Tested up to: 5.5 @@ -13,19 +13,19 @@ * License URI: https://www.gnu.org/licenses/gpl-2.0.html ## Description ## -A blacklist extension for the famous [Statify](https://wordpress.org/plugins/statify/) Wordpress plugin. +A filter extension for the famous [Statify](https://wordpress.org/plugins/statify/) Wordpress plugin. -This plugin adds a customizable blacklist to Statify to allow blocking of referer spam or internal interactions. +This plugin adds customizable filters to Statify to allow blocking of referer spam or internal interactions. ### Features ## -#### Referer Blacklist #### +#### Referer Filter #### Add a list of domains (for simplicity only second-level, e.g. _example.com_ which blocks _everything.example.com_). -#### Target Blacklist #### +#### Target Filter #### Add a list of target pages (e.g. _/test/page/_, _/?page_id=123_) that will be excluded from tracking. -#### IP Blacklist #### +#### IP Filter #### Add a list of IP addresses or subnets (e.g. _192.0.2.123_, _198.51.100.0/24_, _2001:db8:a0b:12f0::/64_). #### CleanUp Database #### @@ -47,7 +47,7 @@ The plugin is capable of handling multisite installations. ## Installation ## * If you don’t know how to install a plugin for WordPress, [here’s how](https://wordpress.org/support/article/managing-plugins/#installing-plugins). * Make sure _Statify_ plugin is installed and active -* Goto _Settings_ -> _Statify Blacklist_ to configure the plugin +* Goto _Settings_ -> _Statify Filter_ to configure the plugin ### Requirements ### * PHP 5.5 or above @@ -57,9 +57,9 @@ The plugin is capable of handling multisite installations. ## Frequently Asked Questions ## ### What is blocked by default? ### -Nothing. By default, all blacklists are empty and disabled. They can and have to be filled by the blog administrator. +Nothing. By default, all filters are empty and disabled. They can and have to be filled by the blog administrator. -A default blacklist is not provided, as the plugin itself is totally neutral. If you want to filter out referer spam, +A default filter is not provided, as the plugin itself is totally neutral. If you want to filter out referer spam, visitors from search engines, just "false" referrers from 301 redirects or you own IP address used for testing only depends on you. ### Does the filter effect user experience? ### @@ -77,16 +77,16 @@ Yes, it is. Just select regular expressions (case-sensitive or insensitive) as m ### Why is IP filtering only available as live filter? ### As you might know, _Statify_ does not store any personal information, including IP addresses in the database. -Because of this, an IP blacklist can only be applied while processing the request and not afterwards. +Because of this, an IP filter can only be applied while processing the request and not afterwards. ### Can whole IP subnet be blocked? ### -Yes. The plugin features subnet blacklists using CIDR notation. -For example _198.51.100.0/24_ blacklists all sources from _198.51.100.1_ to _198.51.100.254_. +Yes. The plugin features subnet filters using CIDR notation. +For example _198.51.100.0/24_ filters all sources from _198.51.100.1_ to _198.51.100.254_. Same for IPv6 prefixes like _2001:db8:a0b:12f0::/64_. ## Screenshots ## -1. Statify Blacklist settings page +1. Statify Filter settings page ## Changelog ## diff --git a/RoboFile.php b/RoboFile.php index 2a7e9a5..debbd51 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -1,6 +1,6 @@ * @license GPL-2.0+ * * @wordpress-plugin - * Plugin Name: Statify Blacklist + * Plugin Name: Statify Filter * Plugin URI: https://wordpress.org/plugins/statify-blacklist/ - * Description: Extension for the Statify plugin to add a customizable blacklists. - * Version: 1.5.2 + * Description: Extension for the Statify plugin to add customizable filters. (formerly "Statify Blacklist) + * Version: 1.6.0-alpha * Author: Stefan Kalscheuer (@stklcode) * Author URI: https://www.stklcode.de * Text Domain: statify-blacklist * License: GPLv2 or later * - * Statify Blacklist is free software: you can redistribute it and/or modify + * Statify Filter is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * any later version. * - * Statify Blacklist is distributed in the hope that it will be useful, + * Statify Filter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Statify Blacklist. If not, see https://www.gnu.org/licenses/gpl-2.0.html. + * along with Statify Filter. If not, see https://www.gnu.org/licenses/gpl-2.0.html. */ // Quit if accessed directly. @@ -124,7 +124,7 @@ function statify_blacklist_disabled_notice() { echo '

'; printf( /* translators: minimum version numbers for WordPress and PHP inserted at placeholders */ - esc_html__( 'Statify Blacklist requires at least WordPress %1$s and PHP %2$s.', 'statify-blacklist' ), + esc_html__( 'Statify Filter requires at least WordPress %1$s and PHP %2$s.', 'statify-blacklist' ), '4.7', '5.5' ); diff --git a/test/statifyblacklist-test.php b/test/statifyblacklist-test.php index a7a18e4..e896199 100644 --- a/test/statifyblacklist-test.php +++ b/test/statifyblacklist-test.php @@ -1,6 +1,6 @@ array( 'active' => 0, @@ -77,13 +77,13 @@ class StatifyBlacklist_Test extends PHPUnit\Framework\TestCase { // No referer. unset( $_SERVER['HTTP_REFERER'] ); $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Non-blacklisted referer. + // Non-filtered referer. $_SERVER['HTTP_REFERER'] = 'http://example.org'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer. + // Filtered referer. $_SERVER['HTTP_REFERER'] = 'http://example.com'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer with path. + // Filtered referer with path. $_SERVER['HTTP_REFERER'] = 'http://example.net/foo/bar.html'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); @@ -139,13 +139,13 @@ class StatifyBlacklist_Test extends PHPUnit\Framework\TestCase { // No referer. unset( $_SERVER['HTTP_REFERER'] ); $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Non-blacklisted referer. + // Non-filtered referer. $_SERVER['HTTP_REFERER'] = 'http://not.evil'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer. + // Filtered referer. $_SERVER['HTTP_REFERER'] = 'http://example.com'; $this->assertTrue( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer with path. + // Filtered referer with path. $_SERVER['HTTP_REFERER'] = 'http://foobar.net/test/me'; $this->assertTrue( StatifyBlacklist::apply_blacklist_filter() ); // Matching both. @@ -196,13 +196,13 @@ class StatifyBlacklist_Test extends PHPUnit\Framework\TestCase { // No referer. unset( $_SERVER['HTTP_REFERER'] ); $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Non-blacklisted referer. + // Non-filtered referer. $_SERVER['HTTP_REFERER'] = 'http://not.evil'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer. + // Filtered referer. $_SERVER['HTTP_REFERER'] = 'http://example.com'; $this->assertTrue( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer with path. + // Filtered referer with path. $_SERVER['HTTP_REFERER'] = 'http://foobar.net/test/me'; $this->assertTrue( StatifyBlacklist::apply_blacklist_filter() ); // Matching both. @@ -405,7 +405,7 @@ class StatifyBlacklist_Test extends PHPUnit\Framework\TestCase { * @return void */ public function test_ip_filter() { - // Prepare Options: 2 blacklisted IPs, disabled. + // Prepare Options: 2 filtered IPs, disabled. StatifyBlacklist::$options = array( 'referer' => array( 'active' => 0, @@ -477,7 +477,7 @@ class StatifyBlacklist_Test extends PHPUnit\Framework\TestCase { * @return void */ public function test_target_filter() { - // Prepare Options: 2 blacklisted domains, disabled. + // Prepare Options: 2 filtered domains, disabled. StatifyBlacklist::$options = array( 'referer' => array( 'active' => 0, @@ -507,14 +507,14 @@ class StatifyBlacklist_Test extends PHPUnit\Framework\TestCase { // Empty target. unset( $_SERVER['REQUEST_URI'] ); $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Non-blacklisted targets. + // Non-filtered targets. $_SERVER['REQUEST_URI'] = ''; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); $_SERVER['REQUEST_URI'] = '/'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); $_SERVER['REQUEST_URI'] = '/?page_id=1'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); - // Blacklisted referer. + // Filtered referer. $_SERVER['REQUEST_URI'] = '/excluded/page/'; $this->assertNull( StatifyBlacklist::apply_blacklist_filter() ); $_SERVER['REQUEST_URI'] = '/?page_id=3'; diff --git a/views/settings-page.php b/views/settings-page.php index 2143f05..7dda7a1 100755 --- a/views/settings-page.php +++ b/views/settings-page.php @@ -1,6 +1,6 @@

-

+

'; @@ -170,7 +170,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) {

-

+

@@ -232,7 +232,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) {
- +