Changeset 3344279
- Timestamp:
- 08/14/2025 05:03:21 AM (7 months ago)
- Location:
- wp-malware-removal/trunk
- Files:
-
- 3 edited
-
inc/pro.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
wpmr.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-malware-removal/trunk/inc/pro.php
r3328887 r3344279 349 349 global $wp_version; 350 350 WP_CLI::log( WP_CLI::colorize( '%n%wMalcure Advanced Edition ' . $wpmr->plugin_data['Version'] . '%B' ) ); 351 WP_CLI::log( WP_CLI::colorize( '%n%wRegistration Details : %B' . print_r( $wpmr->get_setting( 'user' ), 1 ) . '%n' ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- Required for CLI debugging and info display 351 352 // Display clean registration details 353 $user_details = $wpmr->get_setting( 'user' ); 354 if ( ! empty( $user_details ) ) { 355 WP_CLI::log( WP_CLI::colorize( '%n%wRegistration Details:%n' ) ); 356 if ( isset( $user_details['ID'] ) ) { 357 WP_CLI::log( "\tUser ID : " . $user_details['ID'] ); 358 } 359 if ( isset( $user_details['user_email'] ) ) { 360 WP_CLI::log( "\tEmail : " . $user_details['user_email'] ); 361 } 362 if ( isset( $user_details['first_name'] ) ) { 363 WP_CLI::log( "\tFirst Name : " . $user_details['first_name'] ); 364 } 365 if ( isset( $user_details['last_name'] ) ) { 366 WP_CLI::log( "\tLast Name : " . $user_details['last_name'] ); 367 } 368 } 369 352 370 $this->license_req(); 353 371 // WP_CLI::log( print_r( $wpmr->plugin_data, 1 ) ); … … 669 687 array( 'license', 'customer_email', 'site_count', 'activations_left', 'license_limit', 'expires' ) 670 688 ) ) { 671 672 WP_CLI::log( "\t" . ucwords( preg_replace( '/[^A-Za-z0-9 ]/', ' ', $key ) ) . ' : ' . $value ); 689 $formatted_key = ucwords( str_replace( '_', ' ', $key ) ); 690 $formatted_value = $value; 691 // Format specific values for better readability 692 if ( $key === 'license' ) { 693 $formatted_key = 'License'; 694 $formatted_value = ucfirst( $value ); 695 } elseif ( $key === 'expires' ) { 696 $formatted_key = 'Expires'; 697 } elseif ( $key === 'customer_email' ) { 698 $formatted_key = 'Customer Email'; 699 } elseif ( $key === 'license_limit' ) { 700 $formatted_key = 'License Limit'; 701 $formatted_value = ( $value == 0 ) ? 'unlimited' : $value; 702 } elseif ( $key === 'site_count' ) { 703 $formatted_key = 'Site Count'; 704 } elseif ( $key === 'activations_left' ) { 705 $formatted_key = 'Activations Left'; 706 $formatted_value = ( $value == 999999 || $value == 0 ) ? 'unlimited' : $value; 707 } 708 709 WP_CLI::log( "\t" . str_pad( $formatted_key, 18, ' ', STR_PAD_RIGHT ) . ': ' . $formatted_value ); 673 710 } 674 711 } -
wp-malware-removal/trunk/readme.txt
r3333119 r3344279 5 5 Tested up to: 6.8 6 6 Requires PHP: 5.6 7 Stable tag: 17. 27 Stable tag: 17.3 8 8 License: MIT 9 9 License URI: https://opensource.org/licenses/MIT … … 190 190 == Changelog == 191 191 192 = 17.3 = 193 Bugfix: Potential false negatives for certain default files. 194 Bugfix: Fixed formating in WP CLI commands. 195 192 196 = 17.2 = 193 197 Bugfix: File cleanup not working in advanced edition. -
wp-malware-removal/trunk/wpmr.php
r3333119 r3344279 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. 213 * Version: 17.3 14 14 * Author: Malcure 15 15 * Author URI: https://malcure.com … … 3073 3073 do_action( 'wpmr_scan_init', $GLOBALS['WPMR'] ); 3074 3074 } 3075 3075 3076 return $response; 3076 3077 } … … 3489 3490 continue; 3490 3491 } 3492 3491 3493 $checksum_failure = $this->fails_checksum( $file ); 3492 3494 // $this->flog( 'Checksum failure: ' . $checksum_failure ); … … 3694 3696 $page_for_posts = get_option( 'page_for_posts' ); 3695 3697 $page_on_front = get_option( 'page_on_front' ); 3698 // there may be a chance that only one of these is set: page_on_front has not been set but page_for_posts has been set 3696 3699 return $this->check_page_hack( get_permalink( $page_for_posts ) ) || $this->check_page_hack( get_permalink( $page_on_front ) ); 3697 3700 } else { … … 3700 3703 } 3701 3704 3702 function check_page_hack( $url ) { 3705 function check_page_hack( $url = '' ) { 3706 if ( empty( $url ) || ! filter_var( $url, FILTER_VALIDATE_URL ) ) { 3707 $this->flog( 'Invalid URL ' . print_r( $url, 1 ) . ' in ' . __FUNCTION__ ); 3708 return false; 3709 } 3703 3710 $url = add_query_arg( array( uniqid() => uniqid( '', 1 ) ), trailingslashit( $url ) ); 3704 3711 if ( ! $content = $this->get_remote_response( $url ) ) { … … 4065 4072 if ( ! in_array( $hash, $checksums ) || $this->is_file_blacklisted( $hash ) ) { 4066 4073 if ( ! $this->is_registered() ) { 4067 if ( $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( ABSPATH ) . 'wp-config.php' ) || 4068 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( ABSPATH ) . '.htaccess' ) || 4069 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( WP_CONTENT_DIR ) . 'index.php' ) || 4070 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( WP_PLUGIN_DIR ) . 'index.php' ) || 4071 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( get_theme_root() ) . 'index.php' ) 4074 if ( 4075 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( ABSPATH ) . 'wp-config.php' ) || 4076 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( ABSPATH ) . '.htaccess' ) || 4077 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( WP_CONTENT_DIR ) . 'index.php' ) || 4078 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( WP_PLUGIN_DIR ) . 'index.php' ) || 4079 $this->normalise_path( $local_file ) == $this->normalise_path( trailingslashit( get_theme_root() ) . 'index.php' ) 4072 4080 ) { 4073 return false; // ignore known files that may not have a checksum at all 4081 // uncommenting the next line could lead to false negatives 4082 // return false; // ignore known files that may not have a checksum at all 4074 4083 } 4075 4084 } 4076 4085 return 'missing'; 4077 4086 } 4078 4079 4087 return; 4080 4088 } … … 4166 4174 $checksums = $this->sha256_get_core_checksums( $wp_version ); // defaults to en_US 4167 4175 } 4168 if ( ! $checksums ) {4169 $checksums = array();4170 }4176 if ( ! $checksums ) { 4177 $checksums = array(); 4178 } 4171 4179 4172 4180 $plugin_checksums = $this->get_plugin_checksums(); … … 6461 6469 wp_send_json_error( 'Please update to Malcure Advanced Edition to use this feature.' ); 6462 6470 } 6463 $file = base64_decode( sanitize_text_field( wp_unslash( $_REQUEST['file'] ) ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated -- Validated via check_ajax_referer 6471 6472 $file = base64_decode( sanitize_text_field( wp_unslash( $_REQUEST['file'] ) ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated -- Validated via check_ajax_referer 6473 6474 if ( $this->is_in_core_wp_dir( $this->normalise_path( $file ) ) ) { 6475 wp_send_json_error( 'Whitelisting core WordPress files is not allowed. File: ' . $file ); 6476 } 6477 6464 6478 $checksum = @hash_file( 'sha256', $this->normalise_path( $file ) ); 6465 6479 if ( $checksum ) {
Note: See TracChangeset
for help on using the changeset viewer.