includes/Edge/class-edge-purger.php
Edge cache purger — Cloudflare + Bunny.
Class Edge_Purger
Edge cache purger.
class Edge_PurgerConstants
| Constant | Visibility | Value | Line |
|---|---|---|---|
PURGE_LOCK | private | \'wppo_edge_purge_lock\' | 32 |
PURGE_LOCK_TTL | private | 60 | 40 |
publicstatic get_purge_lock_key()
public static function get_purge_lock_key(): stringGet blog-prefixed lock key.
Return: string.
publicstatic has_purge_lock()
public static function has_purge_lock(): boolWhether lock is active.
Return: bool.
publicstatic set_purge_lock()
public static function set_purge_lock(): voidSet lock.
Return: void.
publicstatic purge_all()
public static function purge_all(=\'all\' $type, =null $url_path): boolPurge edge caches (Cloudflare and Bunny) after wppo_after_cache_clear. Parameter Type Default Description $type=\'all\'— Clear type (\’all\’ or \’single_page\’). $url_path=null— Page path (or absolute URL) for single-page clears. Both params are deliberately untyped: this method runs as a WP hook callback (wppo_after_cache_clear via Cache::clear_cache(), untyped) and must stay tolerant of non-string payloads instead of throwing a TypeError.
Return: bool — True when no purge needed or all requests succeeded.
privatestatic resolve_page_url()
private static function resolve_page_url($url_path): stringResolve a single-page purge target to an absolute URL. Parameter Type Default Description $url_pathmixed— Page path or absolute URL.
Return: string — Absolute URL or \’\’.
privatestatic purge_cloudflare_files()
private static function purge_cloudflare_files(string $zone, string $token, string $url): boolPurge specific Cloudflare files (URL-scoped single-page purge). Parameter Type Default Description $zonestring— Zone ID. $tokenstring— API token. $urlstring— Absolute URL to purge.
Return: bool.
privatestatic purge_cloudflare()
private static function purge_cloudflare(string $zone, string $token): boolPurge Cloudflare zone cache (purge_everything). Parameter Type Default Description $zonestring— Zone ID. $tokenstring— API token.
Return: bool.
privatestatic purge_bunny()
private static function purge_bunny(string $zone, string $api_key): boolPurge Bunny pull zone cache. Parameter Type Default Description $zonestring— Pull zone ID. $api_keystring— API key.
Return: bool.
privatestatic log_failure()
private static function log_failure(string $service, string $detail): voidSurface failure via debug log. Parameter Type Default Description $servicestring— Service. $detailstring— Detail.
Return: void.
privatestatic mirror_to_activity_log()
private static function mirror_to_activity_log(string $service, string $detail): voidMirror a failure to the activity log when no debug-log listener exists. Parameter Type Default Description $servicestring— Service. $detailstring— Detail.
Return: void.
Hooks
Hooks referenced in includes/Edge/class-edge-purger.php: Hook Type Line Notes wppo_debug_logaction 290 @param ×2