Configuration Reference

Settings, filter hooks and the complete WP-CLI command surface.

Performance Optimisation keeps its configuration on four surfaces: a single option in the database, a metabox in the post editor, filter hooks for programmatic overrides, and WP-CLI for automation. This page documents all four.

Settings storage

Every toggle in the settings screen lives in one option: wppo_settings. Read it directly when you need to audit what is active on an environment:

get_option('wppo_settings', []);

Per-page controls

The editor ships a Performance Optimisation metabox. It unloads individual scripts and styles for that URL only, or removes the URL from the page cache entirely — no global setting changes required.

Filter hooks

Each pipeline stage exposes a filter whose return value replaces the default behavior:

HookWhat it controls
wppo_before_cache_clearRun custom work before any page-cache purge starts.
wppo_after_cache_clearRun follow-up work once the purge completes.
wppo_cache_page_htmlRewrite page HTML before it is stored in the static cache.
wppo_exclude_minificationKeep URLs or handles out of CSS/JS/HTML minification.
wppo_exclude_defer_jsKeep scripts out of defer processing.
wppo_exclude_delay_jsKeep scripts out of delay-until-interaction processing.
wppo_object_cache_dropin_pathPoint the plugin at a custom object-cache.php drop-in location.
wppo_nginx_rulesEdit generated nginx rules before they are written.
wppo_varnish_purge_max_urlsCap how many URLs each Varnish purge request carries.
wppo_server_timing_enabledSwitch Server-Timing headers on or off per environment.
wppo_lazyload_iframe_allowedAllow or deny lazy loading for iframes.
wppo_video_placeholder_htmlReplace the placeholder shown before a video plays.
wppo_video_play_button_htmlSwap in custom play-button markup.
wppo_filesize_limit_bytesCeiling on the file size the minifier accepts.
wppo_inline_combined_cssInline the combined stylesheet instead of linking it.
wppo_database_cleanup_completedRun reports or notifications after a cleanup pass finishes.
wppo_debug_logFilter entries written to the debug log.

Example: exclude a script from minification

Add handles to the exclusion list and return the merged array. Everything outside the list stays optimized:

add_filter( 'wppo_exclude_minification', function ( array $excluded ) {
    $excluded[] = 'contact-form-7';
    return array_values( array_unique( $excluded ) );
} );

WP-CLI

Every routine task runs from the terminal. The database command takes one action keyword per invocation:

CommandPurpose
wp wppo cache <clear|preload|status>Purge, preload, or inspect the page cache.
wp wppo object_cache <status|ping|enable|disable|flush>Check Redis connectivity and manage the object-cache drop-in.
wp wppo database <revisions|auto_drafts|drafts|trashed_posts|spam_comments|expired_transients|transients|orphan_postmeta|orphans>Delete one category of database cruft on demand.
wp wppo imageWebP/AVIF image conversion tasks.
wp wppo settingsManage the wppo_settings option store.
wp wppo pagespeedRun the PageSpeed Insights integration.
wp wppo system_infoDump environment details for support requests.
wp wppo database expired_transients
wp wppo cache clear && wp wppo cache preload

Debugging

The wppo_debug_log filter controls what reaches the log, so you can raise verbosity while reproducing an issue and quieten it afterwards. When filing a bug report, attach the output of wp wppo system_info — versions, active modules, and drop-in status arrive in one dump.