Changeset 3368160
- Timestamp:
- 09/26/2025 03:06:34 AM (6 months ago)
- Location:
- wp-malware-removal/trunk
- Files:
-
- 5 edited
-
readme.txt (modified) (3 diffs)
-
traits/wpmr_checksums.php (modified) (3 diffs)
-
traits/wpmr_helpers.php (modified) (4 diffs)
-
traits/wpmr_scanner.php (modified) (1 diff)
-
wpmr.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-malware-removal/trunk/readme.txt
r3361852 r3368160 5 5 Tested up to: 6.8 6 6 Requires PHP: 5.6 7 Stable tag: 17. 77 Stable tag: 17.8 8 8 License: MIT 9 9 License URI: https://opensource.org/licenses/MIT … … 190 190 == Changelog == 191 191 192 = 17.8 = 193 UX: Updated to work with new checksum endpoint. 194 192 195 = 17.7 = 193 196 Bugfix: Fixed a bug where errors during definition update wouldn't be reported. … … 734 737 == Upgrade Notice == 735 738 739 = 17.8 = 740 UX: Updated to work with new checksum endpoint. 741 736 742 = 17.7 = 737 743 Bugfix: Fixed a bug where errors during definition update wouldn't be reported. -
wp-malware-removal/trunk/traits/wpmr_checksums.php
r3361852 r3368160 124 124 } 125 125 126 $plugin_checksums = $this->get_plugin_checksums ();126 $plugin_checksums = $this->get_plugin_checksums_wpmr(); 127 127 if ( $plugin_checksums ) { 128 128 $checksums = array_merge( $checksums, $plugin_checksums ); … … 208 208 if ( $extras ) { 209 209 $plugin_checksums = array_merge( $plugin_checksums, $extras ); 210 } 211 return $plugin_checksums; 212 } 213 214 function get_plugin_checksums_wpmr() { 215 $missing = array(); 216 $all_plugins = get_plugins(); 217 $install_path = ABSPATH; 218 $plugin_checksums = array(); 219 $state = $this->get_setting( 'user' ); 220 $state = $this->encode( $state ); 221 foreach ( $all_plugins as $key => $value ) { 222 if ( false !== strpos( $key, '/' ) ) { // plugin has to be inside a directory. currently drop in plugins are not supported 223 $plugin_file = trailingslashit( dirname( $this->dir ) ) . $key; 224 $plugin_file = str_replace( $install_path, '', $plugin_file ); 225 $checksum_url = WPMR_SERVER . '?wpmr_action=wpmr_checksum&slug=' . dirname( $key ) . '&version=' . $value['Version'] . '&type=plugin&state=' . $state; 226 $checksum = wp_safe_remote_get( $checksum_url, array( 'timeout' => 1 ) );// $this->timeout ) ); 227 if ( is_wp_error( $checksum ) ) { 228 $missing[ $key ] = array( 'Version' => $value['Version'] ); 229 continue; 230 } 231 if ( '200' != wp_remote_retrieve_response_code( $checksum ) ) { 232 if ( '404' == wp_remote_retrieve_response_code( $checksum ) ) { 233 $missing[ $key ] = array( 'Version' => $value['Version'] ); 234 } 235 continue; 236 } 237 238 $checksum = wp_remote_retrieve_body( $checksum ); 239 $checksum = json_decode( $checksum, true ); 240 if ( ! is_null( $checksum ) && ! empty( $checksum['files'] ) ) { 241 $checksum = $checksum['files']; 242 foreach ( $checksum as $file => $checksums ) { 243 $plugin_checksums[ trailingslashit( dirname( $plugin_file ) ) . $file ] = $checksums['sha256']; 244 } 245 } else { 246 $missing[ $key ] = array( 'Version' => $value['Version'] ); 247 } 248 } else { 249 } 250 } 251 $extras = $this->get_pro_checksums( $missing ); 252 if ( $extras ) { 253 $plugin_checksums = array_merge( $plugin_checksums, $extras ); 254 } 255 return $plugin_checksums; 256 } 257 258 function get_pro_checksums( $missing ) { 259 if ( empty( $missing ) || ! $this->is_registered() || ! $this->is_advanced_edition() ) { // can't burden our server 260 return; 261 } 262 $state = $this->get_setting( 'user' ); 263 $state = $this->encode( $state ); 264 $all_plugins = $missing; 265 $install_path = ABSPATH; 266 $plugin_checksums = array(); 267 foreach ( $all_plugins as $key => $value ) { 268 if ( false !== strpos( $key, '/' ) ) { // plugin has to be inside a directory. currently drop in plugins are not supported 269 $plugin_file = trailingslashit( dirname( $this->dir ) ) . $key; 270 $plugin_file = str_replace( $install_path, '', $plugin_file ); 271 $checksum_url = WPMR_SERVER . '?wpmr_action=wpmr_checksum&slug=' . dirname( $key ) . '&version=' . $value['Version'] . '&type=plugin&state=' . $state; 272 $checksum = wp_safe_remote_get( $checksum_url, array( 'timeout' => $this->timeout ) ); 273 if ( is_wp_error( $checksum ) ) { 274 continue; 275 } 276 if ( '200' != wp_remote_retrieve_response_code( $checksum ) ) { 277 continue; 278 } 279 $checksum = wp_remote_retrieve_body( $checksum ); 280 $checksum = json_decode( $checksum, true ); 281 if ( ! is_null( $checksum ) && ! empty( $checksum['files'] ) ) { 282 $checksum = $checksum['files']; 283 foreach ( $checksum as $file => $checksums ) { 284 $plugin_checksums[ trailingslashit( dirname( $plugin_file ) ) . $file ] = $checksums['sha256']; 285 } 286 } 287 } else { 288 } 210 289 } 211 290 return $plugin_checksums; … … 243 322 } 244 323 245 function get_pro_checksums( $missing ) {246 if ( empty( $missing ) || ! $this->is_registered() || ! $this->is_advanced_edition() ) { // can't burden our server247 return;248 }249 $state = $this->get_setting( 'user' );250 $state = $this->encode( $state );251 $all_plugins = $missing;252 $install_path = ABSPATH;253 $plugin_checksums = array();254 foreach ( $all_plugins as $key => $value ) {255 if ( false !== strpos( $key, '/' ) ) { // plugin has to be inside a directory. currently drop in plugins are not supported256 $plugin_file = trailingslashit( dirname( $this->dir ) ) . $key;257 $plugin_file = str_replace( $install_path, '', $plugin_file );258 $checksum_url = WPMR_SERVER . '?wpmr_action=wpmr_checksum&slug=' . dirname( $key ) . '&version=' . $value['Version'] . '&type=plugin&state=' . $state;259 $checksum = wp_safe_remote_get( $checksum_url, array( 'timeout' => $this->timeout ) );260 if ( is_wp_error( $checksum ) ) {261 continue;262 }263 if ( '200' != wp_remote_retrieve_response_code( $checksum ) ) {264 continue;265 }266 $checksum = wp_remote_retrieve_body( $checksum );267 $checksum = json_decode( $checksum, true );268 if ( ! is_null( $checksum ) && ! empty( $checksum['files'] ) ) {269 $checksum = $checksum['files'];270 foreach ( $checksum as $file => $checksums ) {271 $plugin_checksums[ trailingslashit( dirname( $plugin_file ) ) . $file ] = $checksums['sha256'];272 }273 }274 } else {275 }276 }277 return $plugin_checksums;278 }279 280 324 function map_core_checksums( $checksums ) { 281 325 $real_abspath = trailingslashit( $this->normalise_path( ABSPATH ) ); -
wp-malware-removal/trunk/traits/wpmr_helpers.php
r3361852 r3368160 592 592 } 593 593 } 594 594 595 595 function llog( $str, $echo = true ) { 596 596 if ( $echo ) { … … 1631 1631 } 1632 1632 1633 1634 1633 function automate_routines() { 1635 1634 if ( ! ( defined( 'DOING_CRON' ) && DOING_CRON ) || ! $this->is_advanced_edition() ) { … … 1644 1643 } 1645 1644 1646 function get_users_loggedin() {1645 function get_users_loggedin() { 1647 1646 return get_users( 1648 1647 array( … … 1703 1702 function debug() { 1704 1703 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 1704 1705 1705 } 1706 1706 } -
wp-malware-removal/trunk/traits/wpmr_scanner.php
r3361852 r3368160 1065 1065 } 1066 1066 } 1067 1068 1067 } -
wp-malware-removal/trunk/wpmr.php
r3361852 r3368160 11 11 * Plugin Name: Malcure Malware Scanner — #1 Toolset for Malware Removal 12 12 * Description: Ultra-precision, comphrensive malware scanner and security hardening to protect your site and find viruses, infections & other security threats & vulnerabilities. Detects over 50,000+ security threats & vulnerabilities. Do not forget to report bugs and share your reviews. 13 * Version: 17. 713 * Version: 17.8 14 14 * Author: Malcure 15 15 * Author URI: https://malcure.com
Note: See TracChangeset
for help on using the changeset viewer.