=== PressVelo Speed ===
Contributors: pressvelo
Tags: speed, performance, pagespeed, lazy load, delay javascript
Requires at least: 6.0
Requires PHP: 7.4
Stable tag: 0.26.0
License: GPLv2 or later

Front-end speed optimization for better Core Web Vitals and PageSpeed scores.

== Description ==

* Used CSS: each local stylesheet is replaced in place by only the rules the page uses (parsed locally, no external service); the full stylesheet loads on first interaction or after page load.
* Cache preload of the whole site in the background, Cloudflare cache purge, compatibility fixes while JS is delayed (WooCommerce gallery, Divi/AOS animations, Elementor lazy backgrounds, preloaders) and conversion of other plugins' JS lazy loading to native lazy loading.

* Page cache (advanced-cache.php drop-in): gzip copies, 304 support, automatic purge on content changes, background re-warm, optional mobile cache, admin bar "Clear page cache".
* Browser caching and Gzip rules in .htaccess (Apache/LiteSpeed), Nginx rules shown in settings.
* WebP: image.jpg.webp created locally with Imagick or GD (on upload and in bulk), served by .htaccess rewrite or by rewriting image URLs.

* Delay JavaScript until the first user interaction (or a timeout), keeping execution order, re-firing DOMContentLoaded/load for delayed scripts, supporting jQuery ready and replaying the first click.
* Safe "defer" mode that keeps the original execution order.
* LCP image detection: fetchpriority="high", preload, never lazy loaded.
* Native lazy loading for images and iframes, missing width/height for local images.
* YouTube facade (thumbnail, player loads on click).
* font-display: swap and locally hosted Google Fonts.
* Removes emoji script, wp-embed, guest Dashicons, optional jQuery Migrate; limits Heartbeat.

* Real-visitor Web Vitals summary: does your site pass Google's Core Web Vitals on mobile and desktop (LCP, INP, CLS, 75th percentile, last 28 days)? No cookies, no IP addresses.
* Database cleanup: revisions, auto-drafts, trashed posts and comments, spam, expired transients.

Every speed feature is in this free plugin, with no limits.

Add ?pvs_off=1 to any URL to see the page without optimization.
Add data-pv-nodelay to a script tag (or a keyword in settings) to keep it out of delay/defer.

= PressVelo Speed Pro =

An optional paid add-on for keeping every page fast: PageSpeed audits of your important pages with a Fix button for each problem (preview first, undo any time), real-visitor Web Vitals per page and per day with the cause and a fix for every red number, a weekly check with an email when speed drops, speed reports with your own logo, automatic database cleaning and priority support. See https://pressvelo.com/pressvelo-speed-pro/

== Changelog ==

= 0.28.11 =
* Fix: 0.28.10 had an invisible byte (BOM) at the start of the main file, which could break JSON answers (REST API, licence checks).

= 0.28.10 =
* The Get Pro link on the Plugins screen is now a soft light-orange pill (orange text, thin border) instead of a solid orange one.

= 0.28.9 =
* WP-Cron check: a small heartbeat event (every 15 minutes) now tells the pre-check that background jobs run, however the host runs them. Hosts that run events with WP-CLI (wp cron event run) were still reported as "WP-Cron does not seem to run" while their late jobs were being cleared.

= 0.28.8 =
* Fix: WP-Cron runs are now recorded on every request. Before, the recording lived in an admin-only class, so runs of wp-cron.php (by a server cron job or by visits) were never seen: the pre-check could not show "WP-Cron is run by the server... last ran X ago" and could warn about late jobs although cron was running.

= 0.28.7 =
* Menu: "Audit & Fix" with an orange Pro badge after Database while PressVelo Speed Pro is not installed; it opens the Pro page in a new tab. The Get Pro link on the Plugins screen is now a small orange button.

= 0.28.6 =
* Two hooks for add-ons: the pvs_html filter (the optimized page, before the final minify and the page cache) and the pvs_htaccess_rules filter (extra lines in PressVelo Speed's .htaccess block). PressVelo Speed Pro uses them for accessibility fixes and security headers. Nothing changes without an add-on.

= 0.28.5 =
* Vitals: the measuring script can also report which element was the largest one (LCP), which one was tapped in the slowest interaction and which one moved most, when an add-on (PressVelo Speed Pro) asks for it. Without the add-on nothing changes.
* The Pro note on the Vitals page now speaks of a 90+ PageSpeed score.

= 0.28.4 =
* Admin bar: a coloured dot before "PressVelo: On" (green), "Test mode" (amber) and "Paused" (red), with a tooltip that explains the state, so a forgotten Test mode is easy to spot.

= 0.28.3 =
* New "site speed" box on the WordPress Dashboard (admins only, can be hidden in Screen Options): optimization status, Core Web Vitals of real visitors on mobile and desktop for the last 28 days, and the slowest page. The numbers are cached for an hour.
* Vitals and Database pages: the note about PressVelo Speed Pro now starts from the site's own numbers (for example which device fails Core Web Vitals and the slowest page, or the size of autoloaded options) and lists what Pro adds. Nothing shows while Pro is active.

= 0.28.2 =
* Local copies of CDN stylesheets and scripts are linked with their file time (?v=), so browsers load a corrected or refreshed copy instead of the one they cached for a year (0.28.1's font fix reached visitors only after their browser cache expired).

= 0.28.1 =
* Fixed: local copies of CDN stylesheets (e.g. Font Awesome) could point at their fonts with http:// when the copy was made in the background (WP-Cron), so https pages blocked the fonts and icons were missing. Copies now point at the font by file name; existing copies are corrected once and Used CSS and cached pages are rebuilt.

= 0.28.0 =
* Vitals shows a clear Core Web Vitals verdict per device (passes / fails / not enough data yet) for the last 28 days. The per-day table and the slowest-pages list are now part of PressVelo Speed Pro.
* Database: the everyday items stay (revisions, auto-drafts, trash, spam, expired transients). Orphaned post meta, old background-job logs, table optimizing and the automatic weekly run moved to PressVelo Speed Pro; a site that had the weekly run on sees a one-time note, and nothing in its database is changed.
* A short "PressVelo Speed Pro" box on the main settings page, a "Get Pro" link in the plugin's row, and a one-time review request on PressVelo's own pages after a week (can be snoozed or turned off). None of it shows while Pro is active.
* Add-on API 3: Vitals data and verdict, Database items (filter pvs_db_items), hooks pvs_vitals_cfg, pvs_vitals_saved, pvs_vitals_page, pvs_db_after_table.

= 0.27.34 =
* Header hero photo preloaded on measured devices where the LCP is the heading over it: the photo still fills the first screen, and Speed Index waited for it.
* Latin font files of local Google Fonts are preloaded (up to three per page), so the first-screen text is not redrawn seconds later in the web font.

= 0.27.33 =
* Lazy background images for Elementor: sections after the first three (classic sections, and Flexbox containers while Elementor's own Lazy Load Background Images is off) load their background photos, and those of their columns and widgets, when they come near the screen instead of on page load. Part of Lazy load images.

= 0.27.32 =
* Theme hero sliders in the page header (photo background per slide): before the page is measured, the first slide's photo is preloaded instead of guessing an image further down as the LCP.
* Sections with data-background photos after the hero get their photo when they come near the screen, not all at once on page load. Hidden slides of Owl carousels download no background photo before the carousel starts.

= 0.27.31 =
* No jump on the first scroll or tap: carousels (Owl, Splide) keep their 'shown before scripts' layout until their script has started them. Before, the slider vanished for a moment when the delayed scripts ran and the page jumped.
* Downloaded Google Fonts stylesheets (up to 12 KB) are written into the page instead of linked, so they no longer block the first paint.

= 0.27.30 =
* SiteGround Speed Optimizer is now reported like other speed plugins: deactivate it. SiteGround's server cache is then cleared from Site Tools > Speed > Caching > Flush Cache; the pre-check and Cache page say so.

= 0.27.29 =
* SiteGround Speed Optimizer is no longer told to be deactivated: it should stay active so PressVelo can clear SiteGround's cache. With both page caches on, a blue note says to keep SiteGround's Dynamic Cache and turn off PressVelo's page cache.

= 0.27.28 =
* "Clear page cache" (and every full purge: theme, menu, plugin changes) now clears the same host and plugin caches as saving the settings: SiteGround, Kinsta, WP Engine, Pantheon, SpinupWP, RunCloud, Cloudways (Breeze), LiteSpeed, Nginx Helper, WP Rocket, W3 Total Cache, WP Super Cache, WP Fastest Cache, WP-Optimize, Cache Enabler and Hummingbird. One failing cache never stops the others; it also runs from cron (scheduled posts).
* Pre-check and Cache page: when the site is behind SiteGround's server cache (X-Proxy-Cache) but SiteGround's Speed Optimizer is not active, a yellow note says to activate it with only Dynamic Cache on, so PressVelo can clear SiteGround's cache too; green when it is active.

= 0.27.27 =
* SiteGround: "Clear page cache" (and every purge PressVelo makes, e.g. one page after an edit) also clears SiteGround's server cache (Dynamic Cache) when its Speed Optimizer plugin is active. The admin bar button now also shows when only a host or Cloudflare cache is in use (PressVelo's own page cache off).

= 0.27.26 =
* Cloudflare: the newer Global API Key format ("cfk_" + 40 characters + checksum, shown for new and rolled keys) is accepted, as well as classic keys of 37-45 hex characters. Before, a cfk_ key was refused with "does not look like a Global API Key".

= 0.27.25 =
* PressVelo's own requests to the site (pre-check, setup check, cache preload, cache warm) use WordPress' own User-Agent format ("WordPress/x; site; PressVelo-Preload", "(Mobile)" for the phone copy) instead of a browser one. Bot protection on hosts like SiteGround dropped the connection for a browser User-Agent sent by the server ("cURL error 56 ... unexpected eof"), so the pre-check failed and the cache was never preloaded.

= 0.27.24 =
* Elementor hero preload also when only one device is measured (quiet sites often have desktop data long before phone data): the unmeasured device gets the first section's background photo, limited to it by media query, and no image further down is guessed as the LCP.

= 0.27.23 =
* LCP on Elementor pages before they are measured (new or just edited pages): when the page's first section has a CSS background photo (its own or its overlay, read from the Elementor post CSS file or inline CSS), that photo is preloaded with high priority, with separate desktop / phone images by media query, instead of guessing an image further down the page.

= 0.27.22 =
* Cloudflare connects on save: with the email and Global API Key saved, PressVelo finds (or checks) the Zone ID and turns clearing Cloudflare's cache on by itself - no checkbox and no separate test. The page shows "Connected" or why not; "Settings saved." says "Cloudflare connected (domain)". Caching pages on Cloudflare stays a choice.

= 0.27.21 =
* Saved secrets (Cloudflare Global API Key / token, Sucuri key and secret) show as dots in their password field instead of an empty field. Only a placeholder is in the page, never the secret; leaving the dots keeps the saved one, pasting over them replaces it.

= 0.27.20 =
* Cloudflare settings simplified: login email + Global API Key (required, marked *), Zone ID found automatically on save from the site's domain (parent domain tried for subdomains). Turning on a Cloudflare feature without them keeps it off and says what is missing; "Cache pages on Cloudflare" turns purging on too. The API token field shows only when one was saved by an earlier version (it still works). Test connection sits under the Zone ID.

= 0.27.19 =
* WebP for background images named only in stylesheet files (Elementor / page builder section and hero backgrounds): they are queued for WebP copies too. With URL delivery (servers without .htaccess) the page gets a copy of such stylesheets that points at the .webp files, also when CSS minify is off; copies are rebuilt when new WebP files are made. Inline styles with root-relative image URLs (/wp-content/...) get .webp too.

= 0.27.18 =
* Age gates are also found by their settings, not only by the script name: an inline script with age gate settings (ageMonths, age_gate, ageVerification, minimum_age, legalAge...) and the script file of the same WordPress handle (e.g. theme "popups.js" with var yocanPopups = {"ageMonths":"3"}) are never delayed, so the "Are you 21+?" gate shows on arrival.

= 0.27.17 =
* Used CSS keeps rules on attributes that scripts running at load set (setAttribute / toggleAttribute, el.hidden = ..., el.dataset.x = ..., data-* and aria-* names in their strings). Before, a rule like .topbar[data-promo-replaced][hidden]{display:none} was left out because the attribute is not in the HTML, so the element showed until the full CSS loaded and the page then jumped.

= 0.27.16 =
* Pre-check shows only what is fine (green) or what needs doing (yellow/red). Notes that need nothing are gone: wp-config.php with WP_CACHE true shows "On." even while PHP still runs an older copy for a few minutes; the background jobs row appears once WP-Cron has been seen running (green) or when jobs are late (yellow); a browser caching check that could not run shows nothing; a host with its own page cache is green.

= 0.27.15 =
* Pre-check: yellow only where something needs doing. Notes that need nothing (server cron not seen yet, PHP still using an older wp-config.php for a few minutes, a host with its own page cache) are shown in blue.
* Pre-check on nginx: browser caching is now read from the cache lifetime the server really sends for a static file; green when it is 7 days or more ("30 days"), yellow with the real value when it is short or missing.

= 0.27.14 =
* Pre-check checks that background jobs (WP-Cron) really run: PressVelo remembers when WP-Cron last ran. With DISABLE_WP_CRON the row turns green ("run by the server; last ran 10 minutes ago"), or warns clearly when scheduled jobs are hours late. With normal WP-Cron it warns only when jobs are half a day late.

= 0.27.13 =
* Pre-check: when wp-config.php already sets WP_CACHE to true but PHP still runs an older copy of the file (PHP opcache), it now says so ("picked up within a few minutes or when PHP restarts") instead of "sets WP_CACHE with its own code".

= 0.27.12 =
* Delay JavaScript no longer delays WordPress script modules (<script type="module" id="...-js-module">, wp-includes/js/dist/script-modules/). Blocks that use the Interactivity API (Accordion/FAQ, Navigation, Search, Query, WooCommerce blocks) start once at page load; with their module delayed they never started (an FAQ that does not open). Modules never block rendering.

= 0.27.11 =
* Fonts: font-display "fallback" (used by WordPress' Font Library) now also becomes swap, so PageSpeed no longer reports "Font display". "optional" and "swap" stay.
* Image width/height: sizes are read from WordPress file names (name-1024x768.jpg) without opening the file, so images far down long pages get them too (only 40 files per page are measured from disk); each image is looked up once per page; an image with an empty src gets the size of its first srcset image.

= 0.27.10 =
* PressVelo's own pages (settings, setup, Vitals, Database and the Pro pages) no longer show other plugins' and themes' notices (ratings, upsells, update reminders). They still show on every other admin page; PressVelo's own notices stay.

= 0.27.9 =
* Imagify is reported only when it shows WebP/AVIF images on the site (its "display next-gen" option); compressing images or only making the copies is fine next to PressVelo.
* Image plugins (Imagify, ShortPixel, EWWW, Smush, WebP Express...) no longer get "Please deactivate": a separate info notice says the plugin can stay for compressing images and names the one option to turn off.

= 0.27.8 =
* The page source comment no longer shows the plugin version: "<!-- Optimized by PressVelo Speed on date UTC -->". The date still shows whether a page came from the cache.

= 0.27.7 =
* Settings split into pages, each with its own menu item and tab: Settings (presets, general, WordPress bloat, link prefetch), Cache, JavaScript, CSS & HTML (Used CSS, minify, fonts), Images & Media (images, video, WebP) and CDN & Integrations (Cloudflare, CDN, Varnish, Sucuri). Saving a page changes only the settings on it.
* Every optimized page now ends with "<!-- Optimized by PressVelo Speed x.y.z on date UTC -->" in the page source (before, only with WP_DEBUG), so it is easy to see that the plugin runs; cached pages also show "Cached by PressVelo Speed on ...".

= 0.27.6 =
* Page cache: an old WP_CACHE false line in wp-config.php (often left by a removed cache plugin) no longer blocks the page cache. It is switched to true, the original line is kept in a comment next to it and a copy of the file is saved as wp-config-pvs-backup.php; turning the cache off puts the original line back. Commented-out WP_CACHE lines are ignored, and a WP_CACHE value set by code is never changed.
* Pre-check shows the real WP_CACHE state in wp-config.php.
* Owl Carousel while JavaScript is delayed: carousels that show several items (data-items="3", data-services-item="3", ...) show that row at once (1 item below 600 px, 2 up to 999 px), and one-item carousels such as testimonials keep the height of their tallest slide. Before, the page jumped by up to the height of a full-width slide when the delayed script ran on the first scroll or touch.

= 0.27.5 =
* Cloudflare full-page cache: the cache rule is written again on re-activation, after a plugin update and by Complete setup (deactivation removes it on purpose; before, it only came back on the next Save).

= 0.27.4 =
* Complete setup is quick now: it saves and shows the result screen at once; the home page check runs from that screen in its own short request (one long request that saved, purged and rebuilt the home page through Cloudflare could time out on small hosts). It still goes back to Safe, then off, when the page does not load correctly. The pre-check's home page load is used as the "before" check.

= 0.27.3 =
* Admin bar: one "PressVelo" item; Clear page cache, Pause optimization and Pre-check & setup are inside it (no separate top-level Clear page cache).

= 0.27.2 =
* Pre-check: an old result is no longer shown after a plugin is activated or deactivated, the theme changes or advanced-cache.php changes; the page asks to run the pre-check again.

= 0.27.1 =
* Pre-check and setup: the site check now runs with the "Run pre-check" button (fast page load). Red items (another speed plugin active) must be fixed first: "Complete setup" stays disabled until a fresh pre-check (30 minutes) shows nothing red; yellow items are notes only. Complete setup optimizes the whole site at once.
* A new install next to another active speed plugin starts in Test mode (visitors keep the site as it is) until Complete setup.
* Settings page and admin bar: "Pre-check & setup".

= 0.27.0 =
* New installs are faster the moment the plugin is activated: optimization goes live at once (no Test mode) with low-risk settings: Safe preset, page cache (only when no other page cache plugin or host cache runs), WebP copies, minify, local fonts, lazy load. Sites that already use PressVelo keep their settings.
* Setup wizard (opens after activation, and from the settings page / admin bar): site check (other speed plugins, page cache, the site loading its own pages, WebP support, .htaccess, PHP memory, WP-Cron), then one click for the speed level (Safe / Balanced / Aggressive), Used CSS, or Test mode first. After applying, the home page is loaded once; if it does not come back whole, the site goes back to Safe (or off) by itself.
* Admin bar "PressVelo: On / Paused / Test mode" with Pause / Resume optimization for everyone in one click.
* Conflict check: Seraphinite Accelerator (error: it optimizes PressVelo's output a second time), PhastPress, WP Meteor, RapidLoad, 10Web Booster, Airlift, Debloat, Clearfy, AccelerateWP, Powered Cache and Simple Cache are now recognized.

= 0.26.0 =
* Add-on API 2: preview. PressVelo Speed Pro can try setting changes on a secret link (?pvs_preview=<token>) before they go live; only those requests use them (also for logged-in users), visitors, the page cache and the settings page keep the live settings, and a save made during a preview request never stores trial values.

= 0.25.4 =
* New: colour placeholder for a measured background LCP (on by default). A hero section whose LCP is a CSS background photo gets the photo's average colour (JPEG/WebP, measured once with GD) as background-color, so it no longer shows a light page background behind white text until the photo arrives. Steadier Speed Index.

= 0.25.3 =
* Used CSS: stylesheets that WordPress prints late, inside the body (page-builder widget styles, header/footer templates), now have their used CSS placed at the end of <head> (setting 'Move late styles to the head', on by default). On slow connections the top of the page was drawn before that CSS arrived and then jumped (e.g. an ElementsKit mobile menu), which made PageSpeed results swing between runs.

= 0.25.2 =
* Conflict notice: Image Optimizer by Elementor is no longer reported. It converts the uploaded files themselves (original kept as backup), does not rewrite image URLs on page view and has no lazy load, so it works side by side with PressVelo's WebP (which only handles the JPEG/PNG files left).

= 0.25.1 =
* Fix (0.25.0): fallback fonts were also added inside @font-face rules, which made the web font's own faces invalid in the inlined Used CSS; web fonts then appeared only when the full stylesheet loaded. @font-face rules are now left untouched.

= 0.25.0 =
* New: size-matched fallback fonts (on by default). Each web font of the page gets a fallback face '<Family> PVS Fallback' = local Arial or Times New Roman with size-adjust and ascent/descent/line-gap overrides measured from the web font itself (the site's TTF/OTF/WOFF file, or the Google Fonts TrueType file for woff2-only families; measured once in the background). It is placed right after the web font in font-family lists (also Elementor's --e-global-typography-*-font-family variables), so text keeps its line breaks when the web font swaps in: no layout shift. Icon fonts are skipped.

= 0.24.1 =
* WebP: with 'Automatic' delivery on an Apache/LiteSpeed-looking server, saving the settings now checks that the .htaccess WebP rule really works (a test image is requested with Accept: image/webp). Hosts that serve static files before .htaccess is read get URL delivery instead, so WebP files are used.
* Measured background LCP preloads use the same (WebP) URL as the page's CSS, so the hero image is downloaded once.

= 0.24.0 =
* Page cache: a left-over wp-content/advanced-cache.php from a deactivated caching plugin (Seraphinite Accelerator, WP Rocket, W3 Total Cache, WP-Optimize, LiteSpeed Cache, WP Super Cache, Cache Enabler, Breeze, FlyingPress, Hummingbird, Comet Cache, Swift Performance, Powered Cache, Simple Cache, NitroPack) is now replaced automatically (copy kept as advanced-cache.php.pvs-backup), also when that plugin is deactivated later. Files of active caching plugins are never touched; files from unknown tools get a 'Replace it' button instead of asking to delete files by hand.

= 0.23.1 =
* Fix: GTranslate language switcher stayed empty until the first interaction in delay mode (its widget script ran at load, its inline settings were delayed), then appeared and shifted the header (CLS). The settings and widget script are now on the built-in never-delay list.

= 0.23.0 =
* New: Redis object cache (off by default). Ticking it checks the Redis connection first, then installs PressVelo's own wp-content/object-cache.php (wp-config WP_REDIS_* settings or 127.0.0.1:6379). If Redis stops answering, the site keeps working with the normal per-request cache. "Flush" deletes only this site's keys (the Redis database may be shared). Another plugin's or the host's object-cache.php is never replaced or removed; ours is removed when turned off or on deactivation.
* New: Varnish purge (Cloudways, VPS stacks): PURGE requests for cleared pages, one regex purge for site-wide clears; address configurable (default 127.0.0.1); Varnish shown when detected.
* New: CDN URL rewrite for a pull-zone CDN (BunnyCDN, KeyCDN, CloudFront...): images, CSS, JS, fonts and video under wp-content / wp-includes (absolute, root-relative, srcset, CSS url()); choose all, images only or CSS/JS/fonts only; preconnect added.
* New: Rebuild the whole page cache every N hours (0 = off), followed by preload.
* Multilingual: Weglot language URLs (/fr/...) preloaded and purged too.
* Preload: a URL that fails is tried once more; URLs failing twice are listed with their HTTP status in the settings.
* Database: "Tables with unused space" optimizes this site's MyISAM / Aria tables that have free space (InnoDB left alone).

= 0.22.2 =
* New: Sucuri Firewall. With the firewall's API key and secret, the Sucuri cache is cleared together with ours (each purged path, or the whole site for site-wide changes or more than 20 paths). The key is checked on save and the result shown; the settings say when the site is served through Sucuri. Key and secret are never shown again and are protected in WP-CLI.
* Cloudflare Global API Key: plain instructions instead of the warning box.

= 0.22.1 =
* Cloudflare: a Global API Key (with the login email) can be used instead of an API token, with a clear security warning on the settings page. A saved API token always wins. The key is never shown again, cannot be read or set with WP-CLI, and pasting it into the token field explains where it belongs.

= 0.22.0 =
* JavaScript delay: new "which scripts" option. "Only scripts from other sites" delays third-party tags (analytics, chat, pixels, ads) and leaves the site's own and inline scripts running as usual; the domain and its subdomains count as the site. Default stays "all scripts".
* JavaScript delay: new "run them" option. "When the browser is idle after load" starts delayed scripts by itself shortly after the page has loaded (or at the first interaction if sooner). Default stays "first interaction".
* Multilingual (WPML, Polylang, TranslatePress): every language's home page is preloaded; saving a post also clears its translations and each language's home page; TranslatePress language URLs (/de/..., also /en/ when the default language has a subdirectory) are preloaded and purged with their page.
* WP-CLI: wp pressvelo status | purge [--url=] | preload | get <key> | set <key> <value> | preset <safe|balanced|aggressive>. The Cloudflare token cannot be read or set from the command line.

= 0.21.1 =
* Cloudflare: new-style API tokens (prefixed, e.g. "cfut_...", longer than 40 characters) are accepted. A value that is not a token is no longer dropped silently: the settings page says so.

= 0.21.0 =
* New (off by default): Cache pages on Cloudflare too, on any plan (free included). On save PressVelo adds one Cache Rule to the zone through the Rulesets API (this site's host, not admin/login/API, not for visitors with login, cart, comment-author, bypass or vary cookies) and removes it again when turned off or on deactivation; other rules in the zone are kept as they are. Every page tells Cloudflare itself what it may keep with a Cloudflare-CDN-Cache-Control header: pages our page cache stores get the same lifetime (a copy served from our cache only for the time it has left); everything else, stale copies and responses that set cookies or fail get no-store. Separate phone copies when the mobile cache is on. Needs the page cache, Cloudflare purging and a token with Zone > Cache Rules > Edit; a missing permission is reported in the settings.

= 0.20.0 =
* Cache: saving a page-builder / theme-builder template (Elementor, Bricks, Divi, Oxygen, Beaver Builder, Breakdance, Kadence, GeneratePress, Astra, JetThemeCore), a block-theme template, global styles, a navigation or reusable block, an ACF options page, or Elementor regenerating its CSS now purges all page caches (once per request).
* Cache: managed-host caches are purged too: Kinsta, WP Engine, Pantheon, SpinupWP, RunCloud Hub (each only when the host's own code is present; a failing host call never breaks saving).
* New (off by default): remove block-editor CSS on pages without blocks (classic themes), disable XML-RPC and pingbacks (kept when Jetpack is active), disable RSS feeds (feed URLs redirect to their page), limit revisions kept per post.

= 0.19.1 =
* Fonts: already minified stylesheets (e.g. elementor-icons.min.css) whose @font-face has no font-display get a copy with swap added (URLs fixed, nothing else changed). Minified files without fonts, or whose fonts already have a font-display value, stay as they are.

= 0.19.0 =
* Fonts: font-display:swap is now also added inside theme and plugin stylesheets (icon fonts, page builders), in their minified copies; "block" and "auto" become swap. Such a copy is kept even when minifying saves less than 10%.
* New: Host CDN files locally (on by default). CSS/JS from jsDelivr, cdnjs, unpkg, code.jquery.com, Google Hosted Libraries, Font Awesome and Bootstrap CDN, plus the fonts those stylesheets use, are copied in the background, checked (never an error page; scripts that load files relative to their own address stay on the CDN), refreshed weekly and served from the site. Integrity/crossorigin are dropped on the local copy and unused preconnects removed. Adobe Fonts / Typekit, Font Awesome kits and ES modules are left alone.
* New: Host Gravatar images locally (on by default), src and srcset, refreshed weekly.

= 0.18.0 =
* Public API for add-ons (PVS_API: settings, update with the same cleaning and side effects as the settings page, purge all caches, conflicts) and the pvs_loaded action. Nothing changes for sites without add-ons.

= 0.17.5 =
* Vitals: pages opened in a background tab (Ctrl+click, "open in new tab") or prerendered are no longer counted with the time the tab sat unseen. Like Google's web-vitals library, paints after the page was first hidden are ignored, and prerendered pages count from when they were shown. Before, such visits showed LCP/FCP of many seconds and made fast pages (often shop product pages) look slow.

= 0.17.4 =
* Built-in exclusions: ad networks that ask not to be delayed (Mediavine and Grow/Journey, Raptive/AdThrive, Ezoic and its Gatekeeper consent) now run at load. AdSense, form plugins, reCAPTCHA and PayPal stay delayed on purpose (they load on the first interaction; cart, checkout and account pages are never optimized).
* Conflict check: image optimizer plugins (ShortPixel, Imagify, EWWW, Smush, Optimole, Image Optimizer by Elementor, Converter for Media, WebP Express, Robin) are reported when they also make WebP/AVIF copies or lazy load while PressVelo does. Compression only is fine.
* Presets: only the preset in use is highlighted; "Custom" is shown when preset settings were changed by hand.

= 0.17.3 =
* Host Google Fonts locally now also covers font files a theme loads straight from fonts.gstatic.com (inline @font-face rules, font preloads). Files are downloaded in the background and checked to be real fonts; the Google preconnect is removed only once nothing loads from Google any more.

= 0.17.2 =
* Settings page: a second Save settings button at the top right that stays in view while scrolling.
* Never cache list: home or / = only the home page, a full URL = that page, * wildcards (/shop/*); other lines still match any URL containing them.
* New 'Do not cache this page' box on the edit screen (also sets DONOTCACHEPAGE and tells LiteSpeed not to cache).

= 0.17.1 =
* Conflict notice: always asks to deactivate the other speed plugin (PressVelo Speed already does the work); for a plugin that must stay, names the exact option to turn off in it.

= 0.17.0 =
* Conflict check: when another speed/cache plugin does the same job as an enabled PressVelo feature (WP Rocket, LiteSpeed Cache, Autoptimize, Perfmatters, SiteGround Speed Optimizer, NitroPack, FlyingPress, Jetpack Boost, W3TC, WP Fastest Cache, WP-Optimize, Hummingbird, lazy-load and page-cache plugins...), the PressVelo pages and the Plugins screen show what overlaps and which option to switch off. Their own settings are read where possible, so only features that are really on are reported.
* Which pages to optimize: all pages, only the listed pages, or all except the listed pages (/, home, /contact/, /shop/*, full URLs), plus a 'Do not optimize this page' box on every post/page edit screen.

= 0.16.5 =
* Fix: Elementor "Lazy Load Background Images" hid gradient backgrounds of top-level containers until the delayed scripts ran, so gradient sections showed as plain white (often with white text on them, which also failed the accessibility contrast check). Those containers now get Elementor's own "e-no-lazyload" class; image backgrounds keep lazy loading.
* SiteGround cache: try sg_cachepress_purge_everything() first.

= 0.16.4 =
* Saving settings also clears the page caches of SiteGround Speed Optimizer (incl. its server cache), WP Fastest Cache, WP-Optimize, Breeze, Cache Enabler, Hummingbird and Nginx Helper, so visitors get pages built with the new settings.

= 0.16.3 =
* Fix: old Settings/Tools links to Vitals and Database now redirect too (redirect runs before WordPress' page access check).

= 0.16.2 =
* Fix: an empty red notice showed on the settings page when there were no errors.

= 0.16.1 =
* Own admin menu: PressVelo Speed > Settings, Vitals, Database (moved from Settings and Tools; old links redirect).

= 0.16.0 =
* Database cleanup (PressVelo Speed > Database): revisions, auto-drafts, trashed posts and comments, spam, expired transients, orphaned post meta and finished Action Scheduler jobs, with counts, using WordPress' own delete functions in batches. Optional weekly run (items older than 30 days).
* Local Google tag: gtag.js downloaded daily and served from the site (cached 1 day by browsers); the original address is used again if downloads fail.
* Object cache status: shows whether a persistent object cache is active and whether the server supports Redis/Memcached.

= 0.15.0 =
* Script manager: rules like 'contact-form-7 = /contact/' load a plugin's CSS and JS only on the listed pages (* wildcards, 'none'). With the 'plugin:' prefix the whole plugin is left out of other visitor page views through a small must-use plugin (never for admin, AJAX, REST, cron, logged-in users or page builders), which also shortens the server response of uncached pages.

= 0.14.0 =
* Real-visitor Web Vitals: a tiny script measures LCP, INP, CLS, FCP and TTFB in a share of visits (default 10%) and sends the numbers once per page view (no cookies, no IP addresses). PressVelo Speed > Vitals shows the 75th percentile per device with good/needs-improvement/poor colours, a daily trend and the slowest pages. Stored 30 days in a small table, at most 1,500 page views a day.

= 0.13.0 =
* Used CSS shared by page type (setting on): products, posts, archives etc. share a growing set of the classes their pages use, and the used CSS made from it is stored and reused, so a new page of that type is built 20-30% faster (no rule is ever missing: a page with new classes adds them first). Pages and page-builder layouts are only shared with themselves.
* Fix: the daily cleanup of parse caches, old inline CSS/JS copies and old measurements never ran; it is now scheduled.

= 0.12.0 =
* Built-in never-delay list: stand-alone consent tools (OneTrust, Iubenda, Termly, Usercentrics, Osano, Didomi, CookieFirst, Cookie Script, Axeptio, Quantcast Choice, Google Funding Choices) and their inline configuration run at once, so the cookie banner shows on arrival.
* Delay mode compatibility: FlexSlider/MetaSlider first slide, Splide, WPBakery stretched rows, Beaver Builder, Enfold and Avada entrance animations stay visible before the first interaction.
* Early hints: LCP image, font and stylesheet preloads and preconnects are sent as an HTTP Link header (also from the page cache); Cloudflare Early Hints turns it into a 103 response.

= 0.11.3 =
* Delay mode: Florya / Patara themes show their compact header (logo + menu button) on screens up to 1064 px before the first interaction, as their script would.

= 0.11.2 =
* Delay mode, first screen before interaction: data-background hero images are written as inline background-image (what the theme script would set); Owl Carousel shows only its first slide until its script runs (full-screen height for js-fullheight sliders); .js-fullheight gets min-height 100vh. Fixes a blank hero on ThemeForest-style themes (e.g. Florya).

= 0.11.1 =
* Delay mode: full-screen preloaders (#preloader, .preloader-bg, loader wrappers, page-loader, Pace.js) stay hidden for the whole page life, not only until the delayed scripts start. Fixes a white screen on mobile before the first interaction (and a flash after it) on themes whose preloader is a separate overlay element.

= 0.11.0 =
* Minify: HTML comments and whitespace (pre, textarea, code, scripts, styles and SVG untouched); local CSS files served from minified copies in uploads/pressvelo-speed/min (kept only when at least 10% smaller; relative URLs made root-relative); big inline style blocks; optional JS file minify (comments and indentation only, line breaks kept; webpack/ES module/currentScript files skipped).
* Link prefetch: Speculation Rules (on hover, or on press) with a hover fallback for other browsers. Admin, login, cart, checkout, account, feeds, files, query-string and nofollow links are never prefetched. WordPress' own speculation rules are replaced.

= 0.10.0 =
* Responsive images: Media Library images printed without srcset (page builders, templates) get WordPress' srcset of their existing sizes. On pages measured on both devices, sizes is set to the width each image really has on mobile and desktop. Lazy images get sizes="auto". Beacon data format 4: pages are measured again.
* WebP for theme, plugin and builder images: images the pages use that are not in the Media Library are converted by a background queue (10 per minute).
* AVIF (optional): an image.jpg.avif copy is made when clearly smaller than the WebP and served by .htaccess to browsers that accept it (not behind Cloudflare, whose cache ignores Vary: Accept).

= 0.9.4 =
* Automatic lazy render is safer: sections taller than 2.5 screens (scroll-driven storytelling) and sections with sticky/fixed elements (now reported by the beacon) are never given content-visibility. Beacon data format 3: pages are measured again.

= 0.9.3 =
* Fix (beacon): with only one device measured, its first-screen list was applied to the other device too (a desktop first-screen image became eager on mobile and competed with the mobile LCP). Until both devices are measured, images keep the normal rules; only a device-limited preload is added for the measured LCP.

= 0.9.2 =
* Fix: click replay only catches the visitor's own (trusted) clicks. A script calling el.click() while delayed scripts started was blocked and replaced the visitor's click (e.g. an age gate 'Yes' click was replayed on another button).

= 0.9.1 =
* Fix: delayed scripts could wait forever when the page reports visible but renders no frames; 100 ms fallback after the first interaction.

= 0.9.0 =
* JS delay loader: scripts start one frame after the first interaction (the response to it paints first, better INP); scheduler.yield() between scripts where supported; non-async scripts inserted by delayed scripts are awaited (max 1 s) before DOMContentLoaded/load are replayed; after window load, up to 4 third-party script hosts are preconnected.
* Page cache: purged pages are kept as stale copies; the first visitor rebuilds the page while others get the stale copy for up to 30 s (also for expired pages). Trashed, deleted and unpublished content is removed at once.
* Page cache: separate copies per value of currency/language cookies (setting, defaults for Aelia, CURCY, WCML, WOOCS, Price Based on Country, Polylang, WPML).
* WooCommerce: cache purged on stock status changes and when scheduled sales start or end.
* More ad/tracking parameters ignored by the page cache for new installs. The drop-in config is refreshed after a plugin update.

= 0.8.0 =
* New: lazy CSS background images (setting on; needs Used CSS and the beacon on both devices). Backgrounds not seen in the first screen move to a copy of their rule gated by :where(.pvsbg) (same place and specificity); an IntersectionObserver adds the class 300 px before the element is on screen. First-screen and LCP backgrounds, hover rules, data: images and multi-layer shorthands are left alone.
* New: automatic lazy render (setting on; needs the beacon on both devices). The beacon also measures page sections; sections at least two screens down on both mobile and desktop get content-visibility:auto with their measured height per device. Ignored when the section count changed. The manual lazy render option still works as before.
* Beacon data format 2 (first-screen backgrounds, viewport height, sections): pages measured by 0.7.x are measured again.

= 0.7.1 =
* Fix (beacon): pages opened in a background tab report no LCP; such reports are no longer sent or stored, and stored 'none' entries are ignored.
* Fix (beacon): an image that is the LCP on one device but sits in a <picture> (no preload possible) stays eager.
* Beacon: when both devices are measured and an image is not the LCP on either, a fetchpriority=high added by WordPress is removed.

= 0.7.0 =
* New: LCP beacon (setting on). A small script measures, in visitors' browsers, the real LCP element (the browser's largest-contentful-paint entry) and the images in the first screen, once per page and device class (mobile < 768 px, desktop). Later page builds preload exactly that image (with a media query when mobile and desktop differ, CSS background LCPs included), give it fetchpriority=high, keep first-screen images eager and lazy-load the rest, instead of guessing. Data: one JSON file per page in uploads/pressvelo-speed/hints, HMAC-signed per page, renewed after 30 days or when the page's images change; max 300 stored reports per hour. Pages not yet measured use the automatic guess as before.

= 0.6.6 =
* New: built-in never-delay list (setting on): Cloudflare Turnstile, vanilla lazy-load libraries and their settings (lazysizes, Smush, Jetpack, vanilla-lazyload), EWWW WebP detection, Cookiebot / CookieYes blockers. Scripts with data-no-defer, data-no-delay or nowprocket are left alone (like data-no-optimize).
* New: embeds from other sites (Google Maps, Vimeo, Spotify, widgets) load at the first interaction in JS delay mode; box size kept with a light placeholder. Same-site, payment, captcha and noscript frames are untouched; YouTube keeps the facade.

= 0.6.5 =
* Fix: deleting a duplicate copy of the plugin (e.g. a second folder from a re-upload) no longer wipes the shared settings and cached files.
* Fix: browser-autofilled logins are no longer saved as the Cloudflare zone/token.

= 0.6.4 =
* New: Lazy HTML (JS delay mode). Selectors listed in the settings (e.g. nav.onetap-accessibility) have their inner HTML (over 2 KB, no scripts) moved to a cached JSON file in uploads; it is prefetched after window load and put back before the delayed scripts run. For panels hidden until a script opens them. Yocan home: HTML 100 -> 73 KB gzip with the OneTap toolbar.

= 0.6.3 =
* Used CSS: content printed hidden (hidden attribute or inline display:none: off-canvas menus, mini carts, search drawers, toolbars) no longer counts for the first-paint CSS; those rules load with the full stylesheet. Panels a non-delayed script names are kept. Setting: Leave out CSS of hidden panels (on).

= 0.6.2 =
* Font preload is skipped when the page has an LCP image (it competed with the image and made LCP later). Image preloads are placed first.

= 0.6.1 =
* Preload/preconnect hints already in the page are moved to the top of <head> (after <meta charset>), so the LCP image starts loading early.
* Local stylesheets/scripts with /../ in their URL are recognised (they stayed render-blocking).

= 0.6.0 =
* Big delayed inline scripts (plugin data, tracking code) are moved to cached .js files: smaller HTML.
* Used CSS: unused custom properties (--x) removed; unused @font-face rules removed (families, weights and italic faces the page does not use).
* Preload of the main fonts (up to two woff2).
* Lazy render option (content-visibility on sections below the fold), off by default.
* SureCookie banner hidden until scripts run (it was shown unpositioned).

= 0.5.3 =
* Fix: <img>/<iframe> markup inside scripts (JSON), templates and textareas is no longer changed (it could break the script).

= 0.5.2 =
* WooCommerce cart, checkout and account pages are never optimized.

= 0.5.1 =
* Test mode: visitors get the original site, only URLs with ?pvs_test=1 are optimized. New installs start in Test mode.

= 0.5.0 =
* Used CSS also reduces big inline <style> blocks (themes that print whole stylesheets in the page); the full block is saved as a cached file and loaded later.
* Used CSS keeps rules for classes that non-delayed scripts add at load.
* Never delayed: age verification gate scripts and tiny no-js -> js class scripts.

= 0.4.1 =
* Smaller Used CSS: minified output, @font-face subsets for scripts the page does not use are skipped, hover/focus-only rules and unused selectors are left out, a stylesheet linked twice is inlined once.
* HFE (Elementor Header & Footer Builder) nav menu: submenu arrow shown before the delayed JS runs.

= 0.4.0 =
* Used CSS (phase 3).
* Cache preload, Cloudflare purge, compatibility fixes, lazy-load conversion (phase 4).

= 0.2.0 =
* Page cache, browser cache rules, WebP conversion and delivery (phase 2).

= 0.1.0 =
* First version (phase 1).
