Changeset 3276806
- Timestamp:
- 04/18/2025 02:48:45 PM (12 months ago)
- Location:
- iron-security
- Files:
-
- 6 edited
- 26 copied
-
tags/2.2.9 (copied) (copied from iron-security/trunk)
-
tags/2.2.9/LICENSE.txt (copied) (copied from iron-security/trunk/LICENSE.txt)
-
tags/2.2.9/README.txt (copied) (copied from iron-security/trunk/README.txt) (2 diffs)
-
tags/2.2.9/admin (copied) (copied from iron-security/trunk/admin)
-
tags/2.2.9/admin/class-iron-security-admin.php (copied) (copied from iron-security/trunk/admin/class-iron-security-admin.php)
-
tags/2.2.9/admin/classes/general-security.php (copied) (copied from iron-security/trunk/admin/classes/general-security.php)
-
tags/2.2.9/admin/classes/login-logout-functionality.php (copied) (copied from iron-security/trunk/admin/classes/login-logout-functionality.php)
-
tags/2.2.9/admin/classes/tracking-access.php (modified) (2 diffs)
-
tags/2.2.9/admin/js/components/Dashboard.jsx (copied) (copied from iron-security/trunk/admin/js/components/Dashboard.jsx)
-
tags/2.2.9/admin/js/components/GeneralSettings.jsx (copied) (copied from iron-security/trunk/admin/js/components/GeneralSettings.jsx)
-
tags/2.2.9/admin/js/dist/dashboard.bundle.js (copied) (copied from iron-security/trunk/admin/js/dist/dashboard.bundle.js)
-
tags/2.2.9/composer.json (copied) (copied from iron-security/trunk/composer.json)
-
tags/2.2.9/composer.lock (copied) (copied from iron-security/trunk/composer.lock)
-
tags/2.2.9/includes (copied) (copied from iron-security/trunk/includes)
-
tags/2.2.9/includes/class-iron-security-deactivator.php (copied) (copied from iron-security/trunk/includes/class-iron-security-deactivator.php)
-
tags/2.2.9/includes/class-iron-security-logger.php (copied) (copied from iron-security/trunk/includes/class-iron-security-logger.php)
-
tags/2.2.9/includes/class-iron-security.php (copied) (copied from iron-security/trunk/includes/class-iron-security.php)
-
tags/2.2.9/includes/ss.json (copied) (copied from iron-security/trunk/includes/ss.json)
-
tags/2.2.9/index.php (copied) (copied from iron-security/trunk/index.php)
-
tags/2.2.9/iron-security.php (copied) (copied from iron-security/trunk/iron-security.php) (2 diffs)
-
tags/2.2.9/languages (copied) (copied from iron-security/trunk/languages)
-
tags/2.2.9/package.json (copied) (copied from iron-security/trunk/package.json)
-
tags/2.2.9/pnpm-lock.yaml (copied) (copied from iron-security/trunk/pnpm-lock.yaml)
-
tags/2.2.9/public (copied) (copied from iron-security/trunk/public)
-
tags/2.2.9/public/class-iron-security-public.php (modified) (1 diff)
-
tags/2.2.9/uninstall.php (copied) (copied from iron-security/trunk/uninstall.php)
-
tags/2.2.9/vendor (copied) (copied from iron-security/trunk/vendor)
-
tags/2.2.9/webpack.config.js (copied) (copied from iron-security/trunk/webpack.config.js)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/classes/tracking-access.php (modified) (2 diffs)
-
trunk/iron-security.php (modified) (2 diffs)
-
trunk/public/class-iron-security-public.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iron-security/tags/2.2.9/README.txt
r3269182 r3276806 5 5 Requires at least: 4.7 6 6 Tested up to: 6.7 7 Stable tag: 2.2. 87 Stable tag: 2.2.9 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 111 111 == Changelog == 112 112 113 = 2.2.9 = 114 * Fix warnings & Small errors 115 113 116 = 2.2.8 = 114 117 * Update -
iron-security/tags/2.2.9/admin/classes/tracking-access.php
r3261056 r3276806 12 12 if ( preg_match( '/^\/wp-admin\/?$/', $request_uri ) || preg_match( '/^\/wp-login\.php$/', $request_uri ) ) { 13 13 global $wpdb; 14 $table_name = $wpdb->prefix . ' access_log_wpironis';14 $table_name = $wpdb->prefix . 'iron_security_logs'; 15 15 16 16 $ip_address = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ); 17 17 $country = $this->get_country_by_ip( $ip_address ); 18 19 $url = esc_url_raw( $_SERVER['REQUEST_URI'] ); 20 $time = current_time( 'mysql' ); 18 $url = esc_url_raw( $_SERVER['REQUEST_URI'] ); 19 $time = current_time( 'mysql' ); 21 20 22 21 if ( $this->is_ip_blocked( $ip_address ) ) { 23 $this->log_blocked_attempt( $ip_address, $url );22 $this->log_blocked_attempt( $ip_address, $url, $country ); 24 23 } else { 25 24 $wpdb->insert( 26 25 $table_name, 27 26 array( 28 'time' => $time, 29 'ip_address' => $ip_address, 30 'country' => sanitize_text_field( $country ), 31 'url' => $url, 32 'status' => 'attempt' 27 'log_type' => 'access_attempt', 28 'user_id' => null, 29 'username' => null, 30 'ip_address' => $ip_address, 31 'message' => 'Access attempt to: ' . $url, 32 'status' => 'attempt', 33 'date_created' => $time, 34 'extra_data' => maybe_serialize( array( 35 'country' => $country, 36 'url' => $url, 37 ) ), 33 38 ), 34 array( 35 '%s', // time 36 '%s', // ip_address 37 '%s', // country 38 '%s', // url 39 '%s' // status 40 ) 39 array( '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) 41 40 ); 42 41 } … … 58 57 public function wpironis_access_log_results() { 59 58 global $wpdb; 60 $table_name = $wpdb->prefix . ' access_log_wpironis';59 $table_name = $wpdb->prefix . 'iron_security_logs'; 61 60 62 // SQL query to get the IP address, country, count of attempts, and URL, ordered by the highest number of attempts63 61 $results = $wpdb->get_results( " 64 SELECT ip_address, country, url, status, COUNT(*) as attempts 65 FROM $table_name 66 GROUP BY ip_address, country, url, status 67 ORDER BY attempts DESC 68 " ); 62 SELECT ip_address, status, log_type, COUNT(*) as attempts 63 FROM $table_name 64 WHERE log_type IN ('access_attempt', 'blocked_attempt') 65 GROUP BY ip_address, status, log_type 66 ORDER BY attempts DESC 67 " ); 69 68 70 69 return $results; 71 70 } 72 71 73 public function log_blocked_attempt( $ip_address, $url ) {72 public function log_blocked_attempt( $ip_address, $url, $country = 'Unknown' ) { 74 73 global $wpdb; 75 $table_name = $wpdb->prefix . 'access_log_wpironis'; 76 77 $country = $this->get_country_by_ip( $ip_address ); 78 $time = current_time( 'mysql' ); 74 $table_name = $wpdb->prefix . 'iron_security_logs'; 75 $time = current_time( 'mysql' ); 79 76 80 77 $wpdb->insert( 81 78 $table_name, 82 79 array( 83 'time' => $time, 84 'ip_address' => $ip_address, 85 'country' => $country, 86 'url' => $url, 87 'status' => 'blocked' 88 ) 80 'log_type' => 'blocked_attempt', 81 'user_id' => null, 82 'username' => null, 83 'ip_address' => $ip_address, 84 'message' => 'Blocked access to: ' . $url, 85 'status' => 'blocked', 86 'date_created' => $time, 87 'extra_data' => maybe_serialize( array( 88 'country' => $country, 89 'url' => $url, 90 ) ), 91 ), 92 array( '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) 89 93 ); 90 94 } -
iron-security/tags/2.2.9/iron-security.php
r3269182 r3276806 17 17 * Plugin URI: https://wpiron.com 18 18 * Description: Iron Security is a powerful WordPress security plugin to protect your site from common threats. Lock down your site with login protection, file security, and HTTP headers — all in one lightweight plugin. 19 * Version: 2.2. 819 * Version: 2.2.9 20 20 * Author: wpiron 21 21 * Author URI: https://wpiron.com/ … … 31 31 } 32 32 33 define( 'IRON_SECURITY_VERSION', '2.2. 8' );33 define( 'IRON_SECURITY_VERSION', '2.2.9' ); 34 34 35 35 function wpiisec_activate_iron_security() { -
iron-security/tags/2.2.9/public/class-iron-security-public.php
r3261056 r3276806 35 35 36 36 // Check XML-RPC 37 $xmlrcapi = $options['wpironis_disable_xmlrpc'] ;37 $xmlrcapi = $options['wpironis_disable_xmlrpc'] ?? null; 38 38 39 39 if ( isset( $xmlrcapi ) && $xmlrcapi === 1 && defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { -
iron-security/trunk/README.txt
r3269182 r3276806 5 5 Requires at least: 4.7 6 6 Tested up to: 6.7 7 Stable tag: 2.2. 87 Stable tag: 2.2.9 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 111 111 == Changelog == 112 112 113 = 2.2.9 = 114 * Fix warnings & Small errors 115 113 116 = 2.2.8 = 114 117 * Update -
iron-security/trunk/admin/classes/tracking-access.php
r3261056 r3276806 12 12 if ( preg_match( '/^\/wp-admin\/?$/', $request_uri ) || preg_match( '/^\/wp-login\.php$/', $request_uri ) ) { 13 13 global $wpdb; 14 $table_name = $wpdb->prefix . ' access_log_wpironis';14 $table_name = $wpdb->prefix . 'iron_security_logs'; 15 15 16 16 $ip_address = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ); 17 17 $country = $this->get_country_by_ip( $ip_address ); 18 19 $url = esc_url_raw( $_SERVER['REQUEST_URI'] ); 20 $time = current_time( 'mysql' ); 18 $url = esc_url_raw( $_SERVER['REQUEST_URI'] ); 19 $time = current_time( 'mysql' ); 21 20 22 21 if ( $this->is_ip_blocked( $ip_address ) ) { 23 $this->log_blocked_attempt( $ip_address, $url );22 $this->log_blocked_attempt( $ip_address, $url, $country ); 24 23 } else { 25 24 $wpdb->insert( 26 25 $table_name, 27 26 array( 28 'time' => $time, 29 'ip_address' => $ip_address, 30 'country' => sanitize_text_field( $country ), 31 'url' => $url, 32 'status' => 'attempt' 27 'log_type' => 'access_attempt', 28 'user_id' => null, 29 'username' => null, 30 'ip_address' => $ip_address, 31 'message' => 'Access attempt to: ' . $url, 32 'status' => 'attempt', 33 'date_created' => $time, 34 'extra_data' => maybe_serialize( array( 35 'country' => $country, 36 'url' => $url, 37 ) ), 33 38 ), 34 array( 35 '%s', // time 36 '%s', // ip_address 37 '%s', // country 38 '%s', // url 39 '%s' // status 40 ) 39 array( '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) 41 40 ); 42 41 } … … 58 57 public function wpironis_access_log_results() { 59 58 global $wpdb; 60 $table_name = $wpdb->prefix . ' access_log_wpironis';59 $table_name = $wpdb->prefix . 'iron_security_logs'; 61 60 62 // SQL query to get the IP address, country, count of attempts, and URL, ordered by the highest number of attempts63 61 $results = $wpdb->get_results( " 64 SELECT ip_address, country, url, status, COUNT(*) as attempts 65 FROM $table_name 66 GROUP BY ip_address, country, url, status 67 ORDER BY attempts DESC 68 " ); 62 SELECT ip_address, status, log_type, COUNT(*) as attempts 63 FROM $table_name 64 WHERE log_type IN ('access_attempt', 'blocked_attempt') 65 GROUP BY ip_address, status, log_type 66 ORDER BY attempts DESC 67 " ); 69 68 70 69 return $results; 71 70 } 72 71 73 public function log_blocked_attempt( $ip_address, $url ) {72 public function log_blocked_attempt( $ip_address, $url, $country = 'Unknown' ) { 74 73 global $wpdb; 75 $table_name = $wpdb->prefix . 'access_log_wpironis'; 76 77 $country = $this->get_country_by_ip( $ip_address ); 78 $time = current_time( 'mysql' ); 74 $table_name = $wpdb->prefix . 'iron_security_logs'; 75 $time = current_time( 'mysql' ); 79 76 80 77 $wpdb->insert( 81 78 $table_name, 82 79 array( 83 'time' => $time, 84 'ip_address' => $ip_address, 85 'country' => $country, 86 'url' => $url, 87 'status' => 'blocked' 88 ) 80 'log_type' => 'blocked_attempt', 81 'user_id' => null, 82 'username' => null, 83 'ip_address' => $ip_address, 84 'message' => 'Blocked access to: ' . $url, 85 'status' => 'blocked', 86 'date_created' => $time, 87 'extra_data' => maybe_serialize( array( 88 'country' => $country, 89 'url' => $url, 90 ) ), 91 ), 92 array( '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) 89 93 ); 90 94 } -
iron-security/trunk/iron-security.php
r3269182 r3276806 17 17 * Plugin URI: https://wpiron.com 18 18 * Description: Iron Security is a powerful WordPress security plugin to protect your site from common threats. Lock down your site with login protection, file security, and HTTP headers — all in one lightweight plugin. 19 * Version: 2.2. 819 * Version: 2.2.9 20 20 * Author: wpiron 21 21 * Author URI: https://wpiron.com/ … … 31 31 } 32 32 33 define( 'IRON_SECURITY_VERSION', '2.2. 8' );33 define( 'IRON_SECURITY_VERSION', '2.2.9' ); 34 34 35 35 function wpiisec_activate_iron_security() { -
iron-security/trunk/public/class-iron-security-public.php
r3261056 r3276806 35 35 36 36 // Check XML-RPC 37 $xmlrcapi = $options['wpironis_disable_xmlrpc'] ;37 $xmlrcapi = $options['wpironis_disable_xmlrpc'] ?? null; 38 38 39 39 if ( isset( $xmlrcapi ) && $xmlrcapi === 1 && defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
Note: See TracChangeset
for help on using the changeset viewer.