Using a local library to implement a CAPTCHA on user forms
As discussed in the previous recipe, Implementing a CAPTCHA on user forms using an online service, adding a CAPTCHA to visitor-facing forms helps reduce unwanted submissions to a website. After seeing how to integrate an online third-party service, this recipe shows how to download and integrate a local PHP script to generate and validate CAPTCHA images locally.
You should be running the final version of the Book Reviews plugin created in Chapter 4, The Power of Custom Post Types. You should also have already followed the Sending email notifications upon new submissions recipe. You should not have any Google reCAPTCHA code from the previous recipe.
Alternatively, you can get the resulting files from the book's GitHub page (
ch7-book-review-user-submission-v3.php file should...