PHPackages                             divineomega/is\_offensive - 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. divineomega/is\_offensive

Abandoned → [jord-jd/is\_offensive](/?search=jord-jd%2Fis_offensive)Library[Utility &amp; Helpers](/categories/utility)

divineomega/is\_offensive
=========================

This PHP package provides an `is\_offensive` helper function. Passing a string to `is\_offensive` will return a boolean telling you if it contains offensive words.

v5.0.0(2mo ago)71.6k2[1 PRs](https://github.com/Jord-JD/is_offensive/pulls)LGPL-3.0-onlyPHPPHP &gt;=7.1

Since Jan 30Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/is_offensive)[ Packagist](https://packagist.org/packages/divineomega/is_offensive)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-is-offensive/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (11)Used By (0)

🤬🤭 Is Offensive Helper Function
===============================

[](#-is-offensive-helper-function)

[![Build Status](https://camo.githubusercontent.com/bed539afcb68daea81486fae4b25b19017a86f57d47c3326fc9ce20e2937f8b9/68747470733a2f2f7472617669732d63692e6f72672f4a6f72642d4a442f69735f6f6666656e736976652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Jord-JD/is_offensive)[![Coverage Status](https://camo.githubusercontent.com/149f397ffb0436dc91fd0fca9a9070c4d439e0462ef330d24b214870b7419e60/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a6f72642d4a442f69735f6f6666656e736976652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Jord-JD/is_offensive?branch=master)[![StyleCI](https://camo.githubusercontent.com/969d0e6258206497c05b3aacada205018f007ff63452e7becd5c4cb22f6b324f/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131393533393834322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/119539842)

This PHP package provides an `is_offensive` helper function. Passing a string to `is_offensive` will return a boolean telling you if it contains offensive words.

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

[](#installation)

The `is_offensive` package can be easily installed using Composer. Just run the following command from the root of your project.

```
composer require "jord-jd/is_offensive"

```

If you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.

Usage
-----

[](#usage)

To check if a word is offensive, just pass it to the `is_offensive` method.

Here are a few examples:

```
is_offensive('fuck');  // true
is_offensive('fuk');   // true

is_offensive('duck');  // false
is_offensive('cat');   // false

is_offensive('sex');         // true
is_offensive('Middlesex');   // false

is_offensive('tit');         // true
is_offensive('Tittesworth'); // false

is_offensive('cunt');        // true
is_offensive('Scunthorpe');  // false
```

If you prefer to avoid using helper functions, the following syntax is also available.

```
$offensive = (new OffensiveChecker())->isOffensive('fuck')  // true
```

### Custom word lists

[](#custom-word-lists)

There are reasons why you may wish to define your own list of offensive words. Perhaps the ones supplied are too strict, or not strict enough.

```
$blacklist = ['moist', 'stinky', 'poo'];

$offensiveChecker = new OffensiveChecker($blacklist);

$offensiveChecker->isOffensive('poo');     // true
$offensiveChecker->isOffensive('poops');   // true
```

You can also define a whitelist of words that will be accepted even if they match the defined list of offensive words.

```
$blacklist = ['moist', 'stinky', 'poo'];
$whitelist = ['poop'];

$offensiveChecker = new OffensiveChecker($blacklist, $whitelist);

$offensiveChecker->isOffensive('poo');     // true
$offensiveChecker->isOffensive('poops');   // false
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance83

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~326 days

Recently: every ~710 days

Total

10

Last Release

87d ago

Major Versions

v1.4.1 → v4.0.02026-02-14

v4.0.0 → v5.0.02026-02-14

PHP version history (2 changes)v1.4.1PHP &gt;=7.0

v4.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (24 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

offensiveoffensive-languagephpphp-helperphp-library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/divineomega-is-offensive/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-is-offensive/health.svg)](https://phpackages.com/packages/divineomega-is-offensive)
```

###  Alternatives

[shaozeming/aliyun-sts

基于阿里云openapi系列接口中STS最新版本的SDK进行封装的composer package

2021.0k1](/packages/shaozeming-aliyun-sts)

PHPackages © 2026

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