includes/Edge/class-cloudflare-purger.php
Cloudflare purge transport — shared helper for CDN_Purger and Edge_Purger.
Class Cloudflare_Purger
Cloudflare purge transport.
class Cloudflare_PurgerConstants
| Constant | Visibility | Value | Line |
|---|---|---|---|
TIMEOUT | private | 10 | 42 |
publicstatic purge()
public static function purge(string $zone, string $token, string=\'cloudflare\' $log_tag, string=\'CDN purge failed\' $fail_prefix): boolPurge everything on Cloudflare for the given zone. Parameter Type Default Description $zonestring— Cloudflare zone ID (already sanitized). $tokenstring— Cloudflare API token (Bearer). $log_tagstring=\'cloudflare\'— Provider tag for wppo_debug_log (\’cloudflare\’ or \’cloudflare-edge\’). $fail_prefixstring=\'CDN purge failed\'— Log message prefix (callers preserve their historic prefix).
Return: bool — True on 2xx, false on WP_Error or non-2xx or empty args.
publicstatic purge_files()
public static function purge_files(string $zone, string $token, array $urls, string=\'cloudflare\' $log_tag, string=\'CDN purge failed\' $fail_prefix): boolPurge specific files on Cloudflare for the given zone. Parameter Type Default Description $zonestring— Cloudflare zone ID (already sanitized). $tokenstring— Cloudflare API token (Bearer). $urlsarray— Absolute URLs to purge. $log_tagstring=\'cloudflare\'— Provider tag for wppo_debug_log (\’cloudflare\’ or \’cloudflare-edge\’). $fail_prefixstring=\'CDN purge failed\'— Log message prefix (callers preserve their historic prefix).
Return: bool — True on 2xx, false on WP_Error or non-2xx or empty args.
privatestatic log_failure()
private static function log_failure(string $service, string $detail, string=\'CDN purge failed\' $fail_prefix): voidSurface a failed purge via wppo_debug_log. Parameter Type Default Description $servicestring— Log tag (e.g. cloudflare, cloudflare-edge). $detailstring— Endpoint / reason. $fail_prefixstring=\'CDN purge failed\'— Log message prefix.
Return: void.
Hooks
Hooks referenced in includes/Edge/class-cloudflare-purger.php: Hook Type Line Notes wppo_debug_logaction 170 @param ×3