Plugin Directory

Changeset 2370481


Ignore:
Timestamp:
08/27/2020 03:47:16 PM (5 years ago)
Author:
wfmatt
Message:

7.4.11 - August 27, 2020

  • Improvement: Added diagnostic debug button to clear Wordfence Central connection data from the database.
  • Improvement: Added help documentation links to modified plugin/theme file scan results.
  • Fix: Prevent file system scan from following symlinks to root.
  • Fix: Cleared pending plugin/theme update scan results and notification when a plugin/theme is auto-updated.
  • Fix: Added check for when site is disconnected on Central's end, but not in the plugin.
Location:
wordfence
Files:
112 added
112 deleted
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wordfence/tags/7.4.11/lib/menu_tools_diagnostic.php

    r2337484 r2370481  
    845845                            </span>
    846846                        </li>
     847                        <li>
     848                            <span>
     849                                <?php _e('Clear all Wordfence Central connection data', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS_REMOVE_CENTRAL_DATA); ?>" target="_blank" rel="noopener noreferrer" class="wfhelp wf-inline-help"></a>
     850                                <input class="wf-btn wf-btn-default wf-btn-sm" type="button" value="<?php esc_attr_e('Clear Connection Data', 'wordfence'); ?>" onclick="WFAD.ajax('wordfence_wfcentral_disconnect', {}, function() { WFAD.colorboxModal((self.isSmallScreen ? '300px' : '400px'), 'Successfully romved data', 'All associated Wordfence Central data has been removed from the database.'); });"/>
     851                            </span>
     852                        </li>
    847853                    </ul>
    848854
  • wordfence/tags/7.4.11/lib/wfCentralAPI.php

    r2337484 r2370481  
    6060        $http = _wp_http_get_object();
    6161        $response = $http->request(WORDFENCE_CENTRAL_API_URL_SEC . $this->getEndpoint(), $args);
     62
     63        if (!is_wp_error($response)) {
     64            $body = wp_remote_retrieve_body($response);
     65            $statusCode = wp_remote_retrieve_response_code($response);
     66
     67            // Check if site has been disconnected on Central's end, but the plugin is still trying to connect.
     68            if ($statusCode === 404 && strpos($body, 'Site has been disconnected') !== false) {
     69                // Increment attempt count.
     70                $centralDisconnectCount = get_site_transient('wordfenceCentralDisconnectCount');
     71                set_site_transient('wordfenceCentralDisconnectCount', ++$centralDisconnectCount, 86400);
     72
     73                // Once threshold is hit, disconnect Central.
     74                if ($centralDisconnectCount > 3) {
     75                    wfRESTConfigController::disconnectConfig();
     76                }
     77            }
     78        }
     79
    6280        return new wfCentralAPIResponse($response);
    6381    }
  • wordfence/tags/7.4.11/lib/wfSupportController.php

    r2337484 r2370481  
    149149    const ITEM_SCAN_RESULT_SKIPPED_PATHS = 'scan-result-skipped-paths';
    150150    const ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES = 'scan-result-repair-modified-files';
     151    const ITEM_SCAN_RESULT_MODIFIED_PLUGIN = 'scan-result-modified-plugin';
     152    const ITEM_SCAN_RESULT_MODIFIED_THEME = 'scan-result-modified-theme';
    151153
    152154    const ITEM_TOOLS_TWO_FACTOR = 'tools-two-factor';
     
    160162    const ITEM_DIAGNOSTICS_TEST_EMAIL = 'diagnostics-test-email';
    161163    const ITEM_DIAGNOSTICS_TEST_ACTIVITY_REPORT = 'diagnostics-test-activity-report';
     164    const ITEM_DIAGNOSTICS_REMOVE_CENTRAL_DATA = 'diagnostics-remove-central-data';
    162165    const ITEM_DIAGNOSTICS_OPTION_DEBUGGING_MODE = 'diagnostics-option-debugging-mode';
    163166    const ITEM_DIAGNOSTICS_OPTION_REMOTE_SCANS = 'diagnostics-option-remote-scans';
     
    327330            case self::ITEM_SCAN_RESULT_SKIPPED_PATHS:
    328331            case self::ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES:
     332            case self::ITEM_SCAN_RESULT_MODIFIED_PLUGIN:
     333            case self::ITEM_SCAN_RESULT_MODIFIED_THEME:
    329334
    330335            case self::ITEM_TOOLS_TWO_FACTOR:
     
    338343            case self::ITEM_DIAGNOSTICS_TEST_EMAIL:
    339344            case self::ITEM_DIAGNOSTICS_TEST_ACTIVITY_REPORT:
     345            case self::ITEM_DIAGNOSTICS_REMOVE_CENTRAL_DATA:
    340346            case self::ITEM_DIAGNOSTICS_OPTION_DEBUGGING_MODE:
    341347            case self::ITEM_DIAGNOSTICS_OPTION_REMOTE_SCANS:
  • wordfence/tags/7.4.11/lib/wordfenceClass.php

    r2353220 r2370481  
    322322        wfConfig::remove('lastPermissionsTemplateCheck');
    323323    }
    324     public static function _scheduleRefreshUpdateNotification($upgrader, $options) {
     324    public static function _scheduleRefreshUpdateNotification($upgrader = null, $options = null) {
    325325        $defer = false;
    326326        if (is_array($options) && isset($options['type']) && $options['type'] == 'core') {
     
    12851285        add_action('upgrader_process_complete', 'wfUpdateCheck::syncAllVersionInfo');
    12861286        add_action('upgrader_process_complete', 'wordfence::_scheduleRefreshUpdateNotification', 99, 2);
     1287        add_action('automatic_updates_complete', 'wordfence::_scheduleRefreshUpdateNotification', 99, 0);
    12871288        add_action('wordfence_refreshUpdateNotification', 'wordfence::_refreshUpdateNotification', 99, 0);
    12881289        add_action('wordfence_completeCoreUpdateNotification', 'wordfence::_completeCoreUpdateNotification', 99, 0);
  • wordfence/tags/7.4.11/lib/wordfenceHash.php

    r2290265 r2370481  
    432432       
    433433        $realPath = realpath($path);
     434        if ($realPath === '/') {
     435            return false;
     436        }
    434437        if (isset($this->foldersProcessed[$realPath])) {
    435438            return false;
     
    526529                                    'modifiedplugin' . $file . $md5,
    527530                                    'Modified plugin file: ' . $file,
    528                                     "This file belongs to plugin \"$itemName\" version \"$itemVersion\" and has been modified from the file that is distributed by WordPress.org for this version. Please use the link to see how the file has changed. If you have modified this file yourself, you can safely ignore this warning. If you see a lot of changed files in a plugin that have been made by the author, then try uninstalling and reinstalling the plugin to force an upgrade. Doing this is a workaround for plugin authors who don't manage their code correctly. [See our FAQ on www.wordfence.com for more info]",
     531                                    sprintf(__("This file belongs to plugin \"$itemName\" version \"$itemVersion\" and has been modified from the file that is distributed by WordPress.org for this version. Please use the link to see how the file has changed. If you have modified this file yourself, you can safely ignore this warning. If you see a lot of changed files in a plugin that have been made by the author, then try uninstalling and reinstalling the plugin to force an upgrade. Doing this is a workaround for plugin authors who don't manage their code correctly. <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Learn More</a>", 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_SCAN_RESULT_MODIFIED_PLUGIN)),
    529532                                    array(
    530533                                        'file' => $file,
     
    566569                                    'modifiedtheme' . $file . $md5,
    567570                                    'Modified theme file: ' . $file,
    568                                     "This file belongs to theme \"$itemName\" version \"$itemVersion\" and has been modified from the original distribution. It is common for site owners to modify their theme files, so if you have modified this file yourself you can safely ignore this warning.",
     571                                    sprintf(__("This file belongs to theme \"$itemName\" version \"$itemVersion\" and has been modified from the original distribution. It is common for site owners to modify their theme files, so if you have modified this file yourself you can safely ignore this warning. <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Learn More</a>", 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_SCAN_RESULT_MODIFIED_THEME)),
    569572                                    array(
    570573                                        'file' => $file,
  • wordfence/tags/7.4.11/modules/login-security/wordfence-login-security.php

    r2353220 r2370481  
    2828   
    2929    define('WORDFENCE_LS_VERSION', '1.0.5');
    30     define('WORDFENCE_LS_BUILD_NUMBER', '1596638737');
     30    define('WORDFENCE_LS_BUILD_NUMBER', '1598542714');
    3131   
    3232    if (!defined('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES')) { define('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES', 15); }
  • wordfence/tags/7.4.11/readme.txt

    r2353222 r2370481  
    55Requires PHP: 5.3
    66Tested up to: 5.5
    7 Stable tag: 7.4.10
     7Stable tag: 7.4.11
    88
    99Secure your website with the most comprehensive WordPress security plugin. Firewall, malware scan, blocking, live traffic, login security & more.
     
    183183
    184184== Changelog ==
     185
     186= 7.4.11 - August 27, 2020 =
     187
     188* Improvement: Added diagnostic debug button to clear Wordfence Central connection data from the database.
     189* Improvement: Added help documentation links to modified plugin/theme file scan results.
     190* Fix: Prevent file system scan from following symlinks to root.
     191* Fix: Cleared pending plugin/theme update scan results and notification when a plugin/theme is auto-updated.
     192* Fix: Added check for when site is disconnected on Central's end, but not in the plugin.
    185193
    186194= 7.4.10 - August 5, 2020 =
  • wordfence/tags/7.4.11/wordfence.php

    r2353220 r2370481  
    55Description: Wordfence Security - Anti-virus, Firewall and Malware Scan
    66Author: Wordfence
    7 Version: 7.4.10
     7Version: 7.4.11
    88Author URI: http://www.wordfence.com/
    99Network: true
     
    1616    exit;
    1717}
    18 define('WORDFENCE_VERSION', '7.4.10');
    19 define('WORDFENCE_BUILD_NUMBER', '1596638737');
     18define('WORDFENCE_VERSION', '7.4.11');
     19define('WORDFENCE_BUILD_NUMBER', '1598542714');
    2020define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) :
    2121    basename(dirname(__FILE__)) . '/' . basename(__FILE__));
  • wordfence/trunk/lib/menu_tools_diagnostic.php

    r2337484 r2370481  
    845845                            </span>
    846846                        </li>
     847                        <li>
     848                            <span>
     849                                <?php _e('Clear all Wordfence Central connection data', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS_REMOVE_CENTRAL_DATA); ?>" target="_blank" rel="noopener noreferrer" class="wfhelp wf-inline-help"></a>
     850                                <input class="wf-btn wf-btn-default wf-btn-sm" type="button" value="<?php esc_attr_e('Clear Connection Data', 'wordfence'); ?>" onclick="WFAD.ajax('wordfence_wfcentral_disconnect', {}, function() { WFAD.colorboxModal((self.isSmallScreen ? '300px' : '400px'), 'Successfully romved data', 'All associated Wordfence Central data has been removed from the database.'); });"/>
     851                            </span>
     852                        </li>
    847853                    </ul>
    848854
  • wordfence/trunk/lib/wfCentralAPI.php

    r2337484 r2370481  
    6060        $http = _wp_http_get_object();
    6161        $response = $http->request(WORDFENCE_CENTRAL_API_URL_SEC . $this->getEndpoint(), $args);
     62
     63        if (!is_wp_error($response)) {
     64            $body = wp_remote_retrieve_body($response);
     65            $statusCode = wp_remote_retrieve_response_code($response);
     66
     67            // Check if site has been disconnected on Central's end, but the plugin is still trying to connect.
     68            if ($statusCode === 404 && strpos($body, 'Site has been disconnected') !== false) {
     69                // Increment attempt count.
     70                $centralDisconnectCount = get_site_transient('wordfenceCentralDisconnectCount');
     71                set_site_transient('wordfenceCentralDisconnectCount', ++$centralDisconnectCount, 86400);
     72
     73                // Once threshold is hit, disconnect Central.
     74                if ($centralDisconnectCount > 3) {
     75                    wfRESTConfigController::disconnectConfig();
     76                }
     77            }
     78        }
     79
    6280        return new wfCentralAPIResponse($response);
    6381    }
  • wordfence/trunk/lib/wfSupportController.php

    r2337484 r2370481  
    149149    const ITEM_SCAN_RESULT_SKIPPED_PATHS = 'scan-result-skipped-paths';
    150150    const ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES = 'scan-result-repair-modified-files';
     151    const ITEM_SCAN_RESULT_MODIFIED_PLUGIN = 'scan-result-modified-plugin';
     152    const ITEM_SCAN_RESULT_MODIFIED_THEME = 'scan-result-modified-theme';
    151153
    152154    const ITEM_TOOLS_TWO_FACTOR = 'tools-two-factor';
     
    160162    const ITEM_DIAGNOSTICS_TEST_EMAIL = 'diagnostics-test-email';
    161163    const ITEM_DIAGNOSTICS_TEST_ACTIVITY_REPORT = 'diagnostics-test-activity-report';
     164    const ITEM_DIAGNOSTICS_REMOVE_CENTRAL_DATA = 'diagnostics-remove-central-data';
    162165    const ITEM_DIAGNOSTICS_OPTION_DEBUGGING_MODE = 'diagnostics-option-debugging-mode';
    163166    const ITEM_DIAGNOSTICS_OPTION_REMOTE_SCANS = 'diagnostics-option-remote-scans';
     
    327330            case self::ITEM_SCAN_RESULT_SKIPPED_PATHS:
    328331            case self::ITEM_SCAN_RESULT_REPAIR_MODIFIED_FILES:
     332            case self::ITEM_SCAN_RESULT_MODIFIED_PLUGIN:
     333            case self::ITEM_SCAN_RESULT_MODIFIED_THEME:
    329334
    330335            case self::ITEM_TOOLS_TWO_FACTOR:
     
    338343            case self::ITEM_DIAGNOSTICS_TEST_EMAIL:
    339344            case self::ITEM_DIAGNOSTICS_TEST_ACTIVITY_REPORT:
     345            case self::ITEM_DIAGNOSTICS_REMOVE_CENTRAL_DATA:
    340346            case self::ITEM_DIAGNOSTICS_OPTION_DEBUGGING_MODE:
    341347            case self::ITEM_DIAGNOSTICS_OPTION_REMOTE_SCANS:
  • wordfence/trunk/lib/wordfenceClass.php

    r2353220 r2370481  
    322322        wfConfig::remove('lastPermissionsTemplateCheck');
    323323    }
    324     public static function _scheduleRefreshUpdateNotification($upgrader, $options) {
     324    public static function _scheduleRefreshUpdateNotification($upgrader = null, $options = null) {
    325325        $defer = false;
    326326        if (is_array($options) && isset($options['type']) && $options['type'] == 'core') {
     
    12851285        add_action('upgrader_process_complete', 'wfUpdateCheck::syncAllVersionInfo');
    12861286        add_action('upgrader_process_complete', 'wordfence::_scheduleRefreshUpdateNotification', 99, 2);
     1287        add_action('automatic_updates_complete', 'wordfence::_scheduleRefreshUpdateNotification', 99, 0);
    12871288        add_action('wordfence_refreshUpdateNotification', 'wordfence::_refreshUpdateNotification', 99, 0);
    12881289        add_action('wordfence_completeCoreUpdateNotification', 'wordfence::_completeCoreUpdateNotification', 99, 0);
  • wordfence/trunk/lib/wordfenceHash.php

    r2290265 r2370481  
    432432       
    433433        $realPath = realpath($path);
     434        if ($realPath === '/') {
     435            return false;
     436        }
    434437        if (isset($this->foldersProcessed[$realPath])) {
    435438            return false;
     
    526529                                    'modifiedplugin' . $file . $md5,
    527530                                    'Modified plugin file: ' . $file,
    528                                     "This file belongs to plugin \"$itemName\" version \"$itemVersion\" and has been modified from the file that is distributed by WordPress.org for this version. Please use the link to see how the file has changed. If you have modified this file yourself, you can safely ignore this warning. If you see a lot of changed files in a plugin that have been made by the author, then try uninstalling and reinstalling the plugin to force an upgrade. Doing this is a workaround for plugin authors who don't manage their code correctly. [See our FAQ on www.wordfence.com for more info]",
     531                                    sprintf(__("This file belongs to plugin \"$itemName\" version \"$itemVersion\" and has been modified from the file that is distributed by WordPress.org for this version. Please use the link to see how the file has changed. If you have modified this file yourself, you can safely ignore this warning. If you see a lot of changed files in a plugin that have been made by the author, then try uninstalling and reinstalling the plugin to force an upgrade. Doing this is a workaround for plugin authors who don't manage their code correctly. <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Learn More</a>", 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_SCAN_RESULT_MODIFIED_PLUGIN)),
    529532                                    array(
    530533                                        'file' => $file,
     
    566569                                    'modifiedtheme' . $file . $md5,
    567570                                    'Modified theme file: ' . $file,
    568                                     "This file belongs to theme \"$itemName\" version \"$itemVersion\" and has been modified from the original distribution. It is common for site owners to modify their theme files, so if you have modified this file yourself you can safely ignore this warning.",
     571                                    sprintf(__("This file belongs to theme \"$itemName\" version \"$itemVersion\" and has been modified from the original distribution. It is common for site owners to modify their theme files, so if you have modified this file yourself you can safely ignore this warning. <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">Learn More</a>", 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_SCAN_RESULT_MODIFIED_THEME)),
    569572                                    array(
    570573                                        'file' => $file,
  • wordfence/trunk/modules/login-security/wordfence-login-security.php

    r2353220 r2370481  
    2828   
    2929    define('WORDFENCE_LS_VERSION', '1.0.5');
    30     define('WORDFENCE_LS_BUILD_NUMBER', '1596638737');
     30    define('WORDFENCE_LS_BUILD_NUMBER', '1598542714');
    3131   
    3232    if (!defined('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES')) { define('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES', 15); }
  • wordfence/trunk/readme.txt

    r2353222 r2370481  
    183183
    184184== Changelog ==
     185
     186= 7.4.11 - August 27, 2020 =
     187
     188* Improvement: Added diagnostic debug button to clear Wordfence Central connection data from the database.
     189* Improvement: Added help documentation links to modified plugin/theme file scan results.
     190* Fix: Prevent file system scan from following symlinks to root.
     191* Fix: Cleared pending plugin/theme update scan results and notification when a plugin/theme is auto-updated.
     192* Fix: Added check for when site is disconnected on Central's end, but not in the plugin.
    185193
    186194= 7.4.10 - August 5, 2020 =
  • wordfence/trunk/wordfence.php

    r2353220 r2370481  
    55Description: Wordfence Security - Anti-virus, Firewall and Malware Scan
    66Author: Wordfence
    7 Version: 7.4.10
     7Version: 7.4.11
    88Author URI: http://www.wordfence.com/
    99Network: true
     
    1616    exit;
    1717}
    18 define('WORDFENCE_VERSION', '7.4.10');
    19 define('WORDFENCE_BUILD_NUMBER', '1596638737');
     18define('WORDFENCE_VERSION', '7.4.11');
     19define('WORDFENCE_BUILD_NUMBER', '1598542714');
    2020define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) :
    2121    basename(dirname(__FILE__)) . '/' . basename(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.