PHPackages                             phelium/recaptcha - 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. phelium/recaptcha

ActiveLibrary[Security](/categories/security)

phelium/recaptcha
=================

reCAPTCHA v2 class

1.0.8(8y ago)4389.4k—9.2%16GPL-2.0-onlyPHPPHP &gt;=5.3.0

Since Jan 13Pushed 8y ago6 watchersCompare

[ Source](https://github.com/shevabam/recaptcha)[ Packagist](https://packagist.org/packages/phelium/recaptcha)[ Docs](https://github.com/shevabam/recaptcha)[ RSS](/packages/phelium-recaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (8)Used By (0)

reCAPTCHA
=========

[](#recaptcha)

- [Installation](#installation)
- [Initialization](#initialization)
- [Usage](#usage)
- [Customization](#customization)
    - [Theme](#theme)
    - [Language](#language)
    - [Type](#type)
- [Full example](#full-example)

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

[](#installation)

With Composer, add this line to your *require* section :

```
"phelium/recaptcha": "dev-master"

```

Then run `composer update`.

Initilization
-------------

[](#initilization)

```
require 'vendor/autoload.php';

use Phelium\Component\reCAPTCHA;

```

To initialize reCAPTCHA, you must provide your site key and your secret key.
There is two possible ways :

```
$reCAPTCHA = new reCAPTCHA('your site key', 'your secret key');

```

or

```
$reCAPTCHA = new reCAPTCHA();
$reCAPTCHA->setSiteKey('your site key');
$reCAPTCHA->setSecretKey('your secret key');

```

Usage
-----

[](#usage)

To generate the *script* tag, use :

```
$reCAPTCHA->getScript();

```

To generate the HTML block, use in your form :

```
$reCAPTCHA->getHtml();

```

Checking the server side, in your form validation script :

```
if ($reCAPTCHA->isValid($_POST['g-recaptcha-response']))
{
	// do whatever you want, the captcha is valid
}
else
{
	// Show errors
	var_dump($reCAPTCHA->getErrorCodes());
}

```

Customization
-------------

[](#customization)

### Theme

[](#theme)

Several themes are available : light (default) or dark.

```
$reCAPTCHA->setTheme('dark');

```

### Language

[](#language)

You can change the language of reCAPTCHA. Check  for more information.
By default, the language is automatically detected.

```
$reCAPTCHA->setLanguage('it');

```

### Type

[](#type)

Several types are available : image (default) or audio.

```
$reCAPTCHA->setType('audio');

```

### Size

[](#size)

Two sizes are available : normal (default) or compact.

```
$reCAPTCHA->setType('compact');

```

Full example
------------

[](#full-example)

Here is an example :

```

    reCAPTCHA example

```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 65% 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 ~202 days

Recently: every ~68 days

Total

7

Last Release

2927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e0e17e3945c589234ce1ae3edb38bdb9fa8ac609f97ad0462b25dc71d3a7b2d?d=identicon)[shevabam](/maintainers/shevabam)

---

Top Contributors

[![shevabam](https://avatars.githubusercontent.com/u/1798289?v=4)](https://github.com/shevabam "shevabam (13 commits)")[![othyn](https://avatars.githubusercontent.com/u/7256684?v=4)](https://github.com/othyn "othyn (4 commits)")[![chadsaun](https://avatars.githubusercontent.com/u/381024?v=4)](https://github.com/chadsaun "chadsaun (2 commits)")[![archer-developer](https://avatars.githubusercontent.com/u/2042397?v=4)](https://github.com/archer-developer "archer-developer (1 commits)")

---

Tags

google-recaptcharecaptcharecaptchav2googlerecaptchacaptcha

### Embed Badge

![Health badge](/badges/phelium-recaptcha/health.svg)

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

###  Alternatives

[cakephp-fr/recaptcha

To easily use Google Recaptcha (free CAPTCHA service that protect websites from spam and abuse) in CakePHP projects

1419.3k](/packages/cakephp-fr-recaptcha)[cake17/cakephp-recaptcha

\[DEPRECIATED\] Please use https://github.com/cakephp-fr/recaptcha/

1211.0k1](/packages/cake17-cakephp-recaptcha)

PHPackages © 2026

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