Changeset 1209557
- Timestamp:
- 07/30/2015 09:22:18 AM (10 years ago)
- Location:
- block-referer-spam/trunk
- Files:
-
- 3 edited
-
lib/RefSpamBlocker.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
ref-spam-blocker.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
block-referer-spam/trunk/lib/RefSpamBlocker.php
r1205210 r1209557 6 6 * @author codestic <[email protected]> 7 7 */ 8 9 8 class RefSpamBlocker { 10 9 … … 14 13 15 14 // register activation 16 register_activation_hook($pluginFile, [&$this, 'activate']);15 register_activation_hook($pluginFile, array(&$this, 'activate')); 17 16 18 17 // add actions 19 add_action('init', [&$this, 'init']);20 add_action('admin_init', [$this, 'registerSettings']);21 add_action('dailyCronjob', [$this, 'dailyCronjob']);22 add_action('wp', [&$this, 'pageLoad']);23 24 add_action('wp_logout', [$this, 'logout']);25 add_action('wp_login', [$this, 'logout']);18 add_action('init', array(&$this, 'init')); 19 add_action('admin_init', array($this, 'registerSettings')); 20 add_action('dailyCronjob', array($this, 'dailyCronjob')); 21 add_action('wp', array(&$this, 'pageLoad')); 22 23 add_action('wp_logout', array($this, 'logout')); 24 add_action('wp_login', array($this, 'logout')); 26 25 } 27 26 … … 39 38 public function init() { 40 39 // init 41 add_action('admin_menu', [&$this, 'createMenu']);40 add_action('admin_menu', array(&$this, 'createMenu')); 42 41 43 42 if (!session_id()) { … … 56 55 'manage_options', 57 56 'ref-spam-block/', 58 [&$this, 'adminDashboard'],57 array(&$this, 'adminDashboard'), 59 58 'dashicons-shield-alt' 60 59 ); 61 60 62 add_action("load-{$hook}", [&$this, 'updateSettings']);61 add_action("load-{$hook}", array(&$this, 'updateSettings')); 63 62 } 64 63 … … 115 114 116 115 // build lines 117 $lines = [];116 $lines = array(); 118 117 $lines[] = '<IfModule mod_rewrite.c>'; 119 118 $lines[] = ' RewriteEngine on'; … … 123 122 124 123 foreach ($list as $index => $host) { 125 $lines[] = "RewriteCond %{HTTP_REFERER} {$host} [NC" . (($index == count($list) -1) ? "" : ",OR") . "]";124 $lines[] = "RewriteCond %{HTTP_REFERER} {$host} [NC" . (($index == count($list) - 1) ? "" : ",OR") . "]"; 126 125 //$lines[] = ' RewriteCond %{HTTP_REFERER} ' . str_replace('.', '\.', $host) . ' [NC,OR]'; 127 126 } -
block-referer-spam/trunk/readme.txt
r1205210 r1209557 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.2.2 6 Stable tag: 1.0. 36 Stable tag: 1.0.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 94 94 == Changelog == 95 95 96 = 1.0.4 = 97 * Fixed the plugin to run on PHP versions lower than 5.4. It should now work on older providers and servers that have not been updated for a while. 98 96 99 = 1.0.3 = 97 100 * Fixed a bug that in "Rewrite Blocking", rules were not actually enforced. Sorry about that! -
block-referer-spam/trunk/ref-spam-blocker.php
r1205210 r1209557 3 3 Plugin Name: Block Referer Spam 4 4 Plugin URI: https://wordpress.org/plugins/block-referer-spam/ 5 Description: Pr otects you fromreferer spam from accessing your site and cleans up your Google Analytics in the process.5 Description: Prevents referer spam from accessing your site and cleans up your Google Analytics in the process. 6 6 Author: codestic 7 Version: 1.0. 37 Version: 1.0.4 8 8 Author URI: http://codestic.com 9 9 Text Domain: ref-spam-blocker … … 13 13 if (defined('ABSPATH') && !class_exists('RefSpamBlocker')) { 14 14 if (!defined('REFSPAMBLOCKER_VERSION')) { 15 define('REFSPAMBLOCKER_VERSION', '1.0. 3');15 define('REFSPAMBLOCKER_VERSION', '1.0.4'); 16 16 } 17 17
Note: See TracChangeset
for help on using the changeset viewer.