PHPackages                             maxcrossan/yii\_ip\_blocker - 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. [Security](/categories/security)
4. /
5. maxcrossan/yii\_ip\_blocker

ActiveLibrary[Security](/categories/security)

maxcrossan/yii\_ip\_blocker
===========================

Will block and logout any users not listed in the whitelist

1.0(7y ago)0101MITPHP

Since May 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/maxcrossan/yii_ip_blocker)[ Packagist](https://packagist.org/packages/maxcrossan/yii_ip_blocker)[ RSS](/packages/maxcrossan-yii-ip-blocker/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

IP Blocker Component for Yii
============================

[](#ip-blocker-component-for-yii)

This will block and logout any users with IP addresses not listed in the whitelist

Installation
------------

[](#installation)

Run the Composer command to install the latest stable version of IPBlocker

```
    php composer.phar require maxcrossan/yii_ip_blocker
```

Configure the component and preload it in protected/config/main.php

```
    'preload'=>array('ip-blocker'),

    'components'=>array(
        'ip-blocker' => array(
            'class' => Crossan\IPBlocker::class,
            //Expression to validate on (should return true if validation is required)
            'validateOn' => '!Yii::app()->user->isGuest',
            //{ip} will be replaced
            'blockedMessage' => "Access to this system is blocked from your IP: {ip}.",
            // Network ranges can be specified as:
            // 1. Wildcard format:     1.2.3.*
            // 2. CIDR format:         1.2.3/24  OR  1.2.3.4/255.255.255.0
            // 3. Start-End IP format: 1.2.3.0-1.2.3.255
            'whitelistedIPs' => array(
                ':1', '127.0.0.1', //Localhost
                '123.123.123.123', //Office
            ),
            'whitelistArraySupplier' => null, //Use this to grab IPs from a method somewhere in your codebase. Will override whitelistedIPs if set.
        ),
    )
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

2912d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c3642ab3733ea6c8d8d909d3d25cb4c2f9c6c79f5cf0bb6e641d40333c7542f?d=identicon)[maxcrossan](/maintainers/maxcrossan)

---

Top Contributors

[![maxcrossan](https://avatars.githubusercontent.com/u/2699110?v=4)](https://github.com/maxcrossan "maxcrossan (2 commits)")

### Embed Badge

![Health badge](/badges/maxcrossan-yii-ip-blocker/health.svg)

```
[![Health](https://phpackages.com/badges/maxcrossan-yii-ip-blocker/health.svg)](https://phpackages.com/packages/maxcrossan-yii-ip-blocker)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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