Lightweight Cookie Notice

Table of Contents

  1. Installation (Single Site)
  2. Installation (Multisite)
  3. Quick Start
  4. Sections Menu
  5. Categories Menu
  6. Cookies Menu
  7. Import Menu
  8. Export Menu
  9. Maintenance Menu
  10. Options Menu
  11. Cookies Block
  12. Delete Cookies Block
  13. Caching Plugins
  14. Geolocation
  15. Shortcodes
  16. Credits
  17. FAQ

1) Installation (Single Site)

With this procedure, you will be able to install the Lightweight Cookie Notice plugin on your WordPress website.

  1. Visit the Plugins -> Add New menu
  2. Click on the Upload Plugin button and select the zip file you just downloaded
  3. Click on Install Now
  4. 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:

  1. Visit the Plugins -> Add New menu
  2. Click on the Upload Plugin button and select the zip file you just downloaded
  3. Click on Install Now
  4. Click on Network Activate

With this procedure, you will be able to perform a Single Site Activation in a WordPress Network environment:

  1. Visit the specific site of the WordPress Network where you want to install the plugin
  2. Visit the Plugins menu
  3. 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.

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:

  1. Install the plugin with the procedure described in the Installation (Single Site) or Installation (Multisite) section.
  2. Customize the text displayed in the cookie notice with the Options -> Cookie Notice -> Message Text option.
  3. Customize the text of the first button with the Options -> Cookie Notice -> Button 1 Text option.
  4. Customize the text of the second button with the Options -> Cookie Notice -> Button 2 Text option.
  5. Customize the content of the modal window with the Options -> Cookie Settings -> Description Header and Options -> Cookie Settings -> Description Footer options.

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:

  1. Install the plugin with the procedure described in the Installation (Single Site) or Installation (Multisite) section.
  2. Customize the text displayed in the cookie notice with the Options -> Cookie Notice -> Message Text option.
  3. Customize the text of the first button with the Options -> Cookie Notice -> Button 1 Text option.
  4. Customize the text of the second button with the Options -> Cookie Notice -> Button 2 Text option.
  5. 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.
  6. Visit the Sections menu and create a section named “Main Section” with a custom description.
  7. 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.
  8. 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:

FieldDescription
NameThe name of the section. This value is displayed in the cookie settings modal window. 
DescriptionThe description of the section. This value is displayed in the cookie settings modal window.
PriorityThe 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:

FieldDescription
NameThe name of the category. This value is displayed in the cookie settings modal window. 
DescriptionThe description of the category. This value is displayed in the cookie settings modal window.  
SectionThe section where the category will be displayed.
ToggleThis option determines if the toggle should be enabled. An active toggle allows the visitor to enable or disable the cookie category.
StateThis option determines the initial state of the category.
Script HeadThe 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 BodyThe 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.
PriorityThe 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
  • Inside posts, pages, or custom post types by using the cookies shortcode
  • In a category displayed in the cookie settings modal window

Each cookie has the following fields:

FieldDescription
NameThe name of the cookie.
ExpirationThe expiration of the cookie.
PurposeThe purpose of the cookie.
PriorityThe priority value determines the order used to display the cookies.
CategoryThe category associated with the cookie.
ProviderThe provider of the cookie.
DomainThe domain of the cookie.
TypeThe type of the cookie.
SensitivityThe sensitivity of the cookie.
SecurityThe security of the cookie.

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:

  1. Click the Choose File button
  2. Select the XML file that includes the data
  3. 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:

  1. Click the Export button
  2. 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:

TaskDescription
Reset PluginThis task restores the initial value of the plugin options and deletes all the plugin data.
Delete TransientThis task deletes the transient associated with the cookie notice.
Delete Category AcceptanceThis task deletes all the records used to store the percentage of acceptance of each category.

 To execute a task, proceed as follows:

  1. Visit the SE Settings -> Maintenance menu
  2. With the Task field, select the task that you want to perform
  3. 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:

  1. Edit a post, page, or custom post type
  2. Enable the Visual Editor
  3. Click on the Add Block button
  4. Select the Cookies block
  5. Customize the behavior of the block with the options available in the Settings Sidebar
  6. 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.

General Information

To include the Delete Cookies block in a post, page, or custom post type, proceed as follows:

  1. Edit a post, page, or custom post type
  2. Enable the Visual Editor
  3. Click on the Add Block button
  4. Select the Delete Cookies block
  5. 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:

  1. Visit the Performance -> General Settings menu of W3 Total Cache
  2. In the Page Cache section, set the Page Cache Method option to “Disk: Basic”
  3. Save your changes
  4. Visit the Performance -> Page Cache menu of W3 Total Cache
  5. In the Advanced section, enable the Late initialization option
  6. Save your changes
  7. Clear the cache

LiteSpeed Cache

To use Lightweight Cookie Notice with the LiteSpeed Cache plugin, proceed as follows:

  1. Visit the LiteSpeed Cache -> Cache menu
  2. Add “daextlwcn” in the Login Cookie option
  3. Save your changes
  4. 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:

  1. Visit the WP Fastest Cache menu
  2. Select the Exclude tab
  3. Click on the Add New Rule button
  4. In the Exclude Page Wizard modal window select “Contain” and enter “daextlwcn” in the text field
  5. Save your changes
  6. 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:

  1. Set the Options -> Geolocation -> Geolocation option to “Enabled”.
  2. Set the Options -> Geolocation -> Geolocation Service to “HostIP.info”.
  3. Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> Geolocation Locale option
  4. 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:

  1. Set the Options -> Geolocation -> Geolocation option to “Enabled”.
  2. Set the Options -> Geolocation -> Geolocation Service to “MaxMind GeoLite2”.
  3. Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> Geolocation Locale option.
  4. 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.
  5. 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 ElementShortcode TagParameters
A table with the Cookies[cookies]category-id
A button that deletes the cookies set by this plugin[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:

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.