cloudflare-proxies.php
Cloudflare-Range-Loader and refresher.
Table of Contents
Functions
- creationell_captcha_cloudflare_snapshot() : array{v4: string[], v6: string[], updated_at: string}
- Returns the bundled Cloudflare snapshot.
- creationell_captcha_cloudflare_ranges() : array<string|int, string>
- The active CF range list: cached option (if fresh) → bundled snapshot.
- creationell_captcha_refresh_cloudflare_ips_now() : array{ok: bool, v4: int, v6: int, fetched_at: int|null, error: string|null}
- Fetches the live Cloudflare ranges and writes them to the cache option.
- creationell_captcha_clear_cloudflare_cache() : bool
- Deletes the cached Cloudflare-range option. The next read falls back to the bundled snapshot. Returns true when the option existed and was deleted, false when the option was absent or the delete failed.
- creationell_captcha_fetch_cloudflare_list() : array<string|int, string>
- Fetches one Cloudflare endpoint and returns the valid CIDR entries.
- creationell_captcha_sync_cloudflare_cron() : void
- Ensures the daily refresh cron slot is in sync with the auto-refresh toggle.
Functions
creationell_captcha_cloudflare_snapshot()
Returns the bundled Cloudflare snapshot.
creationell_captcha_cloudflare_snapshot() : array{v4: string[], v6: string[], updated_at: string}
Return values
array{v4: string[], v6: string[], updated_at: string}creationell_captcha_cloudflare_ranges()
The active CF range list: cached option (if fresh) → bundled snapshot.
creationell_captcha_cloudflare_ranges() : array<string|int, string>
The cached option is considered stale once it is older than 48 hours, shielding against a silently broken cron job.
Return values
array<string|int, string> —IPv4 and IPv6 CIDR ranges, merged.
creationell_captcha_refresh_cloudflare_ips_now()
Fetches the live Cloudflare ranges and writes them to the cache option.
creationell_captcha_refresh_cloudflare_ips_now() : array{ok: bool, v4: int, v6: int, fetched_at: int|null, error: string|null}
Return values
array{ok: bool, v4: int, v6: int, fetched_at: int|null, error: string|null}creationell_captcha_clear_cloudflare_cache()
Deletes the cached Cloudflare-range option. The next read falls back to the bundled snapshot. Returns true when the option existed and was deleted, false when the option was absent or the delete failed.
creationell_captcha_clear_cloudflare_cache() : bool
Return values
boolcreationell_captcha_fetch_cloudflare_list()
Fetches one Cloudflare endpoint and returns the valid CIDR entries.
creationell_captcha_fetch_cloudflare_list(string $url) : array<string|int, string>
Parameters
- $url : string
Return values
array<string|int, string>creationell_captcha_sync_cloudflare_cron()
Ensures the daily refresh cron slot is in sync with the auto-refresh toggle.
creationell_captcha_sync_cloudflare_cron() : void
Hooked on update_option_creationell_captcha_settings (fires on every
settings save). Deactivation cleanup is handled explicitly in
creationell_captcha_deactivate() to avoid re-scheduling the slot during
the deactivation handler.