- 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
- 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
- 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_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
- 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_phone_geo_api_hourly_cap Filter Hook
Overview
The suredonation_phone_geo_api_hourly_cap filter controls the site-wide hourly limit for outbound ipapi.co geolocation requests used by SureDonation to detect the visitor’s country for the Phone field.
The limit helps control API usage and prevents excessive requests from exhausting the available geolocation service quota.
When to Use This Filter
Use this filter when you need to customize the maximum number of IP geolocation requests SureDonation can make per hour.
For example, you can use it to:
- Reduce the number of external geolocation requests.
- Increase the limit for a high-traffic website.
- Adjust the limit when using a paid ipapi.co plan.
- Control third-party API usage based on your site’s requirements.
Filter Signature
apply_filters( 'suredonation_phone_geo_api_hourly_cap', 40 );Parameters
| Parameter | Type | Description |
| $value | int | Maximum number of geolocation API calls allowed per hour. The returned value is converted to an integer. |
Default Value
The default limit is: 40
The default value is intentionally kept well below the ipapi.co free-tier limit of 1,000 requests per day.
Return Value
Return an integer representing the maximum number of geolocation requests allowed per hour.
return 100;
The returned value is coerced to an integer.
Basic Usage
Use add_filter() to modify the hourly limit.
add_filter( 'suredonation_phone_geo_api_hourly_cap', 'your_custom_function', 10, 1 );
function your_custom_function( $cap ) {
    return $cap;
}Example: Increase the Hourly Limit
The following example increases the hourly limit to 200 requests.
add_filter( 'suredonation_phone_geo_api_hourly_cap',
    function () {
        // Allow more lookups per hour on a high-traffic site with a paid plan.
        return 200;
    }
);This can be useful for high-traffic websites that use a paid ipapi.co plan with a higher request allowance.
Example: Reduce the Hourly Limit
You can also reduce the limit to minimize external API requests.
add_filter( 'suredonation_phone_geo_api_hourly_cap',
    function () {
        return 20;
    }
);With this configuration, SureDonation allows a maximum of 20 geolocation requests per hour.
How It Works
The hourly cap is applied as part of the Phone field’s country detection process:
- A visitor loads a SureDonation Phone field.
- SureDonation determines whether IP-based country detection is enabled.
- SureDonation checks the current hourly geolocation request count.
- If the count is below the configured cap, the geolocation API request can proceed.
- Once the hourly cap is reached, additional requests are not sent.
- Visitors after the limit is reached use us as the default country.
- The fallback country is cached for one hour.
- The request counter rolls over each hour.
What Happens When the Limit Is Reached?
Once the configured hourly cap is reached, SureDonation stops making additional ipapi.co requests for that period.
Instead, subsequent visitors:
- Default to the US country.
- Use the cached fallback for one hour.
- Do not trigger another geolocation API request.
This prevents additional visitors from increasing API usage after the hourly limit has been reached.
Best Practices
When changing the default limit:
- Consider your site’s traffic volume.
- Ensure the limit is compatible with your ipapi.co plan.
- Avoid setting an unnecessarily high limit.
- Monitor external API usage if increasing the cap.
- Consider privacy requirements before enabling IP-based geolocation.
Related Hooks
- suredonation_phone_geo_enabled: Globally enables or disables IP-based country detection for SureDonation Phone fields.
We don't respond to the article feedback, we use it to improve our support content.