PHPackages                             jqqjj/simple-anti-robot - 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. jqqjj/simple-anti-robot

ActivePhp[Security](/categories/security)

jqqjj/simple-anti-robot
=======================

Simple APIs for protecting your application far away from robots

1.0.1(6y ago)025MITPHPPHP &gt;=5.3

Since Jan 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jqqjj/simple-anti-robot)[ Packagist](https://packagist.org/packages/jqqjj/simple-anti-robot)[ RSS](/packages/jqqjj-simple-anti-robot/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Simple Anti Robot
=================

[](#simple-anti-robot)

Simple APIs for protecting your application far away from robots.

### Installation

[](#installation)

Run the following to include this via Composer

```
composer require jqqjj/simple-anti-robot
```

### Usage

[](#usage)

Create mysql tables(when using DBTableGateway adapter)

```
CREATE TABLE `simple_anti_robot_sessions` (
  `session_id` char(32) NOT NULL,
  `remaining` int(10) unsigned DEFAULT NULL,
  `expired_time` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `simple_anti_robot_attempts` (
  `session_id` char(32) NOT NULL,
  `status` tinyint(3) unsigned NOT NULL,
  `add_time` timestamp NULL DEFAULT NULL,
  `ip` char(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```

Code:

```
use Jqqjj\SimpleAntiRobot\Manager;
use Jqqjj\SimpleAntiRobot\Adapter\DBTableGateway;

//Create a PDO object
$pdo = new \PDO('mysql:host=localhost;port=3306;dbname=yourdbname','dbuser','dbpasswd');
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

//Create an adapter(Only MySQL adapter is supported Currently)
$adapter = new DBTableGateway($pdo);
$object = new Manager($adapter);

//Run the codes when the client do something incorrectly
$object->attemptFailure();

//Run the codes when the client do things as you want to be
$object->attemptSuccess();

//Check it, it will return false when the client is a robot
if($object->isHuman()){
	//human
}
if($object->isRobot()){
	//robot
}

//Finally, output the cookie
$object->outputCookie();
//OR
header("Set-Cookie:".$object->getOutputCookieString());
```

### License

[](#license)

This package is licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

2316d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c16752bb9a319ab2c9a0374ee7a65dc277464be7ff0b5947da651f5b898f643a?d=identicon)[jqqjj](/maintainers/jqqjj)

---

Top Contributors

[![jqqjj](https://avatars.githubusercontent.com/u/3424783?v=4)](https://github.com/jqqjj "jqqjj (3 commits)")

### Embed Badge

![Health badge](/badges/jqqjj-simple-anti-robot/health.svg)

```
[![Health](https://phpackages.com/badges/jqqjj-simple-anti-robot/health.svg)](https://phpackages.com/packages/jqqjj-simple-anti-robot)
```

###  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)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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