PHPackages                             piwind/geoip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. piwind/geoip

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

piwind/geoip
============

Geolocation for your Flarum forum

v1.6.0(1y ago)069MITPHPPHP ^8.0

Since May 30Pushed 1y agoCompare

[ Source](https://github.com/piwind/flarum-geoip)[ Packagist](https://packagist.org/packages/piwind/geoip)[ RSS](/packages/piwind-geoip/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (3)Used By (0)

GeoIP
=====

[](#geoip)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/76b2032c130b5ca994bdeb3034ebea3e06c5f653e4661a83740a197ceb70e09c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706977696e642f67656f69702e737667)](https://packagist.org/packages/piwind/geoip) [![Total Downloads](https://camo.githubusercontent.com/5e1bcc2c2f071696462b63cf9b8dc7fe309d4625314618127ded903aaf63e197/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706977696e642f67656f69702e737667)](https://packagist.org/packages/piwind/geoip)

A [Flarum](http://flarum.org) extension.

About This Fork
---------------

[](#about-this-fork)

This repository is a fork of [fof/geoip](https://github.com/FriendsOfFlarum/geoip). Just style optimizations, no functional modifications.

### 改动记录

[](#改动记录)

- 优化了样式，优化后的截图看下面

### TODO

[](#todo)

- 网络限制：中国大陆无法连接 `nominatim.openstreetmap.org`

### 备注

[](#备注)

- 请求头限制：个别手机端点开"IP信息"按钮，控制台报错 CORS policy 阻止，状态码 403 Forbidden，但是桌面端是正常的，个例如下：

    ```
    示例请求URL：https://nominatim.openstreetmap.org/reverse?lat=30.2943&lon=120.1663&format=json

    对比桌面端和手机端的请求头的差异：
    sec-ch-ua-mobile【经测试与之无关】
    桌面端		?0
    手机端		?1
    sec-ch-ua-platform【经测试与之无关】
    桌面端		Windows
    手机端		Android

    user-agent【重点还是在UA上】
    桌面端		Mozilla/5.0 (Windows NT 10.0; Win64; x64) Safari/537.36
    失败手机端		Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) Mobile Safari/537.36
    成功手机端		Mozilla/5.0 (Linux; Android 13; Pixel 7) Mobile Safari/537.36

    ```
- 成功的IP信息的请求，控制台会有两条信息：

    ```
    Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus.

    Refused to get unsafe header "X-CSRF-Token"

    ```

Empower Your Flarum Moderators with GeoIP
-----------------------------------------

[](#empower-your-flarum-moderators-with-geoip)

Moderators play a crucial role in maintaining the health and quality of forums. With GeoIP, give them the geolocation tools they need to better understand users, make informed decisions, and maintain a safe environment. Only moderators have access to IP-based geolocation, ensuring user privacy and data security.

### 🌎 Key Features

[](#-key-features)

- **Location Insights**: Enable moderators to identify the country and region of users.
- **Interactive Mapping**: Let moderators visualize user locations with an integrated map view.
- **Threat Detection**: Equip moderators with the ability to highlight potentially malicious IP addresses through threat level indicators. (Via supported IP location data providers)

### Screenshots

[](#screenshots)

**Redesigned post meta info (visible to admins/mods)**【点击帖子的发布时间会弹出帖子的详细信息，包括ip】

[![image-20250531122201781](_MARKDOWN_ASSETS/README.assets/image-20250531122201781.png)](_MARKDOWN_ASSETS/README.assets/image-20250531122201781.png)

**Integration with session management (visible to own profile)**

[![image-20250531122302057](_MARKDOWN_ASSETS/README.assets/image-20250531122302057.png)](_MARKDOWN_ASSETS/README.assets/image-20250531122302057.png)

**Information modal with location map**

[![image](https://user-images.githubusercontent.com/16573496/269137411-ae7657f1-38b5-46ba-9bd7-df802696a882.png)](https://user-images.githubusercontent.com/16573496/269137411-ae7657f1-38b5-46ba-9bd7-df802696a882.png)

### CLI Usage

[](#cli-usage)

The following CLI commands are provided:

#### `lookup`

[](#lookup)

Although IP addresses will be looked up when they are requested, this command will lookup all IP's that do not already have an entry in the `ip_info` table, using the currently selected provider.

```
php flarum piwind:geoip:lookup
```

#### `lookup --force`

[](#lookup---force)

You may also force a refresh of IP data using the currently selected provider.

```
php flarum piwind:geoip:lookup --force
```

### Queue offloading

[](#queue-offloading)

The IP lookup can be time consuming, so the lookup of an unknown IP address is dispatched in a job, if you have a queue running this will run on a worker thread, rather than the main thread.

All IP address lookup jobs are dispatched to the `default` queue by default. If you have multiple queues, you can specify which queue to use for these jobs in your `extend.php`:

```
Piwind\GeoIP\Jobs\RetrieveIP::$onQueue = 'my-other-queue';

```

Installation &amp; Updating
---------------------------

[](#installation--updating)

Install manually with composer:

```
composer require piwind/geoip:"*"
```

Updating:

```
composer update piwind/geoip
php flarum cache:clear
```

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/piwind/geoip)
- [GitHub](https://github.com/piwind/flarum-geoip)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

399d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45837397?v=4)[piwind](/maintainers/piwind)[@piwind](https://github.com/piwind)

---

Top Contributors

[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (43 commits)")[![dsevillamartin](https://avatars.githubusercontent.com/u/6401250?v=4)](https://github.com/dsevillamartin "dsevillamartin (29 commits)")[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (24 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![piwind](https://avatars.githubusercontent.com/u/45837397?v=4)](https://github.com/piwind "piwind (11 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (3 commits)")[![karaok491](https://avatars.githubusercontent.com/u/72854852?v=4)](https://github.com/karaok491 "karaok491 (3 commits)")[![meezaan](https://avatars.githubusercontent.com/u/1839282?v=4)](https://github.com/meezaan "meezaan (1 commits)")[![luceos](https://avatars.githubusercontent.com/u/504687?v=4)](https://github.com/luceos "luceos (1 commits)")[![askvortsov1](https://avatars.githubusercontent.com/u/38059171?v=4)](https://github.com/askvortsov1 "askvortsov1 (1 commits)")

---

Tags

flarum

### Embed Badge

![Health badge](/badges/piwind-geoip/health.svg)

```
[![Health](https://phpackages.com/badges/piwind-geoip/health.svg)](https://phpackages.com/packages/piwind-geoip)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12128.3k](/packages/flarum-lang-russian)[fof/upload

The file upload extension for the Flarum forum with insane intelligence.

191192.5k18](/packages/fof-upload)[oat-sa/tao-core

TAO core extension

66143.7k124](/packages/oat-sa-tao-core)[fof/byobu

Well integrated, advanced private discussions.

59120.6k13](/packages/fof-byobu)[fof/sitemap

Generate a sitemap

1899.7k2](/packages/fof-sitemap)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
