Constants

OPTION_GROUP

OPTION_GROUP ='options'

CUSTOM_BYPASS

CUSTOM_BYPASS ='geolocation'

Name for the custom bypass saved in the database.

SETTING_COUNTRY_BYPASS_ACTIVE

SETTING_COUNTRY_BYPASS_ACTIVE =RCB_OPT_PREFIX . '-country-bypass'

SETTING_COUNTRY_BYPASS_COUNTRIES

SETTING_COUNTRY_BYPASS_COUNTRIES =RCB_OPT_PREFIX . '-country-bypass-countries'

SETTING_COUNTRY_BYPASS_TYPE

SETTING_COUNTRY_BYPASS_TYPE =RCB_OPT_PREFIX . '-country-bypass-type'

SETTING_COUNTRY_BYPASS_DB_DOWNLOAD_TIME

SETTING_COUNTRY_BYPASS_DB_DOWNLOAD_TIME =RCB_OPT_PREFIX . '-country-bypass-db-download-time'

OPTION_COUNTRY_DB_NEXT_DOWNLOAD_TIME

OPTION_COUNTRY_DB_NEXT_DOWNLOAD_TIME =RCB_OPT_PREFIX . '-country-db-next-download-time'

TYPE_ALL

TYPE_ALL ='all'

TYPE_ESSENTIALS

TYPE_ESSENTIALS ='essentials'

DEFAULT_COUNTRY_BYPASS_ACTIVE

DEFAULT_COUNTRY_BYPASS_ACTIVE =false

DEFAULT_COUNTRY_BYPASS_COUNTRIES

DEFAULT_COUNTRY_BYPASS_COUNTRIES ='GDPR,CCPA,GB'

DEFAULT_COUNTRY_BYPASS_TYPE

DEFAULT_COUNTRY_BYPASS_TYPE =self::TYPE_ALL

DEFAULT_COUNTRY_BYPASS_DB_DOWNLOAD_TIME

DEFAULT_COUNTRY_BYPASS_DB_DOWNLOAD_TIME =''

PREDEFINED_COUNTRY_LISTS

PREDEFINED_COUNTRY_LISTS =array('GDPR' => array('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'), 'CCPA' => array('US'))

A list of predefined lists for e.g. `GDPR` or `CCPA`.

Properties

$previousActive

$previousActive :boolean

Save the state of currently active so we can update country database at toggle time.

Type

boolean

Methods

overrideEnableOptionsAutoload()

overrideEnableOptionsAutoload()

overrideRegister()

overrideRegister()

probablyUpdateDatabase()

probablyUpdateDatabase()

consentCreated()

consentCreated(array  $result)

A consent got created, let's save the user country to the associated consent.

Parameters

array $result

revisionArrayIndependent()

revisionArrayIndependent(array  $arr)

Add the country bypass metadata (like MaxMind DB download time) to the independent revision.

Parameters

array $arr

dynamicPredecision()

dynamicPredecision(false|string  $result,\WP_REST_Request  $request)

Determines, if the current page request is outside our defined countries so all cookies are automatically accepted.

Parameters

false|string $result
\WP_REST_Request $request

revisionOptionCountriesExpandPredefinedLists()

revisionOptionCountriesExpandPredefinedLists()

Modify the countries list when it gets saved to the revision.

updateDatabase()

updateDatabase(  $force = false)

Parameters

$force

clearDatabase()

clearDatabase()

updated_option_active()

updated_option_active(\DevOwl\RealCookieBanner\lite\settings\WP_REST_Response  $response,\WP_REST_Request  $request)

The option to enable Country Bypass got updated, let's automatically download the country database.

Parameters

\DevOwl\RealCookieBanner\lite\settings\WP_REST_Response $response
\WP_REST_Request $request

rest_pre_get_setting()

rest_pre_get_setting(mixed  $result,string  $name,array  $args)

Output the download time as ISO string instead of mysql formatted string.

Parameters

mixed $result

Value to use for the requested setting. Can be a scalar matching the registered schema for the setting, or null to follow the default get_option() behavior.

string $name

Setting name (as shown in REST API responses).

array $args

Arguments passed to register_setting() for this setting.

isActive()

isActive()

getCountries()

getCountries()

getType()

getType()

getDatabaseDownloadTime()

getDatabaseDownloadTime()

getNextUpdateTime()

getNextUpdateTime()

Changes to the country database are published daily, but we do this only once a week.

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

enableOptionsAutoload()

enableOptionsAutoload()

Initially `add_option` to avoid autoloading issues.

register()

register()

Register settings.

persistConsent()

persistConsent(string  $accept,integer  $viewPortWidth,integer  $viewPortHeight)

Create the consent for the Custom Bypass.

Parameters

string $accept

Can be essentials or all

integer $viewPortWidth
integer $viewPortHeight

__construct()

__construct()

C'tor.