PHPackages                             agencyrepublic/webpurify - 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. agencyrepublic/webpurify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

agencyrepublic/webpurify
========================

A third-party PHP library for implementing web purify

v1.0.3(9y ago)424.9k2MITPHPPHP &gt;=5.3.0CI failing

Since Dec 5Pushed 9y agoCompare

[ Source](https://github.com/CriticalMassUK/webpurify)[ Packagist](https://packagist.org/packages/agencyrepublic/webpurify)[ Docs](http://github.com/CriticalMassUK/webpurify/)[ RSS](/packages/agencyrepublic-webpurify/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Web Purify API
==============

[](#web-purify-api)

[![Build Status](https://camo.githubusercontent.com/b786dbdb5863cd2888dd536ff8ccddb48306884d7a148e4a45827c9861a0bead/68747470733a2f2f7472617669732d63692e6f72672f437269746963616c4d617373554b2f7765627075726966792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/CriticalMassUK/webpurify)

A library for interfacing with [WebPurify](http://webpurify.com/).

The library is covered by PHPUnit tests using stub mocks and is PSR-0, PSR-1, PSR-2 and PSR-3 compliant.

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

[](#installation)

Add the following to your `composer.json`.

```
{
	"require": {
		"agencyrepublic/webpurify": "dev-master"
	}
}

```

Usage
-----

[](#usage)

There are two classes which you can use to make requests to Web Purify:

- `WebPurify\WebPurifyImage`
- `WebPurify\WebPurifyText`

Most methods listed on the WebPurify documentation can be used as method names for making API calls. There is exception as `return` is a reserved keyword in PHP the method name is `returnExpletives`.

- [Web Purify Image documentation](http://webpurify.com/image-moderation/documentation/)
- [Web Purify Text documentation](http://webpurify.com/documentation/)

WebPurify
---------

[](#webpurify)

These methods are available in both classes.

### setLogger

[](#setlogger)

WebPurify class is a PSR-3 compliant LoggerAwareInterface. It outputs all HTTP requests and responses to a logger. You will need a logger (like [Monolog](https://github.com/Seldaek/monolog)).

```
$logger = new Logger('name');
$logger->pushHandler(new StreamHandler('path/to/your.log'));

$webPurifyImage = new WebPurify\WebPurifyImage($apiKey);
$webPurifyImage->setLogger($logger);

```

### getUseSSL

[](#getusessl)

Get whether SSL will be used for requests.

```
var_dump($webPurifyImage->getUseSSL()); // bool(FALSE)

```

### setUseSSL

[](#setusessl)

Set whether SSL will be used for requests. The default is `false`.

```
$webPurifyImage->setUseSSL(true); // Use SSL in requests

```

WebPurifyImage
--------------

[](#webpurifyimage)

Instantiate `WebPurifyImage` by passing through your API key:

```
$webPurifyImage = new WebPurify\WebPurifyImage($apiKey);

```

### imgCheck

[](#imgcheck)

Returns: &lt;imgid&gt;

Documentation: [webpurify.live.imgcheck](http://webpurify.com/image-moderation/documentation/methods/webpurify.live.imgcheck.php)

```
# string => imgurl
$webPurifyImage->imgCheck("http://.../");

# array => post data
$webPurifyImage->imgCheck(array(
	"imgurl" => "http://.../"
	// ...
));

```

### imgStatus

[](#imgstatus)

Returns:

- true =&gt; approved
- false =&gt; declined
- null =&gt; pending

Documentation: [webpurify.live.imgstatus](http://webpurify.com/image-moderation/documentation/methods/webpurify.live.imgstatus.php)

```
# string => imgid
$webPurifyImage->imgStatus("0123456789abcdef0123456789abcdef");

# array => post data
$webPurifyImage->imgCheck(array(
	"imgid" => "0123456789abcdef0123456789abcdef"
	// ...
));

```

### imgAccount

[](#imgaccount)

Returns: &lt;remaining&gt;

Documentation: [webpurify.live.imgaccount](http://webpurify.com/image-moderation/documentation/methods/webpurify.live.imgaccount.php)

```
# No parameters
$webPurifyImage->imgAccount();

# array => post data
$webPurifyImage->imgAccount(array(
	// ...
));

```

WebPurifyText
-------------

[](#webpurifytext)

Instantiate `WebPurifyTexxt` by passing through your API key:

```
$webPurifyText = new WebPurify\WebPurifyText($apiKey);

```

### check

[](#check)

Returns: boolean &lt;found&gt;

Documentation: [webpurify.live.check](http://webpurify.com/documentation/methods/webpurify.live.check.php)

```
# string => text
$webPurifyText->check("the quick brown fox jumps over the lazy dog");

# array => post data
$webPurifyText->check(array(
	"text" => "the quick brown fox jumps over the lazy dog"
	// ...
));

```

### checkCount

[](#checkcount)

Returns: boolean &lt;found&gt;

Documentation: [webpurify.live.checkcount](http://webpurify.com/documentation/methods/webpurify.live.checkcount.php)

```
# string => text
$webPurifyText->checkCount("the quick brown fox jumps over the lazy dog");

# array => post data
$webPurifyText->check(array(
	"text" => "the quick brown fox jumps over the lazy dog"
	// ...
));

```

### replace

[](#replace)

Returns: string &lt;text&gt;

Documentation: [webpurify.live.replace](http://webpurify.com/documentation/methods/webpurify.live.replace.php)

```
# string => text
$webPurifyText->checkCount("the quick brown fox jumps over the lazy dog");

# array => post data
$webPurifyText->check(array(
	"text" => "the quick brown fox jumps over the lazy dog"
	// ...
));

```

### returnExpletives

[](#returnexpletives)

Returns: array &lt;word&gt;

Documentation: [webpurify.live.return](http://webpurify.com/documentation/methods/webpurify.live.return.php)

```
# string => text
$webPurifyText->returnExpletives("the quick brown fox jumps over the lazy dog");

# array => post data
$webPurifyText->returnExpletives(array(
	"text" => "the quick brown fox jumps over the lazy dog"
	// ...
));

```

### addToBlackList

[](#addtoblacklist)

Returns: boolean &lt;success&gt;

Documentation: [webpurify.live.addtoblacklist](http://webpurify.com/documentation/methods/webpurify.live.addtoblacklist.php)

```
# string => text
$webPurifyText->addToBlackList("scunthorpe");

# array => post data
$webPurifyText->addToBlackList(array(
	"word" => "scunthorpe"
	// ...
));

```

### addToWhiteList

[](#addtowhitelist)

Returns: boolean &lt;success&gt;

Documentation: [webpurify.live.addtowhitelist](http://webpurify.com/documentation/methods/webpurify.live.addtowhitelist.php)

```
# string => word
$webPurifyText->addToWhiteList("scunthorpe");

# array => post data
$webPurifyText->addToWhiteList(array(
	"word" => "scunthorpe"
	// ...
));

```

### removeFromBlackList

[](#removefromblacklist)

Returns: boolean &lt;success&gt;

Documentation: [webpurify.live.removefromblacklist](http://webpurify.com/documentation/methods/webpurify.live.removefromblacklist.php)

```
# string => word
$webPurifyText->removeFromBlackList("scunthorpe");

# array => post data
$webPurifyText->removeFromBlackList(array(
	"word" => "scunthorpe"
	// ...
));

```

### removeFromWhiteList

[](#removefromwhitelist)

Returns: boolean &lt;success&gt;

Documentation: [webpurify.live.removefromwhitelist](http://webpurify.com/documentation/methods/webpurify.live.removefromwhitelist.php)

```
# string => word
$webPurifyText->removeFromWhiteList("scunthorpe");

# array => post data
$webPurifyText->removeFromWhiteList(array(
	"word" => "scunthorpe"
	// ...
));

```

### getBlackList

[](#getblacklist)

Returns: array &lt;word&gt;

Documentation: [webpurify.live.getblacklist](http://webpurify.com/documentation/methods/webpurify.live.getblacklist.php)

```
# No parameters
$webPurifyText->getBlackList();

# array => post data
$webPurifyText->getBlackList(array(
	// ...
));

```

### getWhiteList

[](#getwhitelist)

Returns: array &lt;word&gt;

Documentation: [webpurify.live.getwhitelist](http://webpurify.com/documentation/methods/webpurify.live.getwhitelist.php)

```
# No parameters
$webPurifyText->getWhiteList();

# array => post data
$webPurifyText->getWhiteList(array(
	// ...
));

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 72.7% 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 ~350 days

Total

4

Last Release

3488d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/444f859a38abc4b29f2847bd72fa4529a7d9f6ec43625f677b62301629c8c3a7?d=identicon)[bashaus](/maintainers/bashaus)

---

Top Contributors

[![bashaus](https://avatars.githubusercontent.com/u/1115865?v=4)](https://github.com/bashaus "bashaus (8 commits)")[![tremby](https://avatars.githubusercontent.com/u/199635?v=4)](https://github.com/tremby "tremby (2 commits)")[![morrislaptop](https://avatars.githubusercontent.com/u/67807?v=4)](https://github.com/morrislaptop "morrislaptop (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agencyrepublic-webpurify/health.svg)

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

###  Alternatives

[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k134](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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