Hooks Reference

Comprehensive reference of all slswc_* actions and filters. Organized by category.


Settings

HookTypeParametersDescriptionFile
slswc_slugfilter(string $prefix)Filter the plugin option prefix (default: slswc_)class-slswc.php
slswc_get_sections_{id}filter(array $sections)Filter settings sections for a settings pageclass-slswc-settings-provider.php
slswc_get_settings_{id}filter(array $settings)Filter settings fields for a settings pageclass-slswc-settings-provider.php
slswc_before_save_settingsfilter(array $values)Filter values before saving settingsclass-slswc-settings-provider.php
slswc_renewal_periods_settingsfilter(array $settings)Filter renewal period settings fieldsclass-slswc-settings-provider.php
slswc_renewal_periodsfilter(array $periods)Filter available renewal periodsclass-slswc.php
slswc_renewal_period_defaultsfilter(array $defaults)Filter default renewal periodsclass-slswc.php
slswc_get_renewal_periodsfilter(array $periods)Filter merged renewal periods (defaults + custom)class-slswc.php
slswc_renewal_periods_to_savefilter(array $periods)Filter periods before persistence via REST APIclass-slswc-settings-api.php
slswc_email_reminder_length_defaultsfilter(array $defaults)Filter default email reminder lengthsclass-slswc.php
slswc_server_toolsfilter(array $tools)Map of tool ID => callable run when the tool is executedclass-slswc-tools.php
slswc_tools_settingsfilter(array $settings)Filter the Tools tab fields; add a tool-button field to show a button for a custom toolclass-slswc-settings-provider.php
slswc_tools_process_{tool_id}action(SLSWC_Tools $tools)Fired after a tool's callable runs via POST /slswc/v1/settings/tools/{tool_id}class-slswc-tools.php

License Lifecycle

HookTypeParametersDescriptionFile
slswc_license_activated_notificationaction(SLSWC_License $license, array $domain_data)Fired when a license is activated on a domainclass-slswc-license.php
slswc_license_deactivated_notificationaction(SLSWC_License $license, array $domain_data)Fired when a license is deactivated from a domainclass-slswc-license.php
slswc_license_max_activations_notificationaction(SLSWC_License $license)Fired when activation limit is reachedclass-slswc-license.php
slswc_license_expired_notificationsaction(SLSWC_License $license, WC_Mailer $mailer)Fired when a license expiresclass-slswc-woocommerce-license.php
slswc_license_expiring_notificationsaction(SLSWC_License $license, WC_Mailer $mailer)Fired when a license is about to expireclass-slswc-woocommerce-license.php
slswc_license_renewed_notificationaction(SLSWC_License $license)Fired when a license is renewedclass-slswc-myaccount-api.php, class-slswc-woocommerce-subscriptions.php
slswc_license_recovery_notificationaction(array $licenses, WP_User $user)Fired to send a license recovery emailclass-slswc-license-recovery-api.php
slswc_activate_resultfilter(array $result)Filter the activation result arrayclass-slswc-license.php
slswc_deactivate_resultfilter(array $result)Filter the deactivation result arrayclass-slswc-license.php
slswc_license_expiryfilter(string $expiry, string $purchase_date)Filter computed license expiry dateclass-slswc-license.php
slswc_expired_withinfilter(int $days)Filter the "expired within" thresholdclass-slswc-license.php
slswc_save_max_activation_statusfilter(bool $save)Whether to persist max-activation statusclass-slswc-license.php
slswc_save_max_staging_activation_statusfilter(bool $save)Whether to persist max-staging-activation statusclass-slswc-license.php
slswc_license_not_exists_msgfilter(string $message)Filter "license does not exist" error messageclass-slswc-license.php
slswc_license_domain_active_already_msgfilter(string $message)Filter "domain already active" error messageclass-slswc-license.php
slswc_license_error_messagefilter(string $message, string $error_code)Filter any license error messageclass-slswc-license.php

Subscription Lifecycle

HookTypeParametersDescriptionFile
slswc_subscription_suspendedaction(object $subscription, string $gateway, string $gateway_sub_id)Fired when a subscription is suspendedclass-slswc-woocommerce-subscriptions.php
slswc_subscription_cancelledaction(object $subscription, string $gateway, string $gateway_sub_id)Fired when a subscription is cancelled, including when its order is fully refundedclass-slswc-woocommerce-subscriptions.php, class-slswc-woocommerce-orders.php
slswc_subscription_canceled_notificationaction(object $subscription)Fired to send cancellation notification emailclass-slswc-woocommerce-subscriptions.php
slswc_subscription_resumedaction(object $subscription, string $gateway, string $gateway_sub_id)Fired when a subscription is resumedclass-slswc-woocommerce-subscriptions.php
slswc_subscription_expired_notificationaction(object $subscription)Fired when a subscription expiresclass-slswc-scheduled-actions.php
slswc_subscription_expiring_notificationaction(object $subscription)Fired when a subscription is about to expireclass-slswc-scheduled-actions.php
slswc_retry_subscription_paymentaction(object $subscription)Fired by the scheduled action to retry a failed subscription paymentclass-slswc-scheduled-actions.php
slswc_retry_payment_succeededaction(int $subscription_id)Fired when a payment retry succeedsGateway classes
slswc_admin_daily_summary_notificationaction(array $summary)Fired to send the daily admin summary emailclass-slswc-scheduled-actions.php
slswc_run_one_time_eventsactionFired by the slswc_one_time_events scheduled actionclass-slswc-scheduled-actions.php

Support

HookTypeParametersDescriptionFile
slswc_support_ticket_created_customeraction(object $ticket)Fired when a ticket is created (customer notification)class-slswc-support-service.php
slswc_support_ticket_created_adminaction(object $ticket)Fired when a ticket is created (admin notification)class-slswc-support-service.php
slswc_support_reply_notificationaction(object $ticket, int $message_id)Fired when a reply is added to a ticketclass-slswc-support-service.php
slswc_support_status_changedaction(object $ticket, string $new_status)Fired when a ticket status changesclass-slswc-support-service.php
slswc_support_ticket_closedaction(object $ticket)Fired when a ticket is closedclass-slswc-support-service.php
slswc_support_ticket_assignedaction(object $ticket, int $agent_id)Fired when a ticket is assigned to staffclass-slswc-support-service.php
slswc_support_agent_accessaction(object $agent, object $license, WP_User $inviter)Fired when an agent is granted accessclass-slswc-support-service.php
slswc_support_agent_invitationaction(object $agent, object $license, WP_User $inviter)Fired to send an agent invitation emailclass-slswc-support-service.php
slswc_support_ticket_prefixfilter(string $prefix)Filter ticket number prefix (default: TIC-)class-slswc-support-ticket.php

API

HookTypeParametersDescriptionFile
slswc_api_namespacefilter(string $namespace)Filter the REST API namespace (default: slswc/v1)class-slswc-api.php
slswc_api_connect_enabledfilter(bool $enabled)Whether the /connect endpoint is enabledclass-slswc-api.php
slswc_api_connect_permission_checkfilter(bool $granted, WP_REST_Request $request)Filter connect endpoint permissionclass-slswc-api.php
slswc_remove_domain_rolesfilter(array $roles)Roles allowed to remove domains (default: ['administrator'])class-slswc-api.php
slswc_get_user_purchased_productsfilter(array $products, int $user_id, array $args)Filter user purchased products (flat list keyed by product_id)class-slswc-api.php
slswc_all_licensesfilter(array $formatted, array $raw)Filter admin license listclass-slswc-api.php
slswc_all_customer_licensesfilter(array $formatted, array $raw)Filter customer license listclass-slswc-api.php
slswc_get_licenses_wherefilter(array $formatted, array $raw)Filter filtered license query resultsclass-slswc-api.php
slswc_get_order_licensesfilter(array $licenses, int $order_id, string $return_type, array $raw)Filter licenses for a specific orderclass-slswc-api.php
slswc_get_licensed_customer_idsfilter(array $ids, string $status)Filter licensed customer IDsclass-slswc-api.php
slswc_get_licensed_customer_detailsfilter(array $customers, string $status)Filter licensed customer detailsclass-slswc-api.php
slswc_get_expiring_customersfilter(array $customers)Filter expiring customers listclass-slswc-api.php

Cache Expiry

SLSWC exposes a filter for the lifetime of each cached API response and license query (for example slswc_check_license_cache_expiry and slswc_composer_packages_cache_expiry). See Cache Expiry Filters for the full list with defaults and examples.

Product

HookTypeParametersDescriptionFile
slswc_software_meta_data_savedaction(int $product_id, array $meta)Fired after software product meta is savedclass-slswc-woocommerce-products.php
slswc_software_variation_meta_data_savedaction(int $variation_id, int $index, array $meta)Fired after variation meta is savedclass-slswc-woocommerce-products.php
slswc_updated_license_data_for_product_{id}action(int $product_id, array $license_data, SLSWC_WooCommerce_License $license)Fired for each license after its data is updated from the productclass-slswc-woocommerce-products.php
slswc_updated_license_data_for_product{id}action(array $license_data)Fired once after all of a product's licenses are updated. Note: no underscore before the product IDclass-slswc-woocommerce-products.php
slswc_set_software_propsfilter(array $props)Legacy: filter software product properties when saving. Only applied on WooCommerce older than 3.0class-slswc-woocommerce-products.php
slswc_software_to_array_{id}filter(array $data, WC_Product $product)Filter software product array representationtrait-slswc-product-software.php
slswc_variable_software_childrenfilter(array $children, WC_Product $product)Filter variable software product childrenclass-wc-product-variable-software.php
slswc_meta_keys_to_propsfilter(array $mapping)Filter meta key to property mappingData store classes
slswc_software_type_fieldsfilter(array $fields)Filter software type product fieldsclass-slswc.php
slswc_license_status_typesfilter(array $types)Filter available license status typesclass-slswc.php
slswc_show_software_tabsfilter(string $show)Whether to show software tabs on product pageclass-slswc-woocommerce-product.php
slswc_show_description_tabfilter(string $show)Show product description tabclass-slswc-woocommerce-product.php
slswc_show_installation_tabfilter(string $show)Show product installation tabclass-slswc-woocommerce-product.php
slswc_show_changelog_tabfilter(string $show)Show product changelog tabclass-slswc-woocommerce-product.php
slswc_software_tabsfilter(array $software_tabs)Filter the software tabs (description, installation, changelog) added to the single product page. Each entry has title, priority and callback. Built from the plugin prefixclass-slswc-woocommerce-product.php
slswc_software_license_product_fieldsfilter(array $fields)Filter the field definitions in the License tab of the product editorclass-slswc-woocommerce-products.php
slswc_license_panel_pathfilter(string $path)Filter the path of the template file included for the License tab panelclass-slswc-woocommerce-products.php
slswc_supported_product_typesfilter(array $types)Product types whose software data is saved by the product editor (default: software, variable-software)class-slswc-woocommerce-products.php
slswc_software_product_typesfilter(array $types)Product types treated as software products (default: software, variable-software)class-slswc-product-helper.php

Payment Gateway

HookTypeParametersDescriptionFile
slswc_payment_gatewaysfilter(array $gateways)Register payment gateway classesclass-slswc-payment-gateways.php
slswc_payment_gateway_form_fieldsfilter(array $fields)Filter Stripe gateway form fieldsStripe gateway
slswc_payfast_gateway_form_fieldsfilter(array $fields)Filter PayFast gateway form fieldsPayFast gateway
slswc_cards_payment_fieldsaction(string $gateway_id)Fired during Stripe payment fields renderingStripe gateway
slswc_stripe_thankyou_renderedactionFired after Stripe thank you page rendersStripe gateway
slswc_checkout_verify_zipfilter(bool $verify)Whether Stripe should verify ZIP codeStripe gateway
slswc_checkout_require_billing_addressfilter(bool $require)Whether Stripe requires billing addressStripe gateway
slswc_checkout_require_shipping_addressfilter(bool $require)Whether Stripe requires shipping addressStripe gateway
slswc_checkout_localefilter(string $locale)Filter checkout locale for StripeStripe gateway
slswc_allow_remember_mefilter(bool $allow)Allow "Remember Me" on Stripe checkoutStripe gateway
slswc_descriptionfilter(string $desc, string $gateway_id)Filter gateway descriptionStripe gateway
slswc_display_save_payment_method_checkboxfilter(bool $display)Show tokenization checkboxStripe gateway
slswc_payfast_valid_ipsfilter(array $ips)Filter valid PayFast notification IPsPayFast gateway
slswc_stripe_elements_optionsfilter(array $options)Filter the data localised to window.slswc_stripe_elements for the Stripe card fields. Keys: publishable_key, ajax_url, nonce, client_secret, api_version, order_id. Optional elements_styling and elements_classes (Stripe Elements style and classes) only apply to the legacy separate card fields, used when there is no PaymentIntent client secret (for example pay-for-order or add payment method)class-slswc-payment-gateway-stripe.php

Composer Repository

HookTypeParametersDescriptionFile
slswc_composer_packages_jsonfilter(array $output, int $customer_id)Filter the packages.json outputclass-slswc-composer-repository.php
slswc_composer_packages_cache_expiryfilter(int $seconds)Filter packages.json cache TTL (default: 1 hour)class-slswc-composer-repository.php
slswc_composer_valid_license_statusesfilter(array $statuses)Filter statuses included in Composer (default: active, inactive, expiring)class-slswc-composer-repository.php
slswc_composer_package_entryfilter(array $entry, WC_Product $product)Filter a single Composer package entryclass-slswc-composer-repository.php

DRM (Client Library)

HookTypeParametersDescriptionFile
slswc_drm_config_{identifier}filter(array $config)Modify DRM configurationDRM.php
slswc_drm_state_{identifier}filter(string $state, DRM $drm)Override computed DRM stateDRM.php
slswc_drm_notice_html_{identifier}filter(string $html, string $state, string $status, DRM $drm)Modify notice HTMLDRM.php
slswc_drm_should_lock_page_{identifier}filter(bool $lock, DRM $drm)Prevent interstitial lockDRM.php
slswc_drm_interstitial_html_{identifier}filter(string $html, DRM $drm)Modify interstitial HTMLDRM.php

WooCommerce Integration

HookTypeParametersDescriptionFile
slswc_after_load_woocommerce_hooksactionFired after all WooCommerce hooks are loadedclass-slswc-woocommerce.php
slswc_add_endpointsactionFired to allow adding custom My Account endpointsclass-slswc-woocommerce-my-account.php
slswc_my_account_query_varsfilter(array $vars)Filter My Account query varsclass-slswc-woocommerce-my-account.php
slswc_my_account_menu_linksfilter(array $top_items, array $items)Filter My Account menu itemsclass-slswc-woocommerce-my-account.php
slswc_renewal_urlfilter(string $url)Filter the renewal checkout URLclass-slswc.php
slswc_delete_licenses_when_deleting_orderfilter(bool $delete, int $order_id)Whether to delete licenses when an order is deleted (default: true). Runs on woocommerce_before_delete_order, for both HPOS and legacy order storageclass-slswc-woocommerce-orders.php
slswc_license_failed_noticefilter(string $message)Filter license generation failure noticeclass-slswc-woocommerce-orders.php
slswc_license_order_item_meta_labelfilter(string $label)Filter "License Key" meta label on ordersclass-slswc-woocommerce-orders.php
slswc_license_added_noticefilter(string $message)Filter license added order noteclass-slswc-woocommerce-orders.php
slswc_product_update_download_file_urlfilter(string $url, array $download, array $args)Filter download file URLclass-slswc-woocommerce-my-account.php
slswc_product_update_obfuscated_download_urlfilter(string $url, array $download, array $args)Filter obfuscated download URLclass-slswc-woocommerce-my-account.php
slswc_get_served_download_filefilter(array $download, array $args)Filter served download file dataclass-slswc-woocommerce-my-account.php

Environment Detection

HookTypeParametersDescriptionFile
slswc_is_stagingfilter(bool $is_staging, string $domain)Override staging detectionclass-slswc.php
slswc_is_devfilter(bool $is_dev, string $url, string $environment)Override dev environment detectionclass-slswc.php
slswc_server_live_subdomainfilter(bool $is_live)Override live subdomain detectionclass-slswc.php
slswc_validate_tldsfilter(bool $check)Whether to check TLDs for dev detectionclass-slswc.php
slswc_is_ip_localfilter(bool $is_local, string $host)Override local IP detectionclass-slswc.php
slswc_is_tld_devfilter(bool $is_dev, string $host)Override TLD-based dev detectionclass-slswc.php
slswc_is_subdomain_devfilter(bool $is_dev, string $host)Override subdomain-based dev detectionclass-slswc.php

Reports

HookTypeParametersDescriptionFile
slswc_subscription_renewal_countfilter(int $count, string $start, string $end)Filter subscription renewal countclass-slswc-reports-helper.php
slswc_get_license_renewal_countfilter(int $count, string $start, string $end)Filter license renewal countclass-slswc-reports-helper.php
slswc_get_subscription_customers_within_rangefilter(int $count, string $start, string $end)Filter subscription customers count in date rangeclass-slswc-reports-helper.php
slswc_get_license_customers_within_rangefilter(int $count, string $start, string $end)Filter license customers count in date rangeclass-slswc-reports-helper.php
slswc_get_subscription_customers_at_startfilter(int $count, string $start)Filter customers at period startclass-slswc-reports-helper.php
slswc_get_license_customers_at_startfilter(int $count, string $start)Filter license customers at period startclass-slswc-reports-helper.php
slswc_get_subscription_customers_at_endfilter(int $count, string $end)Filter customers at period endclass-slswc-reports-helper.php
slswc_get_license_customers_at_endfilter(int $count, string $end)Filter license customers at period endclass-slswc-reports-helper.php

Utilities

HookTypeParametersDescriptionFile
slswc_formatted_start_datefilter(string $start_date)Filter formatted start date used in range queriesclass-slswc-utils.php
slswc_formatted_end_datefilter(string $end_date)Filter formatted end date used in range queriesclass-slswc-utils.php
slswc_license_view_urlfilter(string $html)Filter the license admin view link HTMLclass-slswc-license.php

Logging

HookTypeParametersDescriptionFile
slswc_debug_enabledfilter(bool $enabled)Whether debug logging is enabledclass-slswc-logging.php
slswc_stripe_logging_enabledfilter(bool $enabled)Whether Stripe-specific logging is enabledclass-slswc-logger.php

AJAX

HookTypeParametersDescriptionFile
slswc_ajax_{action}actionDispatched for custom AJAX actionsclass-slswc-ajax.php

UI (Admin Panel)

HookTypeParametersDescriptionFile
slswc_license_panel_field_{type}action(string $key, array $details)Render a custom field type in the license panelslswc-wc-license-panel.php, license-panel.php

Setup Wizard

HookTypeParametersDescriptionFile
slswc_recommended_pluginsfilter(array[] $plugins)Filter the plugins recommended in the setup wizard. Each entry has slug and basename (both required; entries without them are dropped), plus name, description, icon, admin_url, admin_label, and optional requires_php / requires_wp minimum versionsclass-slswc-recommended-plugins.php
slswc_client_sdk_urlfilter(string $url)Filter the client SDK documentation link shown in the setup wizard (default: https://licenseserver.io/documentation/client-sdk)class-slswc-setup-wizard.php

Client Library โ€“ API & Updates

Hooks in libraries/slswc/client/src/ for themes/plugins that consume the SLSWC license server.

HookTypeParametersDescriptionFile
slswc_request_info_{text_domain}filter(array $request_info)Filter request data before sending to license serverApiClient.php
slswc_request_options_{text_domain}filter(array $options)Filter wp_safe_remote_get/post options (timeout, etc.)ApiClient.php
slswc_client_get_actionsfilter(array $actions)Filter which API actions use GET instead of POST (default: product, products)ApiClient.php
slswc_api_connectedfilter(string $connected)Filter the "connected" flag stored by the updaterUpdater.php
slswc_api_connected_{text_domain}filter(string $connected)Filter per-product "connected" flagApiClient.php
slswc_api_auth_userfilter(string $auth_user)Filter the authenticated user stored by the updaterUpdater.php
slswc_api_auth_user_{text_domain}filter(string $auth_user)Filter per-product authenticated userApiClient.php
slswc_themes_cache_expiryfilter(int $seconds)Cache TTL for local themes list (default: 2 hours)Updater.php
slswc_plugins_cache_expiryfilter(int $seconds)Cache TTL for local plugins list (default: 2 hours)Updater.php
slswc_updater_license_data_for_all{type}filter(array $licenses_data)Filter all license data; {type} is themes or plugins (or empty for all)Updater.php
slswc_client_default_license_optionsfilter(array $options)Filter default license option valuesLicenseDetails.php

Client Library โ€“ Product Data

HookTypeParametersDescriptionFile
slswc_client_formatted_plugin_datafilter(array $data, array $raw, string $file)Filter formatted plugin data before useHelper.php
slswc_client_formatted_theme_datafilter(array $data, WP_Theme $theme, string $file)Filter formatted theme data before useHelper.php
slswc_client_mapped_remote_productfilter(array $local, array $remote)Filter local product data after mapping remote valuesHelper.php

Client Library โ€“ License UI

HookTypeParametersDescriptionFile
slswc_save_license_{slug}action(array $license_details)Fired when a license is saved from the licenses pageUpdater.php
slswc_after_plugins_licenses_rowsactionFired after plugin license rows are renderedUpdater.php
slswc_after_themes_licenses_listactionFired after theme license rows are renderedUpdater.php
slswc_after_products_licenses_listaction(array $plugins, array $themes)Fired after all license rows are renderedUpdater.php

Client Library โ€“ Logging

HookTypeParametersDescriptionFile
slswc_client_loggingfilter(bool $enabled)Whether client-side logging is enabled (also controlled by SLSWC_CLIENT_LOGGING constant)Helper.php

Common Patterns

Below are real-world implementation examples showing how to combine these hooks.

Adding a Custom Tool

Register a tool in the SLSWC Settings > Tools tab and handle its execution. Clicking the button sends POST /wp-json/slswc/v1/settings/tools/{tool_id} (requires manage_options), which calls the registered callable and then fires slswc_tools_process_{tool_id}:

// Register the callable that runs the tool.
add_filter( 'slswc_server_tools', function ( $tools ) {
    $tools['reset_staging_activations'] = 'my_reset_staging_activations';
    return $tools;
} );

// Add the button to the Tools tab, before the closing sectionend field.
add_filter( 'slswc_tools_settings', function ( $settings ) {
    $button = array(
        'title' => __( 'Reset Staging Activations', 'my-extension' ),
        'desc'  => __( 'Clear all staging domain activations across all licenses.', 'my-extension' ),
        'id'    => 'reset_staging_activations',
        'type'  => 'tool-button',
    );
    array_splice( $settings, count( $settings ) - 1, 0, array( $button ) );
    return $settings;
} );

function my_reset_staging_activations() {
    // Your logic to reset staging activations...
}

// Optional: run follow-up work after the tool's callable.
add_action( 'slswc_tools_process_reset_staging_activations', function ( $tools ) {
    // Your follow-up logic...
} );

Filtering License Activation Results

Modify the response returned when a license is activated โ€” for example, to include custom metadata:

add_filter( 'slswc_activate_result', function ( $result ) {
    // Add a custom field to the activation response.
    $result['support_url'] = 'https://your-store.com/support/';
    $result['docs_url']    = 'https://your-store.com/docs/';
    return $result;
} );

Custom DRM Configuration

Override DRM settings for a specific product from outside the product's own code โ€” useful for a site-wide licensing extension:

add_filter( 'slswc_drm_config_my-plugin', function ( $config ) {
    // Give customers a more generous grace period.
    $config['grace_soft_days'] = 5;
    $config['grace_lock_days'] = 14;

    // Customize the purchase URL for a seasonal promotion.
    $config['purchase_url'] = 'https://your-store.com/black-friday/';

    return $config;
} );

Tip: The {identifier} in DRM filter names is typically the product's text domain. See the DRM docs for the full list of configuration options.

Hooking Into Support Ticket Events

Send a Slack notification when a support ticket is created or assigned:

add_action( 'slswc_support_ticket_created_admin', function ( $ticket ) {
    wp_remote_post( 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL', array(
        'body' => wp_json_encode( array(
            'text' => sprintf( 'New support ticket: %s', $ticket->title ),
        ) ),
        'headers' => array( 'Content-Type' => 'application/json' ),
    ) );
} );

add_action( 'slswc_support_ticket_assigned', function ( $ticket, $agent_id ) {
    $agent = get_userdata( $agent_id );
    // Notify the agent via your preferred channel...
}, 10, 2 );

Customizing Client Library API Requests

Add custom headers or increase the timeout for license server requests:

add_filter( 'slswc_request_options_my-plugin', function ( $options ) {
    $options['timeout'] = 60;
    $options['headers'] = array(
        'X-Custom-Header' => 'my-value',
    );
    return $options;
} );

// Add extra data to the request sent to the license server.
add_filter( 'slswc_request_info_my-plugin', function ( $request_info ) {
    $request_info['site_name'] = get_bloginfo( 'name' );
    return $request_info;
} );

Reacting to Subscription Lifecycle Events

Log subscription events or trigger external integrations:

// Notify your CRM when a subscription is cancelled.
add_action( 'slswc_subscription_cancelled', function ( $subscription, $gateway, $gateway_sub_id ) {
    my_crm_cancel_subscription( $subscription->customer_id, $gateway_sub_id );
}, 10, 3 );

// Auto-deactivate licenses when a subscription expires.
add_action( 'slswc_subscription_expired_notification', function ( $subscription ) {
    // Your logic to handle expired subscription licenses...
} );

Was this article helpful?