Documentation

Notices
in package
Uses UtilsProvider

Notices management.

Table of Contents

Constants

CHECKLIST_PREFIX  = 'checklist-'
DISMISS_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_NOTICE_QUERY_ARG  = 'rcb-dismiss-scanner-explicit-external-url-coverage-notice'
DISMISS_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_NOTICE_START_SCAN_QUERY_ARG  = 'rcb-dismiss-scanner-explicit-external-url-coverage-notice-start-scan'
DISMISS_SERVICES_REQUIRING_GOOGLE_CONSENT_MODE_ACTIVE  = 'rcb-dismiss-gcm-required'
DISMISS_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_CONSENT_TYPES  = 'rcb-dismiss-gcm-no-consent-types'
DISMISS_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_LEGITIMATE_INTEREST  = 'rcb-dismiss-gcm-no-legitimate-interest'
DISMISS_SERVICES_WITH_SUCCESSOR_TEMPLATES_NOTICE_QUERY_ARG  = 'rcb-dismiss-successor-notice'
DISMISS_SERVICES_WITH_UPDATED_TEMPLATES_NOTICE_QUERY_ARG  = 'rcb-dismiss-upgrade-notice'
DISMISSED_BANNERLESS_CONSENT_LEGINT_SERVICES  = 'dismissed-bannerless-consent-legint-services'
DISMISSED_BANNERLESS_CONSENT_SERVICES_WITHOUT_VISUAL_CONTENT_BLOCKER  = 'dismissed-bannerless-consent-services-without-visual-content-blocker'
DISMISSED_SERVICES_REQUIRING_GOOGLE_CONSENT_MODE_ACTIVE  = 'dismissed-services-requiring-gcm'
DISMISSED_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_CONSENT_TYPES  = 'dismissed-services-using-gcm-and-no-consent-types'
DISMISSED_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_LEGITIMATE_INTEREST  = 'dismissed-services-using-gcm-and-no-legitimate-interest'
DISMISSED_SUCCESSORS  = 'dismissed-successors'
MODAL_HINT_PREFIX  = 'modal-hint-'
NOTICE_CHECK_SAVING_CONSENT_VIA_REST_API_ENDPOINT_WORKING  = 'check-saving-consent-via-rest-api-endpoint-working-result'
NOTICE_GET_PRO_MAIN_BUTTON  = 'get-pro-main-button'
NOTICE_GET_PRO_MAIN_BUTTON_NEXT  = 60 * 60 * 24 * 30
NOTICE_REVISON_REQUEST_NEW_CONSENT_PREFIX  = 'revision-request-new-consent-'
NOTICE_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE  = 'scanner-explicit-external-url-coverage'
NOTICE_SCANNER_RERUN_AFTER_PLUGIN_TOGGLE  = 'scanner-rerun-after-plugin-toggle'
NOTICE_SERVICE_DATA_PROCESSING_IN_UNSAFE_COUNTRIES  = 'service-data-processing-in-unsafe-countries'
NOTICE_SERVICES_WITH_EMPTY_PRIVACY_POLICY  = 'services-with-empty-privacy-policy'
NOTICE_SERVICES_WITH_GOOGLE_CONSENT_MODE_ADJUSTMENTS  = 'services-with-gcm-adjustments'
NOTICE_SERVICES_WITH_SUCCESSOR_TEMPLATES  = 'services-with-successor-templates'
NOTICE_SERVICES_WITH_UPDATED_TEMPLATES  = 'services-with-updated-templates'
NOTICE_TCF_TOO_MUCH_VENDORS  = 'tcf-too-much-vendors'
NOTICE_USING_TEMPLATES_WHICH_GOT_DELETED  = 'using-templates-which-got-deleted'
OPTION_NAME  = RCB_OPT_PREFIX . '-notice-states'
SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_DISMISSED  = false
SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_MANUAL_SCAN_REQUIRED  = 'manual'
SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_SCANNED  = 'scanned'
SCANNER_IGNORED_EXTERNAL_HOSTS  = 'scanner-ignored-hosts'
SCANNER_IGNORED_TEMPALTES  = 'scanner-ignored-templates'
TCF_TOO_MUCH_VENDORS  = 30

Properties

$nonBlockingRequestStarted  : mixed
See `http_api_debug` method description.
$states  : mixed

Methods

__construct()  : mixed
C'tor.
added_post_meta_data_processing_in_unsafe_countries()  : mixed
When a service / TCF vendor got created check if the services does processing data in unsafe countries.
admin_notice_scanner_rerun_after_plugin_toggle()  : mixed
Create an notice that the scanner should be rerun after any plugin got toggled.
admin_notice_service_using_template_which_got_deleted()  : mixed
Checks if the notice about service and blocker templates which got deleted should be shown, and returns the titles of the services with some special instructions.
admin_notice_services_with_google_consent_mode_adjustments()  : mixed
Show a notice of services with Google Consent Mode adjustments.
admin_notice_services_with_successor_templates()  : mixed
Show a notice of services and content blockers with a successor template.
admin_notice_services_with_updated_templates()  : mixed
Show a notice of services and content blockers with a template update.
admin_notice_tcf_too_much_vendors()  : mixed
Create an notice and inform the user about too many TCF vendors.
admin_notices_check_saving_consent_via_rest_api_endpoint_working()  : mixed
Create an admin notice for the REST API check if consents can be saved.
admin_notices_scanner_explicit_external_url_coverage()  : mixed
Create an admin notice for scanner external URLs which are now covered by newly published service templates.
admin_notices_services_with_empty_privacy_policy()  : mixed
Create an admin notice for services without privacy policy set.
anyPluginToggledState()  : mixed
When a plugin got toggled show scanner notice.
checkSavingConsentViaRestApiEndpointWorkingHtml()  : mixed
Get the notice HTML for a check if saving of a consent via the REST API works as expected.
dismissScannerExplicitExternalUrlCoverageNotice()  : mixed
Dismiss a scanner explicit external URL coverage notice by type.
getClickedModalHints()  : array<string|int, string>
Get list of clicked modal hints.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
getScannerIgnored()  : mixed
Get a list of ignored scanner results mapped by template and external host.
getStates()  : mixed
Getter.
http_api_debug()  : mixed
We have mechanism to check if the WordPress REST API is working as expected. But when WordPress spawns the WP cron request via `spawn_cron()` it starts a loopback request. That loopback request is non-blocking and when it takes longer than 20 seconds (e.g. checking for updates of plugins, themes, ...) it leads to the following error for all follow-up loopback requests:
isChecklistItem()  : mixed
Get checklist item state.
isConfigProNoticeVisible()  : mixed
Check if the Pro notice should be shown in config page. See `proHeadlineButton.tsx`.
recalculatePostDependingNotices()  : mixed
Reset states of notices which needs to get recalculated when a service / content blocker got updated / deleted.
scannerExplicitExternalUrlCoverageNoticeHtml()  : mixed
Create an admin notice for scanner external URLs which are now covered by newly published service templates.
servicesDataProcessingInUnsafeCountriesNoticeHtml()  : mixed
Checks if the notice about services which are processing data in unsafe countries should be shown, and returns the titles of the services which process data in unsafe countries
servicesWithBannerlessConsentAdjustments()  : array<string|int, mixed>
Read all services and calculate adjustments which needs to be done when bannerless consent is used.
servicesWithGoogleConsentModeAdjustments()  : array<string|int, mixed>
Read all services and calculate adjustments which needs to be done when Google Consent Mode is active or needs to be activated.
servicesWithGoogleConsentModeAdjustmentsHtml()  : array<string|int, string>
Get multiple notice HTMLs of services with Google Consent Mode adjustments.
servicesWithSuccessorTemplates()  : array<string|int, mixed>
Read all services and content blockers which have an successor.
servicesWithSuccessorTemplatesHtml()  : mixed
Get the notice HTML of services and content blockers with a successor template.
servicesWithUpdatedTemplates()  : array<string|int, mixed>
Read all services and content blockers which have an updated template version.
servicesWithUpdatedTemplatesHtml()  : mixed
Get the notice HTML of services and content blockers with a template update.
serviceWithEmptyPrivacyPolicyNoticeHtml()  : mixed
Create an admin notice for services without privacy policy set and return the HTML.
setChecklistItem()  : mixed
Set checklist item as open/closed.
setScannerIgnored()  : mixed
Set a scan result as ignored/unignored.
update_option_banner_active()  : mixed
When the cookie banner gets enabled or disabled, do some checks again.
update_post_meta_data_processing_in_unsafe_countries()  : mixed
When a service / TCF vendor got updated check if the service is now processing data in unsafe countries.
createStates()  : mixed
Create the notice states key-value option with migrations from older Real Cookie Banner versions.

Constants

CHECKLIST_PREFIX

public mixed CHECKLIST_PREFIX = 'checklist-'

DISMISS_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_NOTICE_QUERY_ARG

public mixed DISMISS_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_NOTICE_QUERY_ARG = 'rcb-dismiss-scanner-explicit-external-url-coverage-notice'

DISMISS_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_NOTICE_START_SCAN_QUERY_ARG

public mixed DISMISS_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_NOTICE_START_SCAN_QUERY_ARG = 'rcb-dismiss-scanner-explicit-external-url-coverage-notice-start-scan'
public mixed DISMISS_SERVICES_REQUIRING_GOOGLE_CONSENT_MODE_ACTIVE = 'rcb-dismiss-gcm-required'
public mixed DISMISS_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_CONSENT_TYPES = 'rcb-dismiss-gcm-no-consent-types'
public mixed DISMISS_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_LEGITIMATE_INTEREST = 'rcb-dismiss-gcm-no-legitimate-interest'

DISMISS_SERVICES_WITH_SUCCESSOR_TEMPLATES_NOTICE_QUERY_ARG

public mixed DISMISS_SERVICES_WITH_SUCCESSOR_TEMPLATES_NOTICE_QUERY_ARG = 'rcb-dismiss-successor-notice'

DISMISS_SERVICES_WITH_UPDATED_TEMPLATES_NOTICE_QUERY_ARG

public mixed DISMISS_SERVICES_WITH_UPDATED_TEMPLATES_NOTICE_QUERY_ARG = 'rcb-dismiss-upgrade-notice'
public mixed DISMISSED_BANNERLESS_CONSENT_LEGINT_SERVICES = 'dismissed-bannerless-consent-legint-services'
public mixed DISMISSED_BANNERLESS_CONSENT_SERVICES_WITHOUT_VISUAL_CONTENT_BLOCKER = 'dismissed-bannerless-consent-services-without-visual-content-blocker'
public mixed DISMISSED_SERVICES_REQUIRING_GOOGLE_CONSENT_MODE_ACTIVE = 'dismissed-services-requiring-gcm'
public mixed DISMISSED_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_CONSENT_TYPES = 'dismissed-services-using-gcm-and-no-consent-types'
public mixed DISMISSED_SERVICES_USING_GOOGLE_CONSENT_MODE_NO_LEGITIMATE_INTEREST = 'dismissed-services-using-gcm-and-no-legitimate-interest'

DISMISSED_SUCCESSORS

public mixed DISMISSED_SUCCESSORS = 'dismissed-successors'

MODAL_HINT_PREFIX

public mixed MODAL_HINT_PREFIX = 'modal-hint-'
public mixed NOTICE_CHECK_SAVING_CONSENT_VIA_REST_API_ENDPOINT_WORKING = 'check-saving-consent-via-rest-api-endpoint-working-result'

NOTICE_GET_PRO_MAIN_BUTTON

public mixed NOTICE_GET_PRO_MAIN_BUTTON = 'get-pro-main-button'

NOTICE_GET_PRO_MAIN_BUTTON_NEXT

public mixed NOTICE_GET_PRO_MAIN_BUTTON_NEXT = 60 * 60 * 24 * 30
public mixed NOTICE_REVISON_REQUEST_NEW_CONSENT_PREFIX = 'revision-request-new-consent-'

NOTICE_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE

public mixed NOTICE_SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE = 'scanner-explicit-external-url-coverage'

NOTICE_SCANNER_RERUN_AFTER_PLUGIN_TOGGLE

public mixed NOTICE_SCANNER_RERUN_AFTER_PLUGIN_TOGGLE = 'scanner-rerun-after-plugin-toggle'

NOTICE_SERVICE_DATA_PROCESSING_IN_UNSAFE_COUNTRIES

public mixed NOTICE_SERVICE_DATA_PROCESSING_IN_UNSAFE_COUNTRIES = 'service-data-processing-in-unsafe-countries'

NOTICE_SERVICES_WITH_EMPTY_PRIVACY_POLICY

public mixed NOTICE_SERVICES_WITH_EMPTY_PRIVACY_POLICY = 'services-with-empty-privacy-policy'
public mixed NOTICE_SERVICES_WITH_GOOGLE_CONSENT_MODE_ADJUSTMENTS = 'services-with-gcm-adjustments'

NOTICE_SERVICES_WITH_SUCCESSOR_TEMPLATES

public mixed NOTICE_SERVICES_WITH_SUCCESSOR_TEMPLATES = 'services-with-successor-templates'

NOTICE_SERVICES_WITH_UPDATED_TEMPLATES

public mixed NOTICE_SERVICES_WITH_UPDATED_TEMPLATES = 'services-with-updated-templates'

NOTICE_TCF_TOO_MUCH_VENDORS

public mixed NOTICE_TCF_TOO_MUCH_VENDORS = 'tcf-too-much-vendors'

NOTICE_USING_TEMPLATES_WHICH_GOT_DELETED

public mixed NOTICE_USING_TEMPLATES_WHICH_GOT_DELETED = 'using-templates-which-got-deleted'

OPTION_NAME

public mixed OPTION_NAME = RCB_OPT_PREFIX . '-notice-states'

SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_DISMISSED

public mixed SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_DISMISSED = false

SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_MANUAL_SCAN_REQUIRED

public mixed SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_MANUAL_SCAN_REQUIRED = 'manual'

SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_SCANNED

public mixed SCANNER_EXPLICIT_EXTERNAL_URL_COVERAGE_STATE_SCANNED = 'scanned'

SCANNER_IGNORED_EXTERNAL_HOSTS

public mixed SCANNER_IGNORED_EXTERNAL_HOSTS = 'scanner-ignored-hosts'

SCANNER_IGNORED_TEMPALTES

public mixed SCANNER_IGNORED_TEMPALTES = 'scanner-ignored-templates'

TCF_TOO_MUCH_VENDORS

public mixed TCF_TOO_MUCH_VENDORS = 30

Properties

$nonBlockingRequestStarted

See `http_api_debug` method description.

private mixed $nonBlockingRequestStarted = false

Methods

__construct()

C'tor.

public __construct(Core $core) : mixed
Parameters
$core : Core

added_post_meta_data_processing_in_unsafe_countries()

When a service / TCF vendor got created check if the services does processing data in unsafe countries.

public added_post_meta_data_processing_in_unsafe_countries(int $meta_id, int $object_id, string $meta_key, mixed $meta_value) : mixed
Parameters
$meta_id : int
$object_id : int
$meta_key : string
$meta_value : mixed

admin_notice_scanner_rerun_after_plugin_toggle()

Create an notice that the scanner should be rerun after any plugin got toggled.

public admin_notice_scanner_rerun_after_plugin_toggle() : mixed

admin_notice_service_using_template_which_got_deleted()

Checks if the notice about service and blocker templates which got deleted should be shown, and returns the titles of the services with some special instructions.

public admin_notice_service_using_template_which_got_deleted() : mixed

Show a notice of services with Google Consent Mode adjustments.

public admin_notice_services_with_google_consent_mode_adjustments() : mixed

admin_notice_services_with_successor_templates()

Show a notice of services and content blockers with a successor template.

public admin_notice_services_with_successor_templates() : mixed

admin_notice_services_with_updated_templates()

Show a notice of services and content blockers with a template update.

public admin_notice_services_with_updated_templates() : mixed

admin_notice_tcf_too_much_vendors()

Create an notice and inform the user about too many TCF vendors.

public admin_notice_tcf_too_much_vendors() : mixed

Create an admin notice for the REST API check if consents can be saved.

public admin_notices_check_saving_consent_via_rest_api_endpoint_working() : mixed

admin_notices_scanner_explicit_external_url_coverage()

Create an admin notice for scanner external URLs which are now covered by newly published service templates.

public admin_notices_scanner_explicit_external_url_coverage() : mixed

admin_notices_services_with_empty_privacy_policy()

Create an admin notice for services without privacy policy set.

public admin_notices_services_with_empty_privacy_policy() : mixed

anyPluginToggledState()

When a plugin got toggled show scanner notice.

public anyPluginToggledState(string $plugin, bool $network_wide) : mixed
Parameters
$plugin : string

Plugin slug

$network_wide : bool

Is it activated network wide

checkSavingConsentViaRestApiEndpointWorkingHtml()

Get the notice HTML for a check if saving of a consent via the REST API works as expected.

public checkSavingConsentViaRestApiEndpointWorkingHtml() : mixed

dismissScannerExplicitExternalUrlCoverageNotice()

Dismiss a scanner explicit external URL coverage notice by type.

public dismissScannerExplicitExternalUrlCoverageNotice(string $state) : mixed
Parameters
$state : string

getClickedModalHints()

Get list of clicked modal hints.

public getClickedModalHints() : array<string|int, string>
Return values
array<string|int, string>

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

getScannerIgnored()

Get a list of ignored scanner results mapped by template and external host.

public getScannerIgnored() : mixed

getStates()

Getter.

public getStates() : mixed
Tags
codeCoverageIgnore

http_api_debug()

We have mechanism to check if the WordPress REST API is working as expected. But when WordPress spawns the WP cron request via `spawn_cron()` it starts a loopback request. That loopback request is non-blocking and when it takes longer than 20 seconds (e.g. checking for updates of plugins, themes, ...) it leads to the following error for all follow-up loopback requests:

public http_api_debug(array<string|int, mixed>|WP_Error $response, string $context, string $class, array<string|int, mixed> $args, string $url) : mixed

cURL error 28: Operation timed out after x milliseconds with 0 bytes received

For this reason, we track all non-blocking requests and when a non-blocking request got started, we postpone the follow-up REST API check.

Parameters
$response : array<string|int, mixed>|WP_Error

HTTP response or WP_Error object.

$context : string

Context under which the hook is fired.

$class : string

HTTP transport used.

$args : array<string|int, mixed>

HTTP request arguments.

$url : string

The request URL.

Tags
see
https://app.clickup.com/t/8694nu6cm

isChecklistItem()

Get checklist item state.

public isChecklistItem(string $id) : mixed
Parameters
$id : string

isConfigProNoticeVisible()

Check if the Pro notice should be shown in config page. See `proHeadlineButton.tsx`.

public isConfigProNoticeVisible() : mixed

recalculatePostDependingNotices()

Reset states of notices which needs to get recalculated when a service / content blocker got updated / deleted.

public recalculatePostDependingNotices() : mixed

scannerExplicitExternalUrlCoverageNoticeHtml()

Create an admin notice for scanner external URLs which are now covered by newly published service templates.

public scannerExplicitExternalUrlCoverageNoticeHtml() : mixed

servicesDataProcessingInUnsafeCountriesNoticeHtml()

Checks if the notice about services which are processing data in unsafe countries should be shown, and returns the titles of the services which process data in unsafe countries

public servicesDataProcessingInUnsafeCountriesNoticeHtml() : mixed

servicesWithBannerlessConsentAdjustments()

Read all services and calculate adjustments which needs to be done when bannerless consent is used.

public servicesWithBannerlessConsentAdjustments() : array<string|int, mixed>

This includes services which are using bannerless consent for legitimate interest and services without visual content blockers.

Return values
array<string|int, mixed>

servicesWithGoogleConsentModeAdjustments()

Read all services and calculate adjustments which needs to be done when Google Consent Mode is active or needs to be activated.

public servicesWithGoogleConsentModeAdjustments() : array<string|int, mixed>
Return values
array<string|int, mixed>

servicesWithGoogleConsentModeAdjustmentsHtml()

Get multiple notice HTMLs of services with Google Consent Mode adjustments.

public servicesWithGoogleConsentModeAdjustmentsHtml(array<string|int, mixed> $adjustments) : array<string|int, string>
Parameters
$adjustments : array<string|int, mixed>
Return values
array<string|int, string>

servicesWithSuccessorTemplates()

Read all services and content blockers which have an successor.

public servicesWithSuccessorTemplates() : array<string|int, mixed>
Return values
array<string|int, mixed>

servicesWithSuccessorTemplatesHtml()

Get the notice HTML of services and content blockers with a successor template.

public servicesWithSuccessorTemplatesHtml(array<string|int, mixed> $successors) : mixed
Parameters
$successors : array<string|int, mixed>

servicesWithUpdatedTemplates()

Read all services and content blockers which have an updated template version.

public servicesWithUpdatedTemplates() : array<string|int, mixed>
Return values
array<string|int, mixed>

servicesWithUpdatedTemplatesHtml()

Get the notice HTML of services and content blockers with a template update.

public servicesWithUpdatedTemplatesHtml(array<string|int, mixed> $needsUpdate[, string $context = 'notice' ]) : mixed
Parameters
$needsUpdate : array<string|int, mixed>
$context : string = 'notice'

Can be notice or tile-migration

serviceWithEmptyPrivacyPolicyNoticeHtml()

Create an admin notice for services without privacy policy set and return the HTML.

public serviceWithEmptyPrivacyPolicyNoticeHtml() : mixed

setChecklistItem()

Set checklist item as open/closed.

public setChecklistItem(string $id, bool $state) : mixed
Parameters
$id : string
$state : bool

setScannerIgnored()

Set a scan result as ignored/unignored.

public setScannerIgnored(string $type, string $value, bool $state) : mixed
Parameters
$type : string

Can be template or host

$value : string
$state : bool

update_option_banner_active()

When the cookie banner gets enabled or disabled, do some checks again.

public update_option_banner_active() : mixed

update_post_meta_data_processing_in_unsafe_countries()

When a service / TCF vendor got updated check if the service is now processing data in unsafe countries.

public update_post_meta_data_processing_in_unsafe_countries(null|bool $check, int $object_id, string $meta_key, mixed $meta_value) : mixed
Parameters
$check : null|bool
$object_id : int
$meta_key : string
$meta_value : mixed

createStates()

Create the notice states key-value option with migrations from older Real Cookie Banner versions.

protected createStates() : mixed

        
On this page

Search results