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

ActiveLibrary[Security](/categories/security)

nietonfir/google-recaptcha
==========================

Library to simplify the server-side validation of Google's 'No CAPTCHA reCAPTCHA'

v0.2.1(9y ago)19.5k11MITPHPPHP &gt;=5.4.0

Since Dec 28Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (7)Used By (1)

GoogleReCaptcha
===============

[](#googlerecaptcha)

[ReCAPTCHA](https://developers.google.com/recaptcha/) is a free CAPTCHA service that protect websites from spam and abuse. This library aims to providate an alternative to the [official ReCAPTCHA library](https://github.com/google/ReCAPTCHA) for verifying a users "No CAPTCHA reCAPTCHA" response. Internally it uses [Guzzle](https://github.com/guzzle/guzzle) for communicating with the ReCAPTCHA API.

[![Build Status](https://camo.githubusercontent.com/afc17a88b098409f586380b42ecef1175c4159cb3390baa3801b9e53e588b3c0/68747470733a2f2f7472617669732d63692e6f72672f6e6965746f6e6669722f476f6f676c655265436170746368612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nietonfir/GoogleReCaptcha) [![Latest Stable Version](https://camo.githubusercontent.com/cf64bd1aa5f8dbe6003c113398ca1ec99a4647eafb78f7e85b0d8a87adf70489/68747470733a2f2f706f7365722e707567782e6f72672f6e6965746f6e6669722f676f6f676c652d7265636170746368612f762f737461626c652e737667)](https://packagist.org/packages/nietonfir/google-recaptcha) [![Latest Unstable Version](https://camo.githubusercontent.com/5c0b6d62cc5a459a76b7c0d03a4c77d419323303b12ed59979bf209946853768/68747470733a2f2f706f7365722e707567782e6f72672f6e6965746f6e6669722f676f6f676c652d7265636170746368612f762f756e737461626c652e737667)](https://packagist.org/packages/nietonfir/google-recaptcha) [![License](https://camo.githubusercontent.com/6ff4b0a3b1bc7dbac498308e707750d8580301eb16f5e878a06e83bc34b7a6b6/68747470733a2f2f706f7365722e707567782e6f72672f6e6965746f6e6669722f676f6f676c652d7265636170746368612f6c6963656e73652e737667)](https://packagist.org/packages/nietonfir/google-recaptcha)

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

[](#installation)

The recommended way to install GoogleReCaptcha is through [Composer](http://getcomposer.org).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest stable version of GoogleReCaptcha:

```
composer require "nietonfir/google-recaptcha"
```

Or add GoogleReCaptcha in your `composer.json`

```
"require": {
    "nietonfir/google-recaptcha": "~0.0"
}
```

and tell Composer to install the library:

```
composer update "nietonfir/google-recaptcha"
```

After installing, you need to require Composer's autoloader:

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

Usage
-----

[](#usage)

A sample validation client could look like the following:

```
use GuzzleHttp\Client;
use Nietonfir\Google\ReCaptcha\ReCaptcha;
use Nietonfir\Google\ReCaptcha\Api\RequestData,
    Nietonfir\Google\ReCaptcha\Api\ResponseFactory;

$requestData = new RequestData(
    'YOUR_API_SECRET_HERE',         // secret
    $_POST['g-recaptcha-response'], // user response
    $_SERVER['REMOTE_ADDR']         // end user IP
);

$reCaptcha = new ReCaptcha(new Client(), new ResponseFactory());
$response = $reCaptcha->processRequest($requestData);

if ($response->isValid()) {
    // check the hostname if "Domain Name Validation" is turned off
    // if($_SERVER['SERVER_NAME'] === $response->getHostName()) { … }
    echo 'I\'m not a robot';
} else {
    var_dump($response->getErrors());
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

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

Recently: every ~210 days

Total

6

Last Release

3308d ago

PHP version history (2 changes)v0.0.1PHP &gt;=5.5.0

v0.0.2PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f23105f6a6d70c794497723e5ee85f17d8c7025f3b5195369e8e22053b6459b?d=identicon)[nietonfir](/maintainers/nietonfir)

---

Top Contributors

[![nietonfir](https://avatars.githubusercontent.com/u/438460?v=4)](https://github.com/nietonfir "nietonfir (1 commits)")

---

Tags

googlesecurityrecaptchacaptchaNo CAPTCHA reCAPTCHA

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[phelium/recaptcha

reCAPTCHA v2 class

4389.4k](/packages/phelium-recaptcha)[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)
