Table of Contents
- Installation (Single Site)
- Installation (Multisite)
- Quick Start
- Sections Menu
- Categories Menu
- Cookies Menu
- Import Menu
- Export Menu
- Maintenance Menu
- Options Menu
- Cookies Block
- Delete Cookies Block
- Caching Plugins
- Geolocation
- Shortcodes
- Credits
- FAQ
1) Installation (Single Site)
With this procedure, you will be able to install the Lightweight Cookie Notice plugin on your WordPress website.
- Visit the Plugins -> Add New menu
- Click on the Upload Plugin button and select the zip file you just downloaded
- Click on Install Now
- Click on Activate Plugin
2) Installation (Multisite)
This plugin supports both a Network Activation (the plugin will be activated on all the sites of your WordPress Network) and a Single Site Activation in a WordPress Network environment (the plugin will be activated on a single site of the network).
With this procedure, you will be able to perform a Network Activation:
- Visit the Plugins -> Add New menu
- Click on the Upload Plugin button and select the zip file you just downloaded
- Click on Install Now
- Click on Network Activate
With this procedure, you will be able to perform a Single Site Activation in a WordPress Network environment:
- Visit the specific site of the WordPress Network where you want to install the plugin
- Visit the Plugins menu
- Click on the Activate button
3) Quick Start
This section will guide you in the creation of the two most common types of cookie notices.
Cookie Notice with cookie policy
A cookie notice with cookie policy allows your visitors to read the cookie policy before accepting it.
With this procedure, you will be able to create a cookie notice with one button to read the cookie policy and one button to accept the use of the cookies:
- Install the plugin with the procedure described in the Installation (Single Site) or Installation (Multisite) section.
- Customize the text displayed in the cookie notice with the Options -> Cookie Notice -> Message Text option.
- Customize the text of the first button with the Options -> Cookie Notice -> Button 1 Text option.
- Customize the text of the second button with the Options -> Cookie Notice -> Button 2 Text option.
- Customize the content of the modal window with the Options -> Cookie Settings -> Description Header and Options -> Cookie Settings -> Description Footer options.
Cookie notice with cookie settings
A cookie notice with cookie settings allows your customer to enable or disable specific categories of cookies.
With this procedure, you will be able to create a cookie notice with one button to open the cookie settings and one button to accept the use of the cookies:
- Install the plugin with the procedure described in the Installation (Single Site) or Installation (Multisite) section.
- Customize the text displayed in the cookie notice with the Options -> Cookie Notice -> Message Text option.
- Customize the text of the first button with the Options -> Cookie Notice -> Button 1 Text option.
- Customize the text of the second button with the Options -> Cookie Notice -> Button 2 Text option.
- Customize the text displayed in the modal window associated with the click performed on the first button with the Options -> Cookie Settings -> Description Header and Options -> Cookie Settings -> Description Footer options.
- Visit the Sections menu and create a section named “Main Section” with a custom description.
- Visit the Categories menu and create a category named “First Category”. Set a custom description. Associate the category with the “Main Section” section. Enter the scripts in the Script Head and Script Body fields. These scripts are added to the page when the cookie notice is accepted.
- Visit the Categories menu and create a category named “Second Category”. Set a custom description. Associate the category with the “Main Section” section. Enter the scripts in the Script Head and Script Body fields. These scripts are added to the page when the cookie notice is accepted.
4) Sections Menu
The Sections menu should be used to create sections. The sections are displayed in the cookie settings modal windows and used to group categories.
Each section has the following fields:
Field | Description |
---|---|
Name | The name of the section. This value is displayed in the cookie settings modal window. |
Description | The description of the section. This value is displayed in the cookie settings modal window. |
Priority | The priority value determines the order used to display the sections. |
5) Categories Menu
The Categories menu should be used to create categories. The categories are displayed in the cookie settings modal window and used to give the visitors the ability to enable or disable specific cookie categories.
Each category has the following fields:
Field | Description |
---|---|
Name | The name of the category. This value is displayed in the cookie settings modal window. |
Description | The description of the category. This value is displayed in the cookie settings modal window. |
Section | The section where the category will be displayed. |
Toggle | This option determines if the toggle should be enabled. An active toggle allows the visitor to enable or disable the cookie category. |
State | This option determines the initial state of the category. |
Script Head | The plugin adds this script to the head section of the page when the cookie notice is accepted. Please note that the script tag should always wrap your code. |
Script Body | The plugin adds this script just before the closing body tag when the cookie notice is accepted. Please note that the script tag should always wrap your code. |
Priority | The priority value determines the order used to display the categories. |
6) Cookies Menu
The Cookies menu should be used to store information about the individual cookies used on the website.
You can display the cookies added to this menu in the following contexts:
- Inside post, page, or custom post types by using the Cookies Block
- In a category displayed in the cookie settings modal window
It’s worth noting that the cookies defined in this menu are also used by the Delete Cookies Block.
7) Import Menu
With the Import menu, you will be able to import the plugin data (categories, sections, cookies and category acceptance statistics) previously exported with the Export menu.
Follow this procedure to import the plugin data:
- Click the Choose File button
- Select the XML file that includes the data
- Click the Upload file and import button
8) Export Menu
With the Export menu, you will be able to generate an XML file that includes all the plugin data (categories, sections, cookies and category acceptance statistics).
Follow this procedure to export your tables:
- Click the Export button
- The browser will download the XML file in the default download folder of your operative system
9) Maintenance Menu
The Maintenance menu gives you the ability to perform special operations on the plugin data.
The following tasks are available:
Task | Description |
---|---|
Reset Plugin | This task restores the initial value of the plugin options and deletes all the plugin data. |
Delete Transient | This task deletes the transient associated with the cookie notice. |
Delete Category Acceptance | This task deletes all the records used to store the percentage of acceptance of each category. |
To execute a task, proceed as follows:
- Visit the SE Settings -> Maintenance menu
- With the Task field, select the task that you want to perform
- Click the Execute Task button
10) Options Menu
The Options menu includes 112 options that you can use to customize aspects like:
- The style and content of the cookie notice
- The style and content of the cookie settings modal window
- The geolocation feature
- The capabilities required to access the plugin menu
- Technical functionalities of the plugin
For more information about a single option, hover the mouse over the question mark on the right side of the option. The plugin will display a tooltip with additional information.
11) Cookies Block
The Cookies block allows you to include inside posts, pages, and custom post types a table with the cookies defined in the Cookies Menu.
General Information
To include the Cookies block in a post, page, or custom post type, proceed as follows:
- Edit a post, page, or custom post type
- Enable the Visual Editor
- Click on the Add Block button
- Select the Cookies block
- Customize the behavior of the block with the options available in the Settings Sidebar
- Click the Publish/Update button to apply your changes
Block options
The Cookies block includes the following options in the Settings Sidebar:
- Category
12) Delete Cookies Block
The Delete Cookies block allows you to display a button that deletes:
- The cookies set by this plugin
- The cookies defined in the Cookies menu
General Information
To include the Delete Cookies block in a post, page, or custom post type, proceed as follows:
- Edit a post, page, or custom post type
- Enable the Visual Editor
- Click on the Add Block button
- Select the Delete Cookies block
- Click the Publish/Update button to apply your changes
13) Caching Plugins
Lightweight Cookie Notice supports the most common caching plugins.
WP Super Cache
The plugin is already optimized to work with WP Super Cache. No actions are required.
W3 Total Cache
To use Lightweight Cookie Notice with the W3 Total Cache plugin, proceed as follows:
- Visit the Performance -> General Settings menu of W3 Total Cache
- In the Page Cache section, set the Page Cache Method option to “Disk: Basic”
- Save your changes
- Visit the Performance -> Page Cache menu of W3 Total Cache
- In the Advanced section, enable the Late initialization option
- Save your changes
- Clear the cache
LiteSpeed Cache
To use Lightweight Cookie Notice with the LiteSpeed Cache plugin, proceed as follows:
- Visit the LiteSpeed Cache -> Cache menu
- Add “daextlwcn” in the Login Cookie option
- Save your changes
- Clear the cache
SG Optimizer
To use Lightweight Cookie Notice with the SG Optimizer plugin, you have to exclude the following cookies on the server level:
- daextlwcn-accepted
- daextlwcn-category-status
WP Fastest Cache
To use Lightweight Cookie Notice with the WP Fastest Cache plugin, proceed as follows:
- Visit the WP Fastest Cache menu
- Select the Exclude tab
- Click on the Add New Rule button
- In the Exclude Page Wizard modal window select “Contain” and enter “daextlwcn” in the text field
- Save your changes
- Clear the cache
13) Geolocation
With this plugin, you can display the cookie notice only to visitors located in specific countries. The position of the visitor is retrieved with the HostIP.info service or with the MaxMind GeoLite2 database.
Please note that:
- The results provided by these two geolocation services are not 100% accurate.
- You have to follow the terms of service of these services.
Geolocation with HostIP.info
To enable the geolocation with HostIP.info please proceed as follows:
- Set the Options -> Geolocation -> Geolocation option to “Enabled”.
- Set the Options -> Geolocation -> Geolocation Service to “HostIP.info”.
- Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> Geolocation Locale option
- Save your changes
Geolocation with MaxMind GeoLite2
Lightweight Cookie Notice supports the GeoLite2 IP geolocation database provided by MaxMind.
You can manually download the database and move it to the location specified with the Options -> Geolocation -> MaxMind Database File Path option or enter your license key in the Options -> Geolocation -> MaxMind License Key.
When you provide a valid license, the plugin automatically downloads the database (from the MaxMind website) every week with WP Cron.
To enable the geolocation with MaxMind GeoLite2, please proceed as follows:
- Set the Options -> Geolocation -> Geolocation option to “Enabled”.
- Set the Options -> Geolocation -> Geolocation Service to “MaxMind GeoLite2”.
- Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> Geolocation Locale option.
- Enter your MaxMind License Key in the MaxMind License Key field. To download the license key, log in to the MaxMind website and generate a license key in the Manager License Key tab.
- Enter the path where you want to store the database in the MaxMind Database File Path option.
14) Shortcodes
As a secondary method to include the layout elements generated by the plugin in the posts, you can use the following WordPress shortcodes:
Layout Element | Shortcode Tag | Parameters |
A table to list the defined cookies | [ cookies ] | category-id |
A button to delete the plugin cookies and the defined cookies | [ delete-cookies ] | N/A |
Example 1
Display the cookies not associated with a category.
[ cookies ]
Example 2
Display the cookies associated with the category with ID equal to “2”.
[ cookies category-id="2" ]
Example 3
Display a button that deletes the cookies set by this plugin:
[ delete-cookies ]
16) Credits
This plugin makes use of the following resources:
- Select2 licensed under the MIT License
- Composer licensed under the MIT License
- JShrink license under the BSD 3 Clause License
- GeoIP2 PHP API licensed under the Apache License 2.0
- MaxMind DB Reader PHP API licensed under the Apache License 2.0
- Common Code for MaxMind Web Service Clients licensed under the Apache License 2.0
Disclaimer
This product can include GeoLite2 data created by MaxMind, available from https://www.maxmind.com.
17) FAQ
Can I include HTML tags in the textarea fields available in the back-end?
Yes, the following HTML tags are supported:
- p
- a
- strong
- br
- ol
- ul
- li
Which versions of PHP are supported?
PHP 7.2.0 and later versions are supported.
Which versions of WordPress are supported?
WordPress 5.0 and later versions are supported.