First of all, I object to your assumption that our software doesn’t work. This is not conducive to helping you. I have good reasons to believe that your assumption is false, least of all is that I’m seeing my GeoIP location in my email now that I logged in to reply to your ticket. Having a contrarian starting position implies that you are unwilling to accept that the problem may lie outside our software. This makes it impossible for me to assist you in locating the root cause even if it’s outside our control and help you address it. If you are, however, willing to consider that appearances can be deceiving, have an open mind and are willing to let me help you please read on.
First, I’d like to present my arguments for reasonably disputing your claim that our software does not work.
The geographic database features are provided by the GeoIP plugin which is a simple interface to MaxMind’s PHP library for using their GeoIP databases. To be specific, the code that converts the IP address to a country and continent (the MaxMind GeoIP library for PHP) is written by MaxMind itself, not Akeeba Ltd. We only wrote a plugin which acts as a wrapper (an interface) to it. We did that because Joomla requires installing a Joomla extension to make a third party library available to it. Moreover, our code handles the update of the GeoIP database file, something that MaxMind’s code does not. So, whenever you are thinking about what happens when converting an IP to geographic information: it is MaxMind’s code, not Akeeba’s code, doing it.
We of course use the GeoIP plugin on our own sites, including this one you’re filing the ticket on. We log in to our sites multiple times every day and we receive emails confirming our location — like I did a few minutes ago and I see that my IP is correct, just like my detected country and continent. Same goes for security exceptions which I personally monitor. Furthermore, the same plugin is used by our subscriptions system to determine the country of new clients. It is also used in other cases where we are logging IP addresses, such as downloads that I monitor (I need to know where downloads come from so I can figure out which downloads need to be on a speedier but more expensive CDN). As a result I have thousands more data points every single day than you do in total and the unequivocal conclusion is that our GeoIP plugin and MaxMind’s library code work within the operating parameters MaxMind gives. That is to say, GeoIP is correct for 19 out of 20 cases.
Furthermore, this feature is so prominent and necessary for our own site that it gets its own set of automated tests. This is part of the integration test suite that runs every time before we release a new version of Admin Tools. We automatically spin up new Joomla sites, Admin Tools and the GeoIP plugin are installed, enabled and configured and a variety of scenarios is acted upon these sites. Some of the scenarios include auto-blocking IPs, GeoIP blocking and confirming that the IP to country and territory is working (using a set of IPs from long-standing IPv4 blocks of major ISPs across the world). If something breaks we know before we release our software. If I see something weird I run the tests even if we’re not expected to release Admin Tools anytime soon.
That said, there are many things which could go wrong with GeoIP, none of which is actually under the control of Akeeba Ltd and are not bugs in our software.
The first obvious issue is whether your server reports the correct IP address. Based on your feedback this is not a problem in your case so I’m not going to provide a three page long diatribe on everything that can go wrong on that front :)
If you have not installed or enabled the GeoIP plugin yet, do so now (our software asks you to). If the plugin is not enabled the GeoIP feature will not work. In these two cases you would, indeed, get an empty geolocation result like the one you say you are getting. At no point in your ticket do I see you saying that you have installed and enabled the plugin.
Also, the plugin is not enough. It is just an interface to MaxMInd’s code. You need to update the GeoIP database that is included with it. In fact, the database file included with it is at this point about three years old and severely out of date. If you just installed the plugin follow the documentation instructions for updating its database. If your database is out of date and your IP is unrecognized it would indeed result in an empty geolocation result. The latest version of MaxMind’s GeoIP database does report your IP as being from Japan, I just checked.
If you are doing a manual update remember to extract (NOT rename) the GZipped database file. If you only have the .mmdb.gz file it won’t work. If you rename the .mmdb.gz file to have an .mmdb extension it won’t work. If you use gunzip or a respectable GUI tool supporting .gz files such as 7-Zip to extract the .mmdb.gz file to a .mmdb file it will work. If you use the integrated update it does that for you.
If you use the integrated update it is possible that your host blocks the download and results in a zero-length file. If that’s the case you need to contact your host.
Make sure the MaxMind database file does exist in the location the documentation instructions tell you it should be for manual updates and that it’s readable. Some hosts do stupid things, like renaming or deleting legitimate files under a false pretext of security, telling you the affected file was suspicious or malicious. Unfortunately we can’t do anything about hosts being misleading except call them out on their lies by providing facts.
Also note that MaxMind’s code that we cannot touch, the code that actually converts IPs to geolocation information, requires certain PHP modules to be enabled. If these modules are disabled on your host then it won’t work and return an empty geolocation result. This is normal and doesn’t mean that we have a bug in our software, it means that your host does not meet the minimum requirements of the MaxMind GeoIP database library code.
Finally, if MaxMind’s library is already loaded either by another Joomla extension or as a PHP module we cannot tell it where to look for the GeoIP database file. Therefore it is possible that there is no GeoIP database (.mmdb) file loaded OR an invalid / out of date file. This will result in MaxMind’s library code return empty GeoIP results. Again, this is not a bug in our software, it’s a third party extension or your host doing something wrong. And yes, I’ve seen that a few times about 7 years ago. Just because it hasn’t happened for a very long time doesn’t mean that someone didn’t find a fresh way to screw up, so I keep an open mind about this possibility :)
Please check these items above and you’ll see that if everything is in order our feature (in fact, MaxMind’s code) works fine. If you still can’t figure out what’s wrong ask me to make the ticket private and I’ll ask you for connection info to your site so I can debug it for you and tell you what you need to fix.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!