Download the PHP package digitoimistodude/air-cookie without Composer

On this page you can find all versions of the php package digitoimistodude/air-cookie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package air-cookie

Air cookie

Packagist CookieConsent_Version Tested_up_to WordPress_6.4.3 Compatible_with PHP_8.3 Build

Air cookie provides simple cookie banner and management.

Uses the CookieConsent javascript plugin as a base, making its usage with WordPress easier.

Features

Usage

Link to cookie settings

Remember to add a link into the footer, which allows opening the cookie settings anytime!

If you have Polylang installed and active, use

Cookie categories

By default, plugin has two cookie categories necessary, functional and analytics. You may add new categories with air_cookie\categories filter like shown below.

When adding new categories, the function itself is responsile for handling the translations for title and description.

There is also air_cookie\categories\{category-key} filter available to change the settings of indivual category.

Loading scripts after cookies have been accepted

The easiest way to load external script is by altering the script tag to be:

The example above works only, if the script does not require any extra javascript to be executed after the script has been loaded. If you need to execute extra javascript, use the example below.

Google Tag Manager (gtm.js)

Google Tag Manager (gtag.js)

Google Analytics (analytics.js)

Moving plugin javascript to be loaded after cookies have been accepted

Executing custom javascript after cookies have been accepted

You may execute your own javascript after certain cookie categories have been accepted. There are two ways of doing that: adding the javascript inline to header or using custom javascript events.

Adding the javascript inline

Each cookie category do get its own action, from which javascript can be outputted to be added in the main header script tag.

If you wish to use your own script tag, it is possible with example below

In separate javascript file

If you have custom javascript files in which you need to exceute code only after certain categories are accepted, there is custom javascript events available.

Each cookie category do get its own event, to which you can bind event listener into.

There is also a global custom event available, in which the category key is passed as an detail.

Changing settings

Setting names do follow the CookieConsents option names. Some settings defaults are set to be different than the CookieConsent defaults:

Setting Value
cookie_name air_cookie
current_lang value from polylang or locale option
revision automatically calculated from cookie categories
page_scripts true
gui_options/consent_modal/layout box
gui_options/consent_modal/position bottom left

You may change the settings with air_cookie\settings filter which contains all settings or air_cookie\settings\{setting-name} filter for indivual setting.

Note that these filters *do not** contain the strings or cookie categories. The air_cookie\settings_all filter contains everyhing, but usage is highly disencouraged as everything has their own specific filter.

Modifying default strings

If there is a need to modify default strings, the most preferred way to chage those is via Polylang string translations. To change the strings for all languages, it is not required to change the source.

In case of Polylang not being used, there is air_cookie\strings filter which contains all strings and air_cookie\strings\{string-key} filters for indivual strings.

Third party embeds blocking

By default third party embeds blocking is active and all embeds for following services are blocked: Youtube, Vimeo, Instagram, Facebook, Twitter, Soundcloud, Spotify, Slideshare, WordPress.com Video, Embedly, Issuu, Imgur and TikTok.

Disable this feature with air_cookie\embeds filter by returning false.

Iframe embeds are replaced with placeholder, letting visitor know that the embed might use tracking cookies. They then have opportunity to allow all cookies or enable the singular embed once.

For script embeds, we just replace the src tag with data-src and add data-cookiecategory which makes those to work CookieConsents way of loading scripts.

Cookie category for embeds

When the feature is enabled, a new cookie category is added. When this category is accepted, all embeds are loaded and shown.

Use strings filter air_cookie\strings to modify the texts for this category.

Thumbnails for placeholders

Iframe embed placeholders do support thumbnails. Without a thumbnail, the iframe is replaced with black background box. Youtube and Vimeo embeds do get automatically the placeholder.

For other services, you may use air_cookie\embeds\thumbnail filter like shown below.

Vimeo and Do Not Track

Vimeo embeds are treated a bit differently. For those, we don't add placeholder nor block them. Instead, we add Do Not Track parameter for the embed src which disabled all Vimeo tracking and statistics.

Disable this feature with air_cookie\embeds\vimeo\add_dnt filter, but notice that WordPress Core adds the dnt by default as well.

If you wish to show the placeholder even if the Vimeo embed has Do Not Track enabled, use air_cookie\embeds\vimeo\skip_dnt filter.

Revision control

Cookie policy revision number is automatically calculated from cookie categories key, enabled and readonly values. If new categories are added, some are removed or the values changed the consent modal will be shown again.

In case you wish to have manual control over revision number, use air_cookie\categories\revision filter. First argument is the calculated revision number and second is array containing all current cookie categories.

Visitor consent recording

Finnish cookie law requires the site owner to be able to point when certain visitor has accepted cookies. This is why the plugin has simple visitor consent recording system.

Each visitor is given unique uuid4 ID. When visitor accepts any cookie categories, their browser will send a small request to REST API which records their ID, current revision, accepted cookie categories, timestamp of the event and timestamp of expiry. This data is stored in custom database table and does not contain any extra information about the visitor.

Currently there is no way to disable this feature.

Installing

Download latest version as a zip package and unzip it to your plugins directiry.

Or install with composer, running command composer require digitoimistodude/air-cookie in your project directory or add "digitoimistodude/air-cookie":"dev-master" to your composer.json require.

Updates

Updates will be automatically distributed when new version is released.

Changelog

Changelog can be found from releases page.

Contributing

If you have ideas about the plugin or spot an issue, please let us know. Before contributing ideas or reporting an issue about "missing" features or things regarding to the nature of that matter, please note that this plugin is drafted to fullfill our customers need and might not move into the direction you'd hope. Thank you very much.


All versions of air-cookie with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package digitoimistodude/air-cookie contains the following files

Loading the files please wait ....