Could not open Phar: InvalidArgumentException: The value "" is not a valid IP address. in phar:///home/ddco/public_html/geoip2.phar/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php:177 Stack trace: #0 phar:///home/ddco/public_html/geoip2.phar/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php(165): MaxMind\Db\Reader->findAddressInTree() #1 phar:///home/ddco/public_html/geoip2.phar/src/Database/Reader.php(243): MaxMind\Db\Reader->getWithPrefixLen() #2 phar:///home/ddco/public_html/geoip2.phar/src/Database/Reader.php(216): GeoIp2\Database\Reader->getRecord() #3 phar:///home/ddco/public_html/geoip2.phar/src/Database/Reader.php(86): GeoIp2\Database\Reader->modelFor() #4 /home/ddco/public_html/index.php(22): GeoIp2\Database\Reader->city() #5 {main}
Cleaned up messy code.
Geolocation data pulled locally.
Goodbye needless API calls.