PHPackages                             weijihao/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. weijihao/google-recaptcha

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

weijihao/google-recaptcha
=========================

Easily use Google Recaptcha in CakePHP 3.2+ projects

2.0.9(8y ago)024[2 issues](https://github.com/weijihao/google-recaptcha/issues)MITPHPPHP &gt;=5.6

Since Dec 8Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (19)Used By (0)

[![Build Status](https://camo.githubusercontent.com/0b37147ba3dbe7af29bb10b0169f53d52f5c6540e72b24b22248fe3289b587d3/68747470733a2f2f7472617669732d63692e6f72672f6372616273747564696f2f5265636170746368612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/crabstudio/Recaptcha) [![Latest Stable Version](https://camo.githubusercontent.com/4cda467ce5501ccd9db15d1e648f5bb436ebdbb2be130aa6798274283611c352/68747470733a2f2f706f7365722e707567782e6f72672f6372616273747564696f2f7265636170746368612f762f737461626c65)](https://packagist.org/packages/crabstudio/recaptcha) [![Total Downloads](https://camo.githubusercontent.com/42c3b0106fcc86f513d2b755f2c415a5d68a8cfb9b7e7dba28761b793075eeee/68747470733a2f2f706f7365722e707567782e6f72672f6372616273747564696f2f7265636170746368612f646f776e6c6f616473)](https://packagist.org/packages/crabstudio/recaptcha) [![Latest Unstable Version](https://camo.githubusercontent.com/28481d2b4f55a2f3c1646c5816ff41001c014cd894e42ba3f2fa2b305b1f629d/68747470733a2f2f706f7365722e707567782e6f72672f6372616273747564696f2f7265636170746368612f762f756e737461626c65)](https://packagist.org/packages/crabstudio/recaptcha) [![License](https://camo.githubusercontent.com/73a741dae33c031b18f46535ac60a271659c7a2d17576f1634429b7bfb0421d7/68747470733a2f2f706f7365722e707567782e6f72672f6372616273747564696f2f7265636170746368612f6c6963656e7365)](https://packagist.org/packages/crabstudio/recaptcha)

Integrate Google Recaptcha v2 to your CakePHP v3.2+ project
===========================================================

[](#integrate-google-recaptcha-v2-to-your-cakephp-v32-project)

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require crabstudio/recaptcha

```

Or add the following lines to your application's **composer.json**:

```
"require": {
    "crabstudio/recaptcha": "^2.0"
}

```

followed by the command:

```
composer update

```

Load plugin
-----------

[](#load-plugin)

From command line:

```
bin/cake plugin load Recaptcha

```

Or this line to the end of **Your\_project\\config\\bootstrap.php**

```
Plugin::load('Recaptcha');

```

Load Component and Configure
----------------------------

[](#load-component-and-configure)

Override default configure from loadComponent:

```
$this->loadComponent('Recaptcha.Recaptcha', [
    'enable' => true,     // true/false
    'sitekey' => 'your_site_key', //if you don't have, get one: https://www.google.com/recaptcha/intro/index.html
    'secret' => 'your_secret',
    'type' => 'image',  // image/audio
    'theme' => 'light', // light/dark
    'lang' => 'vi',      // default en
    'size' => 'normal'  // normal|compact|invisible
]);

```

Usage
-----

[](#usage)

Display recaptcha in your view:

```

      // Display recaptcha box in your view, if configure enable = false, nothing to display here

```

Verify in your controller function

```
    public function forgotPassword() {
        if($this->request->is('post')){
            if($this->Recaptcha->verify()) { // if configure enable = false, always return true
                //do something here
            }
            $this->Flash->error(__('Please pass Google Recaptcha first'));
        }
    }

```

Invisible reCAPTCHA Configure
-----------------------------

[](#invisible-recaptcha-configure)

```
$this->loadComponent('Recaptcha.Recaptcha', [
    'enable' => true,     // true/false
    'sitekey' => 'your_site_key', //if you don't have, get one: https://www.google.com/recaptcha/intro/index.html
    'secret' => 'your_secret',
    'type' => 'image',  // image/audio
    'theme' => 'light', // light/dark
    'lang' => 'vi',      // default en
    'size' => 'invisible'  // normal|compact|invisible
    'callback' => 'onSubmit'
]);

```

your custom.js

```
function onSubmit(token) {
    $("form#demo-form").submit();
}

$("button#demo-submit").click(function () {
    event.preventDefault();
    grecaptcha.execute();
});

```

Done

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 50.8% 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 ~47 days

Recently: every ~24 days

Total

17

Last Release

3042d ago

Major Versions

1.0.6 → 2.0.02016-08-28

PHP version history (2 changes)1.0.0PHP &gt;=5.4

2.0.0PHP &gt;=5.6

### Community

Maintainers

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

---

Top Contributors

[![anhtuank7c](https://avatars.githubusercontent.com/u/3163410?v=4)](https://github.com/anhtuank7c "anhtuank7c (30 commits)")[![weijihao](https://avatars.githubusercontent.com/u/11623565?v=4)](https://github.com/weijihao "weijihao (9 commits)")[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (9 commits)")[![JaqueLB](https://avatars.githubusercontent.com/u/15066130?v=4)](https://github.com/JaqueLB "JaqueLB (8 commits)")[![mirko-pagliai](https://avatars.githubusercontent.com/u/293199?v=4)](https://github.com/mirko-pagliai "mirko-pagliai (1 commits)")[![nachitox](https://avatars.githubusercontent.com/u/1167303?v=4)](https://github.com/nachitox "nachitox (1 commits)")[![tobias-urdin](https://avatars.githubusercontent.com/u/14872193?v=4)](https://github.com/tobias-urdin "tobias-urdin (1 commits)")

---

Tags

googlecakephprecaptchacaptchabootstrapcrabstudioanhtuank7cagiletechvn

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[crabstudio/recaptcha

Easily use Google Recaptcha in CakePHP projects

20112.2k1](/packages/crabstudio-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)[mervick/material-design-icons

Google Material Design Icons For Using With Bootstrap

10191.4k7](/packages/mervick-material-design-icons)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[codaxis/cakephp-bootstrap3-helpers

CakePHP highly configurable helpers for Bootstrap 3 framework.

4111.5k2](/packages/codaxis-cakephp-bootstrap3-helpers)

PHPackages © 2026

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