WP coding style

This commit is contained in:
Stefan Kalscheuer 2016-08-20 18:50:38 +02:00
parent bff28ce85b
commit 1e0659e649
5 changed files with 388 additions and 362 deletions

View File

@ -1,124 +1,126 @@
<?php <?php
/* Quit */ /* Quit */
defined('ABSPATH') OR exit; defined( 'ABSPATH' ) OR exit;
/** /**
* Statify Blacklist * Statify Blacklist
* *
* @since 1.0.0 * @since 1.0.0
*/ */
class StatifyBlacklist class StatifyBlacklist {
{ /**
/** * Plugin options
* Plugin options *
* * @var array
* @var array * @since 1.0.0
* @since 1.0.0 */
*/ public static $_options;
public static $_options;
/** /**
* Multisite Status * Multisite Status
* *
* @var bool * @var bool
* @since 1.0.0 * @since 1.0.0
*/ */
public static $multisite; public static $multisite;
/** /**
* Class self initialize * Class self initialize
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function instance() public static function instance() {
{ new self();
new self(); }
}
/** /**
* Class constructor * Class constructor
* *
* @since 1.0.0 * @since 1.0.0
* @changed 1.1.2 * @changed 1.1.2
*/ */
public function __construct() public function __construct() {
{ /* Skip on autosave or AJAX */
/* Skip on autosave or AJAX */ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) OR ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
if ( (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) OR (defined('DOING_AJAX') && DOING_AJAX) ) { return;
return; }
}
/* Plugin options */ /* Plugin options */
self::update_options(); self::update_options();
/* Get multisite status */ /* Get multisite status */
self::$multisite = (is_multisite() && array_key_exists(STATIFYBLACKLIST_BASE, (array)get_site_option('active_sitewide_plugins'))); self::$multisite = ( is_multisite() && array_key_exists( STATIFYBLACKLIST_BASE, (array) get_site_option( 'active_sitewide_plugins' ) ) );
/* Add Filter to statify hook */ /* Add Filter to statify hook */
add_filter('statify_skip_tracking', array('StatifyBlacklist', 'apply_blacklist_filter')); add_filter( 'statify_skip_tracking', array( 'StatifyBlacklist', 'apply_blacklist_filter' ) );
/* Admin only filters */ /* Admin only filters */
if (is_admin()) { if ( is_admin() ) {
/* Load Textdomain (only needed for backend */ /* Load Textdomain (only needed for backend */
load_plugin_textdomain( 'statifyblacklist', false, STATIFYBLACKLIST_DIR.'/lang/'); load_plugin_textdomain( 'statifyblacklist', false, STATIFYBLACKLIST_DIR . '/lang/' );
/* Add actions */ /* Add actions */
add_action('wpmu_new_blog', array('StatifyBlacklist_Install', 'init_site')); add_action( 'wpmu_new_blog', array( 'StatifyBlacklist_Install', 'init_site' ) );
add_action('delete_blog', array('StatifyBlacklist_System', 'init_site')); add_action( 'delete_blog', array( 'StatifyBlacklist_System', 'init_site' ) );
add_filter('plugin_row_meta', array('StatifyBlacklist_Admin', 'plugin_meta_link'), 10, 2); add_filter( 'plugin_row_meta', array( 'StatifyBlacklist_Admin', 'plugin_meta_link' ), 10, 2 );
if (is_multisite()) { if ( is_multisite() ) {
add_action('network_admin_menu', array('StatifyBlacklist_Admin', '_add_menu_page')); add_action( 'network_admin_menu', array( 'StatifyBlacklist_Admin', '_add_menu_page' ) );
add_filter('network_admin_plugin_action_links', array('StatifyBlacklist_Admin', 'plugin_actions_links'), 10, 2); add_filter( 'network_admin_plugin_action_links', array(
} else { 'StatifyBlacklist_Admin',
add_action('admin_menu', array('StatifyBlacklist_Admin', '_add_menu_page')); 'plugin_actions_links'
add_filter('plugin_action_links', array('StatifyBlacklist_Admin', 'plugin_actions_links'), 10, 2 ); ), 10, 2 );
} } else {
} add_action( 'admin_menu', array( 'StatifyBlacklist_Admin', '_add_menu_page' ) );
} add_filter( 'plugin_action_links', array( 'StatifyBlacklist_Admin', 'plugin_actions_links' ), 10, 2 );
}
}
}
/** /**
* Update options * Update options
* *
* @since 1.0.0 * @since 1.0.0
* @changed 1.1.1 * @changed 1.1.1
*/ */
public static function update_options() { public static function update_options() {
self::$_options = wp_parse_args( self::$_options = wp_parse_args(
get_option('statify-blacklist'), get_option( 'statify-blacklist' ),
array( array(
'active_referer' => 0, 'active_referer' => 0,
'referer' => array() 'referer' => array()
) )
); );
} }
/** /**
* Apply the blacklist filter if active * Apply the blacklist filter if active
* *
* @return TRUE if referer matches blacklist. * @return TRUE if referer matches blacklist.
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function apply_blacklist_filter() { public static function apply_blacklist_filter() {
/* Skip if blacklist is inactive */ /* Skip if blacklist is inactive */
if (self::$_options['active_referer'] != 1) { if ( self::$_options['active_referer'] != 1 ) {
return false; return false;
} }
/* Extract relevant domain parts */ /* Extract relevant domain parts */
$referer = strtolower( ( isset($_SERVER['HTTP_REFERER']) ? parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) : '' ) ); $referer = strtolower( ( isset( $_SERVER['HTTP_REFERER'] ) ? parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_HOST ) : '' ) );
$referer = explode('.', $referer); $referer = explode( '.', $referer );
if( count($referer) >1 ) if ( count( $referer ) > 1 ) {
$referer = implode('.', array_slice($referer, -2)); $referer = implode( '.', array_slice( $referer, - 2 ) );
else } else {
$referer = implode('.', $referer); $referer = implode( '.', $referer );
}
/* Get blacklist */ /* Get blacklist */
$blacklist = self::$_options['referer']; $blacklist = self::$_options['referer'];
/* Check blacklist */ /* Check blacklist */
return in_array($referer, $blacklist);
} return in_array( $referer, $blacklist );
}
} }

View File

@ -1,144 +1,158 @@
<?php <?php
/* Quit */ /* Quit */
defined('ABSPATH') OR exit; defined( 'ABSPATH' ) OR exit;
/** /**
* Statify Blacklist admin configuration * Statify Blacklist admin configuration
* *
* @since 1.0.0 * @since 1.0.0
*/ */
class StatifyBlacklist_Admin extends StatifyBlacklist class StatifyBlacklist_Admin extends StatifyBlacklist {
{ /**
/** * Update options
* Update options *
* * @return mixed array of sanitized array on errors, FALSE if there were none
* @return mixed array of sanitized array on errors, FALSE if there were none * @since 1.1.1
* @since 1.1.1 */
*/ public static function update_options( $options ) {
public static function update_options($options) { if ( isset( $options ) && current_user_can( 'manage_options' ) ) {
if (isset($options) && current_user_can('manage_options')) { /* Sanitize URLs and remove empty inputs */
/* Sanitize URLs and remove empty inputs */ $givenReferer = $options['referer'];
$givenReferer = $options['referer']; $sanitizedReferer = self::sanitizeURLs( $givenReferer );
$sanitizedReferer = self::sanitizeURLs($givenReferer);
/* Abort on errors */ /* Abort on errors */
if (!empty(array_diff($givenReferer, $sanitizedReferer))) { if ( ! empty( array_diff( $givenReferer, $sanitizedReferer ) ) ) {
return $sanitizedReferer; return $sanitizedReferer;
} }
/* Update database on success */ /* Update database on success */
if ((is_multisite() && array_key_exists(STATIFYBLACKLIST_BASE, (array)get_site_option('active_sitewide_plugins')))) if ( ( is_multisite() && array_key_exists( STATIFYBLACKLIST_BASE, (array) get_site_option( 'active_sitewide_plugins' ) ) ) ) {
update_site_option('statify-blacklist', $options); update_site_option( 'statify-blacklist', $options );
else } else {
update_option('statify-blacklist', $options); update_option( 'statify-blacklist', $options );
} }
}
/* Refresh options */ /* Refresh options */
parent::update_options(); parent::update_options();
return false; return false;
} }
/** /**
* Add configuration page to admin menu * Add configuration page to admin menu
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function _add_menu_page() { public function _add_menu_page() {
$title = __( 'Statify Blacklist', 'statify-blacklist' ); $title = __( 'Statify Blacklist', 'statify-blacklist' );
if (self::$multisite) if ( self::$multisite ) {
add_submenu_page( 'settings.php', $title, $title, 'manage_network_plugins', 'statify-blacklist-settings', array('StatifyBlacklist_Admin', 'settings_page') ); add_submenu_page( 'settings.php', $title, $title, 'manage_network_plugins', 'statify-blacklist-settings', array(
else 'StatifyBlacklist_Admin',
add_submenu_page( 'options-general.php', $title, $title, 'manage_options', 'statify-blacklist', array('StatifyBlacklist_Admin', 'settings_page') ); 'settings_page'
) );
} else {
add_submenu_page( 'options-general.php', $title, $title, 'manage_options', 'statify-blacklist', array(
'StatifyBlacklist_Admin',
'settings_page'
) );
}
} }
public static function settings_page() { public static function settings_page() {
include STATIFYBLACKLIST_DIR . '/views/settings_page.php'; include STATIFYBLACKLIST_DIR . '/views/settings_page.php';
} }
/** /**
* Add plugin meta links * Add plugin meta links
* *
* @param $links * @param $links
* @param $file * @param $file
* @return array *
* * @return array
* @since 1.0.0 *
*/ * @since 1.0.0
public static function plugin_meta_link($links, $file) { */
if ($file == STATIFYBLACKLIST_BASE) { public static function plugin_meta_link( $links, $file ) {
$links[] = '<a href="https://github.com/stklcode/statify-blacklist">GitHub</a>'; if ( $file == STATIFYBLACKLIST_BASE ) {
} $links[] = '<a href="https://github.com/stklcode/statify-blacklist">GitHub</a>';
return $links; }
}
/** return $links;
* Add plugin action links }
*
* @param array $input Registered links
* @return array Merged links
*
* @since 1.0.0
*/
public static function plugin_actions_links($links, $file) {
$base = self::$multisite ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
if( $file == STATIFYBLACKLIST_BASE && current_user_can('manage_options') ) { /**
array_unshift( * Add plugin action links
$links, *
sprintf( '<a href="%s">%s</a>', esc_attr(add_query_arg( 'page', 'statify-blacklist', $base )), __('Settings')) * @param array $input Registered links
); *
} * @return array Merged links
return $links; *
} * @since 1.0.0
*/
public static function plugin_actions_links( $links, $file ) {
$base = self::$multisite ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
/** if ( $file == STATIFYBLACKLIST_BASE && current_user_can( 'manage_options' ) ) {
* Filter database for cleanup. array_unshift(
* $links,
* @since 1.1.0 sprintf( '<a href="%s">%s</a>', esc_attr( add_query_arg( 'page', 'statify-blacklist', $base ) ), __( 'Settings' ) )
* @changed 1.1.1 );
*/ }
public static function cleanup_database() {
/* Check user permissions */
if (!current_user_can('manage_options'))
die(_e('Are you sure you want to do this?'));
global $wpdb; return $links;
}
/* Sanitize URLs */ /**
$referer = self::sanitizeURLs(self::$_options['referer']); * Filter database for cleanup.
*
* @since 1.1.0
* @changed 1.1.1
*/
public static function cleanup_database() {
/* Check user permissions */
if ( ! current_user_can( 'manage_options' ) ) {
die( _e( 'Are you sure you want to do this?' ) );
}
/* Build filter regexp */ global $wpdb;
$refererRegexp = str_replace('.', '\.', implode('|', $referer));
if (!empty($refererRegexp)) {
/* Execute filter on database */
$wpdb->query(
$wpdb->prepare("DELETE FROM `$wpdb->statify` WHERE referrer REGEXP %s", $refererRegexp)
);
/* Optimize DB */ /* Sanitize URLs */
$wpdb->query("OPTIMIZE TABLE `$wpdb->statify`"); $referer = self::sanitizeURLs( self::$_options['referer'] );
}
} /* Build filter regexp */
$refererRegexp = str_replace( '.', '\.', implode( '|', $referer ) );
if ( ! empty( $refererRegexp ) ) {
/* Execute filter on database */
$wpdb->query(
$wpdb->prepare( "DELETE FROM `$wpdb->statify` WHERE referrer REGEXP %s", $refererRegexp )
);
/* Optimize DB */
$wpdb->query( "OPTIMIZE TABLE `$wpdb->statify`" );
}
}
/** /**
* Sanitize URLs and remove empty results * Sanitize URLs and remove empty results
* @param $urls array given array of URLs *
* @return array sanitized array * @param $urls array given array of URLs
* *
* @since 1.1.1 * @return array sanitized array
*/ *
private static function sanitizeURLs($urls) { * @since 1.1.1
return array_filter( */
array_map( private static function sanitizeURLs( $urls ) {
function($r) { return array_filter(
return preg_replace('/[^\da-z\.-]/i', '', filter_var($r, FILTER_SANITIZE_URL)); array_map(
}, function ( $r ) {
$urls return preg_replace( '/[^\da-z\.-]/i', '', filter_var( $r, FILTER_SANITIZE_URL ) );
) },
); $urls
} )
);
}
} }

View File

@ -1,70 +1,69 @@
<?php <?php
/* Quit */ /* Quit */
defined('ABSPATH') OR exit; defined( 'ABSPATH' ) OR exit;
/** /**
* Statify Blacklist system configuration * Statify Blacklist system configuration
* *
* @since 1.0.0 * @since 1.0.0
*/ */
class StatifyBlacklist_System extends StatifyBlacklist class StatifyBlacklist_System extends StatifyBlacklist {
{ /**
/** * Plugin install handler.
* Plugin install handler. *
* * @since 1.0.0
* @since 1.0.0 *
* * @param bool $network_wide Whether the plugin was activated network-wide or not.
* @param bool $network_wide Whether the plugin was activated network-wide or not. */
*/ public static function install( $network_wide = false ) {
public static function install( $network_wide = false ) { global $wpdb;
global $wpdb;
// Create tables for each site in a network. // Create tables for each site in a network.
if ( is_multisite() && $network_wide ) { if ( is_multisite() && $network_wide ) {
// Todo: Use get_sites() in WordPress 4.6+ // Todo: Use get_sites() in WordPress 4.6+
$ids = $wpdb->get_col( "SELECT blog_id FROM `$wpdb->blogs`" ); $ids = $wpdb->get_col( "SELECT blog_id FROM `$wpdb->blogs`" );
foreach ( $ids as $site_id ) { foreach ( $ids as $site_id ) {
switch_to_blog( $site_id ); switch_to_blog( $site_id );
add_option( add_option(
'statify-blacklist', 'statify-blacklist',
array() array()
); );
} }
restore_current_blog(); restore_current_blog();
} else { } else {
add_option( add_option(
'statify-blacklist', 'statify-blacklist',
array() array()
); );
} }
} }
/** /**
* Plugin uninstall handler. * Plugin uninstall handler.
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function uninstall() { public static function uninstall() {
global $wpdb; global $wpdb;
if ( is_multisite() ) { if ( is_multisite() ) {
$old = get_current_blog_id(); $old = get_current_blog_id();
// Todo: Use get_sites() in WordPress 4.6+ // Todo: Use get_sites() in WordPress 4.6+
$ids = $wpdb->get_col( "SELECT blog_id FROM `$wpdb->blogs`" ); $ids = $wpdb->get_col( "SELECT blog_id FROM `$wpdb->blogs`" );
foreach ( $ids as $id ) { foreach ( $ids as $id ) {
switch_to_blog( $id ); switch_to_blog( $id );
delete_option('statify-blacklist'); delete_option( 'statify-blacklist' );
} }
switch_to_blog( $old ); switch_to_blog( $old );
} }
delete_option('statify-blacklist'); delete_option( 'statify-blacklist' );
} }
} }

View File

@ -12,37 +12,38 @@ Version: 1.1.2
*/ */
/* Quit */ /* Quit */
defined('ABSPATH') OR exit; defined( 'ABSPATH' ) OR exit;
/* Constants */ /* Constants */
define('STATIFYBLACKLIST_FILE', __FILE__); define( 'STATIFYBLACKLIST_FILE', __FILE__ );
define('STATIFYBLACKLIST_DIR', dirname(__FILE__)); define( 'STATIFYBLACKLIST_DIR', dirname( __FILE__ ) );
define('STATIFYBLACKLIST_BASE', plugin_basename(__FILE__)); define( 'STATIFYBLACKLIST_BASE', plugin_basename( __FILE__ ) );
/* System Hooks */ /* System Hooks */
add_action('plugins_loaded', array('StatifyBlacklist', 'instance')); add_action( 'plugins_loaded', array( 'StatifyBlacklist', 'instance' ) );
register_activation_hook(STATIFYBLACKLIST_FILE, array('StatifyBlacklist_System', 'install')); register_activation_hook( STATIFYBLACKLIST_FILE, array( 'StatifyBlacklist_System', 'install' ) );
register_uninstall_hook(STATIFYBLACKLIST_FILE, array('StatifyBlacklist_System', 'uninstall')); register_uninstall_hook( STATIFYBLACKLIST_FILE, array( 'StatifyBlacklist_System', 'uninstall' ) );
/* Autoload */ /* Autoload */
spl_autoload_register('statifyBlacklist_autoload'); spl_autoload_register( 'statifyBlacklist_autoload' );
/** /**
* Autoloader for StatifyBlacklist classes. * Autoloader for StatifyBlacklist classes.
* *
* @param $class * @param $class
*
* @since 1.0.0 * @since 1.0.0
*/ */
function statifyBlacklist_autoload($class) { function statifyBlacklist_autoload( $class ) {
$plugin_classes = array( $plugin_classes = array(
'StatifyBlacklist', 'StatifyBlacklist',
'StatifyBlacklist_Admin', 'StatifyBlacklist_Admin',
'StatifyBlacklist_System' 'StatifyBlacklist_System'
); );
if (in_array($class, $plugin_classes)) { if ( in_array( $class, $plugin_classes ) ) {
require_once(sprintf('%s/inc/%s.class.php', STATIFYBLACKLIST_DIR, strtolower($class))); require_once( sprintf( '%s/inc/%s.class.php', STATIFYBLACKLIST_DIR, strtolower( $class ) ) );
} }
} }

View File

@ -1,94 +1,104 @@
<?php <?php
/* Quit */ /* Quit */
defined('ABSPATH') OR exit; defined( 'ABSPATH' ) OR exit;
/* Update plugin options */ /* Update plugin options */
if ( !empty($_POST['statifyblacklist']) ) { if ( ! empty( $_POST['statifyblacklist'] ) ) {
/* Verify nonce */ /* Verify nonce */
check_admin_referer( 'statify-blacklist-settings' ); check_admin_referer( 'statify-blacklist-settings' );
/* Check user capabilities */ /* Check user capabilities */
if (!current_user_can('manage_options')) { if ( ! current_user_can( 'manage_options' ) ) {
die(_e('Are you sure you want to do this?')); die( _e( 'Are you sure you want to do this?' ) );
} }
if (!empty($_POST['cleanUp'])) { if ( ! empty( $_POST['cleanUp'] ) ) {
/* CleanUp DB */ /* CleanUp DB */
StatifyBlacklist_Admin::cleanup_database(); StatifyBlacklist_Admin::cleanup_database();
} else { } else {
/* Extract referer array */ /* Extract referer array */
if (empty(trim($_POST['statifyblacklist']['referer']))) $referer = array(); if ( empty( trim( $_POST['statifyblacklist']['referer'] ) ) ) {
else $referer = explode("\r\n", $_POST['statifyblacklist']['referer']); $referer = array();
} else {
$referer = explode( "\r\n", $_POST['statifyblacklist']['referer'] );
}
/* Update options (data will be sanitized) */ /* Update options (data will be sanitized) */
$statifyBlacklistUpdateResult= StatifyBlacklist_Admin::update_options( $statifyBlacklistUpdateResult = StatifyBlacklist_Admin::update_options(
array( array(
'active_referer' => (int)@$_POST['statifyblacklist']['active_referer'], 'active_referer' => (int) @$_POST['statifyblacklist']['active_referer'],
'referer' => $referer 'referer' => $referer
) )
); );
/* Generate messages */ /* Generate messages */
if ($statifyBlacklistUpdateResult !== false) { if ( $statifyBlacklistUpdateResult !== false ) {
$statifyBlacklistPostWarning = 'Some URLs are invalid and have been sanitized. Settings have not been saved yet.'; $statifyBlacklistPostWarning = 'Some URLs are invalid and have been sanitized. Settings have not been saved yet.';
} else { } else {
$statifyBlacklistPostSuccess = 'Settings updated successfully.'; $statifyBlacklistPostSuccess = 'Settings updated successfully.';
} }
} }
} }
?> ?>
<div class="wrap"> <div class="wrap">
<h1><?php _e( 'Statify Blacklist', 'statify-blacklist') ?></h1> <h1><?php _e( 'Statify Blacklist', 'statify-blacklist' ) ?></h1>
<?php <?php
if (is_plugin_inactive('statify/statify.php')) { if ( is_plugin_inactive( 'statify/statify.php' ) ) {
print '<div class="notice notice-warning"><p>'; print '<div class="notice notice-warning"><p>';
esc_html_e('Statify plugin is not active.', 'statify-blacklist'); esc_html_e( 'Statify plugin is not active.', 'statify-blacklist' );
print '</p></div>'; print '</p></div>';
} }
if (isset($statifyBlacklistPostWarning)) { if ( isset( $statifyBlacklistPostWarning ) ) {
print '<div class="notice notice-warning"><p>'; print '<div class="notice notice-warning"><p>';
esc_html_e($statifyBlacklistPostWarning); esc_html_e( $statifyBlacklistPostWarning );
print '</p></div>'; print '</p></div>';
} }
if (isset($statifyBlacklistPostSuccess)) { if ( isset( $statifyBlacklistPostSuccess ) ) {
print '<div class="notice notice-success"><p>'; print '<div class="notice notice-success"><p>';
esc_html_e($statifyBlacklistPostSuccess); esc_html_e( $statifyBlacklistPostSuccess );
print '</p></div>'; print '</p></div>';
} }
?> ?>
<form action="" method="post" id="statify-blacklist-settings"> <form action="" method="post" id="statify-blacklist-settings">
<ul style="list-style: none;"> <ul style="list-style: none;">
<li> <li>
<label for="statify-blacklist_active_referer"> <label for="statify-blacklist_active_referer">
<input type="checkbox" name="statifyblacklist[active_referer]" id="statifyblacklist_active_referer" value="1" <?php checked(StatifyBlacklist::$_options['active_referer'], 1); ?> /> <input type="checkbox" name="statifyblacklist[active_referer]" id="statifyblacklist_active_referer"
<?php esc_html_e('Activate referer blacklist', 'statify-blacklist'); ?> value="1" <?php checked( StatifyBlacklist::$_options['active_referer'], 1 ); ?> />
</label> <?php esc_html_e( 'Activate referer blacklist', 'statify-blacklist' ); ?>
</li> </label>
<li> </li>
<label for="statify-blacklist_referer"> <li>
<?php esc_html_e('Referer blacklist:', 'statify-blacklist'); ?><br /> <label for="statify-blacklist_referer">
<textarea cols="40" rows="5" name="statifyblacklist[referer]" id="statify-blacklist_referer"><?php <?php esc_html_e( 'Referer blacklist:', 'statify-blacklist' ); ?><br/>
if (isset($statifyBlacklistUpdateResult) &&$statifyBlacklistUpdateResult !== false) <textarea cols="40" rows="5" name="statifyblacklist[referer]" id="statify-blacklist_referer"><?php
print esc_html(implode("\r\n", $statifyBlacklistUpdateResult)); if ( isset( $statifyBlacklistUpdateResult ) && $statifyBlacklistUpdateResult !== false ) {
else print esc_html( implode( "\r\n", $statifyBlacklistUpdateResult ) );
print esc_html(implode("\r\n", StatifyBlacklist::$_options['referer'])); } else {
?></textarea><br /> print esc_html( implode( "\r\n", StatifyBlacklist::$_options['referer'] ) );
<small>(<?php esc_html_e('Add one domain (without subdomains) each line, e.g. example.com', 'statify-blacklist'); ?>)</small> }
</label> ?></textarea>
</li> <br />
</ul> <small>
<?php wp_nonce_field('statify-blacklist-settings'); ?> (<?php esc_html_e( 'Add one domain (without subdomains) each line, e.g. example.com', 'statify-blacklist' ); ?>
)
</small>
</label>
</li>
</ul>
<?php wp_nonce_field( 'statify-blacklist-settings' ); ?>
<p class="submit"> <p class="submit">
<input class="button-primary" type="submit" name="submit" value="<?php _e('Save Changes') ?>"> <input class="button-primary" type="submit" name="submit" value="<?php _e( 'Save Changes' ) ?>" />
<hr> <hr />
<input class="button-secondary" type="submit" name="cleanUp" value="<?php esc_html_e('CleanUp Database', 'statify-blacklist') ?>" <input class="button-secondary" type="submit" name="cleanUp"
onclick="return confirm('Do you really want to apply filters to database? This cannot be undone.');"> value="<?php esc_html_e( 'CleanUp Database', 'statify-blacklist' ) ?>"
<br> onclick="return confirm('Do you really want to apply filters to database? This cannot be undone.');">
<small><?php esc_html_e('Applies filter (even if disabled) to data stored in database. This cannot be undone!', 'statify-blacklist'); ?></small> <br />
</p> <small><?php esc_html_e( 'Applies filter (even if disabled) to data stored in database. This cannot be undone!', 'statify-blacklist' ); ?></small>
</form> </p>
</form>
</div> </div>