Extension:VisualMathCaptcha

The VisualMathCaptcha extension gave wikis an (at-best) moderately strong captcha with a math operation generated as image. It did not stop all spam, but did reduce the amount of rubbish which got through.

The extension is now abandoned. It was working up to MW 1.20 and PHP 5.3 or so, but on new MediaWiki installations is now failing with:
 * PHP Fatal error: Call to undefined method SpecialPage::SpecialPage in extensions/VisualMathCaptcha/VisualMathCaptcha.body.php on line 16

Source code
README

LocalSettings.part

VisualMathCaptcha.body.php

VisualMathCaptcha.class.php

VisualMathCaptcha.setup.php

VisualMathConfirmCaptcha.class.php

Installation
This extension requires you have GD module for PHP.

Download VisualMathExtension from here (this is not a direct link; extension can't be located by clicking this link).

To install this extension, add the following to LocalSettings.php:

Configuration parameters

 * : [int] max value (included) for each number in operation ; Defaulted to . Needs to be increased as a trivial single-digit challenge will let 10% of the spam through.


 * : [int] count of number in generated operator; Defaulted to.


 * : [array] operators allowed for generation; Defaulted to.

To adjust the minimum/maximum brightness of both the text characters and the random background, one must edit  as these are not assigned parameters. The  and   lines control background and text colour, respectively.

The last three parameters of each contain a random function for brightness, where each controls one primary colour. The maximum range of each must be within 0 to 255, so (for example)  would allow any random intensity,    would be between black and grey,    between grey and white.

Adjust the foreground and background intensity to the lowest contrast which is still human-readable.

With ConfirmEdit
This captcha can be used instead of standard captcha of ConfirmEdit extension. To do so :
 * 1) Open , in ConfirmEdit extension directory, and change   value to.
 * 2) Add following line in LocalSettings.php, after content copied from provided file   :

With Lockdown extension
VisualMathCaptcha uses a special page: SpecialPage:VisualMathCaptcha.

Add in LocalSettings.php

With CorporateContact

 * VisualMathCaptcha can be used with CorporateContact.