Changeset 2222232
- Timestamp:
- 01/05/2020 09:24:24 AM (5 years ago)
- 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 41 41 $table_name1 = $prefix . "nomore404_uri"; 42 42 $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 45 44 $creation_query1 = "CREATE TABLE $table_name1 ( 46 45 uri_id smallint(6) NOT NULL AUTO_INCREMENT, … … 62 61 $table1updated = True; 63 62 }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 65 64 $update_query1 = "ALTER TABLE $table_name1 66 65 ADD date_uploaded DATETIME NULL, … … 69 68 $result = $wpdb->query($update_query1); 70 69 if(false !== $result) $table1updated = True; 70 }else{ 71 $table1updated = True; 71 72 } 72 73 } 73 74 74 75 $table_name2 = $prefix . "nomore404_caller"; 75 76 $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 78 78 $creation_query2 = "CREATE TABLE $table_name2 ( 79 79 caller_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, … … 96 96 $table2updated = True; 97 97 }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 99 99 $update_query2 = "ALTER TABLE $table_name2 100 100 ADD date_uploaded DATETIME NULL, … … 103 103 $result = $wpdb->query($update_query2); 104 104 if(false !== $result) $table2updated = True; 105 }else{ 106 $table2updated = True; 105 107 } 106 108 } … … 108 110 $table_name3 = $prefix . "nomore404_uri_caller"; 109 111 $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 111 113 $creation_query3 = "CREATE TABLE $table_name3 ( 112 114 uri_id smallint(6) NOT NULL, … … 127 129 $table3updated = True; 128 130 }else{ // table exists, upgrade the table if needed 129 if($obj_settings->options['dbversion'] < NOMORE404DBVERSION){ // alter table here131 if($obj_settings->options['dbversion'] < '1.06'){ // alter table here if before v 1.06 130 132 $update_query3 = "ALTER TABLE $table_name3 131 133 ADD date_uploaded DATETIME NULL, … … 133 135 $result = $wpdb->query($update_query3); 134 136 if(false !== $result) $table3updated = True; 137 }else{ 138 $table3updated = True; 135 139 } 136 140 } -
nomore404-404-redirection-and-firewall/trunk/includes/nomore404-view.php
r2221621 r2222232 283 283 284 284 $opt = get_option("nomore404_$counter"); 285 NoMore404_Model_Static_Class::good_error_log("nomore404_$counter :", $opt);286 285 if(false === $opt) add_option("nomore404_$counter", 1); 287 286 else{ 288 287 $this->{$counter} = $opt + 1; 289 290 NoMore404_Model_Static_Class::good_error_log("Counter:", $this->{$counter});291 292 288 update_option("nomore404_$counter", $this->{$counter}); 293 289 } -
nomore404-404-redirection-and-firewall/trunk/nomore404.php
r2221621 r2222232 4 4 * Plugin URI: https://devoutpro.com/nomore404 5 5 * 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.0 66 * Version: 1.07 7 7 * Requires at least: 4.0 8 8 * Requires PHP: 5.3 … … 32 32 defined('ABSPATH') or exit; 33 33 34 define("NOMORE404VERSION", "1.0 6");35 define("NOMORE404DBVERSION", "1.0 6");34 define("NOMORE404VERSION", "1.07"); 35 define("NOMORE404DBVERSION", "1.07"); 36 36 37 37 // plugin activation and uninstallation … … 211 211 // increase counter of blocked Callers by 1 212 212 $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']); 213 218 214 219 wp_die('Sorry, our site is undergoing maintenance, please try again later','Scheduled maintenance'); // malicious caller, stop working … … 331 336 if (isset($_SESSION['uri_data'])) 332 337 $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); 334 339 }elseif ('edit' === $_GET['mode']) { // edit existing uri 335 340 $uri_id = (int) $_GET['id']; … … 443 448 } 444 449 450 // processing caller editing form 445 451 function process_nomore404_caller() { 446 452 // Check if user has proper security level … … 462 468 $caller_data['caller_ip_str'] = ( isset($_POST['caller_ip_str']) ? 463 469 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']);466 470 467 471 $caller_data['comment'] = ( isset($_POST['comment']) ? … … 527 531 } 528 532 533 // processing uri editing form 529 534 function process_nomore404_uri() { 530 535 // Check if user has proper security level -
nomore404-404-redirection-and-firewall/trunk/readme.txt
r2221621 r2222232 6 6 Tested up to: 5.3.2 7 7 Requires PHP: 5.3 8 Stable tag: 1.0 68 Stable tag: 1.07 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 30 30 31 31 == Changelog == 32 1.07 Bugfix - fixed counting of blocked malicious for the widget 32 33 1.06 Whitelist functionality to callers is added, minor UI adjustments to URI table and Callers table. 33 34 Link to abuseipdb is created from Callers malicious column.
Note: See TracChangeset
for help on using the changeset viewer.