We recently moved hosting platforms for the site I am referring to. They did not make any changes to any of the content but just moved it over to a newer version of WP. Prior to the move, your plugin would change which logo is shown based on IP Address. What we had and still need to happen is have one logo appear when the client is in Arizona and another if they are anywhere else. This is the code that is in header-1.php
<div class=”geo-logo”><?php echo do_shortcode(“[geoswitch][geoswitch_case country_code=’US’ state_code=’AZ’][/geoswitch_case][geoswitch_case]
[/geoswitch_case][/geoswitch]”); ?></div>
and here is the code in the header-2.php
Does your plugin not work anymore w/ the newer versions of wordpress? Also, you should know that I downloaded the database and uploaded it to wp-content/plugins. Please let me know why when I used geopeeker.com the logo being used is the one we only want to be used if in Arizona.
]]>I am getting the following error when I attempt to update this plugin
Update Failed: Warning: fopen(C:\inetpub\shop/wp-content/plugins/geoswitch/geoswitch.php): failed to open stream: No such file or directory in C:\inetpub\shop\wp-includes\functions.php on line 4848 Warning: fread() expects parameter 1 to be resource, boolean given in C:\inetpub\shop\wp-includes\functions.php on line 4851 Warning: fclose() expects parameter 1 to be resource, boolean given in C:\inetpub\shop\wp-includes\functions.php on line 4854 {"success":false,"data":{"update":"plugin","slug":"geoswitch","oldVersion":"","newVersion":"","plugin":"geoswitch\/geoswitch.php","pluginName":"","errorMessage":"Plugin update failed."}}
Has anyone experienced anything similar? The plugin appears to be working correctly – except that I am now no longer able to update it.
I am not an experienced php programmer (I am able to follow the code to some extent), I just run a self hosted on-line store that uses the plugin to determine what offers to show to people from different parts of the country.
Thanks.
]]>Just a couple of sinple questions … How often should I update the database for this plugin?
I’ve just downloaded the plugin itself, should I update right away?
]]>I’m trying to set some targeted info for various stores my company owns, each with their own static IP. Is it possible to modify some code or request an update that allows IP address to function as a filter for the [geoswitch_case] shortcode? This would be the most accurate way for me to show content, especially in areas with more than one location.
]]>How can I complement this plugin with content egg? Because I need to appear products to 1 country in specific and another to the rest example
[Content-egg locale = MX]
When someone from Mexico visits will see only products from Mexico, but if it is from the rest of the world would be
[Content-egg locale = US]
How can I use your plugin to complement it?
Fatal error: require_once(): Failed opening required ‘C:\Websites\wordpress\wp-content\plugins\geoswitch\vendor\composer/autoload_static.php’ (include_path=’.;C:\php\pear’) in C:\Websites\wordpress\wp-content\plugins\geoswitch\vendor\composer\autoload_real.php on line 28
]]>Hi guys,
I’ve updated the plugin today to the new version I saw was available but after the update I got the following Fatal Error, this was on three of the sites I updated, reverting back to version 1.1.1 solved the issue.
Not sure if anyone else has reported this issue.
Fatal error: Class ‘GeoIp2\Database\Reader’not found in /plugins/geoswitch/class.geoswitch.php on line 60
]]>When testing the plug-in, the IP address included a port number in it. I couldn’t track down easily why that is so – it could be that WordPress is hosted in IIS on Azure instead of Apache, could be PHP7, could be any number of reasons. However, if i changed the get_user_ip function to the following it works for me. Not sure if you’d like to incorporate it into a revision of your code base.
private static function get_user_ip() {
$ip = getenv('HTTP_CLIENT_IP')?:
getenv('HTTP_X_FORWARDED_FOR')?:
getenv('HTTP_X_FORWARDED')?:
getenv('HTTP_FORWARDED_FOR')?:
getenv('HTTP_FORWARDED')?:
getenv('REMOTE_ADDR');
return preg_replace('/(\:[0-9]*)/', '', $ip);
}
]]>
Hi,
I have a site that has content for two locations: Sydney and Melbourne. I am able to switch the content using pre-get posts and a cookie.
I’d like to auto switch the content if someone is in either of those cities, is there a way to access the city without needing the shortcode?
You can see the site here: https://eatdrinkplay.com
]]>Not sure how to get the ‘from…within’ working.
Is it
[geoswitch_case from….]blah[/geoswitch_case]
or
[geoswitch from …]blah[/geoswitch]
I’ve tried every combo, nothing seems to work.
(Everything else does though…)
]]>Hello,
I’m trying to install your plugin, and I’m only able to display the IP Address.
I’ve tried some IP in the debug but didn’t find a working one.
When I test on https://www.maxmind.com/en/locate-my-ip-address it’s correctly detected but when I try on my website, I have question mark, whatever is my IP address.
It seems it doesn’t read the DB. Is there a way to check if the DB is correctly read by the plugin ?
Best regards
]]>Nice Plugin! Is there any way you can think of to use the shortcodes (lets say city) to have visitor land / be redirected to a particular page related to that city? Trying to have all visitors land to their own local city pages..
]]>If I use the paid GeoIP2 City database or web service which includes postal codes, can I use the postal code as a condition in the shortcode?
]]>