Unfortunately Corejoomla doesn't know what they are talking about.
Like us, they are also using the third party MaxMind GeoIP API library. We are both using the same third party code. As a result their argument that our implementation is buggy is invalid by definition.
However, we DO work around an issue with the requirements of that library (bcmath) that they do not.
The MaxMind library has a requirement on the bcmath PHP library. As we found out a long time ago, some servers do not have the bcmath library enabled by default. On servers using PHP 5.x this simply results in a PHP fatal error saying that bcadd doesn't exist. PHP 7, when confronted with a function name it cannot find, tries to find said function in the current namespace. The file in question is the maxmind-dp/reader/src/MaxMind/Db/Reader/Decoder.php file with the MaxMind\Db\Reader namespace. Therefore PHP 7 is now looking for the MaxMind\Db\Reader\bcadd function which, of course, doesn't exist therefore throwing the confusing error message. Any developer who's used PHP 7 should be able to understand this issue and figure otu that the problem is with the server environment, not someone else's code.
This is an issue that we do work around. When you are loading our copy of the library –through the Akeeba GeoIP provide plugin– we run a check to see if bcmath is enabled. This check happens as soon as Joomla loads our plugin, namely in plugins/system/akgeoip/akgeoip.php lines 26 to 29. If bcmath's functions are not available we load our plugins/system/akgeoip/fakebcmath.php file which implements the missing bcmath functions using pure PHP code. This is why using our plugin always works. We detect if your server is missing a MaxMind library requirement and work around it using custom code.
The problem you have is that you are not actually loading the bcmath library and the plugin from Corejoomla is loaded before our plugin. So their plugin tries to access the MaxMind API library which crashes because it cannot find the bcmath extension. If you load our GeoIP plugin first –meaning that it will register the workaround for the missing bcmath functions– you'll see that Corejoomla's code is "magically" fixed. So, the first thing you should do is change the order of the plugins so our GeoIP plugin loads first.
However, the actual issue is that the bcmath library is not really enabled for your version of PHP. Remember that installing the bcmatch library is not enough. It has to be enabled in the php.ini as well. Furthermore, you need to restart the FastCGI and the web server (Apache, NginX, ...) for the changes to have any effect. This is due to the fact that FastCGI has already created a bunch of PHP processes using the old php.ini. Restarting both, FastCGI first, web server second, is the way to do it.
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!