Documentation

Stats
in package
implements IOverrideStats Uses UtilsProvider, Stats

Consent stats handling. Only write operations are implemented in both free and PRO version to allow "unlocking" after upgrading to PRO.

Table of Contents

Interfaces

IOverrideStats

Constants

STATS_ACCEPTED_ALL_TYPES  = [self::STATS_ACCEPTED_TYPE_ALL, self::STATS_ACCEPTED_TYPE_NONE, self::STATS_ACCEPTED_TYPE_PARTIAL]
STATS_ACCEPTED_TYPE_ALL  = 2
STATS_ACCEPTED_TYPE_NONE  = 0
STATS_ACCEPTED_TYPE_PARTIAL  = 1
TABLE_NAME_BUTTONS_CLICKED  = 'stats_buttons_clicked'
TABLE_NAME_CUSTOM_BYPASS  = 'stats_custom_bypass'
TABLE_NAME_TERMS  = 'stats'
TODO: rename to something like `stats_terms`.

Properties

$me  : Stats
Singleton instance.

Methods

edited_group()  : mixed
Fires after a group got changed, let's update the plain name in database for future display when the group got deleted.
fetchButtonsClickedStats()  : mixed
fetchCustomBypassStats()  : mixed
fetchMainStats()  : mixed
getInstance()  : mixed
Get singleton instance.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
persistButtonClicked()  : mixed
Persist a new consent to a given clicked button to the stats database table.
persistCustomBypass()  : mixed
Persist a new consent to a given clicked button to the stats database table.
persistTerm()  : mixed
Persist a new consent to a given group to the stats database table.
__construct()  : mixed
C'tor.
calculateGroupAcceptTypes()  : mixed
Calculate the accept types for a given consent. It returns an array of keyed term id with accept type.

Constants

STATS_ACCEPTED_ALL_TYPES

public mixed STATS_ACCEPTED_ALL_TYPES = [self::STATS_ACCEPTED_TYPE_ALL, self::STATS_ACCEPTED_TYPE_NONE, self::STATS_ACCEPTED_TYPE_PARTIAL]

STATS_ACCEPTED_TYPE_ALL

public mixed STATS_ACCEPTED_TYPE_ALL = 2

STATS_ACCEPTED_TYPE_NONE

public mixed STATS_ACCEPTED_TYPE_NONE = 0

STATS_ACCEPTED_TYPE_PARTIAL

public mixed STATS_ACCEPTED_TYPE_PARTIAL = 1

TABLE_NAME_BUTTONS_CLICKED

public mixed TABLE_NAME_BUTTONS_CLICKED = 'stats_buttons_clicked'

TABLE_NAME_CUSTOM_BYPASS

public mixed TABLE_NAME_CUSTOM_BYPASS = 'stats_custom_bypass'

TABLE_NAME_TERMS

TODO: rename to something like `stats_terms`.

public mixed TABLE_NAME_TERMS = 'stats'

Properties

$me

Singleton instance.

private static Stats $me = null

Methods

edited_group()

Fires after a group got changed, let's update the plain name in database for future display when the group got deleted.

public edited_group(int $term_id) : mixed
Parameters
$term_id : int

fetchButtonsClickedStats()

public fetchButtonsClickedStats(mixed $from, mixed $to[, mixed $context = null ]) : mixed
Parameters
$from : mixed
$to : mixed
$context : mixed = null

fetchCustomBypassStats()

public fetchCustomBypassStats(mixed $from, mixed $to[, mixed $context = null ]) : mixed
Parameters
$from : mixed
$to : mixed
$context : mixed = null

fetchMainStats()

public fetchMainStats(mixed $from, mixed $to[, mixed $context = null ]) : mixed
Parameters
$from : mixed
$to : mixed
$context : mixed = null

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

persistButtonClicked()

Persist a new consent to a given clicked button to the stats database table.

public persistButtonClicked(string $contextString, string $buttonClicked) : mixed
Parameters
$contextString : string
$buttonClicked : string

persistCustomBypass()

Persist a new consent to a given clicked button to the stats database table.

public persistCustomBypass(string $contextString, string $customBypass) : mixed
Parameters
$contextString : string
$customBypass : string

persistTerm()

Persist a new consent to a given group to the stats database table.

public persistTerm(string $contextString, array<string|int, mixed> $consent, array<string|int, mixed> $previousConsent, string $previousCreated) : mixed
Parameters
$contextString : string
$consent : array<string|int, mixed>
$previousConsent : array<string|int, mixed>

Do not count recurring users in stats

$previousCreated : string

ISO string of previous consent

__construct()

C'tor.

private __construct() : mixed

calculateGroupAcceptTypes()

Calculate the accept types for a given consent. It returns an array of keyed term id with accept type.

private calculateGroupAcceptTypes(array<string|int, mixed> $consent) : mixed
Parameters
$consent : array<string|int, mixed>

        
On this page

Search results