Plugin Directory

Changeset 1912751


Ignore:
Timestamp:
07/21/2018 12:26:14 PM (8 years ago)
Author:
elialgranti
Message:

Updated to version 1.1.4

Location:
geoswitch/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • geoswitch/trunk/class.geoswitch.php

    r1679694 r1912751  
    236236        if (is_null(self::$data_source))
    237237            return null;
     238        // a hook to short-circuit IP checking.
     239        if ( apply_filters( 'geoswitch_skip_ip_check', false, self::$user_ip ) ) {
     240            return null;
     241        }
     242       
     243        // skips checking for private/restricted IP addresses.
     244        if ( ! filter_var( self::$user_ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) {
     245            return null;
     246        }
    238247       
    239248        try {
  • geoswitch/trunk/composer.lock

    r1684730 r1912751  
    22    "_readme": [
    33        "This file locks the dependencies of your project to a known state",
    4         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
     4        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
    55        "This file is @generated automatically"
    66    ],
    7     "hash": "a8152c3aeff794a7bb55ff00377619fb",
    87    "content-hash": "25737d43de99fb5d718029bd29d5374e",
    98    "packages": [
    109        {
    1110            "name": "composer/ca-bundle",
    12             "version": "1.0.7",
     11            "version": "1.1.1",
    1312            "source": {
    1413                "type": "git",
    1514                "url": "https://github.com/composer/ca-bundle.git",
    16                 "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12"
    17             },
    18             "dist": {
    19                 "type": "zip",
    20                 "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b17e6153cb7f33c7e44eb59578dc12eee5dc8e12",
    21                 "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12",
     15                "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169"
     16            },
     17            "dist": {
     18                "type": "zip",
     19                "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169",
     20                "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169",
    2221                "shasum": ""
    2322            },
     
    2827            },
    2928            "require-dev": {
    30                 "phpunit/phpunit": "^4.5",
     29                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
    3130                "psr/log": "^1.0",
    32                 "symfony/process": "^2.5 || ^3.0"
    33             },
    34             "suggest": {
    35                 "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+"
     31                "symfony/process": "^2.5 || ^3.0 || ^4.0"
    3632            },
    3733            "type": "library",
     
    6561                "tls"
    6662            ],
    67             "time": "2017-03-06 11:59:08"
     63            "time": "2018-03-29T19:57:20+00:00"
    6864        },
    6965        {
    7066            "name": "geoip2/geoip2",
    71             "version": "v2.5.0",
     67            "version": "v2.9.0",
    7268            "source": {
    7369                "type": "git",
    7470                "url": "https://github.com/maxmind/GeoIP2-php.git",
    75                 "reference": "87602e1c9f5014291b06e126847123360cb6c2db"
    76             },
    77             "dist": {
    78                 "type": "zip",
    79                 "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/87602e1c9f5014291b06e126847123360cb6c2db",
    80                 "reference": "87602e1c9f5014291b06e126847123360cb6c2db",
     71                "reference": "a807fbf65212eef5d8d2db1a1b31082b53633d77"
     72            },
     73            "dist": {
     74                "type": "zip",
     75                "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/a807fbf65212eef5d8d2db1a1b31082b53633d77",
     76                "reference": "a807fbf65212eef5d8d2db1a1b31082b53633d77",
    8177                "shasum": ""
    8278            },
    8379            "require": {
    8480                "maxmind-db/reader": "~1.0",
    85                 "maxmind/web-service-common": "~0.3",
    86                 "php": ">=5.3.1"
    87             },
    88             "require-dev": {
    89                 "apigen/apigen": "^4.1",
    90                 "phpunit/phpunit": "4.2.*",
    91                 "squizlabs/php_codesniffer": "2.*"
     81                "maxmind/web-service-common": "~0.5",
     82                "php": ">=5.4"
     83            },
     84            "require-dev": {
     85                "friendsofphp/php-cs-fixer": "2.*",
     86                "phpunit/phpunit": "4.*",
     87                "squizlabs/php_codesniffer": "3.*"
    9288            },
    9389            "type": "library",
     
    117113                "maxmind"
    118114            ],
    119             "time": "2017-05-08 20:05:30"
     115            "time": "2018-04-10T15:32:59+00:00"
    120116        },
    121117        {
    122118            "name": "maxmind-db/reader",
    123             "version": "v1.1.3",
     119            "version": "v1.3.0",
    124120            "source": {
    125121                "type": "git",
    126122                "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
    127                 "reference": "7eeccf61b078bb23bb07b1a151a7e5db52871e65"
    128             },
    129             "dist": {
    130                 "type": "zip",
    131                 "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/7eeccf61b078bb23bb07b1a151a7e5db52871e65",
    132                 "reference": "7eeccf61b078bb23bb07b1a151a7e5db52871e65",
    133                 "shasum": ""
    134             },
    135             "require": {
    136                 "php": ">=5.3.1"
    137             },
    138             "require-dev": {
    139                 "phpunit/phpunit": "4.2.*",
     123                "reference": "e042b4f8a2dff41e19019faf16427178b07fbd58"
     124            },
     125            "dist": {
     126                "type": "zip",
     127                "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/e042b4f8a2dff41e19019faf16427178b07fbd58",
     128                "reference": "e042b4f8a2dff41e19019faf16427178b07fbd58",
     129                "shasum": ""
     130            },
     131            "require": {
     132                "php": ">=5.4"
     133            },
     134            "require-dev": {
     135                "friendsofphp/php-cs-fixer": "2.*",
     136                "phpunit/phpunit": "4.* || 5.*",
    140137                "satooshi/php-coveralls": "1.0.*",
    141                 "squizlabs/php_codesniffer": "2.*"
     138                "squizlabs/php_codesniffer": "3.*"
    142139            },
    143140            "suggest": {
    144                 "ext-bcmath": "bcmath or gmp is requred for decoding larger integers with the pure PHP decoder",
    145                 "ext-gmp": "bcmath or gmp is requred for decoding larger integers with the pure PHP decoder",
     141                "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
     142                "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder",
    146143                "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups"
    147144            },
     
    172169                "maxmind"
    173170            ],
    174             "time": "2017-01-19 23:49:38"
     171            "time": "2018-02-21T21:23:33+00:00"
    175172        },
    176173        {
    177174            "name": "maxmind/web-service-common",
    178             "version": "v0.3.1",
     175            "version": "v0.5.0",
    179176            "source": {
    180177                "type": "git",
    181178                "url": "https://github.com/maxmind/web-service-common-php.git",
    182                 "reference": "1fe780bcd6a9038b7e36b13fa0aeeeeca4cdb0a4"
    183             },
    184             "dist": {
    185                 "type": "zip",
    186                 "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/1fe780bcd6a9038b7e36b13fa0aeeeeca4cdb0a4",
    187                 "reference": "1fe780bcd6a9038b7e36b13fa0aeeeeca4cdb0a4",
     179                "reference": "61a9836fa3bb1743ab89752bae5005d71e78c73b"
     180            },
     181            "dist": {
     182                "type": "zip",
     183                "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/61a9836fa3bb1743ab89752bae5005d71e78c73b",
     184                "reference": "61a9836fa3bb1743ab89752bae5005d71e78c73b",
    188185                "shasum": ""
    189186            },
     
    192189                "ext-curl": "*",
    193190                "ext-json": "*",
    194                 "php": ">=5.3"
    195             },
    196             "require-dev": {
     191                "php": ">=5.4"
     192            },
     193            "require-dev": {
     194                "friendsofphp/php-cs-fixer": "2.*",
    197195                "phpunit/phpunit": "4.*",
    198                 "squizlabs/php_codesniffer": "2.*"
    199             },
    200             "type": "library",
    201             "autoload": {
    202                 "psr-4": {
    203                     "MaxMind\\": "src"
     196                "squizlabs/php_codesniffer": "3.*"
     197            },
     198            "type": "library",
     199            "autoload": {
     200                "psr-4": {
     201                    "MaxMind\\Exception\\": "src/Exception",
     202                    "MaxMind\\WebService\\": "src/WebService"
    204203                }
    205204            },
     
    215214            ],
    216215            "description": "Internal MaxMind Web Service API",
    217             "homepage": "https://github.com/maxmind/mm-web-service-api-php",
    218             "time": "2016-08-18 16:36:52"
     216            "homepage": "https://github.com/maxmind/web-service-common-php",
     217            "time": "2018-02-12T22:31:54+00:00"
    219218        }
    220219    ],
  • geoswitch/trunk/geoswitch.php

    r1684932 r1912751  
    55Tags: geocode, geocode switch, geocode filter, geotag, geomarketing, geomarking, geolocation, geofilter, location, local marketing, GeoIP2, MaxMind
    66Description: GeoSwitch is a plugin that allows you to change the content of your site based on the location of your client’s IP.
    7 Version: 1.1.3
     7Version: 1.1.4
    88Author: elialgranti
    99*/
  • geoswitch/trunk/readme.txt

    r1684932 r1912751  
    1 == Geocode Switch ==
     1=== Geocode Switch ===
    22Contributors: elialgranti
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=C7QAD2M3L5T6E
    44Tags: geocode, geocode switch, geocode filter, geotag, geomarketing, geomarking, geolocation, geofilter, location, local marketing, GeoIP2, MaxMind
    5 Version: 1.1.3
     5Version: 1.1.4
    66Requires at least: 3.0
    7 Tested up to: 4.8
    8 Stable tag: 1.1.3
     7Tested up to: 4.9.7
     8Stable tag: 1.1.4
    99License: GPLv2 or later for plugin code, Apache License version 2.0 for Maxmind library under vendor directory
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    118118For debugging whole websites the user IP can be set globally in the admin settings for the plugin.
    119119
     120= Filter Hooks =
     121Geoswitch supports the following filter hooks:
     122`geoswitch_skip_ip_check`
     123Allows to programatically skip the ip check. If the hook callback function returns true the MaxMind libraries are not used to check the IP and the
     124default content (if configured) will be displayed.
     125Usage:
     126
     127`
     128function skip_ip_callback( $skipCheck, $userIp ) {
     129    if ( some_custom_test($userIp) ) {
     130        $skipCheck = true;
     131    }
     132    return $skipChek;
     133}
     134
     135add_filter( 'geoswitch_skip_ip_check', 'skip_ip_callback', 10, 2 );
     136`
     137
     138
    120139== Change Log ==
    121 = 1.1.2 =
     140= 1.1.4 =
     141* Bug fix: Private and reserved IPs are not checked and no longer generate
     142* Added filter hook `geoswitch_skip_ip_check` to bypass the ip check based on
     143(Thanks to [Arūnas Liuiza](https://github.com/ideag) from [arunas.co](https://arunas.co/) for the BugFix and filter hook)
     144= 1.1.3 =
    122145Bug fix: when IP cannot be found plugin correctly evaluates all cases and uses default empty case (if it exists), instead of not displaying anything.
    123146Implemented support for comma separated values in geoswitch_case shortcode. Previous version mentioned this feature in the Readme file, but it was not actually implemented.
     147= 1.1.2 =
     148Error deploying to wordpress. Use version 1.1.3 instead.
    124149= 1.1.1 =
    125150Added setting to for user IP for debugging purposes and updated MaxMind Libraries.
     
    133158
    134159== Upgrade Notice ==
    135 = 1.1.3 =
    136 Bug fix: when IP cannot be found plugin correctly evaluates all cases and uses default empty case (if it exists), instead of not displaying anything.
    137 Implemented support for comma separated values in geoswitch_case code block. Previous version mentioned this feature in the Readme file, but it was not actually implemented.
    138 = 1.1.2 =
    139 Error deploying to wordpress. Use version 1.1.3 instead.
    140 = 1.1.1 =
    141 Added setting to for user IP for debugging purposes and updated MaxMind Libraries.
    142 = 1.1.0 =
    143 Added support for MaxMind GeoIP2 Precision Service and fixed bug with measurement units.
     160= 1.1.4 =
     161* Bug fix: Private and reserved IPs are not checked and no longer generate
     162* Added filter hook `geoswitch_skip_ip_check` to bypass the ip check based on
     163(Thanks to [Arūnas Liuiza](https://github.com/ideag) from [arunas.co](https://arunas.co/) for the BugFix and filter hook)
    144164
    145165== Frequently Asked Questions ==
Note: See TracChangeset for help on using the changeset viewer.