Constants

OPTION_NAME_CLICKED_ACTIONS

OPTION_NAME_CLICKED_ACTIONS =RCB_OPT_PREFIX . '-migration-actions-clicked'

TRANSIENT_CACHE_KEY_BLOCKERS_WITH_BETTER_POTENTIAL_VISUAL_TYPE

TRANSIENT_CACHE_KEY_BLOCKERS_WITH_BETTER_POTENTIAL_VISUAL_TYPE =RCB_OPT_PREFIX . '-blockers-with-better-potential-visual-type'

DELETE_LANGUAGES

DELETE_LANGUAGES =array('de', 'en')

DELETE_OPTIONS_TEXTS

DELETE_OPTIONS_TEXTS =array(\DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_DESCRIPTION, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_EPRIVACY_USA, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_AGE_NOTICE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_AGE_NOTICE_BLOCKER, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_LIST_SERVICES_NOTICE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_CONSENT_FORWARDING, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_ALL, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_ESSENTIALS, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_INDIVIDUAL, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_POWERED_BY_TEXT, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_LINK_SHOW_MISSING, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_LOAD_BUTTON, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_ACCEPT_INFO, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_DESCRIPTION, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_SAVE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_SHOW_MORE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_HIDE_MORE)

Properties

$id

$id :

Type

$actions

$actions :

A set of actions which can be made within this migration.

See also $this::addAction.

Type

Methods

__construct()

__construct()

C'tor. Register your actions with `$this::addAction` here!

init()

init()

Initialize hooks and listen to saves to content blockers so we can update the transient of `fetchBlockersWithBetterPotentialVisualType`.

getId()

getId(): string

Get a unique id for this migration.

Returns

string

getHeadline()

getHeadline(): string

Get a headline for this migration.

Returns

string

getDescription()

getDescription(): string

Get a description for this migration.

Returns

string

isActive()

isActive(): boolean

Check if this migration is active.

Returns

boolean

actions()

actions(): void

`addAction()` your actions here.

dismiss()

dismiss(): boolean

Dismiss this migration.

Returns

boolean

addAction()

addAction(string  $id,string  $title,string  $description,array  $args = array())

Register a new action which can be made for this migration.

Arguments:

  • [linkText] (string) Can be null to disable the link
  • [confirmText] (string) The user needs to confirm this migration with something like "Are you sure?"
  • [callback] (callback|string) Can be null, a callback which is executed when clicking the link or a direct URL
  • [previewImage] (string) Absolute URL to preview image

Parameters

string $id

Unique action ID

string $title
string $description
array $args

Arguments, see above

saveActionPerformed()

saveActionPerformed(string  $id)

Save an action as "performed" so we can show this in the UI.

Parameters

string $id

revisionCurrent()

revisionCurrent(array  $array)

Get the migration as plain array so it can be consumed in the frontend.

Parameters

array $array

getConfigUrl()

getConfigUrl(string  $route)

Get a config URL pointing to a given route (react-router).

Parameters

string $route

hasMajorPreviouslyInstalled()

hasMajorPreviouslyInstalled(integer  $majorVersion)

Check if a given major version was previously installed.

Parameters

integer $majorVersion

removeMajorVersionFromPreviouslyInstalled()

removeMajorVersionFromPreviouslyInstalled(integer  $majorVersion)

Dismiss the migration by removing a major version from the previously installed versions.

Parameters

integer $majorVersion

deleteCustomizerTexts()

deleteCustomizerTexts(array<mixed,string>  $languages,array<mixed,string>  $ids): array<mixed,string>

Delete customizer texts for given languages and option keys.

Parameters

array<mixed,string> $languages
array<mixed,string> $ids

Returns

array<mixed,string> —

Deleted option keys

doDismiss()

doDismiss(string  $migrationId)

Dismiss a migration by ID.

Parameters

string $migrationId

doRegisterActions()

doRegisterActions()

Register all actions with `AbstractDashboardTileMigration#actions()` method.

doAction()

doAction(string  $migrationId,string  $actionId)

Start a given migration by ID.

Parameters

string $migrationId
string $actionId

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

save_post_blocker()

save_post_blocker(integer  $post_ID,\DevOwl\RealCookieBanner\comp\migration\WP_Post  $post,boolean  $update)

A blocker was saved.

Parameters

integer $post_ID
\DevOwl\RealCookieBanner\comp\migration\WP_Post $post
boolean $update

applyMobileOptimizations()

applyMobileOptimizations(array  $result)

Start the scanner and redirect to scanner tab.

Parameters

array $result

scanWebsiteAgain()

scanWebsiteAgain(array  $result)

Start the scanner and redirect to scanner tab.

Parameters

array $result

applyNewTextsAndImportantDesignChanges()

applyNewTextsAndImportantDesignChanges(array  $result)

Apply new customizer texts and important design changes and overwrite existing ones.

Parameters

array $result

fetchBlockersWithBetterPotentialVisualType()

fetchBlockersWithBetterPotentialVisualType(): array<mixed,string>

Calculate existing blockers with potential visual type other than `default` from the templates and cache the result to a transient to avoid the calculation again.

Returns

array<mixed,string>