Download the PHP package justinholtweb/craft-redpen without Composer

On this page you can find all versions of the php package justinholtweb/craft-redpen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-redpen

RedPen

Editorial QA for Craft CMS 5. RedPen enforces your house style guide on every entry — banned terms, brand capitalisation, readability, structure, accessibility and typography — and can add real grammar review from a self-hosted LanguageTool server or an LLM you bring your own key for.

It is not a spellchecker. Your browser already does that, for free, in every field. RedPen checks the things a browser cannot: the rules your organisation actually wrote down.

Requirements

Craft CMS 5.3+ and PHP 8.2+.

Editions

Lite (free) Pro
Full rule library
Review panel on entry edit
One default style profile
Multiple profiles, per-section assignment
Save-time validation (warn or block)
Site-wide audit, report and dashboard widget
LanguageTool and LLM backends
Console command for CI
Editorial sign-off

What it checks

Twelve rules ship in the box, across seven categories.

Terminology — banned and preferred terms (utilize => use), brand and product capitalisation (GithubGitHub).

Grammar — repeated words.

Accessibility — missing or useless image alt text, link text that means nothing out of context (click here), empty links, links that go nowhere.

Structure — headings that skip a level, are empty, or repeat.

Typography — double spaces, spaces before punctuation, missing spaces after it.

Inclusivity — gendered job titles, ableist metaphors, and terms with settled neutral equivalents.

Style and readability — weasel words, passive voice, sentence length, Flesch-Kincaid grade level. These four ship off or as notices, because they are matters of taste and a wall of warnings on day one teaches people to ignore the plugin.

Every rule can be enabled, disabled, re-severitied and configured per profile, and profiles can be scoped to a section, a site, or both.

Severities

checkOnSave and blockOnError both default to off. A plugin that starts refusing saves the moment it is installed is a support ticket, so switching that on is a deliberate act.

Backends

RedPen runs up to three checkers, in order, and merges their findings:

  1. Style rules — the built-in library. Pure PHP, no network, no cost, works everywhere. Always on.
  2. LanguageTool — point languageToolEndpoint at a self-hosted server (docker run -p 8010:8010 erikvl87/languagetool). RedPen never calls LanguageTool's public API: their terms forbid automated requests, and defaulting to it would break every install at once the first time they enforce that.
  3. LLM — a Claude or OpenAI key of your own. Real grammar rewriting and brand-voice review, billed to you. Suggestions land in a diff with per-item accept/reject; RedPen never rewrites copy silently.

An unconfigured backend reports itself unavailable and is skipped, so a missing endpoint never breaks a check the rule engine could have answered.

Extending it

Three events, all on the plugin's services:

Rules::EVENT_REGISTER_RULES adds or replaces a rule (reuse an id to override a built-in), Extractors::EVENT_REGISTER_EXTRACTORS teaches RedPen to read a custom field type, and Checkers::EVENT_REGISTER_CHECKERS adds a validation backend.

A rule is one small class:

Rules take a Fragment and return Issues. They touch no database and no Craft services, which is why the whole library is testable without booting an application.

Settings

Setting Default Notes
language en-US Language rules evaluate against
checkOnLoad true Check when an edit screen opens
checkOnSave false Evaluate on save (Pro)
blockOnError false Let an error actually block the save (Pro)
backends ['rules'] Which checkers run, in order
languageToolEndpoint '' Self-hosted LanguageTool base URL. Env-var friendly
llmProvider anthropic anthropic or openai
llmApiKey '' Env-var friendly
maxFragmentLength 20000 Characters per field sent to a network backend
cacheDuration 300 Seconds a check result is cached

languageToolEndpoint, llmApiKey and llmModel all parse env vars, so credentials stay out of project config.

Running it from the command line

--fail-on is the one that matters in CI: it exits non-zero when anything at that severity or worse is found, so a pipeline can refuse to deploy copy that breaks the style guide. Pro only.

Development

The suite runs without booting Craft — no database, no application, ~0.2s. That is deliberate: the text layer, the rule library and the response parsing are plain PHP over plain value objects, and the network backends sit behind HttpClientInterface, so the parts that carry real logic are directly reachable.

The parts that genuinely need Craft — extractors reading field values, project-config profile storage, save-time validation, the audit query — are verified by integration runs against a local Craft install instead, because faking an element well enough to be meaningful costs more than it proves.

To exercise the LanguageTool backend locally:

then point languageToolEndpoint at it (http://host.docker.internal:8010 from inside DDEV).

Licence

Proprietary. © Justin Holt.


All versions of craft-redpen with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-dom Version *
ext-json Version *
ext-mbstring Version *
craftcms/cms Version ^5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package justinholtweb/craft-redpen contains the following files

Loading the files please wait ...