Plugin Directory

Changeset 2222232


Ignore:
Timestamp:
01/05/2020 09:24:24 AM (5 years ago)
Author:
devoutpro
Message:

v1.07 bugfix counting malicious for the widget

Location:
nomore404-404-redirection-and-firewall/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • nomore404-404-redirection-and-firewall/trunk/includes/nomore404-activation.php

    r2219898 r2222232  
    4141    $table_name1 = $prefix . "nomore404_uri";
    4242    $table1updated = False;
    43     if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name1'") != $table_name1 ) {
    44     // Table was not created !!
     43    if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name1'") != $table_name1 ) { // Table does not exist
    4544        $creation_query1 = "CREATE TABLE $table_name1 (
    4645                            uri_id smallint(6) NOT NULL AUTO_INCREMENT,
     
    6261        $table1updated = True;
    6362    }else{ // table exists, upgrade the table if needed
    64         if($obj_settings->options['dbversion'] < NOMORE404DBVERSION){ // alter table here
     63        if($obj_settings->options['dbversion'] < NOMORE404DBVERSION){ // alter table here if before v 1.06
    6564            $update_query1 = "ALTER TABLE $table_name1
    6665                                ADD date_uploaded DATETIME NULL,
     
    6968            $result = $wpdb->query($update_query1);
    7069            if(false !== $result) $table1updated = True;
     70         }else{
     71            $table1updated = True;
    7172        }
    72     }
     73   }
    7374
    7475    $table_name2 = $prefix . "nomore404_caller";
    7576    $table2updated = False;
    76     if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name2'") != $table_name2 ) {
    77     // Table was not created !!   
     77    if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name2'") != $table_name2 ) { // Table does not exist
    7878        $creation_query2 = "CREATE TABLE $table_name2 (
    7979                            caller_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
     
    9696        $table2updated = True;
    9797    }else{ // table exists, upgrade the table if needed
    98         if($obj_settings->options['dbversion'] < NOMORE404DBVERSION){ // alter table here
     98        if($obj_settings->options['dbversion'] < NOMORE404DBVERSION){ // alter table here if before v 1.06
    9999            $update_query2 = "ALTER TABLE $table_name2
    100100                                ADD date_uploaded DATETIME NULL,
     
    103103            $result = $wpdb->query($update_query2);
    104104            if(false !== $result) $table2updated = True;
     105        }else{
     106            $table2updated = True;
    105107        }
    106108    }
     
    108110    $table_name3 = $prefix . "nomore404_uri_caller";
    109111    $table3updated = False;
    110     if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name3'") != $table_name3 ) {    
     112    if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name3'") != $table_name3 ) { // Table does not exist   
    111113        $creation_query3 = "CREATE TABLE $table_name3 (
    112114                            uri_id smallint(6) NOT NULL,
     
    127129        $table3updated = True;
    128130    }else{ // table exists, upgrade the table if needed
    129         if($obj_settings->options['dbversion'] < NOMORE404DBVERSION){ // alter table here
     131        if($obj_settings->options['dbversion'] < '1.06'){ // alter table here if before v 1.06
    130132            $update_query3 = "ALTER TABLE $table_name3
    131133                                ADD date_uploaded DATETIME NULL,
     
    133135            $result = $wpdb->query($update_query3);
    134136            if(false !== $result) $table3updated = True;
     137        }else{
     138            $table3updated = True;
    135139        }
    136140    }
  • nomore404-404-redirection-and-firewall/trunk/includes/nomore404-view.php

    r2221621 r2222232  
    283283       
    284284        $opt = get_option("nomore404_$counter");
    285         NoMore404_Model_Static_Class::good_error_log("nomore404_$counter :", $opt);
    286285        if(false === $opt) add_option("nomore404_$counter", 1);
    287286        else{
    288287            $this->{$counter} = $opt + 1;
    289            
    290             NoMore404_Model_Static_Class::good_error_log("Counter:", $this->{$counter});
    291            
    292288            update_option("nomore404_$counter", $this->{$counter});
    293289        }
  • nomore404-404-redirection-and-firewall/trunk/nomore404.php

    r2221621 r2222232  
    44 * Plugin URI:          https://devoutpro.com/nomore404
    55 * Description:         NoMore404 is a free WordPress plugin for redirection of 404 pages (301 type of redirection) and simple firewall to block malicious hosts and URLs.
    6  * Version:             1.06
     6 * Version:             1.07
    77 * Requires at least:   4.0
    88 * Requires PHP:        5.3
     
    3232defined('ABSPATH') or exit;
    3333
    34 define("NOMORE404VERSION", "1.06");
    35 define("NOMORE404DBVERSION", "1.06");
     34define("NOMORE404VERSION", "1.07");
     35define("NOMORE404DBVERSION", "1.07");
    3636
    3737// plugin activation and uninstallation
     
    211211        // increase counter of blocked Callers by 1
    212212        $counters_obj->IncreaseCounter('countCallersBlocked');
     213       
     214        // need to update date_last_used and counter of caller here
     215        $caller_data['date_last_used'] = current_time('mysql');
     216        $caller_data['counter']++;
     217        NoMore404_Model_Static_Class::UpdateCaller($caller_data, $caller_data['caller_id']);
    213218       
    214219        wp_die('Sorry, our site is undergoing maintenance, please try again later','Scheduled maintenance'); // malicious caller, stop working
     
    331336                        if (isset($_SESSION['uri_data']))
    332337                            $uri_data = array_merge($uri_data,$_SESSION['uri_data']);
    333                         NoMore404_Model_Static_Class::var_error_log('URI data after merge: ', $uri_data);
     338                        //NoMore404_Model_Static_Class::var_error_log('URI data after merge: ', $uri_data);
    334339                    }elseif ('edit' === $_GET['mode']) { // edit existing uri
    335340                        $uri_id = (int) $_GET['id'];
     
    443448}
    444449
     450// processing caller editing form
    445451function process_nomore404_caller() {
    446452    // Check if user has proper security level
     
    462468    $caller_data['caller_ip_str'] = ( isset($_POST['caller_ip_str']) ?
    463469            filter_var(trim($_POST['caller_ip_str']), FILTER_VALIDATE_IP) : '' );
    464    
    465     //NoMore404_Model_Static_Class::var_error_log('Caller ip str:', $caller_data['caller_ip_str']);
    466470   
    467471    $caller_data['comment'] = ( isset($_POST['comment']) ?
     
    527531}
    528532
     533// processing uri editing form
    529534function process_nomore404_uri() {
    530535    // Check if user has proper security level
  • nomore404-404-redirection-and-firewall/trunk/readme.txt

    r2221621 r2222232  
    66Tested up to: 5.3.2
    77Requires PHP: 5.3
    8 Stable tag: 1.06
     8Stable tag: 1.07
    99License: GPLv2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030
    3131== Changelog ==
     321.07 Bugfix - fixed counting of blocked malicious for the widget
    32331.06 Whitelist functionality to callers is added, minor UI adjustments to URI table and Callers table.
    3334     Link to abuseipdb is created from Callers malicious column.
Note: See TracChangeset for help on using the changeset viewer.