\DevOwl\RealCookieBanner\importImport

Allows to import a JSON string with specific options. If you want to learn more about the scheme, please have a look at the output of the export.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
import()
importSettings()
importCookieGroups()
importCookies()
importBlocker()
importTcfVendorConfigurations()
importCustomizeBanner()
setCookieGroup()
setCookieStatus()
setCookieSkipExisting()
setBlockerStatus()
setBlockerSkipExisting()
setTcfVendorConfigurationStatus()
getCookieGroup()
getCookieStatus()
isCookieSkipExisting()
getBlockerStatus()
isBlockerSkipExisting()
getTcfVendorConfigurationStatus()
getMessages()
getJSON()
instance()
No public properties found
IMPORT_POST_STATI
doImportCookieGroups()
handleGroupUpdate()
handleGroupCreate()
handleCorruptGroup()
doImportSettings()
handleSepcialSetting()
doImportCookies()
handleCookieAssign()
handleCorruptCookie()
doImportBlocker()
correctAssociationIdsForBlocker()
handleCorruptBlocker()
doImportTcfVendorConfigurations()
handleCorruptTcfVendorConfiguration()
doImportCustomizeBanner()
handleSepcialCustomizeBanner()
addMessageWrongUsageKey()
addMessageMissingProperties()
addMessageCreateFailure()
addMessageCreateFailureImportingProInFreeVersion()
probablyAddMessageBlockerAssociation()
addMessageBlockerVisualMediaThumbnail()
addMessageSkipExistingCookie()
addMessageSkipExistingBlocker()
addMessageSkipExistingTcfVendorConfiguration()
probablyAddMessageDuplicateBlocker()
probablyAddMessageDuplicateCookie()
probablyAddMessageCookieGroupNotFound()
addMessageCookieAssignFailure()
addMessageCookieGroupUpdateFailure()
addMessageCookieGroupUpdatedInfo()
probablyAddMessageSettingOnlyPro()
addMessageUpdateOptionFailure()
addMessageOptionOutdated()
addMessageOptionRelatesPageId()
addMessageOptionRelatesMedia()
addMessageOptionMultisite()
addMessage()
$mapCookies
$mapTcfVendorConfigurations
N/A
__construct()
$cookieGroup
$cookieStatus
$cookieSkipExisting
$blockerStatus
$blockerSkipExisting
$tcfVendorConfigurationStatus
$json
$messages
N/A

Constants

IMPORT_POST_STATI

IMPORT_POST_STATI =array('keep', 'publish', 'private', 'draft')

Properties

$mapCookies

$mapCookies :

A map of post_name -> duplicate ID so it can be used for blocker import.

E. g. if a new cookie is created through import, the new ID should be used instead of the defined one in blocker.

Type

$mapTcfVendorConfigurations

$mapTcfVendorConfigurations :

A map of post_name -> duplicate ID so it can be used for blocker import.

E. g. if a new TCF vendor configuration is created through import, the new ID should be used instead of the defined one in blocker.

Type

$cookieGroup

$cookieGroup :integer

Default cookie group when it can not be assigned to one.

Type

integer

$cookieStatus

$cookieStatus :string

Force or "keep" a given post status.

Type

string

$cookieSkipExisting

$cookieSkipExisting :boolean

Skip already existing services.

Type

boolean

$blockerStatus

$blockerStatus :string

Force or "keep" a given post status.

Type

string

$blockerSkipExisting

$blockerSkipExisting :boolean

Skip existing blocker.

Type

boolean

$tcfVendorConfigurationStatus

$tcfVendorConfigurationStatus :string

Force or "keep" a given post status.

Type

string

$json

$json :

The importing JSON as associative array.

Type

$messages

$messages :

Messages occured while importing.

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

import()

import()

Import all available settings in the passed JSON. This also respects the correct order of imports.

importSettings()

importSettings()

Import settings.

importCookieGroups()

importCookieGroups()

Import cookie groups.

importCookies()

importCookies()

Import cookies.

importBlocker()

importBlocker()

Import content blocker.

importTcfVendorConfigurations()

importTcfVendorConfigurations()

Import TCF Vendor configurations.

importCustomizeBanner()

importCustomizeBanner()

Import customize banner settings.

setCookieGroup()

setCookieGroup(integer  $value)

Set default cookie group.

Parameters

integer $value

setCookieStatus()

setCookieStatus(string  $value)

Set service status.

Parameters

string $value

setCookieSkipExisting()

setCookieSkipExisting(boolean  $value)

Set cookies to skip existing.

Parameters

boolean $value

setBlockerStatus()

setBlockerStatus(string  $value)

Set blocker status.

Parameters

string $value

setBlockerSkipExisting()

setBlockerSkipExisting(boolean  $value)

Set blocker to skip existing.

Parameters

boolean $value

setTcfVendorConfigurationStatus()

setTcfVendorConfigurationStatus(string  $value)

Set TCF Vendor configuration status.

Parameters

string $value

getCookieGroup()

getCookieGroup()

Get cookie group.

getCookieStatus()

getCookieStatus()

Get cookie status.

isCookieSkipExisting()

isCookieSkipExisting()

Get cookie skip existing.

getBlockerStatus()

getBlockerStatus()

Get content blocker status.

isBlockerSkipExisting()

isBlockerSkipExisting()

Get blocker skip existing.

getTcfVendorConfigurationStatus()

getTcfVendorConfigurationStatus()

Get TCF Vendor configuration status.

getMessages()

getMessages()

Get happened messages.

getJSON()

getJSON()

Get JSON.

instance()

instance(array  $json)

Get singleton instance.

Parameters

array $json

doImportCookieGroups()

doImportCookieGroups(array  $groups)

Import cookie groups from JSON.

Parameters

array $groups

handleGroupUpdate()

handleGroupUpdate(string  $slug,integer  $term_id,string  $name,string  $description)

Handle to update an existing group instead of creating a new one.

Parameters

string $slug
integer $term_id
string $name
string $description

handleGroupCreate()

handleGroupCreate(string  $slug,string  $name,string  $description,integer  $order)

Handle to create a new group.

Parameters

string $slug
string $name
string $description
integer $order

handleCorruptGroup()

handleCorruptGroup(array  $group,integer  $index)

Check missing meta of passed group.

Parameters

array $group
integer $index

doImportSettings()

doImportSettings(array  $settings)

Import settings from JSON.

Parameters

array $settings

handleSepcialSetting()

handleSepcialSetting(string  $optionName,mixed  $value,string  $key)

Handle special cases for settings.

Parameters

string $optionName
mixed $value
string $key

doImportCookies()

doImportCookies(array  $cookies)

Import cookies from JSON.

Parameters

array $cookies

handleCookieAssign()

handleCookieAssign(integer  $postId,integer  $groupId)

Assign a created cookie to a given group.

Parameters

integer $postId
integer $groupId

handleCorruptCookie()

handleCorruptCookie(array  $cookie,integer  $index)

Check missing meta of passed cookie.

Parameters

array $cookie
integer $index

doImportBlocker()

doImportBlocker(array  $blockers)

Import content blocker from JSON.

Parameters

array $blockers

correctAssociationIdsForBlocker()

correctAssociationIdsForBlocker(array<mixed,string>  $post_names,string  $mapName,string  $association_post_type)

Fetch the correct cookie / TCF vendor ids for the meta.

Parameters

array<mixed,string> $post_names
string $mapName

Can be mapCookies or mapTcfVendorConfigurations

string $association_post_type

handleCorruptBlocker()

handleCorruptBlocker(array  $blocker,integer  $index)

Check missing meta of passed blocker.

Parameters

array $blocker
integer $index

doImportTcfVendorConfigurations()

doImportTcfVendorConfigurations(array  $tcfVendorConfiguration)

Import TCF Vendor configurations from JSON.

Parameters

array $tcfVendorConfiguration

handleCorruptTcfVendorConfiguration()

handleCorruptTcfVendorConfiguration(array  $tcfVendorConfiguration,integer  $index)

Check missing meta of passed configuration.

Parameters

array $tcfVendorConfiguration
integer $index

doImportCustomizeBanner()

doImportCustomizeBanner(array  $sections)

Import customize banner settings from JSON.

Parameters

array $sections

handleSepcialCustomizeBanner()

handleSepcialCustomizeBanner(string  $optionName,string  $section,mixed  $setting,string  $value)

Handle special cases for customize banner settings.

Parameters

string $optionName
string $section
mixed $setting
string $value

addMessageWrongUsageKey()

addMessageWrongUsageKey(string  $type)

A top-level cookie type has incorrect scheme.

Parameters

string $type

addMessageMissingProperties()

addMessageMissingProperties(integer  $index,string  $type,string  $properties)

A type definition is incorrect.

Parameters

integer $index
string $type
string $properties

addMessageCreateFailure()

addMessageCreateFailure(string  $post_title,string  $type,\WP_Error  $error)

`wp_insert_post` failed for given type.

Parameters

string $post_title
string $type
\WP_Error $error

addMessageCreateFailureImportingProInFreeVersion()

addMessageCreateFailureImportingProInFreeVersion(string  $post_title)

User is trying to import PRO template in free version.

Parameters

string $post_title

probablyAddMessageBlockerAssociation()

probablyAddMessageBlockerAssociation(integer  $count,integer  $associatedCount,string  $post_title,integer  $blockerId)

Add message for non-associated cookies / TCF vendors.

Parameters

integer $count
integer $associatedCount
string $post_title
integer $blockerId

addMessageBlockerVisualMediaThumbnail()

addMessageBlockerVisualMediaThumbnail(string  $post_title,integer  $blockerId)

Add message for blocker with configured media library item

Parameters

string $post_title
integer $blockerId

addMessageSkipExistingCookie()

addMessageSkipExistingCookie(string  $post_name)

The cookie got not created because already exists.

Parameters

string $post_name

addMessageSkipExistingBlocker()

addMessageSkipExistingBlocker(string  $post_name)

The content blocker got not created because already exists.

Parameters

string $post_name

addMessageSkipExistingTcfVendorConfiguration()

addMessageSkipExistingTcfVendorConfiguration(integer  $vendorId)

The TCF vendor configuration got not created because already exists.

Parameters

integer $vendorId

probablyAddMessageDuplicateBlocker()

probablyAddMessageDuplicateBlocker(boolean|\WP_Post  $found,string  $post_name,integer  $original,integer  $duplicate)

The content blocker got duplicated.

Parameters

boolean|\WP_Post $found
string $post_name
integer $original
integer $duplicate

probablyAddMessageDuplicateCookie()

probablyAddMessageDuplicateCookie(boolean|\WP_Post  $found,string  $post_name,integer  $group,integer  $created)

The cookie got duplicated.

Parameters

boolean|\WP_Post $found
string $post_name
integer $group
integer $created

probablyAddMessageCookieGroupNotFound()

probablyAddMessageCookieGroupNotFound(boolean  $groupNotFound,string  $post_title,integer  $group,integer  $created)

The cookie could not be associated to the given group, did fallback.

Parameters

boolean $groupNotFound
string $post_title
integer $group
integer $created

addMessageCookieAssignFailure()

addMessageCookieAssignFailure(integer  $postId,\WP_Error  $error)

Cookie could not be assigned to cookie.

Parameters

integer $postId
\WP_Error $error

addMessageCookieGroupUpdateFailure()

addMessageCookieGroupUpdateFailure(string  $name,\WP_Error  $error)

Cookie group could not be updated.

Parameters

string $name
\WP_Error $error

addMessageCookieGroupUpdatedInfo()

addMessageCookieGroupUpdatedInfo(string  $name)

Cookie group is not created instead it was updated.

Parameters

string $name

probablyAddMessageSettingOnlyPro()

probablyAddMessageSettingOnlyPro(boolean  $onlyPro,string  $key)

A PRO-only setting can not be imported in lite.

Parameters

boolean $onlyPro
string $key

addMessageUpdateOptionFailure()

addMessageUpdateOptionFailure(string  $optionName)

`update_option` failured.

Parameters

string $optionName

addMessageOptionOutdated()

addMessageOptionOutdated(string  $key)

Option not related to RCB.

Parameters

string $key

addMessageOptionRelatesPageId()

addMessageOptionRelatesPageId(string  $name,string  $key)

An option relates to a page ID, it can never be imported.

Parameters

string $name
string $key

addMessageOptionRelatesMedia()

addMessageOptionRelatesMedia(string  $name,string  $key)

An option relates to a media, it can never be imported.

Parameters

string $name
string $key

addMessageOptionMultisite()

addMessageOptionMultisite(string  $name,string  $key)

Multisite options can not be imported due to reference issues.

Parameters

string $name
string $key

addMessage()

addMessage(string  $message,string  $severity,string  $fix = null,string  $args = array())

Add a message to the message container.

Parameters

string $message
string $severity

Can be: info, warning, error, success

string $fix

See import.post.tsx

string $args

See import.post.tsx

__construct()

__construct(array  $json)

C'tor.

Parameters

array $json