Changeset 1912751
- Timestamp:
- 07/21/2018 12:26:14 PM (8 years ago)
- Location:
- geoswitch/trunk
- Files:
-
- 4 edited
-
class.geoswitch.php (modified) (1 diff)
-
composer.lock (modified) (7 diffs)
-
geoswitch.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
geoswitch/trunk/class.geoswitch.php
r1679694 r1912751 236 236 if (is_null(self::$data_source)) 237 237 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 } 238 247 239 248 try { -
geoswitch/trunk/composer.lock
r1684730 r1912751 2 2 "_readme": [ 3 3 "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", 5 5 "This file is @generated automatically" 6 6 ], 7 "hash": "a8152c3aeff794a7bb55ff00377619fb",8 7 "content-hash": "25737d43de99fb5d718029bd29d5374e", 9 8 "packages": [ 10 9 { 11 10 "name": "composer/ca-bundle", 12 "version": "1. 0.7",11 "version": "1.1.1", 13 12 "source": { 14 13 "type": "git", 15 14 "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", 22 21 "shasum": "" 23 22 }, … … 28 27 }, 29 28 "require-dev": { 30 "phpunit/phpunit": "^4. 5",29 "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", 31 30 "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" 36 32 }, 37 33 "type": "library", … … 65 61 "tls" 66 62 ], 67 "time": "201 7-03-06 11:59:08"63 "time": "2018-03-29T19:57:20+00:00" 68 64 }, 69 65 { 70 66 "name": "geoip2/geoip2", 71 "version": "v2. 5.0",67 "version": "v2.9.0", 72 68 "source": { 73 69 "type": "git", 74 70 "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", 81 77 "shasum": "" 82 78 }, 83 79 "require": { 84 80 "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.*" 92 88 }, 93 89 "type": "library", … … 117 113 "maxmind" 118 114 ], 119 "time": "201 7-05-08 20:05:30"115 "time": "2018-04-10T15:32:59+00:00" 120 116 }, 121 117 { 122 118 "name": "maxmind-db/reader", 123 "version": "v1. 1.3",119 "version": "v1.3.0", 124 120 "source": { 125 121 "type": "git", 126 122 "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.*", 140 137 "satooshi/php-coveralls": "1.0.*", 141 "squizlabs/php_codesniffer": " 2.*"138 "squizlabs/php_codesniffer": "3.*" 142 139 }, 143 140 "suggest": { 144 "ext-bcmath": "bcmath or gmp is requ red for decoding larger integers with the pure PHP decoder",145 "ext-gmp": "bcmath or gmp is requ red 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", 146 143 "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" 147 144 }, … … 172 169 "maxmind" 173 170 ], 174 "time": "201 7-01-19 23:49:38"171 "time": "2018-02-21T21:23:33+00:00" 175 172 }, 176 173 { 177 174 "name": "maxmind/web-service-common", 178 "version": "v0. 3.1",175 "version": "v0.5.0", 179 176 "source": { 180 177 "type": "git", 181 178 "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", 188 185 "shasum": "" 189 186 }, … … 192 189 "ext-curl": "*", 193 190 "ext-json": "*", 194 "php": ">=5.3" 195 }, 196 "require-dev": { 191 "php": ">=5.4" 192 }, 193 "require-dev": { 194 "friendsofphp/php-cs-fixer": "2.*", 197 195 "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" 204 203 } 205 204 }, … … 215 214 ], 216 215 "description": "Internal MaxMind Web Service API", 217 "homepage": "https://github.com/maxmind/ mm-web-service-api-php",218 "time": "201 6-08-18 16:36:52"216 "homepage": "https://github.com/maxmind/web-service-common-php", 217 "time": "2018-02-12T22:31:54+00:00" 219 218 } 220 219 ], -
geoswitch/trunk/geoswitch.php
r1684932 r1912751 5 5 Tags: geocode, geocode switch, geocode filter, geotag, geomarketing, geomarking, geolocation, geofilter, location, local marketing, GeoIP2, MaxMind 6 6 Description: 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. 37 Version: 1.1.4 8 8 Author: elialgranti 9 9 */ -
geoswitch/trunk/readme.txt
r1684932 r1912751 1 == Geocode Switch==1 === Geocode Switch === 2 2 Contributors: elialgranti 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=C7QAD2M3L5T6E 4 4 Tags: geocode, geocode switch, geocode filter, geotag, geomarketing, geomarking, geolocation, geofilter, location, local marketing, GeoIP2, MaxMind 5 Version: 1.1. 35 Version: 1.1.4 6 6 Requires at least: 3.0 7 Tested up to: 4. 88 Stable tag: 1.1. 37 Tested up to: 4.9.7 8 Stable tag: 1.1.4 9 9 License: GPLv2 or later for plugin code, Apache License version 2.0 for Maxmind library under vendor directory 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 118 118 For debugging whole websites the user IP can be set globally in the admin settings for the plugin. 119 119 120 = Filter Hooks = 121 Geoswitch supports the following filter hooks: 122 `geoswitch_skip_ip_check` 123 Allows 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 124 default content (if configured) will be displayed. 125 Usage: 126 127 ` 128 function skip_ip_callback( $skipCheck, $userIp ) { 129 if ( some_custom_test($userIp) ) { 130 $skipCheck = true; 131 } 132 return $skipChek; 133 } 134 135 add_filter( 'geoswitch_skip_ip_check', 'skip_ip_callback', 10, 2 ); 136 ` 137 138 120 139 == 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 = 122 145 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. 123 146 Implemented 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 = 148 Error deploying to wordpress. Use version 1.1.3 instead. 124 149 = 1.1.1 = 125 150 Added setting to for user IP for debugging purposes and updated MaxMind Libraries. … … 133 158 134 159 == 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) 144 164 145 165 == Frequently Asked Questions ==
Note: See TracChangeset
for help on using the changeset viewer.