\DevOwl\RealCookieBanner\scannerScanner

This isn't really a "cookie" scanner, it is a scanner which detects external URLs, scripts, iframes for the current page request. Additionally, it can automatically detect usable content blocker presets which we can recommend to the user.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
force_blocker_enabled()
teardown()
resolve_blockables()
isActive()
probablyForceSitemaps()
addUrlsToQueue()
purgeUnused()
real_queue_job_label()
real_queue_job_actions()
real_queue_error_description()
reduceCurrentUserPermissions()
getQuery()
getOnChangeDetection()
getExcludeHosts()
instance()
getCurrentSourceUrl()
No public properties found
QUERY_ARG_TOKEN
QUERY_ARG_JOB_ID
REAL_QUEUE_TYPE
QUERY_ARG_FORCE_SITEMAP
probablyInvalidateCacheAfterJobExecution()
doActionAddedRemoved()
No protected properties found
N/A
__construct()
$query
$onChangeDetection
N/A

Constants

QUERY_ARG_TOKEN

QUERY_ARG_TOKEN ='rcb-scan'

QUERY_ARG_JOB_ID

QUERY_ARG_JOB_ID ='rcb-scan-job'

REAL_QUEUE_TYPE

REAL_QUEUE_TYPE ='rcb-scan'

QUERY_ARG_FORCE_SITEMAP

QUERY_ARG_FORCE_SITEMAP ='rcb-force-sitemap'

See `findByRobots.txt`: This simulates to be the current blog to be public so the `robots.txt` exposes a sitemap and also activates the sitemap.

Properties

$query

$query :

Type

$onChangeDetection

$onChangeDetection :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

force_blocker_enabled()

force_blocker_enabled(boolean  $enabled)

Force to enable the content blocker even when the content blocker is deactivated.

Parameters

boolean $enabled

teardown()

teardown()

All presets and external URLs got catched, let's persist them to database.

isActive()

isActive()

Check if the current page request should be scanned.

probablyForceSitemaps()

probablyForceSitemaps()

Force sitemaps in

addUrlsToQueue()

addUrlsToQueue(array<mixed,string>  $urls,boolean  $purgeUnused = false)

Add URLs to the queue so they get scanned.

Parameters

array<mixed,string> $urls
boolean $purgeUnused

If true, the difference of the previous scanned URLs gets automatically purged if they do no longer exist in the URLs (pass only if you have the complete sitemap!)

purgeUnused()

purgeUnused(array<mixed,string>  $urls)

Read a group of all known site URLs and delete them if they no longer exist in the passed URLs.

Parameters

array<mixed,string> $urls

real_queue_job_label()

real_queue_job_label(string  $label,string  $originalType)

Get human-readable label for RCB queue jobs.

Parameters

string $label
string $originalType

real_queue_job_actions()

real_queue_job_actions(array<mixed,array>  $actions,string  $type)

Get actions for RCB queue jobs.

Parameters

array<mixed,array> $actions
string $type

real_queue_error_description()

real_queue_error_description(string  $description,string  $type,array<mixed,integer>  $remaining)

Get human-readable description for a RCB queue jobs.

Parameters

string $description
string $type
array<mixed,integer> $remaining

reduceCurrentUserPermissions()

reduceCurrentUserPermissions()

Remove some capabilities and roles from the current user for the running page request.

For example, some Google Analytics plugins do only print out the analytics code when not manage_options (e.g. WooCommerce Google Analytics).

getQuery()

getQuery()

Getter.

getOnChangeDetection()

getOnChangeDetection()

Getter.

getExcludeHosts()

getExcludeHosts()

Getter.

instance()

instance()

New instance.

getCurrentSourceUrl()

getCurrentSourceUrl()

Get the current source URL usable for a newly created `ScanEntry`. It gets escaped for database use with the help of `esc_url_raw`.

probablyInvalidateCacheAfterJobExecution()

probablyInvalidateCacheAfterJobExecution(\DevOwl\RealQueue\queue\Job  $job)

Try to invalidate some caches after every scan process. The cache is invalidated in the following cases:

  • Scan process was done without job (e.g. calling website with ?rcb-scan)
  • Scan process was done for a single website (e.g. after saving a post)
  • Scan process is within a complete website then, then the following situation is implemented: Depending on the count of scanned entries, every x. job within the complete website scan invalidated the cache.

Parameters

\DevOwl\RealQueue\queue\Job $job

doActionAddedRemoved()

doActionAddedRemoved(array<mixed,\DevOwl\RealCookieBanner\scanner\ScanEntry>  $results,array<mixed,string>  $beforePresets,array<mixed,string>  $beforeExternalHosts,array<mixed,string>  $afterPresets,array<mixed,string>  $afterExternalHosts)

`do_action` when a result from the scanner got removed or added.

Parameters

array<mixed,\DevOwl\RealCookieBanner\scanner\ScanEntry> $results
array<mixed,string> $beforePresets
array<mixed,string> $beforeExternalHosts
array<mixed,string> $afterPresets
array<mixed,string> $afterExternalHosts

__construct()

__construct()

C'tor.