- Handle Custom Stripe Webhook Events
- suredonation_export_secret_option_keys Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- suredonation_enqueue_form_frontend_scripts Action Hook
- suredonation_after_form_duplicated Action Hook
- suredonation_email_sent Action Hook
- suredonation_donor_user_created Action Hook
- suredonation_donation_refunded Action Hook
- suredonation_donation_status_changed Action Hook
- suredonation_donation_completed Action Hook
- suredonation_new_donation Action Hook
- suredonation_donation_created Action Hook
- Validate Field Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_secret_option_keys Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- suredonation_enqueue_form_frontend_scripts Action Hook
- suredonation_after_form_duplicated Action Hook
- suredonation_email_sent Action Hook
- suredonation_donor_user_created Action Hook
- suredonation_donation_refunded Action Hook
- suredonation_donation_status_changed Action Hook
- suredonation_donation_completed Action Hook
- suredonation_new_donation Action Hook
- suredonation_donation_created Action Hook
suredonation_export_secret_option_keys Filter Hook
Overview
The suredonation_export_secret_option_keys filter allows developers to define which SureDonation settings sub-keys contain sensitive information and must be excluded from settings exports.
Use this filter when your extension stores credentials, API keys, gateway tokens, or other secrets inside the SureDonation settings option.
Registering these keys ensures that sensitive information is not exposed in the exported settings JSON.
When to Use This Filter
Use this filter when your add-on:
- Stores API keys in SureDonation settings.
- Stores gateway credentials or tokens.
- Stores third-party service secrets.
- Adds a settings sub-key containing sensitive information.
- Needs to preserve credentials when importing a settings backup.
Filter Signature
apply_filters( 'suredonation_export_secret_option_keys', $keys );Parameters
| Parameter | Type | Description |
| $keys | array | List of settings sub-key names that contain sensitive information. |
Default Secret Keys
SureDonation protects the following keys by default:
- payment_settings
- ai_settings
- spam_protection_settings
These keys contain sensitive configuration such as payment credentials and service-related settings.
Return Value
Return an array containing the secret option sub-key names.
return $keys;
Non-string values are removed automatically.
If a non-array value is returned, SureDonation treats it as an empty list.
Basic Usage
add_filter( 'suredonation_export_secret_option_keys','your_custom_function',10, 1);
function your_custom_function( $keys ) {
    // Add your secret settings keys here.
    return $keys;
}Example: Protect Custom CRM Credentials
If your add-on stores CRM credentials under mysite_crm_settings, register that key as a secret:
add_filter('suredonation_export_secret_option_keys','mysite_protect_crm_credentials', 10, 1);
function mysite_protect_crm_credentials( $keys ) {
    $keys[] = 'mysite_crm_settings';
    return $keys;
}The mysite_crm_settings data will then be excluded from the settings export.
How It Works
The filter is used during the settings export process:
- SureDonation collects the settings stored in its consolidated option.
- SureDonation retrieves the list of protected secret keys.
- The suredonation_export_secret_option_keys filter is applied.
- Your custom secret keys are added to the protected list.
- Protected settings are removed from the exported JSON.
- The remaining settings can be safely exported.
Import Behavior
The same secret-key list is also respected during settings import.
When a settings backup is imported:
- Protected keys from the imported file are not used to overwrite existing credentials.
- Existing credentials remain unchanged.
- Live gateway connections are therefore protected from being cleared by a settings restore.
For example:
Existing Site Settings
↓
Gateway Credentials
↓
Protected Secret Key
↓
Settings Import
↓
Existing Credentials Preserved
Security Considerations
Never Remove Default Secret Keys
Do not replace the existing list with your own keys.
Incorrect:
add_filter( 'suredonation_export_secret_option_keys', function () {
        return [ 'mysite_crm_settings' ];
    }
);This removes SureDonation’s default protected keys and can cause sensitive credentials to be included in the exported JSON.
Recommended:
add_filter( 'suredonation_export_secret_option_keys', function ( $keys ) {
        $keys[] = 'mysite_crm_settings';
        return $keys;
    }
);Do Not Return an Empty Array
Returning an empty array can cause credential-containing settings to be included in the export.
Always preserve the existing $keys array and add your custom secret keys to it.
For Add-on Developers
If your extension stores secrets inside the SureDonation settings blob, you must register the corresponding settings sub-key using this filter.
SureDonation cannot automatically determine whether an arbitrary settings value contains a credential.
For example:
$keys[] = 'my_plugin_api_settings';This ensures that your API credentials are excluded from exports and preserved during imports.
Related Hooks
- Suredonation_export_campaigns_limit: Controls the maximum number of campaigns included in an export.
- Suredonation_export_one_time_only: Controls export behavior for one-time donations.
- Suredonation_import_campaigns_limit: Controls the maximum number of campaigns imported in a single request.
We don't respond to the article feedback, we use it to improve our support content.