0.2.2.1 Release Note

    Posted on May 11, 2021

    IP Location Block 0.2.2.1 isn’t so attractive for you because there’s no new feature except several bug fixes, but it includes a very important alteration related to the IP address geolocation API for local databases of Maxmind and IP2Location.

    In this changelog, I’ll mention about it.

    Replacement of the directory for local databases

    In the previous version, geolocation database files are located at as follows:

    • Maxmind
      wp-content/plugins/ip-location-block/database/

    • IP2Location
      wp-content/plugins/ip2location-{tags|variables|blocker}/

    With this configuration, the Maxmind DBs will always be removed and downloaded at every upgrading of this plugin.

    Now, those DBs can be placed outside this plugin e.g. wp-content/ip-geo-api/ to cut the above useless process. And also cooperation with IP2Location plugins such as IP2Location Tags, IP2Location Variables, IP2Location Country Blocker had been deprecated.

    Additionally, the class libraries for DBs can be put together under that directory. It means that the class libraries and DBs have become independent of this plugin. You can also get them from WordPress-IP-Geo-API separately from this plug.

    WordPress-IP-Geo-API

    Filter hook for DBs

    The following filter hooks can be used to customize the settings of your DBs around.

    • ip-location-block-api-dir
      Full path to the class libraries and local DB files.

    • ip-location-block-maxmind-dir
      Full path where Maxmind GeoLite DB files should be saved.

    • ip-location-block-ip2location-dir
      Full path where IP2Location LITE DB files should be saved.

    • ip-location-block-ip2location-path
      Full path to IP2Location LITE DB file (IPv4).

    And here is a sample code how to use these.

    <?php
    function my_geodbs_dir( $dir ) {
        $upload = wp_upload_dir();
        return $upload['basedir'];
    }
    add_filter( 'ip-location-block-maxmind-dir',     'my_geodbs_dir' );
    add_filter( 'ip-location-block-ip2location-dir', 'my_geodbs_dir' );
    ?>

    You should always deactivate then activate again when you change your settings.

    Option page

    You can check your configuration for DBs at this plugin’s option page.

    Local database settings

    Don’t you need different types of DBs?

    In my observation on coverage for IPv6, Maxmind is better than IP2Location. In any case, the coverage of each DB might be limited by their own data sources. So I think something fallback might be needed.

    If you don’t want one of these, please remove ip-geo-api/maxmind or ip-geo-api/ip2location and this plugin would not download its DB files any more.

    Enjoy emoji