PHPackages                             hotelmah/online-visitors - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. hotelmah/online-visitors

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hotelmah/online-visitors
========================

Online Visitors package returns a PHP one-dimensional indexed array of GeoIP data with Remote IP Addresses and sorted DateTime differences for you to use as you wish like rendering to a view.

v2.0.3(1y ago)06GPL-3.0-onlyPHPPHP &gt;=7.0.0

Since Nov 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hotelmah/online-visitors)[ Packagist](https://packagist.org/packages/hotelmah/online-visitors)[ Docs](https://github.com/hotelmah/online-visitors)[ RSS](/packages/hotelmah-online-visitors/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (5)Used By (0)

About
-----

[](#about)

This package returns a PHP one-dimensional indexed array of GeoIP data with Remote IP Addresses and sorted DateTime differences for you to use as you wish like rendering to a view.

Files Not Included in Packagist Package
---------------------------------------

[](#files-not-included-in-packagist-package)

- *.gitattributes*
- *OnlineVisitors-Test-1.php*

Test File
---------

[](#test-file)

- *OnlineVisitors-Test-1.php*
- This is a sample of how the package works.

In your Script
--------------

[](#in-your-script)

- In each page that you want to record an online visitor, add the following (see the test file for an example):

`require_once('vendor/autoload.php');`

`use function OnlineVisitors\{executeOnlineVisitorsInsertRow, executeGetOnlineVisitorsLatestIPAddressesWithTime};`

- Call this function to insert a row into the database:

`executeOnlineVisitorsInsertRow();`

- Get the latest Online Visitors returned in an indexed array:

`$SelectOptionsAry = executeGetOnlineVisitorsLatestIPAddressesWithTime();`

- Process this returned array as you wish.

Installation - Composer
-----------------------

[](#installation---composer)

- run this command in your project root:

`composer require hotelmah/online-visitors`

- There is no need to manually create/update a composer.json file in your project root since this command does it automatically.
- The package is listed on Packagist, but is hosted on GitHub where the source is pulled from.

Installation - Manual
---------------------

[](#installation---manual)

- Copy the src directory contents to an appropriately named directory like includes/ in your LAMP web hosting provider.
- Refer to the 'In your Script' heading above and/or test file.

Notes
-----

[](#notes)

- The script waits 10 minutes before updating the same Remote IP Address in the database. Thus, the visitor would need to be on your site for more than 10 minutes to see an update.
- 20 records are retrieved and sorted by most recent on top.

Database
--------

[](#database)

- On your server and in your PHP.ini, ensure that SQLite3 is enabled and working.
- A sample SQLite3 database is not included in this repository because the script automatically creates the SQLite3 database if not found. If found, it simply updates the tables.
- The script creates/updates the SQLite3 database in your root web folder (html\_public).
- SQLite3 does not require a username or password. Thus, there is no authentication to use the database.
- The database is a single file.
- The script must have read/write access to the folder the database is in.
- The database default name is OnlineVisitors.db.
- There should be no duplicate IP Addresses in the database unless the City, State, or Zip Code are different.
- You can delete the SQLite3 database on your server at will to start a new database, or rename the database to start a new database.

Third-Party Services
--------------------

[](#third-party-services)

- This script uses cURL to get GeoIP data for the External Remote IP Address received.
- The GeoIP service is a free and publically available service.
- Your own External Remote IP Address is obtained from a free public service.

Feedback
--------

[](#feedback)

- Forks and Pull Requests are welcomed.
- Suggestions and comments for improvement are requested.
- Thank you for reading!

Future Updates
--------------

[](#future-updates)

- The latest 20 records are retrieved. This limit is not yet passed in as a parameter.

License
-------

[](#license)

- GNU GENERAL PUBLIC LICENSE, Version 3.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~42 days

Total

4

Last Release

402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/680e03dee8e2034db2678e5f8da8ca412074d13741637f5a8b40d4be1c118e1f?d=identicon)[hotelmah](/maintainers/hotelmah)

---

Top Contributors

[![hotelmah](https://avatars.githubusercontent.com/u/189757542?v=4)](https://github.com/hotelmah "hotelmah (8 commits)")

---

Tags

curlphpsqlite3phpcurlsqlite3countersOnline Visitors

### Embed Badge

![Health badge](/badges/hotelmah-online-visitors/health.svg)

```
[![Health](https://phpackages.com/badges/hotelmah-online-visitors/health.svg)](https://phpackages.com/packages/hotelmah-online-visitors)
```

###  Alternatives

[stefangabos/zebra_curl

A high performance solution for making multiple HTTP requests concurrently, asynchronously from your PHP projects using cURL

21971.3k2](/packages/stefangabos-zebra-curl)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)

PHPackages © 2026

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