PHPackages                             mcrumley/php-complexify - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mcrumley/php-complexify

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mcrumley/php-complexify
=======================

PHP port of Dan Palmer's jquery.complexify.js

v0.4.1(8y ago)10165.1k↓49.2%4[1 issues](https://github.com/mcrumley/php-complexify/issues)1WTFPLPHP

Since Mar 10Pushed 8y ago3 watchersCompare

[ Source](https://github.com/mcrumley/php-complexify)[ Packagist](https://packagist.org/packages/mcrumley/php-complexify)[ RSS](/packages/mcrumley-php-complexify/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)DependenciesVersions (4)Used By (1)

php-complexify
==============

[](#php-complexify)

PHP port of Dan Palmer's [jquery.complexify.js](https://github.com/danpalmer/jquery.complexify.js/)

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

[](#installation)

```
composer require mcrumley/php-complexify
```

Usage
-----

[](#usage)

```
$check = new \Complexify\Complexify();
$result = $check->evaluateSecurity('correct horse battery staple');

echo round($result->complexity, 1) . '% ';
if ($result->valid) {
    echo 'VALID';
} else {
    echo 'NOT VALID: '.implode(', ', $result->errors);
}
```

Configuration
-------------

[](#configuration)

You can override the default configuration by passing an array to the constructor.

```
$check = new \Complexify\Complexify(array(
    'minimumChars' => 8,          // the minimum acceptable password length
    'strengthScaleFactor' => 1,   // scale the required password strength (higher numbers require a more complex password)
    'bannedPasswords' => array(), // override the default banned password list
    'banMode' => 'strict',        // strict == don't allow substrings of banned passwords, loose == only ban exact matches
    'encoding' => 'UTF-8',        // password string encoding
));
```

Return value
------------

[](#return-value)

The `evaluateSecurity` method returns an object containing the following properties:

- valid - `TRUE` if the password passes all checks
- complexity - The calculated complexity as a percent of the maximum (25 characters with at least one from each set)
- errors - Zero or more strings explaining the checks that did not pass
    - banned
    - tooshort
    - toosimple

License
-------

[](#license)

This code is distributed under the WTFPL v2 licence.

Version History
---------------

[](#version-history)

**0.4** - Changed banmode option to banMode

**0.3.1** - Added composer support

**0.3** - First release (matched version number of the JS version)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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 ~538 days

Total

3

Last Release

3077d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/714344?v=4)[Michael Crumley](/maintainers/mcrumley)[@mcrumley](https://github.com/mcrumley)

---

Top Contributors

[![mcrumley](https://avatars.githubusercontent.com/u/714344?v=4)](https://github.com/mcrumley "mcrumley (10 commits)")

### Embed Badge

![Health badge](/badges/mcrumley-php-complexify/health.svg)

```
[![Health](https://phpackages.com/badges/mcrumley-php-complexify/health.svg)](https://phpackages.com/packages/mcrumley-php-complexify)
```

###  Alternatives

[hybridlogic/validation

A simple, extensible validation library for PHP with support for filtering and validating any input array along with generating client side validation code.

641.1k](/packages/hybridlogic-validation)

PHPackages © 2026

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