Documentation

About the plugin

  • Author: Themeware
  • Requires at least WordPress 3.8
  • Tested up to 4.8.2

Age Checker blocks access to your website content unless the user confirms that they are above the minimum age. This is implemented by overlaying an age verification form over your webpage.

Installation

  • Upload the 'age-checker' plugin folder to your '/wp-content/plugins/' directory or use the WordPress 'Upload plugin' facility
  • Activate Age Checker within the WordPress 'Plugins' page
  • Click on the Age Checker sidebar link to go to the plugin's editor

How to use this plugin

Age Checker will launch with default settings, use the editor to tailor the appearance and settings to your requirements (only admin users can access the plugin's editor). Some of the key sections are annotated below.

1. Preview button

Clicking on the 'Preview' button will open a new window and allow you to view the verification screen in the same way a user would.

2. Preview screen

This section allows you to preview the age verification screen, the preview will update whenever you save some new changes.

3. Configuration editor

This sidebar lets you customise the verification screen with the following expandable sections:

  • Settings
  • Background
  • Form
  • Response

4. Save button

Remember to press the 'Save Changes' button after making some new changes otherwise they will be not be stored.

Configuration

The plugin's editable options and their responsibilities are listed below. You can find them within the configuration editor.

Settings

Plugin active
The age verification screen is off by default, switch 'Plugin active' to 'Yes' if you want to start displaying the screen to users.

Minimum age
This value defines how old a user must be to access your website content.

Verification method
Choose which method you would like to use for age verification.

Date format
Date format preference - used for the 'Birthday' verification method.

Cookie life
This determines the number of days before the verification screen is displayed again to approved users.

Search engines
Choose if you want to display the verification screen to search engine crawlers. It is recommended to set this as 'No' for better SEO.

Exit button
Choose if you need an exit button to redirect users away from the verification screen.

Exit button URL
Exit buttons require a URL to redirect the user.

Background

Options
Choose the verification screen's background mode.

Overlay opacity
You can adjust the overlay opacity for background images/videos. Drag the slider to choose your level, the larger the number, the darker the overlay.

Color
There are some color presets or you can pick a custom color by clicking on the pencil icon.

Image
Only JPG, PNG or GIF files are accepted.

Video
Only MP4 files are accepted.

Form

Note: Entering the keyword '%agc_age%' in these fields will output the 'Minimum age' value.

Title
The verification screen's title.

Intro
The verification screen's introduction.

Checkbox
The checkbox label - used for the 'Checkbox' verification method.

Button
The verification screen's submit button.

Exit button
The verification screen's exit button.

Response

Note: Entering the keyword '%agc_age%' in these fields will output the 'Minimum age' value.

Empty
This message is shown to users if they have not entered anything.

Non existent date
This message is shown to users if they have entered a non existent date - used for the 'Birthday' verification method.

Below minimum age
This message is shown to users if their age is below the minimum - used for the 'Birthday' verification method.

Plugin structure

If you are comfortable with writing in PHP, HTML, CSS, or JavaScript, it is possible to make customizations not offered by the plugin's editor. However, editing the plugin's files is not recommended as future versions of the plugin will overwrite your changes. A summary of the plugin's files is provided below.

PHP

  • age_checker.php - loads the plugin's files with wp_enqueue and processes the AJAX requests sent from the verification screen and editor
  • inc/verify_template.php - HTML for the verification screen
  • admin/admin_template.php - HTML for the editor

JavaScript

  • inc/assets/js/js.js - JavaScript for operating the verification screen
  • inc/assets/js/initialize.js - JavaScript required to launch the verification screen
  • admin/assets/js/js.js - JavaScript for operating the editor
  • admin/assets/js/spectrum.js - JavaScript for the editor's color picker
  • admin/assets/jquery-ui-1.12.1/jquery-ui.min.js - jQuery UI JavaScript for the editor's overlay slider

CSS

  • inc/assets/css/style.css - CSS for the verification screen
  • inc/assets/css/old_ie.css - CSS edits required for older versions of Internet Explorer
  • inc/assets/css/icomoon.css - CSS for icons used in the verification screen and editor
  • admin/assets/css/style.css - CSS for the editor
  • admin/assets/css/preview.css - CSS edits required for including the verification screen in the preview editor
  • admin/assets/css/spectrum.css - CSS for the editor's color picker
  • admin/assets/jquery-ui-1.12.1/jquery-ui.min.css - jQuery UI CSS for the editor's overlay slider