PHPackages                             simplygoodwork/curses - 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. [Templating &amp; Views](/categories/templating)
4. /
5. simplygoodwork/curses

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

simplygoodwork/curses
=====================

A lightweight, developer-focused profanity filter for Craft CMS

1.0.0(5mo ago)017[2 issues](https://github.com/simplygoodwork/craft-curses/issues)proprietaryPHPPHP ^8.0.2CI passing

Since Dec 3Pushed 5mo agoCompare

[ Source](https://github.com/simplygoodwork/craft-curses)[ Packagist](https://packagist.org/packages/simplygoodwork/curses)[ RSS](/packages/simplygoodwork-curses/feed)WikiDiscussions main Synced 1mo ago

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

[![Curses icon](./src/icon.svg)](./src/icon.svg)

Curses!
=======

[](#curses)

Plugin for Craft CMS
--------------------

[](#plugin-for-craft-cms)

A lightweight, developer-focused profanity filter for Craft CMS. Detect and mask inappropriate content in your frontend templates using advanced pattern matching.

Features
--------

[](#features)

- **Twig Filters** - `maskProfanity` and `hasProfanity` for template use
- **Advanced Pattern Matching** - Detects variations including substitutions, obscured text, and repeated letters
- **Config-Based** - Customize the word list via a simple config file

Requirements
------------

[](#requirements)

- Craft CMS `4.0.0` or later
- PHP `8.0.2` or later

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

[](#installation)

```
composer require simplygoodwork/curses
```

Then install the plugin from the Control Panel or run:

```
php craft plugin/install curses
```

Usage
-----

[](#usage)

### Twig Filters

[](#twig-filters)

#### maskProfanity

[](#maskprofanity)

Masks profanity in text using the configured mask character (default `*`):

```
{{ entry.body|maskProfanity }}
{# Output: "This is some **** text" #}

{# Override mask character for this call #}
{{ entry.body|maskProfanity('#') }}
{# Output: "This is some #### text" #}
```

#### hasProfanity

[](#hasprofanity)

Check if text contains profanity:

```
{% if entry.body|hasProfanity %}
    This content may contain inappropriate language.
{% endif %}

{# As a function #}
{% if hasProfanity(entry.body) %}
    {# ... #}
{% endif %}
```

Configuration
-------------

[](#configuration)

The plugin comes with a blank list of words. To customize:

1. Copy `vendor/simplygoodwork/curses/src/config.php` to `config/curses.php`
2. Modify the settings as needed

```
// config/curses.php
return [
    // Character used to mask profanity (default: '*')
    // Set to an empty string '' to remove profanity entirely instead of masking
    'maskCharacter' => '*',

    // Your word list
    'profanities' => [
        'word1',
        'word2',
        // ...
    ],
];
```

The config file is multi-environment aware, so you can have different settings per environment.

Pattern Matching
----------------

[](#pattern-matching)

The plugin detects various obfuscation techniques:

- **Straight Match**: `profanity`
- **Substitution**: `pr0f@n1ty` (common letter replacements like a→@, e→3, i→1)
- **Obscured**: `p-r-o-f-a-n-i-t-y` (with separators like -, \_, .)
- **Doubled**: `pprrooffaanniittyy` (repeated letters)
- **Combined**: `p-r0f@n|tty` (mix of techniques)

Performance
-----------

[](#performance)

- **Request-level caching** - Patterns are compiled once per request
- **Efficient regex** - Single-pass matching for all word variations
- **No database queries** - Words loaded from config file

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md)

Support
-------

[](#support)

[Submit an issue](https://github.com/simplygoodwork/craft-curses/issues) on GitHub.

---

Brought to you by [Good Work](https://simplygoodwork.com)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance71

Regular maintenance activity

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.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

Unknown

Total

1

Last Release

166d ago

### Community

Maintainers

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

---

Top Contributors

[![chrisrowe](https://avatars.githubusercontent.com/u/220456?v=4)](https://github.com/chrisrowe "chrisrowe (2 commits)")[![brandonjjon](https://avatars.githubusercontent.com/u/507435?v=4)](https://github.com/brandonjjon "brandonjjon (1 commits)")

---

Tags

twigfilterprofanitycmsCraftcraftcmscraft-pluginProfanity Filtercurses

### Embed Badge

![Health badge](/badges/simplygoodwork-curses/health.svg)

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

###  Alternatives

[wbrowar/guide

A CMS Guide for Craft CMS.

6154.5k1](/packages/wbrowar-guide)[jalendport/craft-preparse

A fieldtype that parses Twig when an element is saved and saves the result as plain text.

1086.4k](/packages/jalendport-craft-preparse)[nystudio107/craft-autocomplete

Provides Twig template IDE autocomplete of Craft CMS &amp; plugin variables

44204.4k13](/packages/nystudio107-craft-autocomplete)[viget/craft-classnames

Classnames plugin for Craft CMS

1115.5k1](/packages/viget-craft-classnames)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.3k](/packages/verbb-footnotes)

PHPackages © 2026

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