Plugin Directory

Changeset 3368160


Ignore:
Timestamp:
09/26/2025 03:06:34 AM (6 months ago)
Author:
malcure
Message:

new release

Location:
wp-malware-removal/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-malware-removal/trunk/readme.txt

    r3361852 r3368160  
    55Tested up to: 6.8
    66Requires PHP: 5.6
    7 Stable tag: 17.7
     7Stable tag: 17.8
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    190190== Changelog ==
    191191
     192= 17.8 =
     193UX: Updated to work with new checksum endpoint.
     194
    192195= 17.7 =
    193196Bugfix: Fixed a bug where errors during definition update wouldn't be reported.
     
    734737== Upgrade Notice ==
    735738
     739= 17.8 =
     740UX: Updated to work with new checksum endpoint.
     741
    736742= 17.7 =
    737743Bugfix: Fixed a bug where errors during definition update wouldn't be reported.
  • wp-malware-removal/trunk/traits/wpmr_checksums.php

    r3361852 r3368160  
    124124            }
    125125
    126             $plugin_checksums = $this->get_plugin_checksums();
     126            $plugin_checksums = $this->get_plugin_checksums_wpmr();
    127127            if ( $plugin_checksums ) {
    128128                $checksums = array_merge( $checksums, $plugin_checksums );
     
    208208        if ( $extras ) {
    209209            $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            }
    210289        }
    211290        return $plugin_checksums;
     
    243322    }
    244323
    245     function get_pro_checksums( $missing ) {
    246         if ( empty( $missing ) || ! $this->is_registered() || ! $this->is_advanced_edition() ) { // can't burden our server
    247             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 supported
    256                 $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 
    280324    function map_core_checksums( $checksums ) {
    281325        $real_abspath = trailingslashit( $this->normalise_path( ABSPATH ) );
  • wp-malware-removal/trunk/traits/wpmr_helpers.php

    r3361852 r3368160  
    592592        }
    593593    }
    594    
     594
    595595    function llog( $str, $echo = true ) {
    596596        if ( $echo ) {
     
    16311631    }
    16321632
    1633    
    16341633    function automate_routines() {
    16351634        if ( ! ( defined( 'DOING_CRON' ) && DOING_CRON ) || ! $this->is_advanced_edition() ) {
     
    16441643    }
    16451644
    1646         function get_users_loggedin() {
     1645    function get_users_loggedin() {
    16471646        return get_users(
    16481647            array(
     
    17031702    function debug() {
    17041703        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
     1704
    17051705        }
    17061706    }
  • wp-malware-removal/trunk/traits/wpmr_scanner.php

    r3361852 r3368160  
    10651065        }
    10661066    }
    1067 
    10681067}
  • wp-malware-removal/trunk/wpmr.php

    r3361852 r3368160  
    1111 * Plugin Name: Malcure Malware Scanner — #1 Toolset for Malware Removal
    1212 * 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.7
     13 * Version:     17.8
    1414 * Author:      Malcure
    1515 * Author URI:  https://malcure.com
Note: See TracChangeset for help on using the changeset viewer.