Easy Optimizer 2.8.1 has 10 actions and 137 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Easy Optimizer fires an action
add_action( 'easyopt_queue_group_drained', function( $group, $callback ) {
// Your code runs here.
}, 10, 2 );
// Change a value Easy Optimizer is about to use
add_filter( 'easyopt_preset_map', function( $safe, $arg2 ) {
// Change $safe here.
return $safe;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filter a preset's complete settings map. */ apply_filters( 'easyopt_preset_map', $safe, 'safe' ); -
/** * (2.5.0 / M2) The runner found the group EMPTY on exit. State transitions * that used to be side effects of GET status endpoints (preload's running → * done flip) now hang off this authoritative signal instead, so status reads * are read-only. */ do_action( 'easyopt_queue_group_drained', $group, $callback ); -
/** * (2.5.0 / C3) Retries exhausted — surface the terminal failure to * interested modules (the preload results ledger records it against the URL so * the dashboard can show it and the revert pass can retry it later). */ do_action( 'easyopt_queue_task_failed', (string) ( $task['group_name'] ?? '' ), (string) ( $task['callback_action'] ?? '' ), is_array( $task_data ) ? $task_data : array(), $last_error ); -
/** * Filter the built-in cookie exclusions before the user's list is merged. */ apply_filters( 'easyopt_cache_exclude_cookies_defaults', $defaults ); -
/** * Additional hostnames that may serve this site. */ apply_filters( 'easyopt_cache_known_hosts', $hosts ); -
/** * Filter the parameters that key their own cache file. */ apply_filters( 'easyopt_cache_query_strings', $lines ); -
/** * Filter plugins that must never be offered a deactivate action. */ apply_filters( 'easyopt_compat_never_deactivate', $protected ); -
/** * Filter the compatibility registry. */ apply_filters( 'easyopt_compat_registry', $r ); -
/** * Filter the detected cache layers. Third-party code can add/remove layers or * override detection for custom hosting environments. */ apply_filters( 'easyopt_detected_cache_layers', self::$layers ); -
/** * Filter the detected font-handling conflicts. */ apply_filters( 'easyopt_font_conflicts', $found ); -
/** * Filter the generated Gzip/Brotli .htaccess block. */ apply_filters( 'easyopt_htaccess_gzip', $b ); -
/** * Filter HTTP PURGE request headers. */ apply_filters( 'easyopt_http_purge_headers', $headers, $url, $regex ); -
/** * Filter the detected lazy-load conflicts. */ apply_filters( 'easyopt_lazyload_conflicts', $conflicts ); -
/** * Fires after a NEW or CHANGED LCP element is recorded for a URL. The page * cache refreshes ONLY that URL so it gains the preload. */ do_action( 'easyopt_lcp_saved', $url_type, $viewport, $norm_url ); -
/** * Addresses tried, in order, when looking for a direct route to this site. */ apply_filters( 'easyopt_loopback_ips', $ips ); -
/** * Filter the multilingual cookies added to the page-cache key. */ apply_filters( 'easyopt_multilingual_cookies', $cookies ); -
/** * Filter the generated Nginx snippet. */ apply_filters( 'easyopt_nginx_snippet', $n ); -
/** * Filter whether an origin is preconnected in CORS mode. */ apply_filters( 'easyopt_preconnect_crossorigin', $cors, $host ); -
/** * Filter the discovered origins before they are ranked and capped. */ apply_filters( 'easyopt_preconnect_discovered', $origins, $site_host ); -
/** * Filter the pre-flight result before it shapes a preset. */ apply_filters( 'easyopt_preflight_scan', self::$scan ); -
/** * Filter the preload User-Agent (per device). */ apply_filters( 'easyopt_preload_user_agent', $ua, $device ); -
/** * Filter whether a URL may enter the warm queue. */ apply_filters( 'easyopt_preload_warmable_url', true, $url ); -
/** * Filter the proven CSS/JS overlaps. */ apply_filters( 'easyopt_proven_css_js_overlaps', $found ); -
/** * Extend the post-purge archive set (e.g. WPML/Polylang translated URLs). * Returned URLs are purged WITH pagination. */ apply_filters( 'easyopt_purge_post_archive_urls', $archive_urls, $post_id ); -
/** * Invalidate one URL in caches ABOVE us (host, CDN) without touching our own * cache state or its counters. */ do_action( 'easyopt_purge_upstream_url', $easyopt_built_url ); -
/** * Admission gate. A group may declare it has no capacity right now (e.g. the * preload in-flight budget is full). We idle briefly INSIDE the window rather * than claiming a task we would have to defer — deferring runs through the * failure path, and three of those mark a task 'failed'. No URL should ever * fail merely because the host was momentarily busy. */ apply_filters( 'easyopt_queue_can_claim', true, $group, $callback ); -
/** * Allow a queue group to drive its own concurrency dynamically (the preload * governor uses this for adaptive AIMD tuning). Still clamped to [1, * MAX_CONCURRENCY] below, so a filter can never exceed the cap. */ apply_filters( 'easyopt_queue_concurrency', $c, $group, $callback ); -
/** * Fires after all server cache layers have been purged. */ do_action( 'easyopt_server_cache_purged', $results, $layers ); -
/** * Filter the logged-in gate for every affected feature at once. */ apply_filters( 'easyopt_skip_for_logged_in', $skip, $feature ); -
/** * Per-feature escape hatch, e.g. easyopt_skip_for_logged_in_minify. */ apply_filters( "easyopt_skip_for_logged_in_{$feature}", $skip ); -
/** * Filter the wizard's deactivatable-conflict list. */ apply_filters( 'easyopt_wizard_conflicting_plugins', array_values( $out ) ); -
/** * Filter the WooCommerce currency cookies added to the cache key. Lets store * owners register a switcher we don't detect. */ apply_filters( 'easyopt_woo_currency_cookies', $cookies ); -
/** * This action is documented in wp-includes/speculative-loading.php */ do_action( 'wp_load_speculation_rules', $obj ); -
apply_filters( 'easyopt_cloud_api', self::API ); -
apply_filters( 'easyopt_cache_cdn_max_age', self::DEFAULT_CDN_MAX_AGE ); -
do_action( 'easyopt_cache_cleared_all' ); -
apply_filters( 'easyopt_cache_include_cookies', array() ); -
apply_filters( 'easyopt_cache_strip_query_params', $strip ); -
apply_filters( 'easyopt_cache_write_plain', true ); -
apply_filters( 'easyopt_is_openlitespeed', true ); -
apply_filters( 'easyopt_lcp_logged_in', false ); -
do_action( 'easyopt_page_cached' ); -
apply_filters( 'easyopt_preload_warm_timeout', 12, $url, $device ); -
apply_filters( 'easyopt_probe_unverified_default', true, $name ); -
apply_filters( 'easyopt_purge_ignored_post_types', $ignored_types ); -
apply_filters( 'easyopt_purge_limit', 5 ); -
apply_filters( 'easyopt_purge_window', 600 ); -
apply_filters( 'easyopt_skip_htaccess_probe', false ); -
apply_filters( 'bbppt_eligible_post_types', array( 'post', 'page' ) ); -
apply_filters( 'easyopt_asset_gc_days', 30 ); -
apply_filters( 'easyopt_beacon_accept_legacy_token', false ); -
apply_filters( 'easyopt_beacon_classes_max', 3000 ); -
do_action( 'easyopt_cache_cleared_url', $url ); -
apply_filters( 'easyopt_cache_gzip_level', 4 ); -
apply_filters( 'easyopt_cache_html_cacheable', true, $html ); -
apply_filters( 'easyopt_cache_logged_in_per_user', 1 === (int) EasyOpt_Config::get( 'cache_logged_in_per_user', 0 ) ); -
apply_filters( 'easyopt_cache_logged_in_roles', array() ); -
apply_filters( 'easyopt_cache_preload_urls', array_values( $urls ) ); -
apply_filters( 'easyopt_cache_request_cacheable', true ); -
do_action( 'easyopt_cache_stats_computed', $stats ); -
apply_filters( 'easyopt_cache_ttl', (int) EasyOpt_Config::get( 'cache_ttl', 0 ) ); -
apply_filters( 'easyopt_cf_max_purge_calls', 2 ); -
apply_filters( 'easyopt_class_universe_max', 50000 ); -
apply_filters( 'easyopt_clear_all_on_post_delete', true, $post_id, $type ); -
apply_filters( 'easyopt_cloud_recover_url', 'https://customers.freemius.com/store/14517/password/recover' ); -
apply_filters( 'easyopt_cloud_trial_url', 'https://fluxpress.io/pricing?utm_source=plugin&utm_medium=cloud_tab' ); -
apply_filters( 'easyopt_defer_js_admin', false ); -
apply_filters( 'easyopt_defer_js_exclusions', $list ); -
apply_filters( 'easyopt_defer_used_css_generation', false, self::$page_context ); -
apply_filters( 'easyopt_delay_js_admin', false ); -
apply_filters( 'easyopt_delay_js_exclusions', $defaults ); -
apply_filters( 'easyopt_enable_abilities', true ); -
apply_filters( 'easyopt_fluxcdn_allowed_accounts', array( 'test01', 'test02', 'demo01' ) ); -
apply_filters( 'easyopt_fluxcdn_deprovision_url', 'https://fluxpress.io/wp-json/fluxcdn/v1/deprovision' ); -
apply_filters( 'easyopt_fluxcdn_endpoint', untrailingslashit( $ep ) ); -
apply_filters( 'easyopt_fluxcdn_preflight_url', 'https://fluxpress.io/wp-json/fluxcdn/v1/preflight' ); -
apply_filters( 'easyopt_fluxcdn_provision_url', self::PROVISION_URL ); -
apply_filters( 'easyopt_fluxcdn_purge_url', 'https://fluxpress.io/wp-json/fluxcdn/v1/purge' ); -
apply_filters( 'easyopt_fluxcdn_sc_public_token', self::SURECART_PUBLIC_TOKEN ); -
apply_filters( 'easyopt_fluxcdn_usage_url', 'https://fluxpress.io/wp-json/fluxcdn/v1/usage' ); -
apply_filters( 'easyopt_freemius_plan_id', '60626' ); -
apply_filters( 'easyopt_freemius_product_id', '36614' ); -
apply_filters( 'easyopt_freemius_public_key', 'pk_ec60221c78219494e358fc1a0bd01' ); -
apply_filters( 'easyopt_has_varnish', false ); -
apply_filters( 'easyopt_htaccess_rewrite_allowed', true ); -
apply_filters( 'easyopt_images_concurrency', $n ); -
apply_filters( 'easyopt_lazy_force_runtime', false ); -
apply_filters( 'easyopt_lazy_native', (int) EasyOpt_Config::get( 'lazy_native', 1 ) === 1 ); -
apply_filters( 'easyopt_lcp_max_rows', self::MAX_ROWS ); -
apply_filters( 'easyopt_lcp_render_viewport', '' ); -
apply_filters( 'easyopt_live_buffer_blank_threshold', 3 ); -
apply_filters( 'easyopt_loopback_probe_timeout', self::PROBE_TIMEOUT ); -
apply_filters( 'easyopt_minify_css_excludes', $list ); -
apply_filters( 'easyopt_minify_js_excludes', $list ); -
apply_filters( 'easyopt_preconnect_max', self::DEFAULT_MAX ); -
apply_filters( 'easyopt_preconnect_origins', array() ); -
apply_filters( 'easyopt_preconnect_scan_bytes', 120000 ); -
apply_filters( 'easyopt_preload_batch_capture', true ); -
apply_filters( 'easyopt_preload_batch_size', 5 ); -
apply_filters( 'easyopt_preload_concurrency', $c ); -
apply_filters( 'easyopt_preload_cookie', 'wordpress_logged_in_1=1', $device ); -
apply_filters( 'easyopt_preload_enqueue_chunk', 100 ); -
apply_filters( 'easyopt_preload_exclude_taxonomies', $exclude_taxonomies ); -
apply_filters( 'easyopt_preload_fire_and_forget', true ); -
apply_filters( 'easyopt_preload_fonts_max', 12 ); -
apply_filters( 'easyopt_preload_latency_ceiling_ms', self::GOV_LATENCY_CEIL_MS ); -
apply_filters( 'easyopt_preload_max_inflight', $cap ); -
apply_filters( 'easyopt_preload_recency_band', 500 ); -
apply_filters( 'easyopt_preload_recency_priority', true ); -
apply_filters( 'easyopt_preload_revert_after', self::REVERT_AFTER_SECONDS ); -
apply_filters( 'easyopt_preload_revert_cap', self::REVERT_CAP ); -
apply_filters( 'easyopt_preload_revert_max_retries', self::REVERT_MAX_RETRIES ); -
apply_filters( 'easyopt_preload_stale_max_per_run', 5000 ); -
apply_filters( 'easyopt_preload_stale_ttl_days', 0 ); -
apply_filters( 'easyopt_preload_stall_ticks', 5 ); -
apply_filters( 'easyopt_preload_visit_only_url', false, $url ); -
apply_filters( 'easyopt_probe_unverified_ok', true ); -
apply_filters( 'easyopt_purge_growth_floor', 5 ); -
apply_filters( 'easyopt_queue_batch_size', 1, $group, $callback ); -
apply_filters( 'easyopt_queue_pause_until', 0, $group, $callback ); -
apply_filters( 'easyopt_queue_task_delay', 0.5, ( isset( $task['group_name'] ) ? $task['group_name'] : '' ) ); -
apply_filters( 'easyopt_queue_watchdog_keep', false ); -
apply_filters( 'easyopt_reconcile_pages_throttle', 15 * MINUTE_IN_SECONDS ); -
apply_filters( 'easyopt_rest_logged_out_allow', array( 'contact-form-7/', 'wpcf7/', 'wpforms/', 'gravityforms/', 'wc/store/', 'wp/v2/search', 'oembed/', 'wp-site-health/', 'iawp/', ) ); -
apply_filters( 'easyopt_rucss_cdn_url', '' ); -
apply_filters( 'easyopt_rucss_confident', true, $css, $seen, $got ); -
apply_filters( 'easyopt_rucss_excluded_selectors', self::$safelist_patterns ); -
apply_filters( 'easyopt_rucss_excluded_stylesheets', $defaults ); -
apply_filters( 'easyopt_rucss_external_css_hosts', array( 'fonts.googleapis.com', 'fonts.bunny.net', 'use.typekit.net', 'use.fontawesome.com', 'cloud.typography.com', ) ); -
apply_filters( 'easyopt_rucss_fail_ttl', HOUR_IN_SECONDS ); -
apply_filters( 'easyopt_rucss_logged_in', false ); -
apply_filters( 'easyopt_rucss_min_bytes', 150 ); -
apply_filters( 'easyopt_rucss_passthrough_stylesheets', $defaults ); -
apply_filters( 'easyopt_rucss_post_id', '' ); -
apply_filters( 'easyopt_secret_setting_keys', array_values( array_unique( array_merge( EasyOpt_Config::secret_keys(), array( ) ) ) ) ); -
apply_filters( 'easyopt_server_supports_htaccess', $is_apache, $sig ); -
apply_filters( 'easyopt_skip_live_buffer', null ); -
apply_filters( 'easyopt_system_cron_configured', false ); -
apply_filters( 'easyopt_use_advanced_cache_dropin', true ); -
apply_filters( 'easyopt_used_css', $used_css_string ); -
apply_filters( 'easyopt_used_css_memory_multiplier', 20 ); -
apply_filters( 'easyopt_used_css_never_defer', array( 'front', 'home' ), self::$page_context ); -
apply_filters( 'easyopt_varnish_purge_urls', false ); -
apply_filters( 'litespeed_conf', $id ); -
apply_filters( 'wp_speculation_rules_href_exclude_paths', array(), 'prefetch' );
Generated from Easy Optimizer's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: