Constants

ACTION_SCANNER_FOUND_SERVICES

ACTION_SCANNER_FOUND_SERVICES ='rcb-scanner-found-services'

ACTION_SCAN_THIS_SITE

ACTION_SCAN_THIS_SITE ='rcb-scan-this-site'

OPTION_NAME

OPTION_NAME =RCB_OPT_PREFIX . '-scanner-notice-dismissed'

TRANSIENT_SERVICES_FOR_NOTICE

TRANSIENT_SERVICES_FOR_NOTICE =RCB_OPT_PREFIX . '-services-for-notice'

QUERY_ARG_DISMISS

QUERY_ARG_DISMISS =self::OPTION_NAME

MAX_FOUND_SERVICES_LIST_ITEMS

MAX_FOUND_SERVICES_LIST_ITEMS =5

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

admin_bar_menu()

admin_bar_menu(\WP_Admin_Bar  $admin_bar)

Show a "Show banner again" button in the admin toolbar in frontend.

Parameters

\WP_Admin_Bar $admin_bar

generateNoticeTextFromServices()

generateNoticeTextFromServices(array<mixed,string>  $services,integer  $countAll)

Generate the notice text from services.

Parameters

array<mixed,string> $services
integer $countAll

getServicesForNotice()

getServicesForNotice(integer  $max = 5): array

Get a list of found services + external URLs which should be listed in the admin notice.

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

integer $max

Returns

array —

[services chunked to $max, count of all found services]

getDismissedItems()

getDismissedItems()

Get dismissed items by preset or external host URL.

instance()

instance()

New instance.

probablyDismiss()

probablyDismiss()

Check if the query argument isset and dismiss the notice.

__construct()

__construct()

C'tor.