0.2.2.6 Release Note

Posted on May 11, 2021

In this release, 1 bug fix and 2 new feature on admin dashboard.

Bug fix: Exceptions

In 0.2.2.5, I equiped “Exceptions” for Plugins and Themes area where you can specify the plugins/themes to bypass the validation of “Block by country” and “Prevent Zero-day Exploit” without using filter hooks ip-location-block-bypass-plugins and ip-location-block-bypass-themes.

Exceptions for Plugins/Themes area

This feature is for the user who wants to provide the services of plugins / themes to every visitors just in case this plugin blocks them. But because of inconsistency of internal data, this feature didn’t work as expected.

Now it works!

Export log file

This plugin provide you ip-location-block-backup-dir filter hook to export the logs into the specific directory by CSV format. From this release, you can download CSV file on the “Logs” tab to analyze the attacks.

Export CSV log file

Each column in CSV is defined as follow:

Column Sample
Date/Time 2016-06-19 14:28:02
IP address 182.22.72.251
Country code JP
Target admin
Result wp-zep
Requested URI POST[80]:/wp-admin/admin-ajax.php
User agent Mozilla/5.0 (Windows; U; Windows NT 5.1;)
HTTP headers HTTP_X_FORWARDED_FOR=182.22.72.251
$_POST data action=revslider_ajax_action,client_action

A new filter hook

I think there’re some users who want to control the conditions of recording logs in more detail. For example, not “Only when blocked” but also “Unauthenticated users” to analyze what’s going on in your backend.

Record settings

In this case, a new filter hook ip-location-block-record-logs can help you. You can put the following snippet into your theme’s functions.php.

/**
 * Example : Usage of 'ip-location-block-record-logs'
 * Use case: Record logs additionally when an unauthenticated user passes.
 *
 * @param  int    $record   0:none 1:blocked 2:passed 3:unauth 4:auth 5:all
 * @param  string $hook     'comment', 'xmlrpc', 'login' or 'admin'
 * @param  array  $validate the result of validation which contains:
 *  'ip'       => string    ip address
 *  'auth'     => int       authenticated (>= 1) or not (0)
 *  'code'     => string    country code
 *  'time'     => unsinged  processing time for examining the country code
 *  'provider' => string    IP geolocation service provider
 *  'result'   => string    'passed' or the reason of blocking
 * @return int    $record   modified condition
 */
function my_record_logs( $record, $hook, $validate ) {
    /* when an unauthenticated user passes */
    if ( ! $validate['auth'] && 'passed' === $validate['result'] )
        $record = 3; /* Unauthenticated users */

    return $record;
}
add_filter( 'ip-location-block-record-logs', 'my_record_logs', 10, 3 );

Please feel free how to use those filter hooks at Support forum emoji .