User Tools

Site Tools



General Plugin info
Author: WouterDemuynck
Current Version: 1.2
Download: (
Code: -
Forum Thread: -

Required Nucleus Version: >=v3.2 !!


Captchas are used to prevent bots from using various types of computing services. Applications include preventing bots from taking part in online polls, registering for free email accounts (which may then be used to send spam), and, more recently, preventing bot-generated spam by requiring that the (unrecognized) sender successfully pass a captcha test before the email message is delivered. Wikipedia: Captcha


Captcha challenges can be solved by most people, but most bots are currently unable to do so. The NP_Captcha plugin adds challenges in three places:

  • Comment forms (when presented to unregistered site members)
  • Member contact forms (when presented to unregistered site members)
  • Member account activation forms (when registering, the new member is first sent an e-mail with an activation link. At that page, the user can choose a password, and is presented with the captcha challenge)


  • This plugin requires Nucleus version 3.2 or higher.
  • Example site:
  • No captcha images will be presented to registered site members. To test the captchas after installing the plugin, you'll need to either log out or use another browser from which you're not logged in.



  • Download the latest version at the Nucleus Plugins Project
  • Extract the files and upload them into the nucleus plugin directory (you should have a NP_Captcha.php file and a captcha/ subdirectory)
  • Install the plugin or update the subscription list.
  • Configure plugin options


Verifying Installation

As an administrator or logged in site member, you won't see any difference after installing the Captcha plugin.

To verify that captcha images are being generated and to find the problem when they aren't, log out and visit your site as an anonymous user. click through to an item page and verify that a captcha image is displayed. If the captcha image is displayed correctly, everything should work fine.

If no image or an error is displayed, you'll probably in one of two situations:

  • Instead of an image, an error message is displayed (white text on red background). See the table of error messages below for more info.
  • Nothing is displayed at all. This usually indicates that the GD library is missing. In this case, also try visiting the following URL (linebreak added for readability)

    If GD is not available, you'll see a no gd library error. If you see an invalid key image error, the plugin has been installed correctly. For other errors, consult the error messages table below.

If the GD library is available and captcha images still don't show up for anonymous visitors, verify that the commentform-notloggedin.template file in the /nucleus/forms/ directory is up to date. It should contain the following piece of code:


If it doesn't, replace the files in the /nucleus/forms/ directory with those from the latest Nucleus version.

Error Messages

Below is a list of errors you might encounter:

error description
no gd library No GD library is available on your server
no font available None of the font files specified in the plugin options were available to create the image with. Verify that the files exist, are readable and that the case of the filename is correct
invalid key Should never occur unless you try to get around the captcha test.
already activated Should never occur unless you try to get around the captcha test.
unsafe to create Should never occur unless you try to get around the captcha test. May occur if using more than 6 characters in the captcha. (Dobermann)

More resources

  • If you're running your own server on Debian, you'll need the php4-gd package.
  • Nucleus Support Forum: GD Test Script


Quality of images

The amount of compression that must be used when outputting a generated image. It's a number between 0 and 100, defaulting to 75. 100 means excellent image quality, but creates large images. A quality of 0 is the lowest possible quality. The default setting generates images of about 3KB in size.

Minimum characters in image

The minimum amount of characters to appear in an image. No image will be generated with less characters (an error image will be displayed in that case, and the captcha challenge will never be able to succeed)

Fonts to use

A series of font-files, separated using semicolons. The font-files need to be TrueType fonts, and they need to be present in the plugins/captcha folder. The names are case-sensitive on most servers, so beware. When no font can be found, an error image will be generated. When multiple fonts are present, different characters in the image will use different fonts.

Web Safe colors only?

When Yes, only the 216 colors that are supposed to be web-safe will be used in the image. By default, this is Off.

Type of background?

By default, this is set to Noise Characters. It adds a bunch of random characters in the background. When set to Grid, a grid is added instead of noise.

Cleanup entries older than X minutes

For each captcha image that is generated, some bookkeeping is done. Since not all generated captcha images will be answered, old entries are deleted. By default, all entries that have been generated more than 30 minutes ago will be destroyed. Note that this implies that a comment form is visited and it takes someone 31 minutes to formulate a new comment, the challenge will fail. (luckily, a new challenge will be presented in that case)

Error message

Error message to display when an incorrect answer was given for the captcha challenge.

Activation Form Template

HTML code to generate inside an account activation form. <%imgHtml%> inserts the captcha image, <%key%> inserts the public key.

Comment Form Template

HTML code to generate inside a comment form. <%imgHtml%> inserts the captcha image, <%key%> inserts the public key.

Mail Form Template

HTML code to generate inside a member mail form. <%imgHtml%> inserts the captcha image, <%key%> inserts the public key.


  1. On the plugin overview page, uninstall the plugin.
  2. Delete the NP_Captcha.php file and the captcha directory from the plugins/ directory on your server.

Version History

  • v1.2 [2005-02-27 dekarma] GD version check failed on some PHP installs
  • v1.1 [2004-08-13 dekarma] Moved generated HTML code into plugin options
  • v1.0 [2004-08-12 dekarma] Initial release

This plugin would not have been possible without these two people:

Plugin review

NP_Captcha version 1.2 works with Nucleus CMS version 3.31 - 2007-10-27 ftruscot

captcha.txt · Last modified: 2009/05/18 16:43 (external edit)