GeoPlugin no longer free

16 views
Skip to first unread message

PJH

unread,
Apr 16, 2026, 7:15:51 AM (11 days ago) Apr 16
to Fat-Free Framework
```
Thu, 16 Apr 2026 11:05:27 +0000 [5.133.47.106] staging/app/resources/library.php::PJH\geoip(845): Geoip of 5.133.47.106 is ['']{
Thu, 16 Apr 2026 11:05:27 +0000 [5.133.47.106] ....message: (string) "geoPlugin API is no longer available for free use. To continue access, please upgrade to a paid plan"
Thu, 16 Apr 2026 11:05:27 +0000 [5.133.47.106] ....url: (string) "https://www.geoplugin.com/subscription"
Thu, 16 Apr 2026 11:05:27 +0000 [5.133.47.106] }
```

Two things:

1) An API key is needed if you do pay for a subscription (https://www.geoplugin.com/docs); \Web\Geo will need a way to supply it
2) Any thoughts on a new default free alternative? (though given the small size of geo.php, I could probably knock my own up for personal use)

ved

unread,
Apr 16, 2026, 7:59:41 AM (11 days ago) Apr 16
to Fat-Free Framework
Hi,

I've replaced F3's Geo plugin on our system with the following function:

static function ip2country($ip = false) {
    $f3 = \Base::instance();
    $web = \Web::instance();
    if (!$ip) {
        $ip = $f3->IP;
    }
    $public = filter_var(
        $ip,
        FILTER_VALIDATE_IP,
        FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 |
        FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE,
    );
    if (($req = $web->request('http://ip-api.com/json/' . ($public ? $ip : '') , )) && $data = json_decode($req['body'], true)) {
        return [
            'city' => $data['city'] ?: '',
            'region_name' => $data['regionName'] ?: '',
            'country_code' => $data['countryCode'] ?: '',
            'country_name' => $data['country'] ?: ''
        ];
    }
    return false;
}

Hope it helps, cheers.

Paul Herring

unread,
Apr 16, 2026, 8:44:08 AM (11 days ago) Apr 16
to ved via Fat-Free Framework
> Hope it helps

It does, ta.

--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/f3-framework/5991abc1-4b3c-4cd6-bdac-ee2f96d5738en%40googlegroups.com.


--
PJH

Reply all
Reply to author
Forward
0 new messages