Constants

TABLE_NAME

TABLE_NAME ='consent'

CLICKABLE_BUTTONS

CLICKABLE_BUTTONS =array('none', 'main_all', 'main_essential', 'main_close_icon', 'main_custom', 'ind_all', 'ind_essential', 'ind_close_icon', 'ind_custom', \DevOwl\RealCookieBanner\view\shortcode\LinkShortcode::BUTTON_CLICKED_IDENTIFIER, \DevOwl\RealCookieBanner\view\Blocker::BUTTON_CLICKED_IDENTIFIER)

BY_CRITERIA_RESULT_TYPE_NO_DECODE

BY_CRITERIA_RESULT_TYPE_NO_DECODE ='noDecode'

If you do not want to decode data like `revision` or `decision` to real objects (useful for CSV exports).

BY_CRITERIA_RESULT_TYPE_JSON_DECODE

BY_CRITERIA_RESULT_TYPE_JSON_DECODE ='jsonDecode'

BY_CRITERIA_RESULT_TYPE_COUNT

BY_CRITERIA_RESULT_TYPE_COUNT ='count'

BY_CRITERIA_RESULT_TYPE_SQL_QUERY

BY_CRITERIA_RESULT_TYPE_SQL_QUERY ='sqlQuery'

Properties

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

applyCustomDecisionFromPreviousConsent()

applyCustomDecisionFromPreviousConsent(array|string  $previousConsent,array|string  $newConsent,string  $overtake)

Apply a custom decision (e.g. opt-out a single cookie in a cookie group) to a new consent. This is e.g. helpful if you are providing a Custom Bypass (e.g. Geolocation) and want to overtake an opt-out / opt-in from the previous consent.

Parameters

array|string $previousConsent
array|string $newConsent
string $overtake

Can be opt-in or opt-out

validate()

validate(array|string  $consent): array|\WP_Error

Check if passed array is valid consent.

Parameters

array|string $consent

Returns

array|\WP_Error —

Sanitized consent array

purge()

purge(): boolean|array

Delete all available user consents with revisions and stats.

Returns

boolean|array —

Array with deleted counts of the database tables

getTruncatedIpsCount()

getTruncatedIpsCount()

Check if there are truncated IPs saved in the current consents list and return the count of found rows.

byCriteria()

byCriteria(array  $args,string  $returnType = self::BY_CRITERIA_RESULT_TYPE_JSON_DECODE)

Fetch user consents by criteria.

Parameters

array $args

'uuid', 'ip', 'offset', 'perPage', 'from', 'to', 'pure_referer', 'context'

string $returnType

castReadRows()

castReadRows(array<mixed,object>  $results,boolean  $jsonDecode = true)

Cast read rows from database to correct types.

Parameters

array<mixed,object> $results
boolean $jsonDecode

Pass false if you do not want to decode data like revision or decision to real objects (useful for CSV exports)

getCount()

getCount()

Get the total count of current consents.

getReferer()

getReferer(): array<mixed,string>

Get all referer across all consents.

Returns

array<mixed,string>

settings_updated()

settings_updated(\WP_HTTP_Response  $response)

Settings got updated in "Settings" tab, lets reschedule deletion of consents.

Parameters

\WP_HTTP_Response $response

scheduleDeletionOfConsents()

scheduleDeletionOfConsents()

Delete consents older than set duration time

getInstance()

getInstance()

Get singleton instance.

__construct()

__construct()

C'tor.

deleteConsentsByConsentDurationPeriod()

deleteConsentsByConsentDurationPeriod()

Executing query for deletion consents