Plugin Directory

Changeset 3443352


Ignore:
Timestamp:
01/20/2026 03:01:45 PM (2 months ago)
Author:
JavierCasares
Message:

[4.3.1] - 2026-01-20

Fixed

  • Dashboard widget now correctly counts only vulnerabilities from enabled components, excluding disabled ones from settings.
  • Status badge calculation (Critical/Warning) now properly considers only enabled components when determining severity level.
  • Fixed PHPCS warnings for global variables without plugin prefix in wpvulnerability-admin.php and wpvulnerability-adminms.php.

Compatibility

  • WordPress: 4.7 - 6.9
  • PHP: 5.6 - 8.5
  • WP-CLI: 2.3.0 - 2.11.0

Tests

  • PHP Coding Standards: 3.13.5
  • WordPress Coding Standards: 3.3.0
  • Plugin Check (PCP): 1.8.0
Location:
wpvulnerability
Files:
57 added
6 edited

Legend:

Unmodified
Added
Removed
  • wpvulnerability/trunk/assets/admin.css

    r3442647 r3443352  
    121121
    122122/* ==================================================
    123    WPVulnerability Admin Panel Styles
    124    Extracted from inline <style> blocks
    125    ================================================== */
     123    WPVulnerability Admin Panel Styles
     124    Extracted from inline <style> blocks
     125    ================================================== */
    126126
    127127/* ==================================================
    128    Notifications Panel
    129    ================================================== */
     128    Notifications Panel
     129    ================================================== */
    130130.wpvulnerability-notifications-panel .wpvulnerability-security-section {
    131131    background: #fff;
     
    282282
    283283/* ==================================================
    284    Analysis Panel
    285    ================================================== */
     284    Analysis Panel
     285    ================================================== */
    286286.wpvulnerability-analysis-panel .wpvulnerability-security-section {
    287287    background: #fff;
     
    438438
    439439/* ==================================================
    440    Logs Panel
    441    ================================================== */
     440    Logs Panel
     441    ================================================== */
    442442.wpvulnerability-logs-panel .wpvulnerability-security-section {
    443443    background: #fff;
     
    699699
    700700/* ==================================================
    701    Tools Panel
    702    ================================================== */
     701    Tools Panel
     702    ================================================== */
    703703.wpvulnerability-tools-panel .wpvulnerability-tool-card {
    704704    background: #fff;
     
    838838
    839839/* ==================================================
    840    About Panel
    841    ================================================== */
     840    About Panel
     841    ================================================== */
    842842.wpvulnerability-about-panel .wpvulnerability-security-section {
    843843    background: #fff;
     
    962962
    963963/* ==================================================
    964    Dashboard Widget
    965    ================================================== */
     964    Dashboard Widget
     965    ================================================== */
    966966        .wpvuln-status-badge {
    967967display: inline-block;
     
    10651065
    10661066/* ==================================================
    1067    Security Panel
    1068    ================================================== */
     1067    Security Panel
     1068    ================================================== */
    10691069.wpvulnerability-security-panel h2 {
    10701070    margin-top: 0;
  • wpvulnerability/trunk/changelog.txt

    r3442647 r3443352  
    11== Changelog ==
     2
     3= [4.3.1] - 2026-01-20 =
     4
     5**Fixed**
     6
     7* Dashboard widget now correctly counts only vulnerabilities from enabled components, excluding disabled ones from settings.
     8* Status badge calculation (Critical/Warning) now properly considers only enabled components when determining severity level.
     9* Fixed PHPCS warnings for global variables without plugin prefix in wpvulnerability-admin.php and wpvulnerability-adminms.php.
     10
     11**Compatibility**
     12
     13* WordPress: 4.7 - 6.9
     14* PHP: 5.6 - 8.5
     15* WP-CLI: 2.3.0 - 2.11.0
     16
     17**Tests**
     18
     19* PHP Coding Standards: 3.13.5
     20* WordPress Coding Standards: 3.3.0
     21* Plugin Check (PCP): 1.8.0
    222
    323= [4.3.0] - 2026-01-19 =
  • wpvulnerability/trunk/readme.txt

    r3442647 r3443352  
    44Requires at least: 4.7
    55Tested up to: 6.9
    6 Stable tag: 4.3.0
     6Stable tag: 4.3.1
    77Requires PHP: 5.6
    8 Version: 4.3.0
     8Version: 4.3.1
    99License: GPL-3.0-or-later
    1010License URI: https://spdx.org/licenses/GPL-3.0-or-later.html
     
    147147
    148148Maximum security (no shell commands):
     149
    149150`define( 'WPVULNERABILITY_SECURITY_MODE', 'strict' );`
    150151
    151152Only allow ImageMagick shell detection:
     153
    152154`define( 'WPVULNERABILITY_SHELL_EXEC_WHITELIST', 'imagemagick' );`
    153155
    154156Complete disable:
     157
    155158`define( 'WPVULNERABILITY_DISABLE_SHELL_EXEC', true );`
    156159
     
    198201
    199202== Changelog ==
     203
     204= [4.3.1] - 2026-01-20 =
     205
     206**Fixed**
     207
     208* Dashboard widget now correctly counts only vulnerabilities from enabled components, excluding disabled ones from settings.
     209* Status badge calculation (Critical/Warning) now properly considers only enabled components when determining severity level.
     210* Fixed PHPCS warnings for global variables without plugin prefix in wpvulnerability-admin.php and wpvulnerability-adminms.php.
     211
     212**Compatibility**
     213
     214* WordPress: 4.7 - 6.9
     215* PHP: 5.6 - 8.5
     216* WP-CLI: 2.3.0 - 2.11.0
     217
     218**Tests**
     219
     220* PHP Coding Standards: 3.13.5
     221* WordPress Coding Standards: 3.3.0
     222* Plugin Check (PCP): 1.8.0
    200223
    201224= [4.3.0] - 2026-01-19 =
  • wpvulnerability/trunk/wpvulnerability-admin.php

    r3442647 r3443352  
    189189            require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-debug.php';
    190190        }
    191         $debug_info = wpvulnerability_debug_export_info();
    192         $filename   = 'wpvulnerability-debug-' . gmdate( 'Y-m-d-His' ) . '.json';
     191        $wpvulnerability_debug_info = wpvulnerability_debug_export_info();
     192        $wpvulnerability_filename   = 'wpvulnerability-debug-' . gmdate( 'Y-m-d-His' ) . '.json';
    193193
    194194        header( 'Content-Type: application/json' );
    195         header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
    196         header( 'Content-Length: ' . strlen( $debug_info ) );
    197         echo $debug_info; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     195        header( 'Content-Disposition: attachment; filename="' . $wpvulnerability_filename . '"' );
     196        header( 'Content-Length: ' . strlen( $wpvulnerability_debug_info ) );
     197        echo $wpvulnerability_debug_info; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    198198        exit;
    199199    } else {
     
    231231            require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-notifications.php';
    232232        }
    233         $result = wpvulnerability_execute_notification( true );
    234         if ( $result ) {
     233        $wpvulnerability_result = wpvulnerability_execute_notification( true );
     234        if ( $wpvulnerability_result ) {
    235235            set_transient( 'wpvulnerability_message_manual_success', __( 'Notification has been sent.', 'wpvulnerability' ), 10 );
    236236        } else {
     
    22842284    $sqlite_count      = (int) json_decode( get_option( 'wpvulnerability-sqlite-vulnerable' ), true );
    22852285
    2286     // Calculate total vulnerabilities.
    2287     $total_vulnerabilities = $core_count + $plugins_count + $themes_count + $php_count +
    2288                             $apache_count + $nginx_count + $mariadb_count + $mysql_count +
    2289                             $imagemagick_count + $curl_count + $memcached_count + $redis_count + $sqlite_count;
     2286    // Calculate total vulnerabilities (only for enabled components).
     2287    $total_vulnerabilities = 0;
     2288    if ( wpvulnerability_analyze_filter( 'core' ) ) {
     2289        $total_vulnerabilities += $core_count;
     2290    }
     2291    if ( wpvulnerability_analyze_filter( 'plugins' ) ) {
     2292        $total_vulnerabilities += $plugins_count;
     2293    }
     2294    if ( wpvulnerability_analyze_filter( 'themes' ) ) {
     2295        $total_vulnerabilities += $themes_count;
     2296    }
     2297    if ( wpvulnerability_analyze_filter( 'php' ) ) {
     2298        $total_vulnerabilities += $php_count;
     2299    }
     2300    if ( wpvulnerability_analyze_filter( 'apache' ) ) {
     2301        $total_vulnerabilities += $apache_count;
     2302    }
     2303    if ( wpvulnerability_analyze_filter( 'nginx' ) ) {
     2304        $total_vulnerabilities += $nginx_count;
     2305    }
     2306    if ( wpvulnerability_analyze_filter( 'mariadb' ) ) {
     2307        $total_vulnerabilities += $mariadb_count;
     2308    }
     2309    if ( wpvulnerability_analyze_filter( 'mysql' ) ) {
     2310        $total_vulnerabilities += $mysql_count;
     2311    }
     2312    if ( wpvulnerability_analyze_filter( 'imagemagick' ) ) {
     2313        $total_vulnerabilities += $imagemagick_count;
     2314    }
     2315    if ( wpvulnerability_analyze_filter( 'curl' ) ) {
     2316        $total_vulnerabilities += $curl_count;
     2317    }
     2318    if ( wpvulnerability_analyze_filter( 'memcached' ) ) {
     2319        $total_vulnerabilities += $memcached_count;
     2320    }
     2321    if ( wpvulnerability_analyze_filter( 'redis' ) ) {
     2322        $total_vulnerabilities += $redis_count;
     2323    }
     2324    if ( wpvulnerability_analyze_filter( 'sqlite' ) ) {
     2325        $total_vulnerabilities += $sqlite_count;
     2326    }
    22902327
    22912328    // Determine status badge.
     
    22952332
    22962333    if ( $total_vulnerabilities > 0 ) {
    2297         if ( $core_count > 0 || $php_count > 0 || $total_vulnerabilities > 5 ) {
     2334        if ( ( wpvulnerability_analyze_filter( 'core' ) && $core_count > 0 ) ||
     2335            ( wpvulnerability_analyze_filter( 'php' ) && $php_count > 0 ) ||
     2336            $total_vulnerabilities > 5 ) {
    22982337            $status_class = 'wpvuln-status-critical';
    22992338            $status_icon  = '✕';
     
    30283067
    30293068    // Test API.
    3030     $result = wpvulnerability_debug_test_api_component( $component );
    3031 
    3032     wp_send_json_success( $result );
     3069    $wpvulnerability_result = wpvulnerability_debug_test_api_component( $component );
     3070
     3071    wp_send_json_success( $wpvulnerability_result );
    30333072}
    30343073add_action( 'wp_ajax_wpvulnerability_test_api', 'wpvulnerability_ajax_test_api' );
  • wpvulnerability/trunk/wpvulnerability-adminms.php

    r3442647 r3443352  
    7979        if ( check_admin_referer( 'wpvulnerability_nonce', 'wpauto_nonce' ) ) {
    8080
    81                 if ( isset( $_POST['wpvulnerability-config'] ) ) {
     81            if ( isset( $_POST['wpvulnerability-config'] ) ) {
    8282
    8383                $post_config = filter_input( INPUT_POST, 'wpvulnerability-config', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
     
    211211     * @since 3.0.0
    212212     */
    213         if ( isset( $_POST['wpvulnerability_reset'] ) && check_admin_referer( 'wpvulnerability_reset_action', 'wpvulnerability_reset_nonce' ) ) {
    214    
     213    if ( isset( $_POST['wpvulnerability_reset'] ) && check_admin_referer( 'wpvulnerability_reset_action', 'wpvulnerability_reset_nonce' ) ) {
     214
    215215        if ( current_user_can( 'manage_network_options' ) ) {
    216216            // Calls the reset function.
    217217            wpvulnerability_update_database_data();
    218    
     218
    219219            set_transient( 'wpvulnerability_message_manual_success', __( 'Data from source has been reloaded.', 'wpvulnerability' ), 10 );
    220220        } else {
     
    222222        }
    223223    }
    224    
     224
    225225    /**
    226226     * Send an test email
     
    229229     */
    230230    if ( isset( $_POST['wpvulnerability_email'] ) && check_admin_referer( 'wpvulnerability_email_action', 'wpvulnerability_email_nonce' ) ) {
    231    
     231
    232232        if ( ! function_exists( 'wpvulnerability_execute_notification' ) ) {
    233233            require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-core.php';
     
    238238            require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-notifications.php';
    239239        }
    240    
     240
    241241        // Calls the notifications function, forced.
    242242        if ( current_user_can( 'manage_network_options' ) ) {
    243243            $wpmail = wpvulnerability_execute_notification( true );
    244    
     244
    245245            if ( $wpmail ) {
    246    
     246
    247247                set_transient( 'wpvulnerability_message_manual_success', __( 'Test email has been sent.', 'wpvulnerability' ), 10 );
    248    
     248
    249249            } else {
    250    
     250
    251251                set_transient( 'wpvulnerability_message_manual_error', __( 'Test email has failed. Please, check your email settings.', 'wpvulnerability' ), 10 );
    252    
     252
    253253            }
    254254        } else {
     
    256256        }
    257257    }
    258    
     258
    259259    /**
    260260     * Repairs scheduled cron events across the network.
     
    265265        if ( current_user_can( 'manage_network_options' ) ) {
    266266            $wpvulnerability_settings = get_site_option( 'wpvulnerability-config', array() );
    267             $cron_config = is_array( $wpvulnerability_settings ) ? $wpvulnerability_settings : array();
     267            $cron_config              = is_array( $wpvulnerability_settings ) ? $wpvulnerability_settings : array();
    268268            wpvulnerability_repair_network_cron_events( $cron_config );
    269269            set_transient( 'wpvulnerability_message_manual_success', __( 'WPVulnerability cron events have been repaired across the network.', 'wpvulnerability' ), 10 );
     
    272272        }
    273273    }
    274    
     274
    275275    /**
    276276     * Delete all stored API logs across the network.
     
    286286        }
    287287    }
    288    
     288
    289289    /**
    290290     * Fully resets plugin data, settings, and cached API content across the network.
     
    300300        }
    301301    }
    302    
     302
    303303    /**
    304304     * Handles debug action: Clear all caches.
     
    317317        }
    318318    }
    319    
     319
    320320    /**
    321321     * Handles debug action: Reset signatures.
     
    334334        }
    335335    }
    336    
     336
    337337    /**
    338338     * Handles debug action: Export debug info.
     
    345345                require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-debug.php';
    346346            }
    347             $debug_info = wpvulnerability_debug_export_info();
    348             $filename   = 'wpvulnerability-debug-' . gmdate( 'Y-m-d-His' ) . '.json';
    349    
     347            $wpvulnerability_debug_info = wpvulnerability_debug_export_info();
     348            $wpvulnerability_filename   = 'wpvulnerability-debug-' . gmdate( 'Y-m-d-His' ) . '.json';
     349
    350350            header( 'Content-Type: application/json' );
    351             header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
    352             header( 'Content-Length: ' . strlen( $debug_info ) );
    353             echo $debug_info; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     351            header( 'Content-Disposition: attachment; filename="' . $wpvulnerability_filename . '"' );
     352            header( 'Content-Length: ' . strlen( $wpvulnerability_debug_info ) );
     353            echo $wpvulnerability_debug_info; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    354354            exit;
    355355        } else {
     
    357357        }
    358358    }
    359    
     359
    360360    /**
    361361     * Handles debug action: Run update database now.
     
    371371        }
    372372    }
    373    
     373
    374374    /**
    375375     * Handles debug action: Run notification now.
     
    387387                require_once WPVULNERABILITY_PLUGIN_PATH . '/wpvulnerability-notifications.php';
    388388            }
    389             $result = wpvulnerability_execute_notification( true );
    390             if ( $result ) {
     389            $wpvulnerability_result = wpvulnerability_execute_notification( true );
     390            if ( $wpvulnerability_result ) {
    391391                set_transient( 'wpvulnerability_message_manual_success', __( 'Notification has been sent.', 'wpvulnerability' ), 10 );
    392392            } else {
     
    21892189    $sqlite_count      = (int) json_decode( get_site_option( 'wpvulnerability-sqlite-vulnerable' ), true );
    21902190
    2191     // Calculate total vulnerabilities.
    2192     $total_vulnerabilities = $core_count + $plugins_count + $themes_count + $php_count +
    2193                             $apache_count + $nginx_count + $mariadb_count + $mysql_count +
    2194                             $imagemagick_count + $curl_count + $memcached_count + $redis_count + $sqlite_count;
     2191    // Calculate total vulnerabilities (only for enabled components).
     2192    $total_vulnerabilities = 0;
     2193    if ( wpvulnerability_analyze_filter( 'core' ) ) {
     2194        $total_vulnerabilities += $core_count;
     2195    }
     2196    if ( wpvulnerability_analyze_filter( 'plugins' ) ) {
     2197        $total_vulnerabilities += $plugins_count;
     2198    }
     2199    if ( wpvulnerability_analyze_filter( 'themes' ) ) {
     2200        $total_vulnerabilities += $themes_count;
     2201    }
     2202    if ( wpvulnerability_analyze_filter( 'php' ) ) {
     2203        $total_vulnerabilities += $php_count;
     2204    }
     2205    if ( wpvulnerability_analyze_filter( 'apache' ) ) {
     2206        $total_vulnerabilities += $apache_count;
     2207    }
     2208    if ( wpvulnerability_analyze_filter( 'nginx' ) ) {
     2209        $total_vulnerabilities += $nginx_count;
     2210    }
     2211    if ( wpvulnerability_analyze_filter( 'mariadb' ) ) {
     2212        $total_vulnerabilities += $mariadb_count;
     2213    }
     2214    if ( wpvulnerability_analyze_filter( 'mysql' ) ) {
     2215        $total_vulnerabilities += $mysql_count;
     2216    }
     2217    if ( wpvulnerability_analyze_filter( 'imagemagick' ) ) {
     2218        $total_vulnerabilities += $imagemagick_count;
     2219    }
     2220    if ( wpvulnerability_analyze_filter( 'curl' ) ) {
     2221        $total_vulnerabilities += $curl_count;
     2222    }
     2223    if ( wpvulnerability_analyze_filter( 'memcached' ) ) {
     2224        $total_vulnerabilities += $memcached_count;
     2225    }
     2226    if ( wpvulnerability_analyze_filter( 'redis' ) ) {
     2227        $total_vulnerabilities += $redis_count;
     2228    }
     2229    if ( wpvulnerability_analyze_filter( 'sqlite' ) ) {
     2230        $total_vulnerabilities += $sqlite_count;
     2231    }
    21952232
    21962233    // Determine status badge.
     
    22002237
    22012238    if ( $total_vulnerabilities > 0 ) {
    2202         if ( $core_count > 0 || $php_count > 0 || $total_vulnerabilities > 5 ) {
     2239        if ( ( wpvulnerability_analyze_filter( 'core' ) && $core_count > 0 ) ||
     2240            ( wpvulnerability_analyze_filter( 'php' ) && $php_count > 0 ) ||
     2241            $total_vulnerabilities > 5 ) {
    22032242            $status_class = 'wpvuln-status-critical';
    22042243            $status_icon  = '✕';
     
    32753314
    32763315    // Test API.
    3277     $result = wpvulnerability_debug_test_api_component( $component );
    3278 
    3279     wp_send_json_success( $result );
     3316    $wpvulnerability_result = wpvulnerability_debug_test_api_component( $component );
     3317
     3318    wp_send_json_success( $wpvulnerability_result );
    32803319}
    32813320add_action( 'wp_ajax_wpvulnerability_test_api', 'wpvulnerability_ajax_network_test_api' );
  • wpvulnerability/trunk/wpvulnerability.php

    r3442647 r3443352  
    22/**
    33 * Plugin Name: WPVulnerability
    4  * Plugin URI: https://www.wpvulnerability.com/
     4 * Plugin URI: https://www.wpvulnerability.com/plugin/
    55 * Description: Receive information about possible vulnerabilities in your WordPress from WordPress Vulnerability Database API.
    66 * Requires at least: 4.7
    77 * Requires PHP: 5.6
    8  * Version: 4.3.0
    9  * Author: Javier Casares
    10  * Author URI: https://www.javiercasares.com/
    11  * License: GPL-2.0-or-later
    12  * License URI: https://spdx.org/licenses/GPL-2.0-or-later.html
     8 * Version: 4.3.1
     9 * Author: ROBOTSTXT
     10 * Author URI: https://www.robotstxt.es/
     11 * License: GPL-3.0-or-later
     12 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
    1313 * Text Domain: wpvulnerability
    1414 * Domain Path: /languages
     
    2424 * Set some constants that I can change in future versions.
    2525 */
    26 define( 'WPVULNERABILITY_PLUGIN_VERSION', '4.3.0' );
     26define( 'WPVULNERABILITY_PLUGIN_VERSION', '4.3.1' );
    2727define( 'WPVULNERABILITY_API_HOST', 'https://www.wpvulnerability.net/' );
    2828
Note: See TracChangeset for help on using the changeset viewer.