Plugin Directory

Changeset 1209557


Ignore:
Timestamp:
07/30/2015 09:22:18 AM (10 years ago)
Author:
codestic
Message:

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.

Location:
block-referer-spam/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • block-referer-spam/trunk/lib/RefSpamBlocker.php

    r1205210 r1209557  
    66 * @author codestic <[email protected]>
    77 */
    8 
    98class RefSpamBlocker {
    109
     
    1413
    1514        // register activation
    16         register_activation_hook($pluginFile, [&$this, 'activate']);
     15        register_activation_hook($pluginFile, array(&$this, 'activate'));
    1716
    1817        // 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'));
    2625    }
    2726
     
    3938    public function init() {
    4039        // init
    41         add_action('admin_menu', [&$this, 'createMenu']);
     40        add_action('admin_menu', array(&$this, 'createMenu'));
    4241
    4342        if (!session_id()) {
     
    5655            'manage_options',
    5756            'ref-spam-block/',
    58             [&$this, 'adminDashboard'],
     57            array(&$this, 'adminDashboard'),
    5958            'dashicons-shield-alt'
    6059        );
    6160
    62         add_action("load-{$hook}", [&$this, 'updateSettings']);
     61        add_action("load-{$hook}", array(&$this, 'updateSettings'));
    6362    }
    6463
     
    115114
    116115        // build lines
    117         $lines = [];
     116        $lines = array();
    118117        $lines[] = '<IfModule mod_rewrite.c>';
    119118        $lines[] = '  RewriteEngine on';
     
    123122
    124123        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") . "]";
    126125            //$lines[] = '  RewriteCond %{HTTP_REFERER} ' . str_replace('.', '\.', $host) . ' [NC,OR]';
    127126        }
  • block-referer-spam/trunk/readme.txt

    r1205210 r1209557  
    44Requires at least: 3.0.1
    55Tested up to: 4.2.2
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9494== Changelog ==
    9595
     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
    9699= 1.0.3 =
    97100* 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  
    33Plugin Name: Block Referer Spam
    44Plugin URI: https://wordpress.org/plugins/block-referer-spam/
    5 Description: Protects you from referer spam from accessing your site and cleans up your Google Analytics in the process.
     5Description: Prevents referer spam from accessing your site and cleans up your Google Analytics in the process.
    66Author: codestic
    7 Version: 1.0.3
     7Version: 1.0.4
    88Author URI: http://codestic.com
    99Text Domain: ref-spam-blocker
     
    1313if (defined('ABSPATH') && !class_exists('RefSpamBlocker')) {
    1414    if (!defined('REFSPAMBLOCKER_VERSION')) {
    15         define('REFSPAMBLOCKER_VERSION', '1.0.3');
     15        define('REFSPAMBLOCKER_VERSION', '1.0.4');
    1616    }
    1717
Note: See TracChangeset for help on using the changeset viewer.