Loyal Security 1.6.0 has 15 actions and 56 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Loyal Security fires an action
add_action( 'loyalsec_ban_removed', function( $ip ) {
// Your code runs here.
}, 10, 1 );
// Change a value Loyal Security is about to use
add_filter( 'https_local_ssl_verify', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Fires after a ban is removed. Used by integrations that mirror the ban list * elsewhere (the web-server ban block, Cloudflare sync). */ do_action( 'loyalsec_ban_removed', $ip ); -
/** * Fires after an event is logged. Used for real-time alerting/notifications. */ do_action( 'loyalsec_event_logged', $type, $data, $id ); -
/** * This filter is documented in wp-includes/class-wp-http-streams.php */ apply_filters( 'https_local_ssl_verify', false ); -
/** * Fires after backup retention has been enforced (extension point for add-ons * that keep data of their own alongside backups). */ do_action( 'loyalsec_backup_retention_enforced' ); -
/** * Fires after a ban is added or updated. Used by integrations (e.g. Cloudflare * sync) to mirror the ban to an external edge firewall. */ do_action( 'loyalsec_ban_added', (string) $ban['ip'], array( 'reason' => (string) $ban['reason'], 'type' => (string) $ban['type'], 'source' => (string) $ban['source'], 'cidr' => (string) $ban['cidr'], ) ); -
/** * Fires after Loyal Security has fully booted. */ do_action( 'loyalsec_booted', $this ); -
/** * Filters the product name shown in the dashboard, admin menu, admin bar, * alert emails and passkey prompts. */ apply_filters( 'loyalsec_brand_name', self::NAME ); -
/** * Filters whether the breached-password check runs. */ apply_filters( 'loyalsec_breach_check_enabled', true, (int) $user_id ); -
/** * Filters how many checksum files the cache folder may hold. */ apply_filters( 'loyalsec_checksum_cache_max_files', self::MAX_FILES ); -
/** * Fires alongside `loyalsec_scan_finding` for each newly recorded finding. */ do_action( 'loyalsec_cloud_reputation_scanner', $f ); -
/** * Fires on a WAF signature or virtual-patch block. */ do_action( 'loyalsec_cloud_reputation_waf', $type, $context ); -
/** * Filters whether a Google country site is added automatically while the * Google Analytics service is on. */ apply_filters( 'loyalsec_csp_auto_allow_google_domains', true, $host, $dir ); -
/** * Seconds during which a repeat of one violation is only counted, not written. */ apply_filters( 'loyalsec_csp_report_interval', CspReportThrottle::INTERVAL ); -
/** * Whether to report a CVE that carries no usable version information (can't be * confirmed to affect the installed version). Default false = drop it as junk. */ apply_filters( 'loyalsec_cve_report_without_version', false, $cve, $installed ); -
/** * Filters the hosts the database scan accepts in a stored <script src> or * <iframe src>. A host also covers its subdomains. */ apply_filters( 'loyalsec_db_scan_allowed_hosts', $hosts ); -
/** * Filters which parts of the database the content scan reads. Each entry is * one source: posts, postmeta, terms, termmeta, options, comments, usermeta, * snippets, site_address, admins. They always run in that order; unknown * entries are ignored. */ apply_filters( 'loyalsec_db_scan_sources', self::SOURCES ); -
/** * Filters how many seconds one scan call spends on the database phase before * it hands back (it always completes the window it is reading). */ apply_filters( 'loyalsec_db_scan_step_seconds', self::DB_STEP_SECONDS ); -
/** * Filters the files in the WordPress root that are expected although they are * not part of WordPress, such as an analytics endpoint a plugin writes there. */ apply_filters( 'loyalsec_expected_root_files', $files ); -
/** * Fires after ANY feed dataset is written to the cache — distinct from the * cve-only `loyalsec_feed_updated` hook below. Consumers that care about a * specific dataset (e.g. FirewallModule refreshing the prepend's config * snapshot after a 'waf'/'patches' sync) should filter on $dataset themselves. */ do_action( 'loyalsec_feed_dataset_updated', $dataset, $rules ); -
/** * Fires after a CVE advisory dataset is written to the feed cache. */ do_action( 'loyalsec_feed_updated', $rules ); -
/** * Filters how many rows `scan_findings` may hold for its index to be added * during a request. */ apply_filters( 'loyalsec_findings_index_inline_rows', self::INLINE_ROWS ); -
/** * Filters how many seconds the index build may wait for a lock on the table. */ apply_filters( 'loyalsec_findings_index_lock_wait', $deferred ? 60 : 5, $deferred ); -
/** * Filters the health-score checks before the score is totalled. */ apply_filters( 'loyalsec_health_score_checks', $checks ); -
/** * Filter the computed incident score for a cluster. */ apply_filters( 'loyalsec_incident_score', $score, $events ); -
/** * Filters how many seconds one slice of an integrity job works (never more * than 60). */ apply_filters( 'loyalsec_integrity_slice_seconds', $default, $context ); -
/** * Filter the event types shown by the free live traffic monitor. */ apply_filters( 'loyalsec_live_event_types', $types ); -
/** * Filters the audit log's row cap. 0 turns the cap off. */ apply_filters( 'loyalsec_log_max_rows', self::DEFAULT_MAX_ROWS ); -
/** * Filters the login error codes shown as they are, because they say nothing * about whether the account exists or the password was right. */ apply_filters( 'loyalsec_login_error_codes_shown', array( 'empty_username', 'empty_password', 'test_cookie', 'loyalsec_captcha', 'loyalsec_banned', 'loyalsec_login_locked' ) ); -
/** * Filters extra notes appended to the neutral "Incorrect username or password" * message, for example how to finish a two-factor sign-in. Notes must not * depend on whether the password was right, or they would reveal it. */ apply_filters( 'loyalsec_login_error_notes', array(), self::$failed_login ); -
/** * Fires on every failed login, after it is recorded. */ do_action( 'loyalsec_login_failed', $ip, (string) $username ); -
/** * Filters the login error codes that are not counted as failed logins (prompts * such as "enter your code", rather than wrong credentials). */ apply_filters( 'loyalsec_login_failure_ignored_codes', self::NOT_FAILURES ); -
/** * Filters whether an event is emailed. An add-on that already sends its own, * more specific email for an event can return false here so the owner gets one * email, not two. */ apply_filters( 'loyalsec_notification_email', true, $type, $data, $severity ); -
/** * Fires for every event that passed the mute list, after the email channel * ran, so an add-on can deliver it through channels of its own. */ do_action( 'loyalsec_notification_event', array( 'type' => $type, 'data' => $data, 'severity' => $severity, 'guide' => $guide, 'id' => $id ), $this->module ); -
/** * Filters whether an event whose audit row could not be written is still * notified. */ apply_filters( 'loyalsec_notify_unrecorded_event', true, $type, $data, $severity ); -
/** * Filters the onboarding steps after their done-state has been evaluated. */ apply_filters( 'loyalsec_onboarding_steps', $steps ); -
/** * Filters whether the Loyal Security Pro plugin is active. Pro hooks this; * nothing in the free plugin sets it. */ apply_filters( 'loyalsec_pro_active', false ); -
/** * Fires after a repair backup is recorded. Lets the incident module check * whether the accumulated backup storage has crossed the admin-reminder * threshold. */ do_action( 'loyalsec_repair_backup_recorded', $entry ); -
/** * Filters the result of a completed restore (extension point, e.g. to replay * data recorded after the backup was taken). */ apply_filters( 'loyalsec_restore_result', $result, $manifest ); -
/** * Filters whether the built-in weekly scan runs. An add-on that schedules its * own, more frequent scans can return false to avoid scanning twice. */ apply_filters( 'loyalsec_run_weekly_scan', true ); -
/** * Filters how many `scan.finding` audit rows one scan may write. Every row * counts, critical ones included. Once the limit is reached only critical * findings are still written (severity critical, or a score of 30 and over, * which is what telemetry treats as critical), so 0 writes critical findings * only. The rows are not the findings: all of them are stored and fire the * actions, and `scan.completed` ... */ apply_filters( 'loyalsec_scan_audit_rows_per_scan', self::AUDIT_ROWS_PER_SCAN ); -
/** * Filters the share of time (0.1 to 1.0) a scan driver spends working; it * waits for the rest. 1.0 turns the waiting off. */ apply_filters( 'loyalsec_scan_duty_cycle', self::DUTY_CYCLE ); -
/** * Fires once for each newly-recorded scan finding. */ do_action( 'loyalsec_scan_finding', $f ); -
/** * Filters the 1-minute load average above which the background scan waits * instead of working. 0 (the default) turns the check off. */ apply_filters( 'loyalsec_scan_max_load', 0.0 ); -
/** * Filters how many seconds of scanning one dashboard request does (paced; * never more than 60). */ apply_filters( 'loyalsec_scan_slice_seconds', 8.0 ); -
/** * Filters the files the malware scanner trusts without scanning. */ apply_filters( 'loyalsec_scanner_trusted_files', $map ); -
/** * Filters the addresses treated as this server, which skip the firewall's rate * and query-cardinality limits (bans and content checks still apply). */ apply_filters( 'loyalsec_server_ips', $ips ); -
/** * Filters whether the vulnerability warnings are shown on the Plugins screen * (and the network Themes screen). Decided on `admin_init` at priority 10, so * add the filter before then. */ apply_filters( 'loyalsec_show_vuln_row_notices', $show ); -
/** * Filters the threat-intelligence sync schedule. */ apply_filters( 'loyalsec_threatintel_sync_recurrence', 'twicedaily' ); -
/** * An allowed-but-suspicious ("near miss") request: it scored on the WAF but * stayed below the block threshold, so it is being let through. The * bypass-telemetry module subscribes (only when the admin has opted in) to * record an anonymized snapshot, so that if this request later proves to have * planted malware we can report exactly what slipped past the firewall. No-op * when nothing is listening. */ do_action( 'loyalsec_waf_near_miss', $req, $decision ); -
/** * Filters whether XML-RPC stays reachable even though "Disable XML-RPC" is on, * because another plugin needs it. Pingbacks and system.multicall stay * disabled either way. */ apply_filters( 'loyalsec_xmlrpc_needed', $needed ); -
apply_filters( 'loyalsec_auto_whitelist_ttl', 30 * DAY_IN_SECONDS ); -
apply_filters( 'auth_redirect_scheme', '' ); -
apply_filters( 'loyalsec_auto_whitelist_max', 25 ); -
apply_filters( 'loyalsec_backup_min_free_bytes', max( self::MIN_FREE_BYTES, (int) ( $largest * 1.5 ) ), $largest ); -
apply_filters( 'loyalsec_baseline_orphan_grace_seconds', self::ORPHAN_GRACE ); -
apply_filters( 'loyalsec_baseline_orphan_sweep', false ); -
apply_filters( 'loyalsec_closed_findings_max_rows', self::FINDINGS_MAX ); -
apply_filters( 'loyalsec_closed_findings_retention_days', self::CLOSED_DAYS ); -
apply_filters( 'loyalsec_csp_violations_max_rows', self::CSP_MAX ); -
apply_filters( 'loyalsec_csp_violations_retention_days', 90 ); -
apply_filters( 'loyalsec_feed_public_key', $key_b64 ); -
apply_filters( 'loyalsec_feed_stale_seconds', 3 * DAY_IN_SECONDS ); -
apply_filters( 'loyalsec_feed_url', LicenseKit::feed_url() ); -
apply_filters( 'loyalsec_integrity_duty_cycle', self::DUTY_CYCLE ); -
do_action( 'loyalsec_integrity_job_lost', $cur ); -
apply_filters( 'loyalsec_log_retention_days', 90 ); -
apply_filters( 'loyalsec_login_attempts_max_rows', self::LOGIN_ATTEMPTS_MAX ); -
apply_filters( 'loyalsec_login_attempts_retention_days', 30 ); -
apply_filters( 'loyalsec_notifications_max_rows', self::NOTIFICATIONS_MAX ); -
apply_filters( 'loyalsec_repair_backups_max_bytes', self::MAX_BYTES ); -
apply_filters( 'loyalsec_trusted_device_ttl', self::COOKIE_TTL, $user_id );
Generated from Loyal Security's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: