Documentation

Consent extends AbstractConsent
in package
implements IOverrideConsent Uses Consent, UtilsProvider

Settings > Consent.

Table of Contents

Interfaces

IOverrideConsent

Constants

AGE_NOTICE_COUNTRY_AGE_MAP  = ['INHERIT' => 0, 'GDPR' => 16, 'BE' => 13, 'DK' => 13, 'EE' => 13, 'FI' => 13, 'IS' => 13, 'LV' => 13, 'NO' => 13, 'PT' => 13, 'SE' => 13, 'MT' => 13, 'AT' => 14, 'BG' => 14, 'CY' => 14, 'IT' => 14, 'LT' => 14, 'ES' => 14, 'CZ' => 15, 'FR' => 15, 'GR' => 15, 'SI' => 15, 'DE' => 16, 'HR' => 16, 'HU' => 16, 'LI' => 16, 'LU' => 16, 'NL' => 16, 'PL' => 16, 'RO' => 16, 'SK' => 16, 'IE' => 16, 'CH' => 13]
COOKIE_VERSION_1  = 1
Search the coding for difference.
COOKIE_VERSION_2  = 2
COOKIE_VERSION_3  = 3
DEFAULT_ACCEPT_ALL_FOR_BOTS  = true
DEFAULT_AGE_NOTICE  = true
DEFAULT_AGE_NOTICE_AGE_LIMIT  = 'INHERIT'
DEFAULT_CONSENT_DURATION  = 120
DEFAULT_COOKIE_DURATION  = 365
DEFAULT_COOKIE_VERSION  = self::COOKIE_VERSION_3
DEFAULT_DATA_PROCESSING_IN_UNSAFE_COUNTRIES  = false
DEFAULT_DATA_PROCESSING_IN_UNSAFE_COUNTRIES_SAFE_COUNTRIES  = 'GDPR,ADEQUACY'
DEFAULT_FAILED_CONSENT_DOCUMENTATION_HANDLING  = self::FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY
DEFAULT_LIST_SERVICES_NOTICE  = true
DEFAULT_RESPECT_DO_NOT_TRACK  = false
DEFAULT_SAVE_IP  = false
FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY  = 'essentials'
FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC  = 'optimistic'
FAILED_CONSENT_DOCUMENTATION_HANDLINGS  = [self::FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC, self::FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY]
OPTION_GROUP  = 'options'
PREDEFINED_DATA_PROCESSING_IN_SAFE_COUNTRIES_LISTS  = [ // EU: https://reciprocitylabs.com/resources/what-countries-are-covered-by-gdpr/ // EEA: https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Glossary:European_Economic_Area_(EEA) 'GDPR' => ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LV', 'LT', 'LU', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE'], 'ADEQUACY' => ['AD', 'AR', 'CA', 'FO', 'GG', 'IL', 'IM', 'JP', 'JE', 'NZ', 'KR', 'CH', 'GB', 'UY', 'US'], ]
A list of predefined lists for e.g. `GDPR` considered as secury country for data processing in unsafe countries.
SETTING_ACCEPT_ALL_FOR_BOTS  = RCB_OPT_PREFIX . '-accept-all-for-bots'
SETTING_AGE_NOTICE  = RCB_OPT_PREFIX . '-age-notice'
SETTING_AGE_NOTICE_AGE_LIMIT  = RCB_OPT_PREFIX . '-age-notice-age-limit'
SETTING_CONSENT_DURATION  = RCB_OPT_PREFIX . '-consent-duration'
SETTING_COOKIE_DURATION  = RCB_OPT_PREFIX . '-cookie-duration'
SETTING_COOKIE_VERSION  = RCB_OPT_PREFIX . '-cookie-version'
SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES  = RCB_OPT_PREFIX . '-data-processing-in-unsafe-countries'
SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES_SAFE_COUNTRIES  = RCB_OPT_PREFIX . '-data-processing-in-unsafe-countries-safe-countries'
SETTING_FAILED_CONSENT_DOCUMENTATION_HANDLING  = RCB_OPT_PREFIX . '-failed-consent-documentation-handling'
SETTING_LIST_SERVICES_NOTICE  = RCB_OPT_PREFIX . '-list-services-notice'
SETTING_RESPECT_DO_NOT_TRACK  = RCB_OPT_PREFIX . '-respect-do-not-track'
SETTING_SAVE_IP  = RCB_OPT_PREFIX . '-save-ip'
TRANSIENT_SCHEDULE_CONSENTS_DELETION  = RCB_OPT_PREFIX . '-schedule-consents-deletion'

Properties

$me  : Consent
Singleton instance.
$settings  : Settings
See Settings

Methods

calculateServicesWithDataProcessingInUnsafeCountries()  : mixed
Calculate configured services which are processing data in unsafe countries.
enableOptionsAutoload()  : mixed
Initially `add_option` to avoid autoloading issues.
getAgeNoticeAgeLimit()  : int
Get the configured age limit for the age notice.
getAgeNoticeAgeLimitRaw()  : string|int
Get the configured age limit for the age notice in raw format.
getConsentDuration()  : int
Get the consent duration in months.
getCookieDuration()  : int
Get the cookie duration for the consent cookies in days.
getCookieVersion()  : int
Get the cookie version for the consent cookies.
getDataProcessingInUnsafeCountriesSafeCountries()  : array<string|int, string>
Get safe countries for the data-processing-in-unsafe-countries option with expanded predefined lists.
getDataProcessingInUnsafeCountriesSafeCountriesRaw()  : array<string|int, string>
Get safe countries for the data-processing-in-unsafe-countries option.
getFailedConsentDocumentationHandling()  : string
Get the behavior what should be done when documentating the consent fails. See als `FAILED_CONSENT_HANDLINGS`.
getInstance()  : mixed
Get singleton instance.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
getSettings()  : mixed
Getter.
isAcceptAllForBots()  : bool
Check if bots should acceppt all cookies automatically.
isAgeNoticeEnabled()  : bool
Check if age notice hint is enabled
isDataProcessingInUnsafeCountries()  : bool
Check if data processing in unsafe countries is enabled.
isListServicesNoticeEnabled()  : bool
Check if list-services notice hint is enabled
isRespectDoNotTrack()  : bool
Check if "Do not Track" header is respected.
isSaveIpEnabled()  : bool
Check if IPs should be saved in plain in database.
option_consent_duration()  : mixed
The consent duration may not be greater than 120 months.
option_cookie_duration()  : mixed
The cookie duration may not be greater than 365 days.
overrideEnableOptionsAutoload()  : mixed
overrideRegister()  : mixed
register()  : mixed
Register settings.
setCookieVersion()  : mixed
Set the cookie version for the consent cookies.
setSettings()  : mixed
Setter.
update_option_consent_transient_deletion()  : mixed
Delete transient when settings are updated
__construct()  : mixed
C'tor.

Constants

AGE_NOTICE_COUNTRY_AGE_MAP

public mixed AGE_NOTICE_COUNTRY_AGE_MAP = ['INHERIT' => 0, 'GDPR' => 16, 'BE' => 13, 'DK' => 13, 'EE' => 13, 'FI' => 13, 'IS' => 13, 'LV' => 13, 'NO' => 13, 'PT' => 13, 'SE' => 13, 'MT' => 13, 'AT' => 14, 'BG' => 14, 'CY' => 14, 'IT' => 14, 'LT' => 14, 'ES' => 14, 'CZ' => 15, 'FR' => 15, 'GR' => 15, 'SI' => 15, 'DE' => 16, 'HR' => 16, 'HU' => 16, 'LI' => 16, 'LU' => 16, 'NL' => 16, 'PL' => 16, 'RO' => 16, 'SK' => 16, 'IE' => 16, 'CH' => 13]

Search the coding for difference.

public mixed COOKIE_VERSION_1 = 1

DEFAULT_ACCEPT_ALL_FOR_BOTS

public mixed DEFAULT_ACCEPT_ALL_FOR_BOTS = true

DEFAULT_AGE_NOTICE

public mixed DEFAULT_AGE_NOTICE = true

DEFAULT_AGE_NOTICE_AGE_LIMIT

public mixed DEFAULT_AGE_NOTICE_AGE_LIMIT = 'INHERIT'
public mixed DEFAULT_CONSENT_DURATION = 120
public mixed DEFAULT_COOKIE_DURATION = 365
public mixed DEFAULT_COOKIE_VERSION = self::COOKIE_VERSION_3

DEFAULT_DATA_PROCESSING_IN_UNSAFE_COUNTRIES

public mixed DEFAULT_DATA_PROCESSING_IN_UNSAFE_COUNTRIES = false

DEFAULT_DATA_PROCESSING_IN_UNSAFE_COUNTRIES_SAFE_COUNTRIES

public mixed DEFAULT_DATA_PROCESSING_IN_UNSAFE_COUNTRIES_SAFE_COUNTRIES = 'GDPR,ADEQUACY'
public mixed DEFAULT_FAILED_CONSENT_DOCUMENTATION_HANDLING = self::FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY

DEFAULT_LIST_SERVICES_NOTICE

public mixed DEFAULT_LIST_SERVICES_NOTICE = true

DEFAULT_RESPECT_DO_NOT_TRACK

public mixed DEFAULT_RESPECT_DO_NOT_TRACK = false

DEFAULT_SAVE_IP

public mixed DEFAULT_SAVE_IP = false
public mixed FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY = 'essentials'
public mixed FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC = 'optimistic'
public mixed FAILED_CONSENT_DOCUMENTATION_HANDLINGS = [self::FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC, self::FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY]

OPTION_GROUP

public mixed OPTION_GROUP = 'options'

PREDEFINED_DATA_PROCESSING_IN_SAFE_COUNTRIES_LISTS

A list of predefined lists for e.g. `GDPR` considered as secury country for data processing in unsafe countries.

public mixed PREDEFINED_DATA_PROCESSING_IN_SAFE_COUNTRIES_LISTS = [ // EU: https://reciprocitylabs.com/resources/what-countries-are-covered-by-gdpr/ // EEA: https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Glossary:European_Economic_Area_(EEA) 'GDPR' => ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LV', 'LT', 'LU', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE'], 'ADEQUACY' => ['AD', 'AR', 'CA', 'FO', 'GG', 'IL', 'IM', 'JP', 'JE', 'NZ', 'KR', 'CH', 'GB', 'UY', 'US'], ]

SETTING_ACCEPT_ALL_FOR_BOTS

public mixed SETTING_ACCEPT_ALL_FOR_BOTS = RCB_OPT_PREFIX . '-accept-all-for-bots'

SETTING_AGE_NOTICE

public mixed SETTING_AGE_NOTICE = RCB_OPT_PREFIX . '-age-notice'

SETTING_AGE_NOTICE_AGE_LIMIT

public mixed SETTING_AGE_NOTICE_AGE_LIMIT = RCB_OPT_PREFIX . '-age-notice-age-limit'
public mixed SETTING_CONSENT_DURATION = RCB_OPT_PREFIX . '-consent-duration'
public mixed SETTING_COOKIE_DURATION = RCB_OPT_PREFIX . '-cookie-duration'
public mixed SETTING_COOKIE_VERSION = RCB_OPT_PREFIX . '-cookie-version'

SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES

public mixed SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES = RCB_OPT_PREFIX . '-data-processing-in-unsafe-countries'

SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES_SAFE_COUNTRIES

public mixed SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES_SAFE_COUNTRIES = RCB_OPT_PREFIX . '-data-processing-in-unsafe-countries-safe-countries'
public mixed SETTING_FAILED_CONSENT_DOCUMENTATION_HANDLING = RCB_OPT_PREFIX . '-failed-consent-documentation-handling'

SETTING_LIST_SERVICES_NOTICE

public mixed SETTING_LIST_SERVICES_NOTICE = RCB_OPT_PREFIX . '-list-services-notice'

SETTING_RESPECT_DO_NOT_TRACK

public mixed SETTING_RESPECT_DO_NOT_TRACK = RCB_OPT_PREFIX . '-respect-do-not-track'

SETTING_SAVE_IP

public mixed SETTING_SAVE_IP = RCB_OPT_PREFIX . '-save-ip'

TRANSIENT_SCHEDULE_CONSENTS_DELETION

public mixed TRANSIENT_SCHEDULE_CONSENTS_DELETION = RCB_OPT_PREFIX . '-schedule-consents-deletion'

Properties

Methods

calculateServicesWithDataProcessingInUnsafeCountries()

Calculate configured services which are processing data in unsafe countries.

public calculateServicesWithDataProcessingInUnsafeCountries() : mixed

enableOptionsAutoload()

Initially `add_option` to avoid autoloading issues.

public enableOptionsAutoload() : mixed

getAgeNoticeAgeLimit()

Get the configured age limit for the age notice.

public getAgeNoticeAgeLimit() : int
Return values
int

getAgeNoticeAgeLimitRaw()

Get the configured age limit for the age notice in raw format.

public getAgeNoticeAgeLimitRaw() : string|int
Return values
string|int

Can be an integer or "INHERIT" string

getConsentDuration()

Get the consent duration in months.

public getConsentDuration() : int
Return values
int

getCookieDuration()

Get the cookie duration for the consent cookies in days.

public getCookieDuration() : int
Return values
int

getCookieVersion()

Get the cookie version for the consent cookies.

public getCookieVersion() : int
Return values
int

getDataProcessingInUnsafeCountriesSafeCountries()

Get safe countries for the data-processing-in-unsafe-countries option with expanded predefined lists.

public getDataProcessingInUnsafeCountriesSafeCountries() : array<string|int, string>
Return values
array<string|int, string>

getDataProcessingInUnsafeCountriesSafeCountriesRaw()

Get safe countries for the data-processing-in-unsafe-countries option.

public abstract getDataProcessingInUnsafeCountriesSafeCountriesRaw() : array<string|int, string>
Return values
array<string|int, string>

getFailedConsentDocumentationHandling()

Get the behavior what should be done when documentating the consent fails. See als `FAILED_CONSENT_HANDLINGS`.

public getFailedConsentDocumentationHandling() : string
Return values
string

getInstance()

Get singleton instance.

public static getInstance() : mixed
Tags
codeCoverageIgnore

getPluginConstantPrefix()

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

public getPluginConstantPrefix() : string
Tags
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

getSettings()

Getter.

public getSettings() : mixed
Tags
codeCoverageIgnore

isAcceptAllForBots()

Check if bots should acceppt all cookies automatically.

public isAcceptAllForBots() : bool
Return values
bool

isAgeNoticeEnabled()

Check if age notice hint is enabled

public isAgeNoticeEnabled() : bool
Return values
bool

isDataProcessingInUnsafeCountries()

Check if data processing in unsafe countries is enabled.

public abstract isDataProcessingInUnsafeCountries() : bool
Return values
bool

isListServicesNoticeEnabled()

Check if list-services notice hint is enabled

public isListServicesNoticeEnabled() : bool
Return values
bool

isRespectDoNotTrack()

Check if "Do not Track" header is respected.

public isRespectDoNotTrack() : bool
Return values
bool

isSaveIpEnabled()

Check if IPs should be saved in plain in database.

public isSaveIpEnabled() : bool
Return values
bool

The consent duration may not be greater than 120 months.

public option_consent_duration(mixed $value) : mixed
Parameters
$value : mixed

The cookie duration may not be greater than 365 days.

public option_cookie_duration(mixed $value) : mixed
Parameters
$value : mixed
Tags
since
1.10

overrideEnableOptionsAutoload()

public overrideEnableOptionsAutoload() : mixed

overrideRegister()

public overrideRegister() : mixed

register()

Register settings.

public register() : mixed

setCookieVersion()

Set the cookie version for the consent cookies.

public setCookieVersion(mixed $version) : mixed
Parameters
$version : mixed

Delete transient when settings are updated

public update_option_consent_transient_deletion() : mixed

__construct()

C'tor.

private __construct() : mixed

        
On this page

Search results