Jump to content

Extension:MWDrivelDefence

From mediawiki.org
MediaWiki extensions manual
MWDrivelDefence
Release status: beta
Implementation Special page , Parser function , Hook
Description Provides plain English checking and WCAG 2.2 AA accessibility analysis for wiki content
Author(s) Gary Foster - DAFO Creative Ltd (squeak24talk)
Latest version 0.1.2
MediaWiki >= 1.43
Database changes No
$wgMWDrivelDefenceAutoAnalyze, $wgMWDrivelDefenceNamespaces, $wgMWDrivelDefenceMinWords, $wgMWDrivelDefenceMaxSentenceLength
Licence GNU Affero General Public License 3.0 or later
Download
README
CHANELOG
Extension Testing
Issues Open tasks · Report a bug

The MWDrivelDefence extension provides plain English checking functionality and WCAG 2.2 AA accessibility analysis for MediaWiki content. Based on guidance from the Plain English Campaign, it helps editors create more accessible and readable articles.

Features

[edit]

Plain English Analysis

[edit]
  • Special page: A dedicated Special:MWDrivelDefence page for analysing pasted or typed text.
  • Parser function: Inline text checking using {{#drivelcheck:text to check}}.
  • Automatic analysis: Optional automatic analysis of pages on save, with results posted to the talk page.
  • Word analysis: Identifies words that could be replaced with simpler alternatives.
  • Sentence analysis: Highlights long sentences that may be difficult to read.
  • Statistical summary: Provides word counts, sentence counts, and readability metrics.

WCAG 2.2 AA Accessibility Analysis

[edit]
  • Reading level: Flesch–Kincaid Grade Level, Flesch Reading Ease, and Gunning Fog Index calculations.
  • Dyslexia-friendly analysis: Paragraph length, sentence complexity, complex word identification, and design recommendations.
  • Screen reader compatibility: Alt text verification, heading structure analysis, form label checking, and table header validation.
  • Colour contrast checking: WCAG AA/AAA compliance verification with an interactive contrast-ratio calculator.
  • Overall WCAG compliance score: Comprehensive accessibility rating.

Installation

[edit]
  • https://github.com/dafogary/MWDrivelDefence and place the file(s) in a directory called MWDrivelDefence in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MWDrivelDefence' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Alternatively, clone the repository directly into your extensions/ directory:

cd extensions/
git clone https://github.com/dafogary/MWDrivelDefence.git

Usage

[edit]

Special page

[edit]

Visit Special:MWDrivelDefence on your wiki. Paste or type text into the text area, select your analysis options, and click Analyse Text to generate a report covering plain English compliance and WCAG 2.2 AA accessibility.

Parser function

[edit]

Use the parser function to check text inline within wiki pages:

{{#drivelcheck:This is some text that you want to check for plain English usage.}}

This renders the text with an Analyse button that users can click to run the analysis.

Configuration parameters

[edit]

The extension works out of the box with no additional configuration. The following optional parameters may be added to LocalSettings.php:

$wgMWDrivelDefenceAutoAnalyze
Automatically analyse pages when saved and post results to the talk page. Default: false.
$wgMWDrivelDefenceNamespaces
Array of namespace IDs to analyse. Default: [ 0, 4 ] (Main and Project).
$wgMWDrivelDefenceMinWords
Minimum word count required to trigger automatic analysis. Default: 50.
$wgMWDrivelDefenceMaxSentenceLength
Maximum recommended sentence length (in words) before a warning is raised. Default: 25.

See also

[edit]