PHPdoc and ReadMe corrections
This commit is contained in:
parent
df59e43b29
commit
7929dd66bd
@ -7,7 +7,7 @@
|
||||
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
## Description ##
|
||||
A blacklist extension for the famous [Statify](https://de.wordpress.org/plugins/statify/) Wordpress plugin.
|
||||
A blacklist extension for the famous [Statify](https://wordpress.org/plugins/statify/) Wordpress plugin.
|
||||
|
||||
This plugin adds customizable blacklist to Statify to allow blocking of referer spam or internal interactions.
|
||||
|
||||
@ -54,14 +54,14 @@ visitors from search engines, just "false" referers from 301 redirects or you ow
|
||||
No. It only prevent's _Statify_ from tracking, nothing more or less.
|
||||
|
||||
### Does live filtering impact performance? ###
|
||||
Yes, but probalby not noticeable. Checking a single referer string against a (usually small) list should be neglectible compared to the total loading procedure.
|
||||
Yes, but probalby not noticeable. Checking a single referer string against a (usually small) list should be negligible compared to the total loading procedure.
|
||||
If this still is an issue for you, consider deactivating the filter and only run the one-time-cleanup or activate the cron job.
|
||||
|
||||
### Is any personal data collected? ###
|
||||
No. The privacy policy of _Statify_ is untouched. Data is only processed, not stored or exposed to anyone.
|
||||
|
||||
### Are regular expression filters possible? ###
|
||||
Yes, it it. Just select if you want to filter using regular expressions case sensitive or insensitive.
|
||||
Yes, it is. Just select if you want to filter using regular expressions case sensitive or insensitive.
|
||||
|
||||
Note, that regular expression matching is significantly slower than the plain domain filter. Hence it is only recommended for asynchronous cron or manual execution and not for live filtering.
|
||||
|
||||
@ -78,6 +78,7 @@ Because of this, an IP blacklist can only be applied while processing the reques
|
||||
### 1.4.0 / work in progress ###
|
||||
* IP blacklist implemented (#7)
|
||||
* Target page blacklist implemented (#8)
|
||||
* Internal configuration restructured (upgrade on plugin activation)
|
||||
|
||||
### 1.3.1 / 09.12.2016 ###
|
||||
* Continue filtering if no filter applies (#6)
|
||||
|
@ -42,7 +42,6 @@ class StatifyBlacklist {
|
||||
* Class constructor
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @changed 1.2.1
|
||||
*/
|
||||
public function __construct() {
|
||||
/* Skip on autosave or AJAX */
|
||||
@ -94,10 +93,10 @@ class StatifyBlacklist {
|
||||
/**
|
||||
* Update options
|
||||
*
|
||||
* @param $options array New options to save
|
||||
* @param array $options New options to save
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @changed 1.1.1
|
||||
* @since 1.2.1 update_options($options = null) Parameter with default value introduced
|
||||
*/
|
||||
public static function update_options( $options = null ) {
|
||||
self::$_options = wp_parse_args(
|
||||
@ -138,10 +137,9 @@ class StatifyBlacklist {
|
||||
/**
|
||||
* Apply the blacklist filter if active
|
||||
*
|
||||
* @return TRUE if referer matches blacklist.
|
||||
* @return bool TRUE if referer matches blacklist.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @since 1.4.0 Target and IP blacklist
|
||||
*/
|
||||
public static function apply_blacklist_filter() {
|
||||
/* Referer blacklist */
|
||||
@ -252,8 +250,8 @@ class StatifyBlacklist {
|
||||
/**
|
||||
* Helper function to check if an IP address matches a given subnet.
|
||||
*
|
||||
* @param $ip string IP address to check
|
||||
* @param $net string IP address or subnet in CIDR notation
|
||||
* @param string $ip IP address to check
|
||||
* @param string $net IP address or subnet in CIDR notation
|
||||
*
|
||||
* @return bool TRUE, if the given IP addresses matches the given subnet
|
||||
*/
|
||||
|
@ -13,11 +13,10 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
|
||||
/**
|
||||
* Update options
|
||||
*
|
||||
* @param $options array New options to save
|
||||
* @param array $options New options to save
|
||||
*
|
||||
* @return mixed array of sanitized array on errors, FALSE if there were none
|
||||
* @return array|bool array of sanitized array on errors, FALSE if there were none
|
||||
* @since 1.1.1
|
||||
* @changed 1.4.0
|
||||
*/
|
||||
public static function update_options( $options = null ) {
|
||||
if ( isset( $options ) && current_user_can( 'manage_options' ) ) {
|
||||
@ -82,10 +81,10 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
|
||||
/**
|
||||
* Add plugin meta links
|
||||
*
|
||||
* @param $links
|
||||
* @param $file
|
||||
* @param array $links Registered links
|
||||
* @param string $file The filename
|
||||
*
|
||||
* @return array
|
||||
* @return array Merged links
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ -100,7 +99,8 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
|
||||
/**
|
||||
* Add plugin action links
|
||||
*
|
||||
* @param array $input Registered links
|
||||
* @param array $links Registered links
|
||||
* @param string $file The filename
|
||||
*
|
||||
* @return array Merged links
|
||||
*
|
||||
@ -123,7 +123,6 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
|
||||
* Filter database for cleanup.
|
||||
*
|
||||
* @since 1.1.0
|
||||
* @changed 1.4.0
|
||||
*/
|
||||
public static function cleanup_database() {
|
||||
/* Check user permissions */
|
||||
@ -195,12 +194,11 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
|
||||
/**
|
||||
* Sanitize URLs and remove empty results
|
||||
*
|
||||
* @param $urls array given array of URLs
|
||||
* @param array $urls given array of URLs
|
||||
*
|
||||
* @return array sanitized array
|
||||
*
|
||||
* @since 1.1.1
|
||||
* @changed 1.2.0
|
||||
*/
|
||||
private static function sanitizeURLs( $urls ) {
|
||||
return array_flip(
|
||||
@ -218,7 +216,7 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
|
||||
/**
|
||||
* Sanitize IP addresses with optional CIDR notation and remove empty results
|
||||
*
|
||||
* @param $ips array given array of URLs
|
||||
* @param array $ips given array of URLs
|
||||
*
|
||||
* @return array sanitized array
|
||||
*
|
||||
|
@ -15,7 +15,6 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
||||
* Plugin install handler.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @changed 1.4.0
|
||||
*
|
||||
* @param bool $network_wide Whether the plugin was activated network-wide or not.
|
||||
*/
|
||||
@ -81,7 +80,6 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
||||
* Upgrade plugin options.
|
||||
*
|
||||
* @since 1.2.0
|
||||
* @changed 1.4.0
|
||||
*/
|
||||
public static function upgrade() {
|
||||
self::update_options();
|
||||
@ -130,7 +128,7 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
||||
/* Version older than current major release */
|
||||
if ( self::$_options['version'] < self::VERSION_MAIN ) {
|
||||
/* Merge default options with current config, assuming only additive changes */
|
||||
$options = array_merge( self::defaultOptions(), self::$_options );
|
||||
$options = array_merge_recursive( self::defaultOptions(), self::$_options );
|
||||
$options['version'] = self::VERSION_MAIN;
|
||||
if ( ( is_multisite() && array_key_exists( STATIFYBLACKLIST_BASE, (array) get_site_option( 'active_sitewide_plugins' ) ) ) ) {
|
||||
update_site_option( 'statify-blacklist', $options );
|
||||
|
@ -35,7 +35,7 @@ spl_autoload_register( 'statifyBlacklist_autoload' );
|
||||
/**
|
||||
* Autoloader for StatifyBlacklist classes.
|
||||
*
|
||||
* @param $class
|
||||
* @param string $class name of the class to load
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
@ -141,7 +141,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) {
|
||||
</li>
|
||||
<li>
|
||||
<label for="statify-blacklist_referer">
|
||||
<?php esc_html_e( 'Referer blacklist:', 'statify-blacklist' ); ?><br/>
|
||||
<?php esc_html_e( 'Referer blacklist', 'statify-blacklist' ); ?>:<br/>
|
||||
<textarea cols="40" rows="5" name="statifyblacklist[referer][blacklist]" id="statify-blacklist_referer"><?php
|
||||
if ( isset( $statifyBlacklistUpdateResult['referer'] ) ) {
|
||||
print esc_html( implode( "\r\n", array_keys( $statifyBlacklistUpdateResult['referer'] ) ) );
|
||||
@ -203,7 +203,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) {
|
||||
</li>
|
||||
<li>
|
||||
<label for="statify-blacklist_target">
|
||||
<?php esc_html_e( 'Target blacklist:', 'statify-blacklist' ); ?><br/>
|
||||
<?php esc_html_e( 'Target blacklist', 'statify-blacklist' ); ?>:<br/>
|
||||
<textarea cols="40" rows="5" name="statifyblacklist[target][blacklist]" id="statify-blacklist_target"><?php
|
||||
if ( isset( $statifyBlacklistUpdateResult['target'] ) ) {
|
||||
print esc_html( implode( "\r\n", array_keys( $statifyBlacklistUpdateResult['target'] ) ) );
|
||||
@ -240,7 +240,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) {
|
||||
</li>
|
||||
<li>
|
||||
<label for="statify-blacklist_ip">
|
||||
<?php esc_html_e( 'IP blacklist:', 'statify-blacklist' ); ?><br/>
|
||||
<?php esc_html_e( 'IP blacklist', 'statify-blacklist' ); ?>:<br/>
|
||||
<textarea cols="40" rows="5" name="statifyblacklist[ip][blacklist]" id="statify-blacklist_ip"><?php
|
||||
if ( isset( $statifyBlacklistUpdateResult['ip'] ) ) {
|
||||
print esc_html( $_POST['statifyblacklist']['ip']['blacklist'] );
|
||||
|
Loading…
x
Reference in New Issue
Block a user