class-preload-buffer-coordinator.php

Frontend preload, output-buffer, and cache-warm coordination.

Source includes/Core/class-preload-buffer-coordinator.php3 min readPart of Performance Optimisation

includes/Core/class-preload-buffer-coordinator.php

Frontend preload, output-buffer, and cache-warm coordination.

Namespace: PerformanceOptimise\\Inc · Lines: 406

Class Preload_Buffer_Coordinator

Coordinates frontend buffering and cache-warm scheduling.

Source: includes/Core/class-preload-buffer-coordinator.php, line 31

final class Preload_Buffer_Coordinator

Tags: @since NEXT

Properties

PropertyVisibilityTypeDefaultLine
$get_optionsprivatecallable():—39
$image_optimisationprivateImage_Optimisation—47
$google_fontsprivateGoogle_Fonts—55
$safe_mode_activeprivatecallable(array):—63
$aggressive_bypass_activeprivatecallable():—71
$enqueue_unique_async_actionprivatecallable(string,array,string):—79
$used_css_buffer_enhancedprivateboolfalse87

public __construct()

public function __construct(callable $get_options, Image_Optimisation $image_optimisation, Google_Fonts $google_fonts, callable $safe_mode_active, callable $aggressive_bypass_active, ?callable=null $enqueue_unique_async_action)

Constructor.

ParameterTypeDefaultDescription
$get_optionscallable—Resolved options reader.
$image_optimisationImage_Optimisation—LCP output callback target.
$google_fontsGoogle_Fonts—Google Fonts output callback target.
$safe_mode_activecallable—Safe-mode decision port.
$aggressive_bypass_activecallable—Aggressive-bypass decision port.
$enqueue_unique_async_action?callable=null—Optional atomic scheduling port.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 100

publicstatic should_use_core_template_buffer()

public static function should_use_core_template_buffer(): bool

Whether WP 6.9+ core owns the template-enhancement output buffer.

Return: bool — True when core\’s template-enhancement path is available.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 125

public process_used_css_only()

public function process_used_css_only($filtered_output, $output)

Process used-CSS on the WP 6.9+ enhancement filter path.

ParameterTypeDefaultDescription
$filtered_outputmixed—Output from earlier enhancement filters.
$outputmixed—Raw template output.

Return: string — Fail-open HTML string.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 145

public start_used_css_buffer()

public function start_used_css_buffer(): void

Start the legacy used-CSS buffer on supported pre-6.9 paths.

Return: void.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 190

public start_lcp_priority_buffer()

public function start_lcp_priority_buffer(): void

Start the legacy LCP buffer on supported pre-6.9 paths.

Return: void.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 210

public process_used_css_capture()

public function process_used_css_capture($buffer)

Process the legacy used-CSS output buffer.

ParameterTypeDefaultDescription
$buffermixed—Output-buffer content.

Return: string — Fail-open HTML string.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 230

public queue_crawler_warm_after_cache_invalidation()

public function queue_crawler_warm_after_cache_invalidation(int $post_id, ?array=null $settings): void

Queue a cache warm after smart purge when sitemap preload is enabled.

ParameterTypeDefaultDescription
$post_idint—Saved post ID.
$settings?array=null—Optional settings snapshot.

Return: void.

Tags: @since NEXT · @internal Optional settings override is a focused test seam.

Source: includes/Core/class-preload-buffer-coordinator.php, line 265

public queue_used_css_regeneration()

public function queue_used_css_regeneration(int $post_id, ?array=null $settings): void

Queue used-CSS generation when the setting is enabled.

ParameterTypeDefaultDescription
$post_idint—Saved post ID.
$settings?array=null—Optional settings snapshot.

Return: void.

Tags: @since NEXT · @internal Optional settings override is a focused test seam.

Source: includes/Core/class-preload-buffer-coordinator.php, line 301

private legacy_buffer_owned_by_core()

private function legacy_buffer_owned_by_core(): bool

Whether a runtime core enhancement buffer owns the legacy route.

Return: bool — True when no legacy buffer may open.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 315

private should_optimise_for_logged_in()

private function should_optimise_for_logged_in(): bool

Whether optimisation may run for the current viewer.

Return: bool — True when frontend optimisation is eligible.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 339

private reject_legacy_woo_dynamic_url()

private function reject_legacy_woo_dynamic_url(string $url, array $options): bool

Mixed-version fallback for rejecting dynamic Woo preload URLs.

ParameterTypeDefaultDescription
$urlstring—Candidate permalink.
$optionsarray—Resolved settings snapshot.

Return: bool — True when the URL must not be scheduled.

Tags: @since NEXT

Source: includes/Core/class-preload-buffer-coordinator.php, line 352

Hooks

Hooks referenced in includes/Core/class-preload-buffer-coordinator.php:

HookTypeLineNotes
wppo_debug_logaction173—
wppo_debug_logaction251—