Scanner
in package
Uses
UtilsProvider
Scanner view.
Table of Contents
Constants
- ACTION_SCAN_THIS_SITE = 'rcb-scan-this-site'
- ACTION_SCANNER_FOUND_SERVICES = 'rcb-scanner-found-services'
- MAX_FOUND_SERVICES_LIST_ITEMS = 5
- QUERY_ARG_DISMISS = RCB_OPT_PREFIX . '-scanner-notice-dismissed'
- TRANSIENT_SERVICES_FOR_NOTICE = RCB_OPT_PREFIX . '-services-for-notice'
Methods
- admin_bar_menu() : mixed
- Show a "Show banner again" button in the admin toolbar in frontend.
- generateNoticeTextFromServices() : mixed
- Generate the notice text from services.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getServicesForNotice() : array<string|int, mixed>
- Get a list of found services + external URLs which should be listed in the admin notice.
- instance() : mixed
- New instance.
- __construct() : mixed
- C'tor.
Constants
ACTION_SCAN_THIS_SITE
public
mixed
ACTION_SCAN_THIS_SITE
= 'rcb-scan-this-site'
ACTION_SCANNER_FOUND_SERVICES
public
mixed
ACTION_SCANNER_FOUND_SERVICES
= 'rcb-scanner-found-services'
MAX_FOUND_SERVICES_LIST_ITEMS
public
mixed
MAX_FOUND_SERVICES_LIST_ITEMS
= 5
QUERY_ARG_DISMISS
public
mixed
QUERY_ARG_DISMISS
= RCB_OPT_PREFIX . '-scanner-notice-dismissed'
TRANSIENT_SERVICES_FOR_NOTICE
public
mixed
TRANSIENT_SERVICES_FOR_NOTICE
= RCB_OPT_PREFIX . '-services-for-notice'
Methods
admin_bar_menu()
Show a "Show banner again" button in the admin toolbar in frontend.
public
admin_bar_menu(WP_Admin_Bar $admin_bar) : mixed
Parameters
- $admin_bar : WP_Admin_Bar
generateNoticeTextFromServices()
Generate the notice text from services.
public
generateNoticeTextFromServices(array<string|int, string> $services, int $countAll) : mixed
Parameters
- $services : array<string|int, string>
- $countAll : int
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetServicesForNotice()
Get a list of found services + external URLs which should be listed in the admin notice.
public
getServicesForNotice([int $max = 5 ]) : array<string|int, mixed>
Attention: This query is cached to a transient as it is very expensive! Use
delete_transient(Scanner::TRANSIENT_SERVICES_FOR_NOTICE)
to invalidate the cache.
Parameters
- $max : int = 5
Return values
array<string|int, mixed> —[services chunked to $max
, count of all found services]
instance()
New instance.
public
static instance() : mixed
Tags
__construct()
C'tor.
private
__construct() : mixed