Hooks reference
Every action and filter, with its exact signature. All Free hooks fire only after the plugin has confirmed its requirements, except activate, deactivate and uninstall.
Press ⌘K and type part of a hook name to jump straight to its section.
Lifecycle
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_loaded | action | ( Plugin $plugin ). Free has booted. Extensions start here. |
siteryn_abandoned_cart_upgrade | action | ( string|false $old, string $new ). On init (20) when the version changed. |
siteryn_abandoned_cart_activate | action | No arguments. On activation; WooCommerce may not be loaded yet. |
siteryn_abandoned_cart_deactivate | action | No arguments. After cron events are cleared. Only clear runtime state. |
siteryn_abandoned_cart_scheduled_hooks | filter | ( string[] $hooks ). Cron hooks cleared on deactivation. |
siteryn_abandoned_cart_network_activation_limit | filter | ( int $limit ). How many sites network activation sets up directly; the others set themselves up on their first request. Default 500. |
siteryn_abandoned_cart_uninstall | action | No arguments. In uninstall.php, per site. |
Cart tracking
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_should_track | filter | ( bool $track, array $snapshot ). Return false to skip a cart. Runs last, after the email, guest, consent and exclusion rules. |
siteryn_abandoned_cart_consent_declined | action | ( bool $deleted ). A guest clicked "No thanks" (or unticked the box). $deleted: their open cart was removed. |
siteryn_abandoned_cart_cart_snapshot | filter | ( array $snapshot, WC_Cart $cart ). Adjust data before it is recorded. |
siteryn_abandoned_cart_item_data | filter | ( array $extra, array $cart_item ). JSON-safe line data restored with the cart. |
siteryn_abandoned_cart_cart_activity | action | ( array $snapshot ). The cart was created or changed (at shutdown). |
siteryn_abandoned_cart_cart_emptied | action | ( string $customer_key, int|null $cart_id ) |
siteryn_abandoned_cart_email_captured | action | ( string $email ). A guest's classic-checkout email came in. |
siteryn_abandoned_cart_order_created | action | ( WC_Order $order, int|null $cart_id ). Classic or block checkout. |
siteryn_abandoned_cart_order_converted | action | ( WC_Order $order ). First paid or on-hold status. |
siteryn_abandoned_cart_order_reversed | action | ( WC_Order $order, string $to ). Cancelled, refunded or failed after converting. |
siteryn_abandoned_cart_converted_statuses | filter | ( string[] $statuses ). Default: paid statuses plus on-hold. |
A snapshot holds customer_key, user_id, email, first_name, items, cart_hash, total, currency and locale. Use CartTracker::suspend() / resume() while rebuilding a cart in code.
Cart records
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_status_changed | action | ( Cart $cart, string $from, string $to ). After every transition. |
siteryn_abandoned_cart_cart_{status} | action | ( Cart $cart, string $from ). _cart_active, _cart_abandoned, _cart_recovery_sent, _cart_recovered, _cart_completed, _cart_expired. |
siteryn_abandoned_cart_cart_saved | action | ( Cart $cart, bool $is_new ) |
siteryn_abandoned_cart_cart_deleted | action | ( Cart $cart ) |
siteryn_abandoned_cart_cart_anonymized | action | ( Cart $cart ) |
siteryn_abandoned_cart_event_labels | filter | ( array $labels ). Timeline event labels. |
siteryn_abandoned_cart_expire_days | filter | ( int $days ). Inactivity before an open cart expires. Default: the Expire Idle Carts After setting (30). |
siteryn_abandoned_cart_cart_marked_recovered | action | ( Cart $cart ). An admin used Mark as recovered. |
siteryn_abandoned_cart_event_style | filter | ( array{icon, variant, group} $style, string $type ). Timeline icon and group for an event type. |
siteryn_abandoned_cart_cleanup_done | action | ( array{expired, deleted, anonymized} ). After the daily cleanup. |
Abandonment detection
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_is_abandoned | filter | ( bool $abandoned, Cart $cart ). Return false to keep a cart active. It is checked again next run. |
siteryn_abandoned_cart_detection_done | action | ( array{abandoned, completed, expired, skipped} ). Not fired when a run is skipped. |
Recovery links
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_recovery_base_url | filter | ( string $base ). Default home_url('/'). |
siteryn_abandoned_cart_recovery_redirect | filter | ( string $url, Cart $cart ). Landing page after a restore. Default: checkout. |
siteryn_abandoned_cart_restorable_line | filter | ( array|WP_Error $line, array $item, WC_Product $product ). Return a WP_Error to skip a line. |
siteryn_abandoned_cart_cart_restored | action | ( Cart $cart, int $restored, string[] $missing ) |
siteryn_abandoned_cart_token_lifetime | filter | ( int $seconds ). Minimum 1 hour. |
siteryn_abandoned_cart_resolve_token | filter | ( null $resolved, string $hash ). Return ['cart' => Cart, 'expires_at' => int] for tokens you issued. |
siteryn_abandoned_cart_link_scanner_agents | filter | ( string[] $fragments ). Case-insensitive user-agent fragments treated as link scanners and bots. A link opened by one restores nothing. |
siteryn_abandoned_cart_is_link_scanner | filter | ( bool $scanner, string $user_agent ). Final say on whether a request comes from a scanner or bot. An empty user agent counts as one. |
siteryn_abandoned_cart_link_opened | action | ( Cart $cart, string $token_hash ). A link was opened and its cart restored into that visitor's session. Scanners posing as browsers fire it too. |
siteryn_abandoned_cart_recovery_confirmed | action | ( Cart $cart, string $token_hash, string $source ). A person's return was confirmed: $source is beacon (the landing page) or order. Once per restored session; count human clicks here. |
Recovery email
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_email_placeholders | filter | ( array $placeholders, Cart $cart ). Plain-text values, including {unsubscribe_url}. |
siteryn_abandoned_cart_email_args | filter | ( array $args, Cart $cart ). Template arguments, including logo_url, show_images, show_items and colors. Pro applies per-email design at priority 20. |
siteryn_abandoned_cart_email_headers | filter | ( string[] $headers, Cart $cart, string $to ). From, Reply-To and List-Unsubscribe headers, just before sending. |
siteryn_abandoned_cart_email_suppressed | action | ( Cart $cart, string $to ). An email was refused because the address is unsubscribed. |
siteryn_abandoned_cart_email | filter | ( array{subject, html, text} $email, Cart $cart ). The rendered email. |
siteryn_abandoned_cart_email_before_items / _after_items | action | ( array $args ). Inside the HTML template. |
siteryn_abandoned_cart_pre_send_email | filter | ( null $sent, array $email, Cart $cart, string $to, string $url ). Return a bool to send another way. |
siteryn_abandoned_cart_free_email_enabled | filter | ( bool $enabled ). Whether Free's sender runs at all. |
siteryn_abandoned_cart_email_due_carts | filter | ( Cart[] $carts ). Due carts the scheduled sender is about to email. Remove the ones your extension emails itself: they get no send and no "skipped" entry. |
siteryn_abandoned_cart_should_send_email | filter | ( bool $send, Cart $cart, array $args ). Per-cart veto. $args are the EmailSender::send() options (context identifies an extension's message). |
siteryn_abandoned_cart_recently_emailed | filter | ( bool $recent, string $email, int $exclude_cart_id, int $since ). Whether an address counts as recently emailed for the per-address cooldown. |
siteryn_abandoned_cart_email_batch_size | filter | ( int $size ). Default 25, 1–500. |
siteryn_abandoned_cart_email_max_age | filter | ( int $seconds ). Default 7 days. |
siteryn_abandoned_cart_email_cooldown | filter | ( int $seconds ). Per-address cooldown. Default: One Email per Address Every × 3600 (24 h); 0 disables it. |
siteryn_abandoned_cart_email_sent / _email_failed | action | ( Cart $cart, array $args ). After wp_mail() accepted or refused a recovery email; $args are the send() options. |
siteryn_abandoned_cart_email_run_done | action | ( array{sent, failed, skipped} ) |
Unsubscribe & notifications
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_unsubscribe_url | filter | ( string $url, Cart $cart ) |
siteryn_abandoned_cart_is_suppressed | filter | ( bool $suppressed, string $email ) |
siteryn_abandoned_cart_unsubscribed | action | ( string $hash, string $source, int $cart_id ). An address was added to the list. |
siteryn_abandoned_cart_resubscribed | action | ( string $hash ) |
siteryn_abandoned_cart_erase_suppression | filter | ( bool $erase, string $email ). Default false: an erasure request keeps the hash so the opt-out is honoured. |
siteryn_abandoned_cart_admin_notification | filter | ( array{to, subject, html, headers}|false $email, Cart $cart, ?WC_Order $order ). Return false to skip. |
siteryn_abandoned_cart_admin_notified | action | ( Cart $cart, array $email ) |
siteryn_abandoned_cart_metrics_series | filter | ( array $series, int $days ). Dashboard chart data. |
Templates
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_template_path | filter | ( string $path, string $name ). Resolved template file. |
siteryn_abandoned_cart_before_template / _after_template | action | ( string $name, array $args ) |
Admin, metrics & settings
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_metrics | filter | ( array $metrics, int $days ). Cached 5 minutes. |
siteryn_abandoned_cart_dashboard_cards | filter | ( array $cards, array $metrics ). Each card is a list: array( label, value (escaped HTML), dashicon, variant ). |
siteryn_abandoned_cart_system_status_cards | filter | ( array $cards ). System Status summary cards: label, value, state (ok, warn, fail, info, accent), icon, optional text. |
siteryn_abandoned_cart_system_status_rows | filter | ( array $rows, string $table ). Rows array( label, value, ?bool ) of the requirements, tracking or environment table. The bool shows an OK / Needs Attention pill. |
siteryn_abandoned_cart_settings_sections | filter | ( array $sections ). Settings tabs. |
siteryn_abandoned_cart_settings_fields | filter | ( array $fields ) |
siteryn_abandoned_cart_render_field_{type} | action | ( array $field, mixed $value, string $name, string $id ) |
siteryn_abandoned_cart_sanitize_field_{type} | filter | ( mixed $default, mixed $raw, array $field ) |
siteryn_abandoned_cart_settings_get_all | filter | ( array $settings ) |
siteryn_abandoned_cart_settings_save_redirect | filter | ( false|array $redirect, string $option_name ). Return an array to block a save. |
siteryn_abandoned_cart_settings_nav_visible | filter | ( bool $visible, string $section ) |
…_settings_nav_badge · _nav_icon · _nav_sublabel · _description | filter | ( string $value, string $section ) |
siteryn_abandoned_cart_settings_sidebar_{section} | action | ( string $section ). Any tab's sidebar, above its Reset to Defaults card. |
siteryn_abandoned_cart_settings_sidebar | action | ( string $section ). Cart Tracking tab's sidebar, after the Tracking Status card. |
siteryn_abandoned_cart_settings_main_after | action | ( string $section ). Cart Tracking tab's main column, after its form. |
siteryn_abandoned_cart_settings_reset_actions | filter | ( array $actions ). Option name to admin-post reset action, for an extension's own option. |
siteryn_abandoned_cart_settings_reset_keep_keys | filter | ( string[] $keep, string $option_name, string $section ). Keys a reset leaves alone for users without manage_options. |
siteryn_abandoned_cart_ajax_rate_limit | filter | ( int $limit, string $name ). Requests per minute per visitor. |
siteryn_abandoned_cart_client_ip | filter | ( string $ip ). Default REMOTE_ADDR. Behind a proxy or CDN, return the visitor's IP from your proxy's header. Used only as a hash, for throttling. |
siteryn_abandoned_cart_behind_proxy | filter | ( bool $behind, string[] $headers ). Whether the site counts as behind a proxy/CDN (the System Status notice). |
siteryn_abandoned_cart_ip_rate_limit_factor | filter | ( int $factor ). How many times an endpoint's limit all guests on one IP share. Default 10. |
siteryn_abandoned_cart_load_frontend_assets | filter | ( bool $load ). Default: checkout only (not the order-received page), while tracking is on. |
siteryn_deactivation_feedback_endpoint | filter | ( string $url ). Where the deactivation survey is sent. Shared by every Siteryn plugin. |
siteryn_dashboard_plugins | filter | ( array $plugins ). Cards on the shared Siteryn Welcome page. |
Pro: lifecycle & license
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_pro_loaded | action | ( Pro\Plugin $plugin ). Pro has booted, licensed or not. |
siteryn_abandoned_cart_pro_features_loaded | action | ( Pro\Plugin $plugin ). init (15), only with an active license. |
siteryn_abandoned_cart_pro_activated | action | No arguments. On activation. |
siteryn_abandoned_cart_pro_upgrade | action | ( string|false $old, string $new ) |
siteryn_abandoned_cart_pro_deactivate / _uninstall | action | No arguments. |
siteryn_abandoned_cart_pro_license_activated | action | ( ActivationOutcome $outcome ) |
siteryn_abandoned_cart_pro_license_deactivated | action | ( bool $done ) |
Pro: campaigns
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_pro_condition_types | filter | ( array $types ). type => [label, ops[], value]. Value is one of number, integer, ids, slugs, segment or choice:a,b. Also used by Segments. |
siteryn_abandoned_cart_pro_condition_matches | filter | ( bool $result, array{type, op, value} $condition, Cart $cart ) |
siteryn_abandoned_cart_pro_select_campaign | filter | ( Campaign|null $campaign, Cart $cart ). Fires for the first matching campaign only. Return null to skip. |
siteryn_abandoned_cart_pro_step_email | filter | ( array $overrides, Cart $cart, Campaign $campaign, int $step ). $step is 0-based. subject is the cart's A/B variant; may include from_name, from_address, reply_to. |
siteryn_abandoned_cart_pro_step_postponed | action | ( Cart $cart, Campaign $campaign, int $step, int $until, string $reason ). A step waits: $reason is send_window or cooldown (Free's "One Email per Address Every"). |
siteryn_abandoned_cart_pro_step_unsubscribed | action | ( Cart $cart, Campaign $campaign, int $step ). A sequence ended because the address is unsubscribed. |
siteryn_abandoned_cart_pro_segment_saved / _segment_deleted | action | ( array $segment ) / ( string $id ) |
siteryn_abandoned_cart_pro_cart_enrolled | action | ( Cart $cart, Campaign $campaign ) |
siteryn_abandoned_cart_pro_step_sent | action | ( Cart $cart, Campaign $campaign, int $step ) |
siteryn_abandoned_cart_pro_link_opened | action | ( array $token_event, Cart $cart ). A campaign email's link was opened and its cart restored. Email link scanners fire it too, so don't count clicks here. |
siteryn_abandoned_cart_pro_recovery_confirmed | action | ( array $token_event, Cart $cart, string $source ). A person came back through a campaign email's link ($source is beacon or order). Pro records the click here. |
siteryn_abandoned_cart_pro_campaign_run_done | action | ( array{enrolled, sent, failed, skipped} ) |
siteryn_abandoned_cart_pro_campaign_saved / _deleted | action | ( Campaign $campaign ) / ( string $id ) |
Pro: coupons & analytics
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_pro_coupon | filter | ( WC_Coupon $coupon, Cart $cart, array $settings ). Before the coupon is saved. |
siteryn_abandoned_cart_pro_coupons_per_address | filter | ( int $max ). Default 3 per 30 days; 0 disables coupons. |
siteryn_abandoned_cart_pro_metrics | filter | ( array $metrics, int $days ). Cached 10 minutes. Includes opens, open_rate and ab_tests. |
siteryn_abandoned_cart_pro_metrics_series | filter | ( array $series, int $days ). Recovery Over Time chart data. |
siteryn_abandoned_cart_pro_analytics_toolbar | action | ( int $days ). End of the Analytics toolbar form. |
siteryn_abandoned_cart_pro_analytics_export_rows | filter | ( array $rows, int $days ). CSV rows. Never add personal data. |
siteryn_abandoned_cart_pro_digest_data | filter | ( array $data, string $frequency ). Digest numbers. |
siteryn_abandoned_cart_pro_pre_send_digest | filter | ( bool|null $sent, array $email, string[] $to ). Return a bool to send another way. |
Pro: integrations & settings
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_pro_integrations | filter | ( IntegrationInterface[] $integrations ). Default: one integration per webhook endpoint. |
siteryn_abandoned_cart_pro_event_payload | filter | ( array $payload, string $event, Cart $cart ). When the event is queued. |
siteryn_abandoned_cart_pro_onsite_show | filter | ( bool $show ). Whether to offer the on-site prompt. |
siteryn_abandoned_cart_pro_sanitize_settings | filter | ( array $clean ) |
siteryn_abandoned_cart_pro_settings_tabs / _settings_fields | filter | ( array ) |
siteryn_abandoned_cart_pro_admin_config | filter | ( array $config ). Never put secrets here. |
Pro: AI
| Hook | Type | Arguments · when |
|---|---|---|
siteryn_abandoned_cart_pro_ai_providers | filter | ( array<string, ProviderInterface> $providers ) |
siteryn_abandoned_cart_pro_ai_provider_config | filter | ( ProviderConfig $config ) |
siteryn_abandoned_cart_pro_ai_max_retries | filter | ( int $retries, string $provider_id ). 0–2, default 1. |
siteryn_abandoned_cart_pro_ai_allow_insecure_local_endpoint | filter | ( bool $allow, string $url ). Allows http://localhost. |
siteryn_abandoned_cart_pro_ai_email_brief | filter | ( array $brief, array $raw ). The data sent to the provider. |
siteryn_abandoned_cart_pro_ai_email_prompt | filter | ( string $instruction ). The system prompt. |
siteryn_abandoned_cart_pro_ai_email_draft | filter | ( array $draft, array $brief ) |
siteryn_abandoned_cart_pro_ai_insights_data | filter | ( array $data, int $days ). Totals sent for insights. Keep it aggregated. |
siteryn_abandoned_cart_pro_ai_insights_prompt | filter | ( string $prompt ) |