Plugin Directory

Changeset 1177050


Ignore:
Timestamp:
06/08/2015 09:23:58 PM (11 years ago)
Author:
mmaunder
Message:
  • Improvement: Handled uncaught exception when noc1 is not available in 2FA.
  • Improvement: Fixed issue with limit-logins mu-plugin on GoDaddy counting first login attempt in 2FA against total allowed login attempts.
  • Fix: Fixed bug with IPs not resolving to countries when printable IP passed to logBlockedIP.
  • Fix: Fixed issue with free users country blocking redirects working after downgrade.
  • Fix: Encoded URL field in country blocking options.
  • Fix: Added a check to verify field has not already been altered prior to calling ALTER in runInstall.
  • Fix: Fixed issue with scan_options method being called after method has been removed.
  • Fix: Fixed bug in scan when dns_get_record fails and error condition was not handled.
  • Fix: Fixed PHP notice when 'Crawler' not included in browser pcap result.
Location:
wordfence
Files:
33 edited
19 copied

Legend:

Unmodified
Added
Removed
  • wordfence/tags/6.0.6/js/admin.js

    r1172235 r1177050  
    16851685            },
    16861686            invalidCountryURLMsg: function(URL) {
    1687                 this.colorbox('400px', "Invalid URL", "URL's that you provide for bypassing country blocking must start with '/' or 'http://' without quotes. The URL that is invalid is: " + URL);
     1687                this.colorbox('400px', "Invalid URL", "URL's that you provide for bypassing country blocking must start with '/' or 'http://' without quotes. The URL that is invalid is: " + this.htmlEscape(URL));
    16881688                return;
    16891689            },
     
    20332033                // Older versions of Opera
    20342034                return this._windowHasFocus;
     2035            },
     2036
     2037            htmlEscape: function(html) {
     2038                return String(html)
     2039                    .replace(/&/g, '&')
     2040                    .replace(/"/g, '"')
     2041                    .replace(/'/g, ''')
     2042                    .replace(/</g, '&lt;')
     2043                    .replace(/>/g, '&gt;');
    20352044            }
    20362045        };
  • wordfence/tags/6.0.6/lib/email_genericAlert.php

    r1076331 r1177050  
    1717
    1818Click here to sign-up for the Premium version of Wordfence now.
    19 https://www.wordfence.com/wordfence-signup/
     19https://www.wordfence.com/zz1/wordfence-signup/
    2020
    2121<?php } ?>
  • wordfence/tags/6.0.6/lib/email_newIssues.php

    r1070802 r1177050  
    3636
    3737<p>Click here to sign-up for the Premium version of Wordfence now.<br>
    38 <a href="https://www.wordfence.com/wordfence-signup/">https://www.wordfence.com/wordfence-signup/</a></p>
     38<a href="https://www.wordfence.com/zz2/wordfence-signup/">https://www.wordfence.com/zz2/wordfence-signup/</a></p>
    3939
    4040<?php } ?>
  • wordfence/tags/6.0.6/lib/email_passwdChanged.php

    r1128972 r1177050  
    2121Thank you.
    2222
    23 Email generated by Wordfence. Learn more at http://www.wordfence.com/
     23Email generated by Wordfence. Learn more at http://www.wordfence.com/zz3/
  • wordfence/tags/6.0.6/lib/email_pleaseChangePasswd.php

    r1128972 r1177050  
    2121Thank you.
    2222
    23 Email generated by Wordfence. Learn more at http://www.wordfence.com/
     23Email generated by Wordfence. Learn more at http://www.wordfence.com/zz4/
  • wordfence/tags/6.0.6/lib/menu_countryBlocking.php

    r1128972 r1177050  
    1313            <strong>Country Blocking is only available to Premium Members at this time</strong><br /><br />
    1414            Country Blocking is a premium feature because we have licensed a very accurate commercial geolocation database to provide this feature. If you would like to
    15             activate this feature, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can <a href="http://docs.wordfence.com/en/Country_blocking" target="_blank">learn more about Country Blocking on our documentation website</a>.
     15            activate this feature, simply <a href="https://www.wordfence.com/gnl1countryBlock1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can <a href="http://docs.wordfence.com/en/Country_blocking" target="_blank">learn more about Country Blocking on our documentation website</a>.
    1616        </div>
    1717<?php } ?>
     
    5353        <tr><th colspan="2">
    5454            If user who is allowed to access the site views the URL
    55             <input type="text" id="wfBypassViewURL" value="<?php echo wp_kses(wfConfig::get('cbl_bypassViewURL', ""), array()); ?>" size="20" />
     55            <input type="text" id="wfBypassViewURL" value="<?php echo esc_attr(wfConfig::get('cbl_bypassViewURL', ""), array()); ?>" size="20" />
    5656            then set a cookie that will bypass country blocking in future in case that user hits the site from a blocked country.
    5757            </th></tr>
     
    114114?>
    115115    If you would like access to this premium feature, please
    116     <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
     116    <a href="https://www.wordfence.com/gnl1countryBlock2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
    117117</p>
    118118<?php
  • wordfence/tags/6.0.6/lib/menu_options.php

    r1172235 r1177050  
    3939                    <?php } else { ?>
    4040                    The currently active API Key is a <span style="color: #F00; font-weight: bold;">Free Key</span>. <a
    41                             href="https://www.wordfence.com/wordfence-signup/" target="_blank">Click Here to Upgrade to
     41                            href="https://www.wordfence.com/gnl1optAPIKey1/wordfence-signup/" target="_blank">Click Here to Upgrade to
    4242                            Wordfence Premium now.</a>
    4343                        <?php } ?>
     
    4949                        <table border="0">
    5050                            <tr>
    51                                 <td><a href="https://www.wordfence.com/manage-wordfence-api-keys/"
     51                                <td><a href="https://www.wordfence.com/gnl1optMngKys/manage-wordfence-api-keys/"
    5252                                       target="_blank"><input type="button" value="Renew your premium license"/></a>
    5353                                </td>
     
    412412                                href="http://docs.wordfence.com/en/Wordfence_options#Scan_public_facing_site"
    413413                                target="_blank" class="wfhelp"></a>(<a
    414                                 href="https://www.wordfence.com/wordfence-signup/" target="_blank">Paid members only</a>)
     414                                href="https://www.wordfence.com/gnl1optPdOnly1/wordfence-signup/" target="_blank">Paid members only</a>)
    415415                        </th>
    416416                        <td><input type="checkbox" id="scansEnabled_public" class="wfConfigElem"
     
    10751075            If you use the free edition of Wordfence, you don't need to worry about entering an API key in the "API Key"
    10761076            field above. One is automatically created for you. If you choose to <a
    1077                 href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to Wordfence Premium
     1077                href="https://www.wordfence.com/gnl1optUpg1/wordfence-signup/" target="_blank">upgrade to Wordfence Premium
    10781078                edition</a>, you will receive an API key. You will need to copy and paste that key into the "API Key"
    10791079            field above and hit "Save" to activate your key.
  • wordfence/tags/6.0.6/lib/menu_passwd.php

    r1128972 r1177050  
    1313            We then provide a way to change weak passwords or alert members that they need to improve their password strength.
    1414            To activate this feature, simply
    15             <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can
     15            <a href="https://www.wordfence.com/gnl1pwAuditUp1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can
    1616            <a href="http://docs.wordfence.com/en/Wordfence_Password_Auditing" target="_blank">learn more about Password Auditing on our Documentation Website</a>.
    1717        </div>
     
    178178        ?>
    179179        If you would like access to this premium feature, please
    180         <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
     180        <a href="https://www.wordfence.com/gnl1pwAuditUp2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
    181181    </p>
    182182    <?php
  • wordfence/tags/6.0.6/lib/menu_scan.php

    r1164420 r1177050  
    1313                <td>
    1414                    <div style="border: 1px solid #CCC; padding: 4px;">
    15                         <a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank" class="wfhelp"></a><a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank">Read our scanning documentation</a>. You can also <a href="#" onclick="WFAD.startTourAgain(); return false;">start the tour again</a>, <a href="http://www.wordfence.com/subscribe-to-the-wordfence-email-list/" target="_blank">subscribe to get WordPress Security Alerts and Product News</a> or <a target="_blank" href="http://support.wordfence.com/">visit our support website help.</a> Love Wordfence? You can help by doing two simple things: <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">Go to WordPress.org now and give this plugin a 5&#9733; rating</a>. Blog about Wordfence and link to the <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">plugin page</a> or <a href="http://www.wordfence.com/" target="_blank">www.wordfence.com</a>. Spreading the word helps us keep the best features free.
     15                        <a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank" class="wfhelp"></a><a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank">Read our scanning documentation</a>. You can also <a href="#" onclick="WFAD.startTourAgain(); return false;">start the tour again</a>, <a href="http://www.wordfence.com/gnl1listSubscr/subscribe-to-the-wordfence-email-list/" target="_blank">subscribe to get WordPress Security Alerts and Product News</a> or <a target="_blank" href="http://support.wordfence.com/">visit our support website help.</a> Love Wordfence? You can help by doing two simple things: <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">Go to WordPress.org now and give this plugin a 5&#9733; rating</a>. Blog about Wordfence and link to the <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">plugin page</a> or <a href="http://www.wordfence.com/gnl1scanTopHome/" target="_blank">www.wordfence.com</a>. Spreading the word helps us keep the best features free.
    1616                    </div>
    1717                </td>
     
    4040            <?php } else { ?>
    4141            <div style="margin: 0 0 20px 5px; width: 795px;">
    42                 <strong style="color: #F00;">How to upgrade:</strong> If you would like access to our <a href="http://support.wordfence.com/" target="_blank">Premium Support help system</a> and features like Cellphone Sign-in, Country Blocking, external site scanning and the ability to schedule scans, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">visit our Wordfence Premium sign-up page</a> and sign up for a Premium Wordfence API key. Then go to the Wordfence options page on this site and replace your free API key with your new premium key. You will immediately be upgraded to Wordfence Premium with all the features it includes and you will have instant access to our ticketing system on <a href="http://support.wordfence.com/" target="_blank">support.wordfence.com</a>.
     42                <strong style="color: #F00;">How to upgrade:</strong> If you would like access to our <a href="http://support.wordfence.com/" target="_blank">Premium Support help system</a> and features like Cellphone Sign-in, Country Blocking, external site scanning and the ability to schedule scans, simply <a href="https://www.wordfence.com/gnl1scanUpgrade/wordfence-signup/" target="_blank">visit our Wordfence Premium sign-up page</a> and sign up for a Premium Wordfence API key. Then go to the Wordfence options page on this site and replace your free API key with your new premium key. You will immediately be upgraded to Wordfence Premium with all the features it includes and you will have instant access to our ticketing system on <a href="http://support.wordfence.com/" target="_blank">support.wordfence.com</a>.
    4343            </div>
    4444
  • wordfence/tags/6.0.6/lib/menu_scanSchedule.php

    r1023626 r1177050  
    77                <strong>Scan Scheduling is only available to Premium Members at this time</strong><br /><br />
    88                Scan Scheduling is a premium feature because it places additional load on our scanning servers. If you would like to
    9                 activate this feature, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options
     9                activate this feature, simply <a href="https://www.wordfence.com/gnl1scanSched1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options
    1010                page.
    1111            </div>
     
    9393?>
    9494    If you would like access to this premium feature, please
    95     <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our Premium version</a>.
     95    <a href="https://www.wordfence.com/gnl1scanSched2/wordfence-signup/" target="_blank">upgrade to our Premium version</a>.
    9696</p>
    9797<?php
  • wordfence/tags/6.0.6/lib/menu_twoFactor.php

    r1023626 r1177050  
    77                <strong>Cellphone Sign-in is only available to Premium Members at this time</strong><br /><br />
    88                Cellphone Sign-in is a premium feature because we are charged per SMS we send when a user signs in. If you would like to
    9                 activate this feature, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page.
     9                activate this feature, simply <a href="https://www.wordfence.com/gnl1twoFac1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page.
    1010                <br /><br />
    1111                Wordfence's Cellphone Sign-in uses a technique called "Two Factor Authentication" which is used by banks, government agencies and military world-wide as one of the most secure forms of remote system authentication. It's now available from Wordfence for your WordPress website. We recommend you enable Cellphone Sign-in for all Administrator level accounts. You can <a href="http://docs.wordfence.com/en/Cellphone_sign-in" target="_blank">learn more about Cellphone Sign-in on our documentation website</a>.
     
    7979?>
    8080    If you would like access to this premium feature, please
    81     <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
     81    <a href="https://www.wordfence.com/gnl1twoFac2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
    8282<?php
    8383}
  • wordfence/tags/6.0.6/lib/wfActivityReport.php

    r1164420 r1177050  
    346346        global $wpdb;
    347347
    348         $is_bin_ip = !wfUtils::isValidIP($ip_address);
    349         if (!$is_bin_ip) {
    350             $ip_address = wfUtils::inet_pton($ip_address);
     348        if (wfUtils::isValidIP($ip_address)) {
     349            $ip_bin = wfUtils::inet_pton($ip_address);
     350        } else {
     351            $ip_bin = $ip_address;
     352            $ip_address = wfUtils::inet_ntop($ip_bin);
    351353        }
    352354
     
    358360        }
    359361
    360         $country = wfUtils::IP2Country($is_bin_ip ? wfUtils::inet_ntop($ip_address) : $ip_address);
     362        $country = wfUtils::IP2Country($ip_address);
    361363
    362364        $wpdb->query($wpdb->prepare(<<<SQL
     
    365367ON DUPLICATE KEY UPDATE blockCount = blockCount + 1
    366368SQL
    367             , $ip_address, $country));
     369            , $ip_bin, $country));
    368370    }
    369371
  • wordfence/tags/6.0.6/lib/wfLog.php

    r1172235 r1177050  
    791791        //End range/UA blocking
    792792
    793         $blockedCountries = wfConfig::get('cbl_countries', false);
    794         $bareRequestURI = wfUtils::extractBareURI($_SERVER['REQUEST_URI']);
    795         $bareBypassRedirURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassRedirURL', ''));
    796         $skipCountryBlocking = false;
    797 
    798         if($bareBypassRedirURI && $bareRequestURI == $bareBypassRedirURI){ //Run this before country blocking because even if the user isn't blocked we need to set the bypass cookie so they can bypass future blocks.
    799             $bypassRedirDest = wfConfig::get('cbl_bypassRedirDest', '');
    800             if($bypassRedirDest){
     793        // Country blocking
     794        if (wfConfig::get('isPaid')) {
     795            $blockedCountries = wfConfig::get('cbl_countries', false);
     796            $bareRequestURI = wfUtils::extractBareURI($_SERVER['REQUEST_URI']);
     797            $bareBypassRedirURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassRedirURL', ''));
     798            $skipCountryBlocking = false;
     799
     800            if($bareBypassRedirURI && $bareRequestURI == $bareBypassRedirURI){ //Run this before country blocking because even if the user isn't blocked we need to set the bypass cookie so they can bypass future blocks.
     801                $bypassRedirDest = wfConfig::get('cbl_bypassRedirDest', '');
     802                if($bypassRedirDest){
     803                    self::setCBLCookieBypass();
     804                    $this->redirect($bypassRedirDest); //exits
     805                }
     806            }
     807            $bareBypassViewURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassViewURL', ''));
     808            if($bareBypassViewURI && $bareBypassViewURI == $bareRequestURI){
    801809                self::setCBLCookieBypass();
    802                 $this->redirect($bypassRedirDest); //exits
    803             }
    804         }
    805         $bareBypassViewURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassViewURL', ''));
    806         if($bareBypassViewURI && $bareBypassViewURI == $bareRequestURI){
    807             self::setCBLCookieBypass();
    808             $skipCountryBlocking = true;
    809         }
    810            
    811         if((! $skipCountryBlocking) && $blockedCountries && wfConfig::get('isPaid') && (! self::isCBLBypassCookieSet()) ){
    812             if(is_user_logged_in() && (! wfConfig::get('cbl_loggedInBlocked', false)) ){ //User is logged in and we're allowing logins
    813                 //Do nothing
    814             } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') !== false && (! wfConfig::get('cbl_loginFormBlocked', false))  ){ //It's the login form and we're allowing that
    815                 //Do nothing
    816             } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') === false && (! wfConfig::get('cbl_restOfSiteBlocked', false))  ){ //It's the rest of the site and we're allowing that
    817                 //Do nothing
    818             } else {
    819                 if($country = wfUtils::IP2Country($IP) ){
    820                     foreach(explode(',', $blockedCountries) as $blocked){
    821                         if(strtoupper($blocked) == strtoupper($country)){ //At this point we know the user has been blocked
    822                             if(wfConfig::get('cbl_action') == 'redir'){
    823                                 $redirURL = wfConfig::get('cbl_redirURL');
    824                                 $eRedirHost = wfUtils::extractHostname($redirURL);
    825                                 $isExternalRedir = false;
    826                                 if($eRedirHost && $eRedirHost != wfUtils::extractHostname(home_url())){ //It's an external redirect...
    827                                     $isExternalRedir = true;
     810                $skipCountryBlocking = true;
     811            }
     812
     813            if((! $skipCountryBlocking) && $blockedCountries && (! self::isCBLBypassCookieSet()) ){
     814                if(is_user_logged_in() && (! wfConfig::get('cbl_loggedInBlocked', false)) ){ //User is logged in and we're allowing logins
     815                    //Do nothing
     816                } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') !== false && (! wfConfig::get('cbl_loginFormBlocked', false))  ){ //It's the login form and we're allowing that
     817                    //Do nothing
     818                } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') === false && (! wfConfig::get('cbl_restOfSiteBlocked', false))  ){ //It's the rest of the site and we're allowing that
     819                    //Do nothing
     820                } else {
     821                    if($country = wfUtils::IP2Country($IP) ){
     822                        foreach(explode(',', $blockedCountries) as $blocked){
     823                            if(strtoupper($blocked) == strtoupper($country)){ //At this point we know the user has been blocked
     824                                if(wfConfig::get('cbl_action') == 'redir'){
     825                                    $redirURL = wfConfig::get('cbl_redirURL');
     826                                    $eRedirHost = wfUtils::extractHostname($redirURL);
     827                                    $isExternalRedir = false;
     828                                    if($eRedirHost && $eRedirHost != wfUtils::extractHostname(home_url())){ //It's an external redirect...
     829                                        $isExternalRedir = true;
     830                                    }
     831                                    if( (! $isExternalRedir) && wfUtils::extractBareURI($redirURL) == $bareRequestURI){ //Is this the URI we want to redirect to, then don't block it
     832                                        //Do nothing
     833                                        /* Uncomment the following if page components aren't loading for the page we redirect to.
     834                                           Uncommenting is not recommended because it means that anyone from a blocked country
     835                                           can crawl your site by sending the page blocked users are redirected to as the referer for every request.
     836                                           But it's your call.
     837                                        } else if(wfUtils::extractBareURI($_SERVER['HTTP_REFERER']) == $redirURL){ //If the referer the page we want to redirect to? Then this might be loading as a component so don't block.
     838                                            //Do nothing
     839                                        */
     840                                    } else {
     841                                        $this->redirect(wfConfig::get('cbl_redirURL'));
     842                                    }
     843                                } else {
     844                                    $this->do503(3600, "Access from your area has been temporarily limited for security reasons");
     845                                    wfConfig::inc('totalCountryBlocked');
    828846                                }
    829                                 if( (! $isExternalRedir) && wfUtils::extractBareURI($redirURL) == $bareRequestURI){ //Is this the URI we want to redirect to, then don't block it
    830                                     //Do nothing
    831                                 /* Uncomment the following if page components aren't loading for the page we redirect to.
    832                                    Uncommenting is not recommended because it means that anyone from a blocked country
    833                                    can crawl your site by sending the page blocked users are redirected to as the referer for every request.
    834                                    But it's your call.
    835                                 } else if(wfUtils::extractBareURI($_SERVER['HTTP_REFERER']) == $redirURL){ //If the referer the page we want to redirect to? Then this might be loading as a component so don't block.
    836                                     //Do nothing   
    837                                 */
    838                                 } else {
    839                                     $this->redirect(wfConfig::get('cbl_redirURL'));
    840                                 }
    841                             } else {
    842                                 $this->do503(3600, "Access from your area has been temporarily limited for security reasons");
    843                                 wfConfig::inc('totalCountryBlocked');
    844847                            }
    845848                        }
  • wordfence/tags/6.0.6/lib/wfScanEngine.php

    r1172235 r1177050  
    6868        $this->jobList[] = 'knownFiles_main';
    6969        $this->jobList[] = 'knownFiles_finish';
    70         foreach(array('knownFiles', 'fileContents', 'database', 'posts', 'comments', 'passwds', 'dns', 'diskSpace', 'oldVersions') as $scanType){
    71             if(wfConfig::get('scansEnabled_' . $scanType)){
    72                 if(method_exists($this, 'scan_' . $scanType . '_init')){
    73                     foreach(array('init', 'main', 'finish') as $op){ $this->jobList[] = $scanType . '_' . $op; };
    74                 } else {
     70        foreach (array('knownFiles', 'fileContents', 'database', 'posts', 'comments', 'passwds', 'dns', 'diskSpace', 'oldVersions') as $scanType) {
     71            if (wfConfig::get('scansEnabled_' . $scanType)) {
     72                if (method_exists($this, 'scan_' . $scanType . '_init')) {
     73                    foreach (array('init', 'main', 'finish') as $op) {
     74                        $this->jobList[] = $scanType . '_' . $op;
     75                    };
     76                } else if (method_exists($this, 'scan_' . $scanType)) {
    7577                    $this->jobList[] = $scanType;
    7678                }
     
    124126            self::checkForKill();
    125127            $jobName = $this->jobList[0];
    126             call_user_func(array($this, 'scan_' . $jobName));
     128            $callback = array($this, 'scan_' . $jobName);
     129            if (is_callable($callback)) {
     130                call_user_func($callback);
     131            }
    127132            array_shift($this->jobList); //only shift once we're done because we may pause halfway through a job and need to pick up where we left off
    128133            self::checkForKill();
     
    812817            $this->status(2, 'info', "Starting DNS scan for $host");
    813818
    814             $cnameArrRec = dns_get_record($host, DNS_CNAME);
     819            $cnameArrRec = @dns_get_record($host, DNS_CNAME);
    815820            $cnameArr = array();
    816821            $cnamesWeMustTrack = array();
    817             foreach($cnameArrRec as $elem){
    818                 $this->status(2, 'info', "Scanning CNAME DNS record for " . $elem['host']);
    819                 if($elem['host'] == $host){
    820                     $cnameArr[] = $elem;
    821                     $cnamesWeMustTrack[] = $elem['target'];
    822                 }
    823             }
     822            if ($cnameArrRec) {
     823                foreach($cnameArrRec as $elem){
     824                    $this->status(2, 'info', "Scanning CNAME DNS record for " . $elem['host']);
     825                    if($elem['host'] == $host){
     826                        $cnameArr[] = $elem;
     827                        $cnamesWeMustTrack[] = $elem['target'];
     828                    }
     829                }
     830            }
     831
    824832            function wfAnonFunc1($a){ return $a['host'] . ' points to ' . $a['target']; }
    825833            $cnameArr = array_map('wfAnonFunc1', $cnameArr);
  • wordfence/tags/6.0.6/lib/wordfenceClass.php

    r1172257 r1177050  
    329329        $db->queryWriteIgnoreError("drop table if exists $prefix"."wfFileQueue");
    330330        $db->queryWriteIgnoreError("drop table if exists $prefix"."wfFileChanges");
    331         //Adding primary key to this table because some backup apps use primary key during backup.
    332         $db->queryWriteIgnoreError("alter table {$prefix}wfStatus add id bigint UNSIGNED NOT NULL auto_increment PRIMARY KEY");
     331
     332        $result = $wpdb->get_row("SHOW FIELDS FROM {$prefix}wfStatus where field = 'id'");
     333        if (!$result || strtolower($result->Key) != 'pri') {
     334            //Adding primary key to this table because some backup apps use primary key during backup.
     335            $db->queryWriteIgnoreError("alter table {$prefix}wfStatus add id bigint UNSIGNED NOT NULL auto_increment PRIMARY KEY");
     336        }
    333337
    334338        $optScanEnabled = $db->querySingle("select val from $prefix"."wfConfig where name='scansEnabled_options'");
     
    388392        }
    389393
     394        // Fix the data in the country column.
     395        // TODO: add version check so this doesn't run on every update.
     396        $ip_results = $wpdb->get_results("SELECT * FROM `{$prefix}wfBlockedIPLog` GROUP BY IP");
     397        if ($ip_results) {
     398            foreach ($ip_results as $ip_row) {
     399                $wpdb->query($wpdb->prepare("UPDATE `{$prefix}wfBlockedIPLog` SET countryCode = %s WHERE IP = %s", wfUtils::IP2Country(wfUtils::inet_ntop($ip_row->IP)), $ip_row->IP));
     400            }
     401        }
     402
    390403        //Must be the final line
    391404    }
     
    505518
    506519        // Change GoDaddy's limit login mu-plugin since it can interfere with the two factor auth message.
    507         if (defined('GD_SYSTEM_PLUGIN_DIR') && file_exists(GD_SYSTEM_PLUGIN_DIR . 'limit-login-attempts/limit-login-attempts.php')
    508             && defined('LIMIT_LOGIN_DIRECT_ADDR')) {
     520        if (self::hasGDLimitLoginsMUPlugin()) {
    509521            add_action('login_errors', array('wordfence', 'fixGDLimitLoginsErrors'), 11);
    510522        }
     
    585597        if($UA){
    586598            $b = $browscap->getBrowser($UA);
    587             if($b['Crawler']){
     599            if(!empty($b['Crawler'])){
    588600                $isCrawler = true;
    589601            }
     
    879891                                } else if($_POST['wordfence_authFactor'] == $t[2]){
    880892                                    $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
    881                                     $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
    882                                     if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
    883                                         break; //Let them sign in without two factor
    884                                     }
    885                                     if(isset($codeResult['ok']) && $codeResult['ok']){
    886                                         $t[2] = $codeResult['code'];
    887                                         $t[4] = time() + 1800; //30 minutes until code expires
    888                                         wfConfig::set_ser('twoFactorUsers', $twoFactorUsers); //save the code the user needs to enter and return an error.
    889                                         self::$authError = new WP_Error('twofactor_required', __('<strong>CODE EXPIRED. CHECK YOUR PHONE:</strong> The code you entered has expired. Codes are only valid for 30 minutes for security reasons. We have sent you a new code. Please sign in using your username and your password followed by a space and the new code we sent you.'));
    890                                         return self::$authError;
    891                                     } else {
    892                                         break; //No new code was received. Let them sign in with the expired code.
     893                                    try {
     894                                        $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
     895
     896                                        if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
     897                                            break; //Let them sign in without two factor
     898                                        }
     899                                        if(isset($codeResult['ok']) && $codeResult['ok']){
     900                                            $t[2] = $codeResult['code'];
     901                                            $t[4] = time() + 1800; //30 minutes until code expires
     902                                            wfConfig::set_ser('twoFactorUsers', $twoFactorUsers); //save the code the user needs to enter and return an error.
     903                                            self::$authError = new WP_Error('twofactor_required', __('<strong>CODE EXPIRED. CHECK YOUR PHONE:</strong> The code you entered has expired. Codes are only valid for 30 minutes for security reasons. We have sent you a new code. Please sign in using your username and your password followed by a space and the new code we sent you.'));
     904                                            return self::$authError;
     905                                        } else {
     906                                            break; //No new code was received. Let them sign in with the expired code.
     907                                        }
     908
     909                                    } catch (Exception $e) {
     910                                        // Couldn't connect to noc1, let them sign in since the password was correct.
     911                                        break;
    893912                                    }
    894913                                } else { //Bad code, so cancel the login and return an error to user.
     
    902921                            if($t[0] == $userDat->ID && $t[3] == 'activated'){ //Yup, enabled, so lets send the code
    903922                                $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
    904                                 $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
    905                                 if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
    906                                     break; //Let them sign in without two factor if their API key has expired or they're not paid and for some reason they have this set up.
     923                                try {
     924                                    $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
     925                                    if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
     926                                        break; //Let them sign in without two factor if their API key has expired or they're not paid and for some reason they have this set up.
     927                                    }
     928                                } catch (Exception $e) {
     929                                    // Couldn't connect to noc1, let them sign in since the password was correct.
     930                                    break;
    907931                                }
    908 
    909932                                if(isset($codeResult['ok']) && $codeResult['ok']){
    910933                                    $t[2] = $codeResult['code'];
    911934                                    $t[4] = time() + 1800; //30 minutes until code expires
    912935                                    wfConfig::set_ser('twoFactorUsers', $twoFactorUsers); //save the code the user needs to enter and return an error.
     936
     937                                    if (self::hasGDLimitLoginsMUPlugin() && function_exists('limit_login_get_address')) {
     938                                        $retries = get_option('limit_login_retries', array());
     939                                        $ip = limit_login_get_address();
     940
     941                                        if (!is_array($retries)) {
     942                                            $retries = array();
     943                                        }
     944                                        if (isset($retries[$ip]) && is_int($retries[$ip])) {
     945                                            $retries[$ip]--;
     946                                        } else {
     947                                            $retries[$ip] = 0;
     948                                        }
     949                                        update_option('limit_login_retries', $retries);
     950                                    }
     951
    913952                                    self::$authError = new WP_Error( 'twofactor_required', __( '<strong>CHECK YOUR PHONE</strong>: A code has been sent to your phone and will arrive within 30 seconds. Please sign in again and add a space and the code to the end of your password.' ) );
    914953                                    return self::$authError;
     
    32833322    }
    32843323
     3324    /**
     3325     * @return bool
     3326     */
     3327    public static function hasGDLimitLoginsMUPlugin() {
     3328        return defined('GD_SYSTEM_PLUGIN_DIR') && file_exists(GD_SYSTEM_PLUGIN_DIR . 'limit-login-attempts/limit-login-attempts.php')
     3329            && defined('LIMIT_LOGIN_DIRECT_ADDR');
     3330    }
     3331
     3332    /**
     3333     * @param string $content
     3334     * @return string
     3335     */
    32853336    public static function fixGDLimitLoginsErrors($content) {
    32863337        if (self::$authError) {
  • wordfence/tags/6.0.6/readme.txt

    r1172257 r1177050  
    44Requires at least: 3.9
    55Tested up to: 4.2.2
    6 Stable tag: 6.0.5
     6Stable tag: 6.0.6
    77
    88Wordfence Security is a free enterprise class security and performance plugin that makes your site up to 50 times faster and more secure.
     
    172172
    173173== Changelog ==
     174
     175= 6.0.6 =
     176* Improvement: Handled uncaught exception when noc1 is not available in 2FA.
     177* Improvement: Fixed issue with limit-logins mu-plugin on GoDaddy counting first login attempt in 2FA against total allowed login attempts.
     178* Fix: Fixed bug with IPs not resolving to countries when printable IP passed to logBlockedIP.
     179* Fix: Fixed issue with free users country blocking redirects working after downgrade.
     180* Fix: Encoded URL field in country blocking options.
     181* Fix: Added a check to verify field has not already been altered prior to calling ALTER in runInstall.
     182* Fix: Fixed issue with scan_options method being called after method has been removed.
     183* Fix: Fixed bug in scan when dns_get_record fails and error condition was not handled.
     184* Fix: Fixed PHP notice when 'Crawler' not included in browser pcap result.
    174185
    175186= 6.0.5 =
  • wordfence/tags/6.0.6/views/reports/activity-report-email-inline.php

    r1164420 r1177050  
    120120                    <?php echo $title ?>
    121121                </div>
    122                 <a href="http://www.wordfence.com/" style="font-size: 100%; vertical-align: baseline; outline: none; color: orange; text-decoration: none; margin: 0; padding: 0; border: 0;"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt="" style="font-size: 100%; vertical-align: baseline; -ms-interpolation-mode: bicubic; outline: none; text-decoration: none; margin: 0; padding: 0; border: 0 none;" /></a>
    123 
    124                 <p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
    125                     This email was sent from your website <a href="<?php echo site_url() ?>"><?php echo site_url() ?></a> and is a summary of security related activity that Wordfence monitors for the period <?php printf('%s to %s', $report_start, $report_end) ?>. <?php if (!wfConfig::get('isPaid')): ?>NOTE: You are using the free version of Wordfence and are missing out on features like cellphone sign-in, country blocking and detecting if your site IP is sending spam. <a href="http://www.wordfence.com/?utm_source=plugin&utm_medium=UI&utm_campaign=summaryEmail">Click here to upgrade to Wordfence Premium now</a>.<?php endif ?>
     122                <a href="http://www.wordfence.com/zz5/" style="font-size: 100%; vertical-align: baseline; outline: none; color: orange; text-decoration: none; margin: 0; padding: 0; border: 0;"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt="" style="font-size: 100%; vertical-align: baseline; -ms-interpolation-mode: bicubic; outline: none; text-decoration: none; margin: 0; padding: 0; border: 0 none;" /></a>
     123
     124                <p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
     125                    This email was sent from your website <a href="<?php echo site_url() ?>"><?php echo site_url() ?></a> and is a summary of security related activity that Wordfence monitors for the period <?php printf('%s to %s', $report_start, $report_end) ?>. <?php if (!wfConfig::get('isPaid')): ?>NOTE: You are using the free version of Wordfence and are missing out on features like cellphone sign-in, country blocking and detecting if your site IP is sending spam. <a href="http://www.wordfence.com/zz6/">Click here to upgrade to Wordfence Premium now</a>.<?php endif ?>
    126126                </p>
    127127
  • wordfence/tags/6.0.6/views/reports/activity-report-email.php

    r1164420 r1177050  
    296296                    Activity for week of<br> <strong><?php echo date_i18n(get_option('date_format')) ?></strong>
    297297                </div>
    298                 <a href="http://www.wordfence.com/"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
     298                <a href="http://www.wordfence.com/zz7/"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
    299299
    300300                <h2>Top 10 IP's Blocked</h2>
  • wordfence/tags/6.0.6/views/reports/activity-report.php

    r1164420 r1177050  
    44 */
    55?>
    6 <a href="//www.wordfence.com/"><img src="//www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
     6<a href="//www.wordfence.com/zz8/"><img src="//www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
    77
    88<h2>Top <?php echo (int) $limit; ?> IP's Blocked</h2>
  • wordfence/tags/6.0.6/wordfence.php

    r1172257 r1177050  
    55Description: Wordfence Security - Anti-virus, Firewall and High Speed Cache
    66Author: Wordfence
    7 Version: 6.0.5
     7Version: 6.0.6
    88Author URI: http://www.wordfence.com/
    99*/
     
    1111    return;
    1212}
    13 define('WORDFENCE_VERSION', '6.0.5');
     13define('WORDFENCE_VERSION', '6.0.6');
    1414if(get_option('wordfenceActivated') != 1){
    1515    add_action('activated_plugin','wordfence_save_activation_error'); function wordfence_save_activation_error(){ update_option('wf_plugin_act_error',  ob_get_contents()); }
  • wordfence/trunk/js/admin.js

    r1172235 r1177050  
    16851685            },
    16861686            invalidCountryURLMsg: function(URL) {
    1687                 this.colorbox('400px', "Invalid URL", "URL's that you provide for bypassing country blocking must start with '/' or 'http://' without quotes. The URL that is invalid is: " + URL);
     1687                this.colorbox('400px', "Invalid URL", "URL's that you provide for bypassing country blocking must start with '/' or 'http://' without quotes. The URL that is invalid is: " + this.htmlEscape(URL));
    16881688                return;
    16891689            },
     
    20332033                // Older versions of Opera
    20342034                return this._windowHasFocus;
     2035            },
     2036
     2037            htmlEscape: function(html) {
     2038                return String(html)
     2039                    .replace(/&/g, '&amp;')
     2040                    .replace(/"/g, '&quot;')
     2041                    .replace(/'/g, '&#39;')
     2042                    .replace(/</g, '&lt;')
     2043                    .replace(/>/g, '&gt;');
    20352044            }
    20362045        };
  • wordfence/trunk/lib/email_genericAlert.php

    r1076331 r1177050  
    1717
    1818Click here to sign-up for the Premium version of Wordfence now.
    19 https://www.wordfence.com/wordfence-signup/
     19https://www.wordfence.com/zz1/wordfence-signup/
    2020
    2121<?php } ?>
  • wordfence/trunk/lib/email_newIssues.php

    r1070802 r1177050  
    3636
    3737<p>Click here to sign-up for the Premium version of Wordfence now.<br>
    38 <a href="https://www.wordfence.com/wordfence-signup/">https://www.wordfence.com/wordfence-signup/</a></p>
     38<a href="https://www.wordfence.com/zz2/wordfence-signup/">https://www.wordfence.com/zz2/wordfence-signup/</a></p>
    3939
    4040<?php } ?>
  • wordfence/trunk/lib/email_passwdChanged.php

    r1128972 r1177050  
    2121Thank you.
    2222
    23 Email generated by Wordfence. Learn more at http://www.wordfence.com/
     23Email generated by Wordfence. Learn more at http://www.wordfence.com/zz3/
  • wordfence/trunk/lib/email_pleaseChangePasswd.php

    r1128972 r1177050  
    2121Thank you.
    2222
    23 Email generated by Wordfence. Learn more at http://www.wordfence.com/
     23Email generated by Wordfence. Learn more at http://www.wordfence.com/zz4/
  • wordfence/trunk/lib/menu_countryBlocking.php

    r1128972 r1177050  
    1313            <strong>Country Blocking is only available to Premium Members at this time</strong><br /><br />
    1414            Country Blocking is a premium feature because we have licensed a very accurate commercial geolocation database to provide this feature. If you would like to
    15             activate this feature, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can <a href="http://docs.wordfence.com/en/Country_blocking" target="_blank">learn more about Country Blocking on our documentation website</a>.
     15            activate this feature, simply <a href="https://www.wordfence.com/gnl1countryBlock1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can <a href="http://docs.wordfence.com/en/Country_blocking" target="_blank">learn more about Country Blocking on our documentation website</a>.
    1616        </div>
    1717<?php } ?>
     
    5353        <tr><th colspan="2">
    5454            If user who is allowed to access the site views the URL
    55             <input type="text" id="wfBypassViewURL" value="<?php echo wp_kses(wfConfig::get('cbl_bypassViewURL', ""), array()); ?>" size="20" />
     55            <input type="text" id="wfBypassViewURL" value="<?php echo esc_attr(wfConfig::get('cbl_bypassViewURL', ""), array()); ?>" size="20" />
    5656            then set a cookie that will bypass country blocking in future in case that user hits the site from a blocked country.
    5757            </th></tr>
     
    114114?>
    115115    If you would like access to this premium feature, please
    116     <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
     116    <a href="https://www.wordfence.com/gnl1countryBlock2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
    117117</p>
    118118<?php
  • wordfence/trunk/lib/menu_options.php

    r1172235 r1177050  
    3939                    <?php } else { ?>
    4040                    The currently active API Key is a <span style="color: #F00; font-weight: bold;">Free Key</span>. <a
    41                             href="https://www.wordfence.com/wordfence-signup/" target="_blank">Click Here to Upgrade to
     41                            href="https://www.wordfence.com/gnl1optAPIKey1/wordfence-signup/" target="_blank">Click Here to Upgrade to
    4242                            Wordfence Premium now.</a>
    4343                        <?php } ?>
     
    4949                        <table border="0">
    5050                            <tr>
    51                                 <td><a href="https://www.wordfence.com/manage-wordfence-api-keys/"
     51                                <td><a href="https://www.wordfence.com/gnl1optMngKys/manage-wordfence-api-keys/"
    5252                                       target="_blank"><input type="button" value="Renew your premium license"/></a>
    5353                                </td>
     
    412412                                href="http://docs.wordfence.com/en/Wordfence_options#Scan_public_facing_site"
    413413                                target="_blank" class="wfhelp"></a>(<a
    414                                 href="https://www.wordfence.com/wordfence-signup/" target="_blank">Paid members only</a>)
     414                                href="https://www.wordfence.com/gnl1optPdOnly1/wordfence-signup/" target="_blank">Paid members only</a>)
    415415                        </th>
    416416                        <td><input type="checkbox" id="scansEnabled_public" class="wfConfigElem"
     
    10751075            If you use the free edition of Wordfence, you don't need to worry about entering an API key in the "API Key"
    10761076            field above. One is automatically created for you. If you choose to <a
    1077                 href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to Wordfence Premium
     1077                href="https://www.wordfence.com/gnl1optUpg1/wordfence-signup/" target="_blank">upgrade to Wordfence Premium
    10781078                edition</a>, you will receive an API key. You will need to copy and paste that key into the "API Key"
    10791079            field above and hit "Save" to activate your key.
  • wordfence/trunk/lib/menu_passwd.php

    r1128972 r1177050  
    1313            We then provide a way to change weak passwords or alert members that they need to improve their password strength.
    1414            To activate this feature, simply
    15             <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can
     15            <a href="https://www.wordfence.com/gnl1pwAuditUp1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page. You can
    1616            <a href="http://docs.wordfence.com/en/Wordfence_Password_Auditing" target="_blank">learn more about Password Auditing on our Documentation Website</a>.
    1717        </div>
     
    178178        ?>
    179179        If you would like access to this premium feature, please
    180         <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
     180        <a href="https://www.wordfence.com/gnl1pwAuditUp2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
    181181    </p>
    182182    <?php
  • wordfence/trunk/lib/menu_scan.php

    r1164420 r1177050  
    1313                <td>
    1414                    <div style="border: 1px solid #CCC; padding: 4px;">
    15                         <a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank" class="wfhelp"></a><a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank">Read our scanning documentation</a>. You can also <a href="#" onclick="WFAD.startTourAgain(); return false;">start the tour again</a>, <a href="http://www.wordfence.com/subscribe-to-the-wordfence-email-list/" target="_blank">subscribe to get WordPress Security Alerts and Product News</a> or <a target="_blank" href="http://support.wordfence.com/">visit our support website help.</a> Love Wordfence? You can help by doing two simple things: <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">Go to WordPress.org now and give this plugin a 5&#9733; rating</a>. Blog about Wordfence and link to the <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">plugin page</a> or <a href="http://www.wordfence.com/" target="_blank">www.wordfence.com</a>. Spreading the word helps us keep the best features free.
     15                        <a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank" class="wfhelp"></a><a href="http://docs.wordfence.com/en/Wordfence_scanning" target="_blank">Read our scanning documentation</a>. You can also <a href="#" onclick="WFAD.startTourAgain(); return false;">start the tour again</a>, <a href="http://www.wordfence.com/gnl1listSubscr/subscribe-to-the-wordfence-email-list/" target="_blank">subscribe to get WordPress Security Alerts and Product News</a> or <a target="_blank" href="http://support.wordfence.com/">visit our support website help.</a> Love Wordfence? You can help by doing two simple things: <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">Go to WordPress.org now and give this plugin a 5&#9733; rating</a>. Blog about Wordfence and link to the <a href="http://wordpress.org/extend/plugins/wordfence/" target="_blank">plugin page</a> or <a href="http://www.wordfence.com/gnl1scanTopHome/" target="_blank">www.wordfence.com</a>. Spreading the word helps us keep the best features free.
    1616                    </div>
    1717                </td>
     
    4040            <?php } else { ?>
    4141            <div style="margin: 0 0 20px 5px; width: 795px;">
    42                 <strong style="color: #F00;">How to upgrade:</strong> If you would like access to our <a href="http://support.wordfence.com/" target="_blank">Premium Support help system</a> and features like Cellphone Sign-in, Country Blocking, external site scanning and the ability to schedule scans, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">visit our Wordfence Premium sign-up page</a> and sign up for a Premium Wordfence API key. Then go to the Wordfence options page on this site and replace your free API key with your new premium key. You will immediately be upgraded to Wordfence Premium with all the features it includes and you will have instant access to our ticketing system on <a href="http://support.wordfence.com/" target="_blank">support.wordfence.com</a>.
     42                <strong style="color: #F00;">How to upgrade:</strong> If you would like access to our <a href="http://support.wordfence.com/" target="_blank">Premium Support help system</a> and features like Cellphone Sign-in, Country Blocking, external site scanning and the ability to schedule scans, simply <a href="https://www.wordfence.com/gnl1scanUpgrade/wordfence-signup/" target="_blank">visit our Wordfence Premium sign-up page</a> and sign up for a Premium Wordfence API key. Then go to the Wordfence options page on this site and replace your free API key with your new premium key. You will immediately be upgraded to Wordfence Premium with all the features it includes and you will have instant access to our ticketing system on <a href="http://support.wordfence.com/" target="_blank">support.wordfence.com</a>.
    4343            </div>
    4444
  • wordfence/trunk/lib/menu_scanSchedule.php

    r1023626 r1177050  
    77                <strong>Scan Scheduling is only available to Premium Members at this time</strong><br /><br />
    88                Scan Scheduling is a premium feature because it places additional load on our scanning servers. If you would like to
    9                 activate this feature, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options
     9                activate this feature, simply <a href="https://www.wordfence.com/gnl1scanSched1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options
    1010                page.
    1111            </div>
     
    9393?>
    9494    If you would like access to this premium feature, please
    95     <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our Premium version</a>.
     95    <a href="https://www.wordfence.com/gnl1scanSched2/wordfence-signup/" target="_blank">upgrade to our Premium version</a>.
    9696</p>
    9797<?php
  • wordfence/trunk/lib/menu_twoFactor.php

    r1023626 r1177050  
    77                <strong>Cellphone Sign-in is only available to Premium Members at this time</strong><br /><br />
    88                Cellphone Sign-in is a premium feature because we are charged per SMS we send when a user signs in. If you would like to
    9                 activate this feature, simply <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page.
     9                activate this feature, simply <a href="https://www.wordfence.com/gnl1twoFac1/wordfence-signup/" target="_blank">click here and get a premium Wordfence API Key</a>, and then copy and paste it into your options page.
    1010                <br /><br />
    1111                Wordfence's Cellphone Sign-in uses a technique called "Two Factor Authentication" which is used by banks, government agencies and military world-wide as one of the most secure forms of remote system authentication. It's now available from Wordfence for your WordPress website. We recommend you enable Cellphone Sign-in for all Administrator level accounts. You can <a href="http://docs.wordfence.com/en/Cellphone_sign-in" target="_blank">learn more about Cellphone Sign-in on our documentation website</a>.
     
    7979?>
    8080    If you would like access to this premium feature, please
    81     <a href="https://www.wordfence.com/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
     81    <a href="https://www.wordfence.com/gnl1twoFac2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
    8282<?php
    8383}
  • wordfence/trunk/lib/wfActivityReport.php

    r1164420 r1177050  
    346346        global $wpdb;
    347347
    348         $is_bin_ip = !wfUtils::isValidIP($ip_address);
    349         if (!$is_bin_ip) {
    350             $ip_address = wfUtils::inet_pton($ip_address);
     348        if (wfUtils::isValidIP($ip_address)) {
     349            $ip_bin = wfUtils::inet_pton($ip_address);
     350        } else {
     351            $ip_bin = $ip_address;
     352            $ip_address = wfUtils::inet_ntop($ip_bin);
    351353        }
    352354
     
    358360        }
    359361
    360         $country = wfUtils::IP2Country($is_bin_ip ? wfUtils::inet_ntop($ip_address) : $ip_address);
     362        $country = wfUtils::IP2Country($ip_address);
    361363
    362364        $wpdb->query($wpdb->prepare(<<<SQL
     
    365367ON DUPLICATE KEY UPDATE blockCount = blockCount + 1
    366368SQL
    367             , $ip_address, $country));
     369            , $ip_bin, $country));
    368370    }
    369371
  • wordfence/trunk/lib/wfLog.php

    r1172235 r1177050  
    791791        //End range/UA blocking
    792792
    793         $blockedCountries = wfConfig::get('cbl_countries', false);
    794         $bareRequestURI = wfUtils::extractBareURI($_SERVER['REQUEST_URI']);
    795         $bareBypassRedirURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassRedirURL', ''));
    796         $skipCountryBlocking = false;
    797 
    798         if($bareBypassRedirURI && $bareRequestURI == $bareBypassRedirURI){ //Run this before country blocking because even if the user isn't blocked we need to set the bypass cookie so they can bypass future blocks.
    799             $bypassRedirDest = wfConfig::get('cbl_bypassRedirDest', '');
    800             if($bypassRedirDest){
     793        // Country blocking
     794        if (wfConfig::get('isPaid')) {
     795            $blockedCountries = wfConfig::get('cbl_countries', false);
     796            $bareRequestURI = wfUtils::extractBareURI($_SERVER['REQUEST_URI']);
     797            $bareBypassRedirURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassRedirURL', ''));
     798            $skipCountryBlocking = false;
     799
     800            if($bareBypassRedirURI && $bareRequestURI == $bareBypassRedirURI){ //Run this before country blocking because even if the user isn't blocked we need to set the bypass cookie so they can bypass future blocks.
     801                $bypassRedirDest = wfConfig::get('cbl_bypassRedirDest', '');
     802                if($bypassRedirDest){
     803                    self::setCBLCookieBypass();
     804                    $this->redirect($bypassRedirDest); //exits
     805                }
     806            }
     807            $bareBypassViewURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassViewURL', ''));
     808            if($bareBypassViewURI && $bareBypassViewURI == $bareRequestURI){
    801809                self::setCBLCookieBypass();
    802                 $this->redirect($bypassRedirDest); //exits
    803             }
    804         }
    805         $bareBypassViewURI = wfUtils::extractBareURI(wfConfig::get('cbl_bypassViewURL', ''));
    806         if($bareBypassViewURI && $bareBypassViewURI == $bareRequestURI){
    807             self::setCBLCookieBypass();
    808             $skipCountryBlocking = true;
    809         }
    810            
    811         if((! $skipCountryBlocking) && $blockedCountries && wfConfig::get('isPaid') && (! self::isCBLBypassCookieSet()) ){
    812             if(is_user_logged_in() && (! wfConfig::get('cbl_loggedInBlocked', false)) ){ //User is logged in and we're allowing logins
    813                 //Do nothing
    814             } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') !== false && (! wfConfig::get('cbl_loginFormBlocked', false))  ){ //It's the login form and we're allowing that
    815                 //Do nothing
    816             } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') === false && (! wfConfig::get('cbl_restOfSiteBlocked', false))  ){ //It's the rest of the site and we're allowing that
    817                 //Do nothing
    818             } else {
    819                 if($country = wfUtils::IP2Country($IP) ){
    820                     foreach(explode(',', $blockedCountries) as $blocked){
    821                         if(strtoupper($blocked) == strtoupper($country)){ //At this point we know the user has been blocked
    822                             if(wfConfig::get('cbl_action') == 'redir'){
    823                                 $redirURL = wfConfig::get('cbl_redirURL');
    824                                 $eRedirHost = wfUtils::extractHostname($redirURL);
    825                                 $isExternalRedir = false;
    826                                 if($eRedirHost && $eRedirHost != wfUtils::extractHostname(home_url())){ //It's an external redirect...
    827                                     $isExternalRedir = true;
     810                $skipCountryBlocking = true;
     811            }
     812
     813            if((! $skipCountryBlocking) && $blockedCountries && (! self::isCBLBypassCookieSet()) ){
     814                if(is_user_logged_in() && (! wfConfig::get('cbl_loggedInBlocked', false)) ){ //User is logged in and we're allowing logins
     815                    //Do nothing
     816                } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') !== false && (! wfConfig::get('cbl_loginFormBlocked', false))  ){ //It's the login form and we're allowing that
     817                    //Do nothing
     818                } else if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') === false && (! wfConfig::get('cbl_restOfSiteBlocked', false))  ){ //It's the rest of the site and we're allowing that
     819                    //Do nothing
     820                } else {
     821                    if($country = wfUtils::IP2Country($IP) ){
     822                        foreach(explode(',', $blockedCountries) as $blocked){
     823                            if(strtoupper($blocked) == strtoupper($country)){ //At this point we know the user has been blocked
     824                                if(wfConfig::get('cbl_action') == 'redir'){
     825                                    $redirURL = wfConfig::get('cbl_redirURL');
     826                                    $eRedirHost = wfUtils::extractHostname($redirURL);
     827                                    $isExternalRedir = false;
     828                                    if($eRedirHost && $eRedirHost != wfUtils::extractHostname(home_url())){ //It's an external redirect...
     829                                        $isExternalRedir = true;
     830                                    }
     831                                    if( (! $isExternalRedir) && wfUtils::extractBareURI($redirURL) == $bareRequestURI){ //Is this the URI we want to redirect to, then don't block it
     832                                        //Do nothing
     833                                        /* Uncomment the following if page components aren't loading for the page we redirect to.
     834                                           Uncommenting is not recommended because it means that anyone from a blocked country
     835                                           can crawl your site by sending the page blocked users are redirected to as the referer for every request.
     836                                           But it's your call.
     837                                        } else if(wfUtils::extractBareURI($_SERVER['HTTP_REFERER']) == $redirURL){ //If the referer the page we want to redirect to? Then this might be loading as a component so don't block.
     838                                            //Do nothing
     839                                        */
     840                                    } else {
     841                                        $this->redirect(wfConfig::get('cbl_redirURL'));
     842                                    }
     843                                } else {
     844                                    $this->do503(3600, "Access from your area has been temporarily limited for security reasons");
     845                                    wfConfig::inc('totalCountryBlocked');
    828846                                }
    829                                 if( (! $isExternalRedir) && wfUtils::extractBareURI($redirURL) == $bareRequestURI){ //Is this the URI we want to redirect to, then don't block it
    830                                     //Do nothing
    831                                 /* Uncomment the following if page components aren't loading for the page we redirect to.
    832                                    Uncommenting is not recommended because it means that anyone from a blocked country
    833                                    can crawl your site by sending the page blocked users are redirected to as the referer for every request.
    834                                    But it's your call.
    835                                 } else if(wfUtils::extractBareURI($_SERVER['HTTP_REFERER']) == $redirURL){ //If the referer the page we want to redirect to? Then this might be loading as a component so don't block.
    836                                     //Do nothing   
    837                                 */
    838                                 } else {
    839                                     $this->redirect(wfConfig::get('cbl_redirURL'));
    840                                 }
    841                             } else {
    842                                 $this->do503(3600, "Access from your area has been temporarily limited for security reasons");
    843                                 wfConfig::inc('totalCountryBlocked');
    844847                            }
    845848                        }
  • wordfence/trunk/lib/wfScanEngine.php

    r1172235 r1177050  
    6868        $this->jobList[] = 'knownFiles_main';
    6969        $this->jobList[] = 'knownFiles_finish';
    70         foreach(array('knownFiles', 'fileContents', 'database', 'posts', 'comments', 'passwds', 'dns', 'diskSpace', 'oldVersions') as $scanType){
    71             if(wfConfig::get('scansEnabled_' . $scanType)){
    72                 if(method_exists($this, 'scan_' . $scanType . '_init')){
    73                     foreach(array('init', 'main', 'finish') as $op){ $this->jobList[] = $scanType . '_' . $op; };
    74                 } else {
     70        foreach (array('knownFiles', 'fileContents', 'database', 'posts', 'comments', 'passwds', 'dns', 'diskSpace', 'oldVersions') as $scanType) {
     71            if (wfConfig::get('scansEnabled_' . $scanType)) {
     72                if (method_exists($this, 'scan_' . $scanType . '_init')) {
     73                    foreach (array('init', 'main', 'finish') as $op) {
     74                        $this->jobList[] = $scanType . '_' . $op;
     75                    };
     76                } else if (method_exists($this, 'scan_' . $scanType)) {
    7577                    $this->jobList[] = $scanType;
    7678                }
     
    124126            self::checkForKill();
    125127            $jobName = $this->jobList[0];
    126             call_user_func(array($this, 'scan_' . $jobName));
     128            $callback = array($this, 'scan_' . $jobName);
     129            if (is_callable($callback)) {
     130                call_user_func($callback);
     131            }
    127132            array_shift($this->jobList); //only shift once we're done because we may pause halfway through a job and need to pick up where we left off
    128133            self::checkForKill();
     
    812817            $this->status(2, 'info', "Starting DNS scan for $host");
    813818
    814             $cnameArrRec = dns_get_record($host, DNS_CNAME);
     819            $cnameArrRec = @dns_get_record($host, DNS_CNAME);
    815820            $cnameArr = array();
    816821            $cnamesWeMustTrack = array();
    817             foreach($cnameArrRec as $elem){
    818                 $this->status(2, 'info', "Scanning CNAME DNS record for " . $elem['host']);
    819                 if($elem['host'] == $host){
    820                     $cnameArr[] = $elem;
    821                     $cnamesWeMustTrack[] = $elem['target'];
    822                 }
    823             }
     822            if ($cnameArrRec) {
     823                foreach($cnameArrRec as $elem){
     824                    $this->status(2, 'info', "Scanning CNAME DNS record for " . $elem['host']);
     825                    if($elem['host'] == $host){
     826                        $cnameArr[] = $elem;
     827                        $cnamesWeMustTrack[] = $elem['target'];
     828                    }
     829                }
     830            }
     831
    824832            function wfAnonFunc1($a){ return $a['host'] . ' points to ' . $a['target']; }
    825833            $cnameArr = array_map('wfAnonFunc1', $cnameArr);
  • wordfence/trunk/lib/wordfenceClass.php

    r1172257 r1177050  
    329329        $db->queryWriteIgnoreError("drop table if exists $prefix"."wfFileQueue");
    330330        $db->queryWriteIgnoreError("drop table if exists $prefix"."wfFileChanges");
    331         //Adding primary key to this table because some backup apps use primary key during backup.
    332         $db->queryWriteIgnoreError("alter table {$prefix}wfStatus add id bigint UNSIGNED NOT NULL auto_increment PRIMARY KEY");
     331
     332        $result = $wpdb->get_row("SHOW FIELDS FROM {$prefix}wfStatus where field = 'id'");
     333        if (!$result || strtolower($result->Key) != 'pri') {
     334            //Adding primary key to this table because some backup apps use primary key during backup.
     335            $db->queryWriteIgnoreError("alter table {$prefix}wfStatus add id bigint UNSIGNED NOT NULL auto_increment PRIMARY KEY");
     336        }
    333337
    334338        $optScanEnabled = $db->querySingle("select val from $prefix"."wfConfig where name='scansEnabled_options'");
     
    388392        }
    389393
     394        // Fix the data in the country column.
     395        // TODO: add version check so this doesn't run on every update.
     396        $ip_results = $wpdb->get_results("SELECT * FROM `{$prefix}wfBlockedIPLog` GROUP BY IP");
     397        if ($ip_results) {
     398            foreach ($ip_results as $ip_row) {
     399                $wpdb->query($wpdb->prepare("UPDATE `{$prefix}wfBlockedIPLog` SET countryCode = %s WHERE IP = %s", wfUtils::IP2Country(wfUtils::inet_ntop($ip_row->IP)), $ip_row->IP));
     400            }
     401        }
     402
    390403        //Must be the final line
    391404    }
     
    505518
    506519        // Change GoDaddy's limit login mu-plugin since it can interfere with the two factor auth message.
    507         if (defined('GD_SYSTEM_PLUGIN_DIR') && file_exists(GD_SYSTEM_PLUGIN_DIR . 'limit-login-attempts/limit-login-attempts.php')
    508             && defined('LIMIT_LOGIN_DIRECT_ADDR')) {
     520        if (self::hasGDLimitLoginsMUPlugin()) {
    509521            add_action('login_errors', array('wordfence', 'fixGDLimitLoginsErrors'), 11);
    510522        }
     
    585597        if($UA){
    586598            $b = $browscap->getBrowser($UA);
    587             if($b['Crawler']){
     599            if(!empty($b['Crawler'])){
    588600                $isCrawler = true;
    589601            }
     
    879891                                } else if($_POST['wordfence_authFactor'] == $t[2]){
    880892                                    $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
    881                                     $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
    882                                     if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
    883                                         break; //Let them sign in without two factor
    884                                     }
    885                                     if(isset($codeResult['ok']) && $codeResult['ok']){
    886                                         $t[2] = $codeResult['code'];
    887                                         $t[4] = time() + 1800; //30 minutes until code expires
    888                                         wfConfig::set_ser('twoFactorUsers', $twoFactorUsers); //save the code the user needs to enter and return an error.
    889                                         self::$authError = new WP_Error('twofactor_required', __('<strong>CODE EXPIRED. CHECK YOUR PHONE:</strong> The code you entered has expired. Codes are only valid for 30 minutes for security reasons. We have sent you a new code. Please sign in using your username and your password followed by a space and the new code we sent you.'));
    890                                         return self::$authError;
    891                                     } else {
    892                                         break; //No new code was received. Let them sign in with the expired code.
     893                                    try {
     894                                        $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
     895
     896                                        if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
     897                                            break; //Let them sign in without two factor
     898                                        }
     899                                        if(isset($codeResult['ok']) && $codeResult['ok']){
     900                                            $t[2] = $codeResult['code'];
     901                                            $t[4] = time() + 1800; //30 minutes until code expires
     902                                            wfConfig::set_ser('twoFactorUsers', $twoFactorUsers); //save the code the user needs to enter and return an error.
     903                                            self::$authError = new WP_Error('twofactor_required', __('<strong>CODE EXPIRED. CHECK YOUR PHONE:</strong> The code you entered has expired. Codes are only valid for 30 minutes for security reasons. We have sent you a new code. Please sign in using your username and your password followed by a space and the new code we sent you.'));
     904                                            return self::$authError;
     905                                        } else {
     906                                            break; //No new code was received. Let them sign in with the expired code.
     907                                        }
     908
     909                                    } catch (Exception $e) {
     910                                        // Couldn't connect to noc1, let them sign in since the password was correct.
     911                                        break;
    893912                                    }
    894913                                } else { //Bad code, so cancel the login and return an error to user.
     
    902921                            if($t[0] == $userDat->ID && $t[3] == 'activated'){ //Yup, enabled, so lets send the code
    903922                                $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
    904                                 $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
    905                                 if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
    906                                     break; //Let them sign in without two factor if their API key has expired or they're not paid and for some reason they have this set up.
     923                                try {
     924                                    $codeResult = $api->call('twoFactor_verification', array(), array('phone' => $t[1]) );
     925                                    if(isset($codeResult['notPaid']) && $codeResult['notPaid']){
     926                                        break; //Let them sign in without two factor if their API key has expired or they're not paid and for some reason they have this set up.
     927                                    }
     928                                } catch (Exception $e) {
     929                                    // Couldn't connect to noc1, let them sign in since the password was correct.
     930                                    break;
    907931                                }
    908 
    909932                                if(isset($codeResult['ok']) && $codeResult['ok']){
    910933                                    $t[2] = $codeResult['code'];
    911934                                    $t[4] = time() + 1800; //30 minutes until code expires
    912935                                    wfConfig::set_ser('twoFactorUsers', $twoFactorUsers); //save the code the user needs to enter and return an error.
     936
     937                                    if (self::hasGDLimitLoginsMUPlugin() && function_exists('limit_login_get_address')) {
     938                                        $retries = get_option('limit_login_retries', array());
     939                                        $ip = limit_login_get_address();
     940
     941                                        if (!is_array($retries)) {
     942                                            $retries = array();
     943                                        }
     944                                        if (isset($retries[$ip]) && is_int($retries[$ip])) {
     945                                            $retries[$ip]--;
     946                                        } else {
     947                                            $retries[$ip] = 0;
     948                                        }
     949                                        update_option('limit_login_retries', $retries);
     950                                    }
     951
    913952                                    self::$authError = new WP_Error( 'twofactor_required', __( '<strong>CHECK YOUR PHONE</strong>: A code has been sent to your phone and will arrive within 30 seconds. Please sign in again and add a space and the code to the end of your password.' ) );
    914953                                    return self::$authError;
     
    32833322    }
    32843323
     3324    /**
     3325     * @return bool
     3326     */
     3327    public static function hasGDLimitLoginsMUPlugin() {
     3328        return defined('GD_SYSTEM_PLUGIN_DIR') && file_exists(GD_SYSTEM_PLUGIN_DIR . 'limit-login-attempts/limit-login-attempts.php')
     3329            && defined('LIMIT_LOGIN_DIRECT_ADDR');
     3330    }
     3331
     3332    /**
     3333     * @param string $content
     3334     * @return string
     3335     */
    32853336    public static function fixGDLimitLoginsErrors($content) {
    32863337        if (self::$authError) {
  • wordfence/trunk/readme.txt

    r1172257 r1177050  
    44Requires at least: 3.9
    55Tested up to: 4.2.2
    6 Stable tag: 6.0.5
     6Stable tag: 6.0.6
    77
    88Wordfence Security is a free enterprise class security and performance plugin that makes your site up to 50 times faster and more secure.
     
    172172
    173173== Changelog ==
     174
     175= 6.0.6 =
     176* Improvement: Handled uncaught exception when noc1 is not available in 2FA.
     177* Improvement: Fixed issue with limit-logins mu-plugin on GoDaddy counting first login attempt in 2FA against total allowed login attempts.
     178* Fix: Fixed bug with IPs not resolving to countries when printable IP passed to logBlockedIP.
     179* Fix: Fixed issue with free users country blocking redirects working after downgrade.
     180* Fix: Encoded URL field in country blocking options.
     181* Fix: Added a check to verify field has not already been altered prior to calling ALTER in runInstall.
     182* Fix: Fixed issue with scan_options method being called after method has been removed.
     183* Fix: Fixed bug in scan when dns_get_record fails and error condition was not handled.
     184* Fix: Fixed PHP notice when 'Crawler' not included in browser pcap result.
    174185
    175186= 6.0.5 =
  • wordfence/trunk/views/reports/activity-report-email-inline.php

    r1164420 r1177050  
    120120                    <?php echo $title ?>
    121121                </div>
    122                 <a href="http://www.wordfence.com/" style="font-size: 100%; vertical-align: baseline; outline: none; color: orange; text-decoration: none; margin: 0; padding: 0; border: 0;"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt="" style="font-size: 100%; vertical-align: baseline; -ms-interpolation-mode: bicubic; outline: none; text-decoration: none; margin: 0; padding: 0; border: 0 none;" /></a>
    123 
    124                 <p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
    125                     This email was sent from your website <a href="<?php echo site_url() ?>"><?php echo site_url() ?></a> and is a summary of security related activity that Wordfence monitors for the period <?php printf('%s to %s', $report_start, $report_end) ?>. <?php if (!wfConfig::get('isPaid')): ?>NOTE: You are using the free version of Wordfence and are missing out on features like cellphone sign-in, country blocking and detecting if your site IP is sending spam. <a href="http://www.wordfence.com/?utm_source=plugin&utm_medium=UI&utm_campaign=summaryEmail">Click here to upgrade to Wordfence Premium now</a>.<?php endif ?>
     122                <a href="http://www.wordfence.com/zz5/" style="font-size: 100%; vertical-align: baseline; outline: none; color: orange; text-decoration: none; margin: 0; padding: 0; border: 0;"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt="" style="font-size: 100%; vertical-align: baseline; -ms-interpolation-mode: bicubic; outline: none; text-decoration: none; margin: 0; padding: 0; border: 0 none;" /></a>
     123
     124                <p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
     125                    This email was sent from your website <a href="<?php echo site_url() ?>"><?php echo site_url() ?></a> and is a summary of security related activity that Wordfence monitors for the period <?php printf('%s to %s', $report_start, $report_end) ?>. <?php if (!wfConfig::get('isPaid')): ?>NOTE: You are using the free version of Wordfence and are missing out on features like cellphone sign-in, country blocking and detecting if your site IP is sending spam. <a href="http://www.wordfence.com/zz6/">Click here to upgrade to Wordfence Premium now</a>.<?php endif ?>
    126126                </p>
    127127
  • wordfence/trunk/views/reports/activity-report-email.php

    r1164420 r1177050  
    296296                    Activity for week of<br> <strong><?php echo date_i18n(get_option('date_format')) ?></strong>
    297297                </div>
    298                 <a href="http://www.wordfence.com/"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
     298                <a href="http://www.wordfence.com/zz7/"><img src="http://www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
    299299
    300300                <h2>Top 10 IP's Blocked</h2>
  • wordfence/trunk/views/reports/activity-report.php

    r1164420 r1177050  
    44 */
    55?>
    6 <a href="//www.wordfence.com/"><img src="//www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
     6<a href="//www.wordfence.com/zz8/"><img src="//www.wordfence.com/wp-content/themes/parallelus-salutation/wfCustomHome/images/wordfenceLogo.png" alt=""/></a>
    77
    88<h2>Top <?php echo (int) $limit; ?> IP's Blocked</h2>
  • wordfence/trunk/wordfence.php

    r1172257 r1177050  
    55Description: Wordfence Security - Anti-virus, Firewall and High Speed Cache
    66Author: Wordfence
    7 Version: 6.0.5
     7Version: 6.0.6
    88Author URI: http://www.wordfence.com/
    99*/
     
    1111    return;
    1212}
    13 define('WORDFENCE_VERSION', '6.0.5');
     13define('WORDFENCE_VERSION', '6.0.6');
    1414if(get_option('wordfenceActivated') != 1){
    1515    add_action('activated_plugin','wordfence_save_activation_error'); function wordfence_save_activation_error(){ update_option('wf_plugin_act_error',  ob_get_contents()); }
Note: See TracChangeset for help on using the changeset viewer.