Digital Sovereignty for everyone

Hooks and filters

Every hook name is derived from the plugin namespace lh_block_and_shortcode_auditor (itself filterable via lh_block_and_shortcode_auditor_return_plugin_namespace). The plugin fires no actions of its own.

Filters

Filter (prefix lh_block_and_shortcode_auditor) Default and purpose
_init_plugin true. Return false to disable the plugin.
_return_summary_table_name, _return_usage_table_name {base_prefix}lh_bsa_summary, {base_prefix}lh_bsa_usage
_return_tag_types block, shortcode
_return_excluded_post_types Core system types plus lh_wpn_message and ap_outbox
_return_excluded_statuses auto-draft, inherit, trash
_return_widget_sources block => content, text => text, custom_html => content
_return_batch_size 100 posts per batch job
_return_sweep_timeout 6 hours before an unfinished sweep may be restarted
_return_stall_timeout 15 minutes (minimum 60 seconds) without a finished batch before the watchdog resumes a sweep; also how often the watchdog checks
_return_refresh_delay 60 seconds before counts refresh after an edit
_return_schedule_check_interval 12 hours between daily-sweep schedule checks
_return_shortcode_tag_regex [a-z][a-z0-9_-]*
_is_shortcode_candidate Args: $is_candidate, $tag, $match, $after, $shape (attributes, self_closing, enclosing). Override the false-positive rules.
_get_registered_blocks, _get_registered_shortcodes Captured registry as tag => provider
_return_registry_signature_parts Active plugins, network plugins, stylesheet, template, plugin version
_return_lock_name {base_prefix}lh_bsa_summary_{blog_id} MySQL lock name
_return_loopback_query_var, _do_loopback lh_bsa_capture; true
_use_action_scheduler True when Action Scheduler is loaded; return false to force WP-Cron
_return_group Action Scheduler group, the text domain
_return_site_capability, _return_network_capability, _return_mcp_capability manage_options, install_plugins, install_plugins
_return_ability_classes Ability key => class map
_return_option_name, _return_scanner_option_name, _return_db_version_option_name Option name overrides

Background jobs

Per site, in Action Scheduler (group lh-block-and-shortcode-auditor) when available, otherwise WP-Cron:

  • lh_block_and_shortcode_auditor_daily_sweep: recurring daily, unique. Starts a sweep unless one is running.
  • lh_block_and_shortcode_auditor_scan_batch: async, args $cursor (last post ID) and $token (the sweep’s token). Scans the next 100 posts and queues the next batch, or finishes the sweep; exits immediately if the token is no longer current. Deliberately not unique.
  • lh_block_and_shortcode_auditor_resume_sweep (since 0.1.17): single, the watchdog. Queued when a sweep starts and requeued by itself every stall timeout while the sweep runs. If no batch has finished in that time it resumes the sweep from the last post scanned under a new token; once the sweep has finished it exits without requeuing.
  • lh_block_and_shortcode_auditor_refresh_counts: single, unique, one minute after an edit. Rebuilds the summary from the last captured registry.

Core hooks used

plugins_loaded (bootstrap), init (table install; schedule check at priority 20), shutdown priority 0 (registry capture on front-end requests), save_post priority 20, deleted_post, update_option_widget_{id_base}, wp_uninitialize_site, admin_menu, network_admin_menu (priority 5 shared LH Network Tools menu, priority 10 submenu), wp_abilities_api_categories_init, wp_abilities_api_init.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.