Core
extends Core
in package
implements
IOverrideCore
Uses
Core, Core
Singleton core class which handles the main system for plugin. It includes registering of the autoload, all hooks (actions & filters) (see BaseCore class).
Table of Contents
Interfaces
Constants
- ADD_MANAGE_MIN_CAPABILITY_TO_ALL_USERS_WITH = 'manage_options'
- Add the minimum required capability so a user can manage cookies to all users, which also have the `manage_options` capability.
- MANAGE_MIN_CAPABILITY = 'manage_real_cookie_banner'
- The minimal required capability so a user can manage cookies.
Properties
- $activator : Activator
- The plugins activator class.
- $adInitiator : AdInitiator
- See AdInitiator.
- $anonymousAssetBuilder : AnonymousAssetBuilder
- See AnonymousAssetBuilder.
- $assets : Assets
- The plugins asset class.
- $banner : Banner
- The banner.
- $blocker : Blocker
- The blocker.
- $compLanguage : AbstractLanguagePlugin
- See AbstractLanguagePlugin.
- $configPage : ConfigPage
- The config page.
- $cookieConsentManagement : CookieConsentManagement
- See CookieConsentManagement.
- $excludeAssets : ExcludeAssets
- See ExcludeAssets.
- $me : Core
- Singleton instance.
- $notices : Notices
- See Notices.
- $pageRequestUuid4 : string
- An unique id for this page request. This is e. g. needed for unique overlay id.
- $plugin_data : mixed
- The stored plugin data.
- $realQueue : Core
- See RealQueue.
- $rpmInitiator : RpmInitiator
- See RpmInitiator.
- $scanner : Scanner
- See Scanner.
- $service : Service
- The utils service class.
- $tcfVendorListNormalizer : TcfVendorListNormalizer
- See TcfVendorListNormalizer.
- $updater : mixed
- The updater instance.
Methods
- customize_save_response() : mixed
- Check if any plugin specific setting got changed in customize.
- getActivator() : Activator
- Getter.
- getAdInitiator() : mixed
- Get ad initiator from `real-utils`.
- getAnonymousAssetBuilder() : mixed
- Getter.
- getAssets() : Assets
- Getter
- getBanner() : mixed
- Get banner.
- getBaseAssetsUrl() : mixed
- Return the base URL to assets specially for Real Cookie Banner.
- getBlocker() : mixed
- Get blocker.
- getCompLanguage() : mixed
- Get compatibility language class.
- getConfigPage() : mixed
- Get config page.
- getCookieConsentManagement() : mixed
- Getter.
- getExcludeAssets() : mixed
- Getter.
- getInstance() : Core
- Get singleton core class.
- getInternalPackages() : object
- Get a list of internal packages (our own, symlinked from the monorepo).
- getNotices() : mixed
- Getter.
- getPageRequestUuid4() : mixed
- Get request uuid 4.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getPluginData() : array<string|int, string>|string|null
- Gets the plugin data.
- getRealQueue() : mixed
- Getter.
- getRpmInitiator() : mixed
- Get ad initiator from `real-product-manager-wp-client`.
- getScanner() : mixed
- Getter.
- getService() : Service
- Getter
- getTcfVendorListNormalizer() : mixed
- Getter.
- i18n() : mixed
- Define constants which relies on i18n localization loaded.
- init() : mixed
- The init function is fired even the init hook of WordPress. If possible it should register all hooks to have them in one place.
- isLicenseActive() : mixed
- Check if a license is active.
- overrideConstruct() : mixed
- overrideInit() : mixed
- overrideInitCustomize() : mixed
- This method should be called in your 'init' action through your core.
- overrideRegisterPostTypes() : mixed
- overrideRegisterSettings() : mixed
- queryArguments() : mixed
- See filter RCB/Query/Arguments.
- registerPostTypes() : mixed
- Register post types and custom taxonomies.
- registerSettings() : mixed
- Register settings.
- updateDbCheck() : mixed
- Updates the database version in the options table.
- versionCompareOlderThan() : mixed
- Checks if a previously installed version is lower than an expected version.
- __construct() : mixed
- Application core constructor.
- construct() : mixed
- The constructor handles the core startup mechanism.
Constants
ADD_MANAGE_MIN_CAPABILITY_TO_ALL_USERS_WITH
Add the minimum required capability so a user can manage cookies to all users, which also have the `manage_options` capability.
public
mixed
ADD_MANAGE_MIN_CAPABILITY_TO_ALL_USERS_WITH
= 'manage_options'
MANAGE_MIN_CAPABILITY
The minimal required capability so a user can manage cookies.
public
mixed
MANAGE_MIN_CAPABILITY
= 'manage_real_cookie_banner'
Properties
$activator
The plugins activator class.
private
Activator
$activator
$adInitiator
See AdInitiator.
private
AdInitiator
$adInitiator
$anonymousAssetBuilder
See AnonymousAssetBuilder.
private
AnonymousAssetBuilder
$anonymousAssetBuilder
$assets
The plugins asset class.
private
Assets
$assets
$banner
The banner.
private
Banner
$banner
$blocker
The blocker.
private
Blocker
$blocker
$compLanguage
See AbstractLanguagePlugin.
private
AbstractLanguagePlugin
$compLanguage
$configPage
The config page.
private
ConfigPage
$configPage
$cookieConsentManagement
See CookieConsentManagement.
private
CookieConsentManagement
$cookieConsentManagement
$excludeAssets
See ExcludeAssets.
private
ExcludeAssets
$excludeAssets
$me
Singleton instance.
private
static Core
$me
= null
$notices
See Notices.
private
Notices
$notices
$pageRequestUuid4
An unique id for this page request. This is e. g. needed for unique overlay id.
private
string
$pageRequestUuid4
$plugin_data
The stored plugin data.
private
mixed
$plugin_data
$realQueue
See RealQueue.
private
Core
$realQueue
$rpmInitiator
See RpmInitiator.
private
RpmInitiator
$rpmInitiator
$scanner
See Scanner.
private
Scanner
$scanner
$service
The utils service class.
private
Service
$service
$tcfVendorListNormalizer
See TcfVendorListNormalizer.
private
TcfVendorListNormalizer
$tcfVendorListNormalizer
$updater
The updater instance.
private
mixed
$updater
Tags
Methods
customize_save_response()
Check if any plugin specific setting got changed in customize.
public
customize_save_response(array<string|int, mixed> $response) : mixed
Parameters
- $response : array<string|int, mixed>
getActivator()
Getter.
public
getActivator() : Activator
Tags
Return values
ActivatorgetAdInitiator()
Get ad initiator from `real-utils`.
public
getAdInitiator() : mixed
Tags
getAnonymousAssetBuilder()
Getter.
public
getAnonymousAssetBuilder() : mixed
Tags
getAssets()
Getter
public
getAssets() : Assets
Tags
Return values
AssetsgetBanner()
Get banner.
public
getBanner() : mixed
Tags
getBaseAssetsUrl()
Return the base URL to assets specially for Real Cookie Banner.
public
getBaseAssetsUrl(string $path) : mixed
Parameters
- $path : string
getBlocker()
Get blocker.
public
getBlocker() : mixed
Tags
getCompLanguage()
Get compatibility language class.
public
getCompLanguage() : mixed
Tags
getConfigPage()
Get config page.
public
getConfigPage() : mixed
Tags
getCookieConsentManagement()
Getter.
public
getCookieConsentManagement() : mixed
Tags
getExcludeAssets()
Getter.
public
getExcludeAssets() : mixed
Tags
getInstance()
Get singleton core class.
public
static getInstance() : Core
Return values
CoregetInternalPackages()
Get a list of internal packages (our own, symlinked from the monorepo).
public
getInternalPackages() : object
Return values
objectgetNotices()
Getter.
public
getNotices() : mixed
Tags
getPageRequestUuid4()
Get request uuid 4.
public
getPageRequestUuid4() : mixed
Tags
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetPluginData()
Gets the plugin data.
public
getPluginData([string $key = null ]) : array<string|int, string>|string|null
Parameters
- $key : string = null
-
The key of the data to return
Tags
Return values
array<string|int, string>|string|nullgetRealQueue()
Getter.
public
getRealQueue() : mixed
Tags
getRpmInitiator()
Get ad initiator from `real-product-manager-wp-client`.
public
getRpmInitiator() : mixed
Tags
getScanner()
Getter.
public
getScanner() : mixed
Tags
getService()
Getter
public
getService() : Service
Tags
Return values
ServicegetTcfVendorListNormalizer()
Getter.
public
getTcfVendorListNormalizer() : mixed
Tags
i18n()
Define constants which relies on i18n localization loaded.
public
i18n() : mixed
init()
The init function is fired even the init hook of WordPress. If possible it should register all hooks to have them in one place.
public
init() : mixed
isLicenseActive()
Check if a license is active.
public
isLicenseActive() : mixed
overrideConstruct()
public
overrideConstruct() : mixed
overrideInit()
public
overrideInit() : mixed
overrideInitCustomize()
This method should be called in your 'init' action through your core.
public
overrideInitCustomize() : mixed
overrideRegisterPostTypes()
public
overrideRegisterPostTypes() : mixed
overrideRegisterSettings()
public
overrideRegisterSettings() : mixed
queryArguments()
See filter RCB/Query/Arguments.
public
queryArguments(array<string|int, mixed> $arguments, string $context) : mixed
Parameters
- $arguments : array<string|int, mixed>
- $context : string
registerPostTypes()
Register post types and custom taxonomies.
public
registerPostTypes() : mixed
registerSettings()
Register settings.
public
registerSettings() : mixed
updateDbCheck()
Updates the database version in the options table.
public
updateDbCheck() : mixed
It also installs the needed database tables.
versionCompareOlderThan()
Checks if a previously installed version is lower than an expected version.
public
static versionCompareOlderThan(string|false $installed, string $version[, array<string|int, string> $allowedPrerelease = [] ][, callable $prereleaseAdditionalCheck = null ]) : mixed
Additionally, we can check for a prerelease version, too. The $allowedPrerelease
needs
to be an array (e.g. ["2.15.1", "2.16.0"]
), and if the installed version is a prerelease
(e.g. 2.15.1-9507
), the version 2.15.1
gets extracted and checked for existence in the array.
Usage with $prereleaseAdditionalCheck
: You can pass an additional callback which is executed before
returning true
when a prerelease got found. An example scenario for this callable is to check for
a specific database table if you drop a column. Why is this needed? Imagine you are sending multiple
prerelease to a customer.
Parameters
- $installed : string|false
- $version : string
- $allowedPrerelease : array<string|int, string> = []
- $prereleaseAdditionalCheck : callable = null
-
($prereleaseVersion, $prereleaseCiIid) => boolean
__construct()
Application core constructor.
protected
__construct() : mixed
construct()
The constructor handles the core startup mechanism.
protected
construct() : mixed
The constructor is protected because a factory method should only create a Core object.