PHPackages                             crazy-max/cws-captcha - 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. crazy-max/cws-captcha

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

crazy-max/cws-captcha
=====================

PHP class to generate a captcha to avoid spam.

1.7.2(6y ago)318MITPHPPHP &gt;=5.3.0

Since Aug 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/crazy-max/CwsCaptcha)[ Packagist](https://packagist.org/packages/crazy-max/cws-captcha)[ Docs](https://github.com/crazy-max/CwsCaptcha)[ RSS](/packages/crazy-max-cws-captcha/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (1)Versions (6)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/a579d437467ad6187457bc2d2f1ba227b72e087647c6372fce8ea86a79b909ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6372617a792d6d61782f6377732d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/crazy-max/cws-captcha)[![Minimum PHP Version](https://camo.githubusercontent.com/55453b8aba1f0d2c449c2dfa58e6debd503f9d637d2e474960cea8c266371e2f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e332e302d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/414e2aa9659200fdd0290709387532524908ddf0af2decac3943bbb1f2cfd628/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f6372617a792d6d61782f437773436170746368612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/crazy-max/CwsCaptcha)[![Code Quality](https://camo.githubusercontent.com/219645a9cceaca1803a42b5c019dff044c84567578beac2ffe163c622eb7ffc5/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f38326436366537303861346134336361393431366431613766346233346630392e7376673f7374796c653d666c61742d737175617265)](https://www.codacy.com/app/crazy-max/CwsCaptcha)[![Become a sponsor](https://camo.githubusercontent.com/2b64183536d3742cfdfdbe2a16c7a26ae05e6a3db44e513ff73defdeed344cc1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f722d6372617a792d2d6d61782d3138313731372e7376673f6c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/sponsors/crazy-max)[![Donate Paypal](https://camo.githubusercontent.com/86518966c73798ed1c862566d92cd4cdd48152e30ab7f42fb7d5138138231d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d3030343537632e7376673f6c6f676f3d70617970616c267374796c653d666c61742d737175617265)](https://www.paypal.me/crazyws)

⚠️ Abandoned project
--------------------

[](#warning-abandoned-project)

This project is not maintained anymore and is abandoned. Feel free to fork and make your own changes if needed.

Thanks to everyone for their valuable feedback and contributions.

About
-----

[](#about)

PHP class to generate a captcha to avoid spam.

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

[](#installation)

```
composer require crazy-max/cws-captcha
```

And download the code:

```
composer install # or update
```

Getting started
---------------

[](#getting-started)

See `tests/test.php`, `tests/testCaptcha.php` files samples to help you.

To create a captcha, copy/edit `testCaptcha.php` file and insert this in your HTML :

```

```

Example
-------

[](#example)

[![](.res/example.png)](.res/example.png)

Methods
-------

[](#methods)

**process** - Process the captcha generation.
**check** - Static method that checks the captcha code entered.

**getWidth** - Captcha width in px.
**setWidth** - Set the captcha width in px.
**getHeight** - Captcha height in px.
**setHeight** - Set the captcha height in px.
**getMinLength** - Captcha minimum length.
**setMinLength** - Set the captcha minimum length.
**getMaxLength** - Captcha maximum length.
**setMaxLength** - Set the captcha maximum length.
**getBgdColor** - Hexadecimal background color.
**setBgdColor** - Set the hexadecimal background color.
**getBgdTransparent** - The background transparent for PNG image type.
**setBgdTransparent** - Set background transparent for PNG image type. If enabled, this will disable the background color.
**getFgdColors** - Hexadecimal foreground colors list for font letters.
**setFgdColors** - Set the Hexadecimal foreground colors list for font letters.
**getFonts** - Fonts definition (letter\_space, min and max size, filename).
**getMaxRotation** - Max clockwise rotations for a letter.
**setMaxRotation** - Set the max clockwise rotations for a letter.
**getPeriod** - Generated image period (x, y).
**setPeriod** - Set the generated image period (x, y).
**getAmplitude** - Generated image amplitude (x, y).
**setAmplitude** - Set the generated image amplitude (x, y).
**getBlur** - The blur effect using the Gaussian method.
**setBlur** - Add blur effect using the Gaussian method.
**getEmboss** - The emboss effect.
**setEmboss** - Add emboss effect.
**getPixelate** - The pixelate effect.
**setPixelate** - Add pixelate effect.
**getFormat** - Image format.
**setPngFormat** - Set the png image format. (default)
**setJpegFormat** - Set the jpeg image format.
**getError** - The last error.

How can I help ?
----------------

[](#how-can-i-help-)

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬 You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) 👏 or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! 🚀

Thanks again for your support, it is much appreciated! 🙏

License
-------

[](#license)

MIT. See `LICENSE` for more details.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

2440d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2ac50dd173150fc9339728d7b2b1c872b6853111b20e4569844e215f644f632?d=identicon)[crazy-max](/maintainers/crazy-max)

---

Top Contributors

[![crazy-max](https://avatars.githubusercontent.com/u/1951866?v=4)](https://github.com/crazy-max "crazy-max (25 commits)")

---

Tags

captchagdphpspamcaptcha

### Embed Badge

![Health badge](/badges/crazy-max-cws-captcha/health.svg)

```
[![Health](https://phpackages.com/badges/crazy-max-cws-captcha/health.svg)](https://phpackages.com/packages/crazy-max-cws-captcha)
```

###  Alternatives

[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.5M10](/packages/karser-karser-recaptcha3-bundle)[laminas/laminas-captcha

Generate and validate CAPTCHAs using Figlets, images, ReCaptcha, and more

2419.2M49](/packages/laminas-laminas-captcha)[isometriks/spam-bundle

Provides spam protection for Symfony forms

46205.4k1](/packages/isometriks-spam-bundle)[abanoubnassem/filament-grecaptcha-field

Provides a Google reCaptcha V2 field for the Filament Forms

26126.1k2](/packages/abanoubnassem-filament-grecaptcha-field)[aryehraber/statamic-captcha

Protect your Statamic forms using a Captcha service

17205.3k](/packages/aryehraber-statamic-captcha)[mobicms/captcha

A simple PHP CAPTCHA library

2618.4k3](/packages/mobicms-captcha)

PHPackages © 2026

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