source: trunk/www.guidonia.net/wp/wp-content/plugins/really-simple-captcha/README.txt@ 44

Last change on this file since 44 was 44, checked in by luciano, 15 years ago
File size: 2.9 KB
Line 
1=== Really Simple CAPTCHA ===
2Contributors: takayukister
3Donate link: http://pledgie.com/campaigns/3259
4Tags: captcha
5Requires at least: 2.2
6Tested up to: 2.7.1
7Stable tag: 1.0
8
9Really Simple CAPTCHA is a CAPTCHA module intended to be called from other plugins. It is originally created for my Contact Form 7 plugin.
10
11== Description ==
12
13Really Simple CAPTCHA does not work alone and is intended to work with other plugins. It is originally created for Contact Form 7, however, you can use it with your own plugin.
14
15Note: This product is "really simple" as its name suggests, i.e., it is not strongly secure. If you need perfect security, you should try other solutions.
16
17= How does it work? =
18
19Really Simple CAPTCHA does not use PHP "Sessions" for storing states, unlike many other PHP CAPTCHA solutions, but stores them as temporary files. This allows you to embed it into WordPress without worrying about conflicts.
20
21When you generate a CAPTCHA, Really Simple CAPTCHA creates two files for it; one is an image file of CAPTCHA, and the other is a PHP file which returns the correct answer to the CAPTCHA.
22
23The two files have the same (random) prefix in their file names, for example, "a7hk3ux8p.png" and "a7hk3ux8p.php." In this case, for example, when the respondent answers "K5GF" as an answer to the "a7hk3ux8p.png" image, then Really Simple CAPTCHA runs "a7hk3ux8p.php" code and tests the answer against the return value it receives. If the return value is "K5GF," the two match, and the answer is confirmed as correct.
24
25= How to use with your plugin =
26
27First, create an instance of ReallySimpleCaptcha class:
28
29 `$captcha_instance = new ReallySimpleCaptcha();`
30
31You can change the instance variables as you wish.
32
33 `// Change the background color of CAPTCHA image to black`
34 `$captcha_instance->bg = array(0, 0, 0);`
35
36See really-simple-captcha.php if you are interested in other variables.
37
38Generate a random word for CAPTCHA.
39
40 `$word = $captcha_instance->generate_random_word();`
41
42Generate an image file and a PHP code file in the temporary directory.
43
44 `$prefix = mt_rand();`
45 `$captcha_instance->generate_image($prefix, $word);`
46
47Then, show the image and get an answer from respondent.
48
49Check the correctness of the answer.
50
51 `$correct = $captcha_instance->check($prefix, $the_answer_from_respondent);`
52
53If the $correct is true, go ahead. Otherwise, block the respondent -- as it would appear not to be human.
54
55And last, remove the temporary image and PHP files, as they are no longer in use.
56
57 `$captcha_instance->remove($prefix);`
58
59That's all.
60
61If you wish to see a live sample of this, you can try Contact Form 7.
62
63== Installation ==
64
65In most cases you can install automatically from WordPress.
66
67However, if you install this manually, follow these steps:
68
691. Upload the entire `really-simple-captcha` folder to the `/wp-content/plugins/` directory.
701. Activate the plugin through the 'Plugins' menu in WordPress.
71
72FYI: There is no "control panel" for this plugin.
Note: See TracBrowser for help on using the repository browser.