=== ElementsBoost – Speed & Performance Optimizer for Elementor ===
Contributors: lmscrafter, mmubashirtaqi
Tags: elementor, speed, performance, optimization, pagespeed
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.8.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires Plugins: elementor

Remove unused Elementor CSS and JavaScript your caching plugin can't touch — safely, page by page, with preview and one-click undo.

== Description ==

**Elementor loads heavy assets on every page — even pages that don't use them.**

Font Awesome on a page with zero icons. Swiper on a page with no carousels. Animations CSS when nothing animates. That's 400–800 KB of unused weight on every single page load.

Your caching plugin compresses this bloat. **ElementsBoost removes it.**

= Why caching plugins aren't enough =

WP Rocket, LiteSpeed Cache, FlyingPress, and W3 Total Cache are excellent at caching, minifying, and compressing assets. But they don't understand Elementor's architecture. They can't tell which libraries a specific page actually uses, and they can't selectively remove unused Elementor widget CSS/JS.

That's what ElementsBoost does.

**Use ElementsBoost to remove unused Elementor bloat first. Then let your caching plugin optimize the cleaner output.**

They work together — not against each other.

= What makes ElementsBoost different =

Most performance plugins optimize blindly. ElementsBoost understands Elementor:

* **Elementor-specific scanning** — identifies which widgets, libraries, and addon scripts each page actually uses
* **Per-page control** — remove assets on one page without affecting others (Pro)
* **Risk visibility** — every optimization shows a risk level (Low / Medium / High) so you know what's safe to enable
* **Preview before applying** — see the leaner page as admin before visitors do (Pro)
* **One-click undo** — reverse any change instantly, no backups needed
* **Works inside the Elementor editor** — diagnose and fix issues without leaving the editor

= Built for safety, not speed stunts =

Performance plugins that break sliders, popups, forms, or checkout pages cost you more than they save. ElementsBoost is designed to reduce that risk:

* Every toggle shows estimated savings and a risk level
* The Compatibility Warning Engine flags known plugin compatibility risks before you enable anything
* Safe Preview lets you test changes privately as an admin — visitors continue seeing the original (Pro)
* Auto-Revert quietly rolls a toggle back if it breaks your front-end and tells you what happened
* Settings History keeps the last 30 settings snapshots so you can return to any earlier state with one click
* The Elementor editor itself is never affected by front-end optimizations

= Who this is for =

* **Elementor freelancers** maintaining client sites who need faster pages without the risk
* **Agencies** managing multiple Elementor sites with addon bloat from Essential Addons, JetEngine, ElementsKit, and similar packs
* **Site owners** with slow Elementor pages who don't want to manually inspect scripts
* **Anyone using Elementor addons** — the more addons you have, the more unused assets pile up

== Free Version Features ==

The free version gives you real optimization tools — not a teaser.

= Safe Global Optimizations =

14 one-click toggles to remove common Elementor and WordPress bloat:

* Disable Font Awesome (~100 KB saved)
* Disable Elementor Icons (~80 KB saved)
* Disable Animations CSS (~80 KB saved)
* Disable Swiper.js (~140 KB saved)
* Disable Dialog/Lightbox (~50 KB saved)
* Disable Google Fonts (~50 KB saved)
* Disable Elementor assets on non-Elementor pages (~400 KB saved)
* Disable WP Emoji, oEmbed, jQuery Migrate, Gutenberg CSS, Dashicons
* CLS Fix — auto-inject width/height on images to reduce layout shift

Each toggle shows estimated savings and a risk level. All changes are instantly reversible.

= Smart Onboarding =

The first time you open ElementsBoost, the plugin scans your site (Elementor version, theme, active addon packs, header/footer templates, WooCommerce) and recommends which toggles are safe to enable for your exact setup. One click applies the safe set.

= Asset Usage Map =

A background scan tracks which Elementor pages actually use Swiper, Font Awesome, Animations, and Dialog/Lightbox. Every "Disable X" toggle checks the map for the current page first and keeps assets that are genuinely needed.

= Settings History =

Every settings change is automatically saved as a snapshot. The Settings History panel on your dashboard keeps your last 30 snapshots — restore any of them with one click. A safety snapshot is taken before each restore so you can undo a restore.

= Compatibility Warning Engine =

Scans your active plugins for known compatibility risks before you enable an optimization:

* Severity levels — High / Medium / Low
* Friendly warnings instead of vague errors
* Optional plugin compatibility alerts when you activate a new plugin in WordPress
* Editor health check — diagnoses and repairs Elementor editor loading issues

= In-Editor Diagnostics (BuraqOptimizer) =

A floating panel inside the Elementor editor that shows:

* **Elementor Optimization Score (EOS)** — how well this page is optimized for Elementor-specific bloat
* **Per-page findings** — what's slowing this page down, with Fix / Guide / Undo buttons
* **Asset breakdown** — which plugins are loading which CSS/JS on this page
* **Data fixes** — fix heading hierarchy, empty containers, YouTube lazy-load, and meta descriptions directly in the editor, with full undo
* **Site insights** — cross-page benchmark and trend tracking

= Content Scanner =

* Batch-scan every page with a progress bar
* Per-page Optimization Score, weight, and top findings
* Score history tracking over time
* Element inventory — all Elementor widgets used across your site
* Plugin Profiler — which plugins contribute which CSS/JS weight

= WordPress Cleanup =

* Remove emoji scripts and styles
* Remove oEmbed scripts
* Remove jQuery Migrate
* Remove Gutenberg block CSS on non-block pages
* Remove Dashicons on the front-end
* Font preload hints

= Built-in Documentation =

Accordion-style docs inside the plugin — Quick Start, Feature Reference, FAQ, and Troubleshooting. No external docs site needed.

== Pro Version Features ==

Upgrade to [ElementsBoost Pro](https://elementsboost.com/) when you need deeper, per-page Elementor optimization with proof.

= Elementor Lean Mode =

The core Pro feature. Lean Mode analyzes which Elementor widgets each page actually uses, then lets you remove the libraries it doesn't need:

* **Per-page asset removal** — strip unused Swiper, Font Awesome, Animations CSS, and more on specific pages without affecting others
* **Third-party addon detection** — identifies bloat from Essential Addons, JetElements, ElementsKit, Premium Addons, PowerPack, Ultimate Addons, Happy Addons, and Plus Addons
* **Safe Preview** — preview the leaner page with a private admin cookie before applying; visitors always see the original until you're ready
* **Live PageSpeed Benchmark** — run a before/after Google PageSpeed test directly from the dashboard to measure real improvement

= JavaScript Optimization =

* Automatic `defer` on non-critical JavaScript
* Smart delay until user interaction — hold analytics, chat widgets, and tracking scripts until the visitor scrolls or clicks

= Critical CSS Engine =

* Extract inline `<style>` blocks into external files
* Defer non-critical CSS loading
* Generate per-page critical CSS

= Image Compression =

A self-hosted, 3-tier compression engine that runs entirely on your server — no external API, no monthly credits, no per-image fees:

* Auto-selects the best available method (native binaries, Imagick, or GD)
* WebP and AVIF conversion
* Bulk compression for your entire media library
* Backup and one-click restore for every compressed image

= Unlimited Optimization Rules =

The free version includes 10 Lean Mode rules. Pro removes the limit entirely.

= License & Updates =

* License activation and deactivation from the plugin's License tab
* Automatic updates delivered through your normal WordPress Plugins screen
* Priority support

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/elementor-boost/` or install directly from **Plugins → Add New**.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Open **ElementsBoost** in the admin menu.
4. Smart Onboarding will scan your site and recommend safe toggles — click **Apply Recommended** to enable them in one step.
5. Open any page in Elementor — the BuraqOptimizer panel appears automatically with page-specific findings and fixes.

== Frequently Asked Questions ==

= Will this break my site? =

ElementsBoost is designed to reduce that risk. Every toggle shows a risk level. The Compatibility Warning Engine flags known issues before you enable a setting. Auto-Revert quietly rolls a toggle back if it breaks your front-end. Settings History lets you return to any earlier state with one click. Pro users can preview changes with Safe Preview before visitors see anything.

= Does this replace WP Rocket, LiteSpeed Cache, or FlyingPress? =

No — and it shouldn't. ElementsBoost and caching plugins do different things. ElementsBoost removes unused Elementor assets that caching plugins can't identify. Your caching plugin then caches and compresses the cleaner output. Use them together.

= Does this work with Elementor Pro? =

Yes. ElementsBoost works with both Elementor (free) and Elementor Pro.

= Does this work with Elementor addons? =

Yes. Lean Mode (Pro) detects bloat from 8 major addon packs: Essential Addons, ElementsKit, JetEngine, Premium Addons, PowerPack, Ultimate Addons, Happy Addons, and Plus Addons.

= How much faster will my site be? =

It depends on your hosting, theme, plugin count, and page complexity. Sites with multiple Elementor addons on shared hosting typically see the largest improvement. ElementsBoost helps identify and remove unused assets — results vary based on how much unused bloat your pages carry.

= What is the Elementor Optimization Score (EOS)? =

EOS measures how well a page is optimized for Elementor-specific bloat — enabled toggles, code quality, SEO structure, and asset usage. It complements Google PageSpeed; it does not replace it. Use both together for the full picture.

= How does image compression work without an API? =

The compression engine runs entirely on your server using three methods — native binaries (jpegoptim, optipng), Imagick, and GD — cascading automatically based on what your hosting supports. No images leave your server. No API keys. No monthly credits.

= What's the difference between Free and Pro? =

**Free** gives you 14 global optimization toggles, the full BuraqOptimizer editor panel, Smart Onboarding, Compatibility Warning Engine, Settings History, Asset Usage Map, content scanner, plugin profiler, and data fixes with undo.

**Pro** adds Elementor Lean Mode (per-page asset removal with Safe Preview), live PageSpeed benchmarking, Critical CSS engine, JavaScript delay/defer, image compression with WebP/AVIF, third-party addon bloat detection, and unlimited optimization rules.

= Does this collect any data? =

Only if you explicitly enable the Diagnostics toggle in General settings. When enabled, it sends anonymous usage data (WordPress and Elementor versions, enabled optimizations) once a week to help improve the plugin. No personal data, page URLs, or page content is ever collected. See the External Services section below for full details.

= What happens if I deactivate the plugin? =

All optimizations are reversed. Your site returns to its original state. Compressed images remain compressed (with backups available for restore), but no front-end changes persist after deactivation.

== External services ==

This plugin connects to the following external services under specific conditions:

= Google Fonts API =
When the "Self-host Google Fonts" feature is enabled, the plugin downloads font CSS and font files from Google Fonts (fonts.googleapis.com and fonts.gstatic.com) to serve them locally from your server. This is a one-time download that is cached locally — subsequent page loads use the local copy. No user data is sent to Google during this process.

* Google Fonts Terms of Service: https://developers.google.com/fonts/terms
* Google Privacy Policy: https://policies.google.com/privacy

= ElementsBoost Telemetry Service (Optional — Opt-in Only) =
When you explicitly enable the "Diagnostics" toggle in the General settings, the plugin sends anonymous, aggregated usage data to elementsboost.com (specifically the REST endpoint `https://elementsboost.com/wp-json/elementsboost-telemetry/v1/collect`) on a weekly basis. This data includes: WordPress and Elementor version numbers, PHP version, active theme name, number of active plugins, number of Elementor pages, which optimization toggles are enabled, and a hashed (non-reversible) site identifier. No personal data, page URLs, page content, or identifiable information is ever sent. This feature is disabled by default and requires manual opt-in.

* ElementsBoost Privacy Policy: https://elementsboost.com/privacy-policy/
* ElementsBoost Terms of Service: https://elementsboost.com/terms-of-service/

= ElementsBoost Benchmarks API =
The plugin fetches aggregated, anonymous ecosystem benchmarks from elementsboost.com (specifically `https://elementsboost.com/wp-json/elementsboost-telemetry/v1/benchmarks`) to power the "How You Compare" dashboard widget. This request sends no user data — it only retrieves aggregated statistics about average optimization scores across all participating sites. The response is cached locally for 6 hours.

* ElementsBoost Privacy Policy: https://elementsboost.com/privacy-policy/
* ElementsBoost Terms of Service: https://elementsboost.com/terms-of-service/

= ElementsBoost Plugin Compatibility Feed =
The "Show compatibility alerts when activating plugins" feature (enabled by default, can be turned off under Settings → Optimization → General → Plugin Behavior & Tools) downloads a curated list of WordPress plugins known to conflict with Elementor from `https://elementsboost.com/wp-json/elementsboost-intel/v1/intelligence-feed`. The feed is fetched once per day on a WordPress cron event. This request sends no user data — it only retrieves the aggregated risk list. The response is cached locally for 24 hours.

* ElementsBoost Privacy Policy: https://elementsboost.com/privacy-policy/
* ElementsBoost Terms of Service: https://elementsboost.com/terms-of-service/

= Google PageSpeed Insights API (Pro) =
When using the PageSpeed Benchmark feature in ElementsBoost Pro, the plugin sends your page URL to Google's PageSpeed Insights API (v5) to retrieve performance scores and Core Web Vitals metrics. Only the page URL is sent — no cookies, user data, or authentication tokens are transmitted. Results are stored locally in post meta for before/after comparison.

* Google PageSpeed Insights Terms: https://developers.google.com/terms
* Google Privacy Policy: https://policies.google.com/privacy

== Screenshots ==

1. Dashboard — optimization stats, performance trend, and one-click safe apply.
2. BuraqOptimizer — in-editor panel showing Elementor Optimization Score and per-page findings.
3. Optimization toggles — 14 toggles with estimated savings and risk levels.
4. Content Scanner — batch scan every page with per-page scores and history.
5. Compatibility Warning Engine — risk warnings with severity badges and one-click fix.
6. Element Manager — enable or disable individual Elementor widgets.
7. Plugin Profiler — per-plugin CSS/JS weight contribution breakdown.
8. Elementor Lean Mode — per-page asset analysis with removable bloat detection (Pro).
9. PageSpeed Benchmark — before/after Google PageSpeed scores with Core Web Vitals (Pro).
10. Safe Preview — admin-only preview of the optimized page before applying (Pro).

== Changelog ==

= 1.8.5 =
* Improved: The heading-hierarchy detector and one-click fixer now also understand Elementor Pro heading-emitting widgets (Call to Action, Price Table, Flip Box) and expose an `elementsboost_heading_widget_map` filter so add-ons can register more. Pro widgets are only counted when an explicit h1–h6 tag is set, so they can never create a phantom, unfixable finding.
* Housekeeping: Documented the plugin's direct database reads (Optimizer Brain history table, telemetry aggregates, attachment lookups, prefix migration, uninstall cleanup) and Elementor meta lookups with the appropriate annotations, clearing the remaining advisory Plugin Check notices. No behavior change.

= 1.8.4 =
* Improved: Findings rows that can only be fixed manually (images the auto-fix can't reach — external/CDN URLs, JavaScript-injected, or outside the media library) now label their score badge as "+N pts (manual fix)" instead of "up to +N pts", so the points no longer imply a one-click Fix button that those rows intentionally don't have. Their action remains "Show in X-Ray" to locate each image for editing.

= 1.8.3 =
* Fixed: The "Heading hierarchy has N skips" finding could loop forever — clicking Fix reported "Nothing to fix" and the row returned on every re-scan. The skip detection now reads the page's Elementor heading-emitting widgets (heading, icon-box, image-box) — the exact set the one-click fix can edit — instead of counting raw heading tags in the rendered page (which included theme header/footer and third-party headings the fixer cannot change). Detection and the Fix button now always agree.

= 1.8.2 =
* Compliance: Replaced all inline admin/editor scripts with external, properly enqueued `.js` files (no heredoc/nowdoc syntax, which Plugin Check disallows). The dashboard tab fallback, snapshots, plugin-risk notice, auto-revert notice, PageSpeed card, and onboarding panel scripts now load via `wp_enqueue_script()`.

= 1.8.1 =
* Compliance: Removed all output buffering (`ob_start()`) from the plugin. The two front-end image buffers (CLS width/height and lazy-loading) now run as per-image filters on `wp_content_img_tag`, `post_thumbnail_html` and `get_avatar`, so no full-page output buffer is opened. All admin/dashboard inline scripts are now built as plain strings and attached with `wp_add_inline_script()` instead of being captured through an output buffer.

= 1.8.0 =
* Compliance: The exported HTML report no longer contains an embedded style block — all presentation is applied as per-element style attributes on the standalone download.
* Security: Self-hosted Google Fonts CSS is now sanitized at the point of output before being attached via `wp_add_inline_style()` (markup, escape sequences and executable CSS constructs are stripped). The Google Fonts source host is also strictly validated.
* Naming: All remaining `eb_pro_*` options renamed to `elementsboost_pro_*`, with an automatic one-time migration of existing values. No unprefixed or short-prefixed option names remain.
* Performance: Image dimension lookups for the CLS auto-fix are now cached persistently (previously an uncached database query ran per image per page view). Cache is invalidated when the media library changes.
* Performance: Failed Google Fonts downloads are now remembered for an hour instead of being retried on every page view, eliminating repeated blocking remote requests when the network is unavailable.
* Cleanup: Uninstall now removes every plugin option and user-meta entry under the `elementsboost_` prefix.
* Improved: CLS/lazy-load image processing now handles multiline image tags and quoted attributes containing ">", and skips data/blob URIs and JS-template placeholder images.
* Improved: PageDNA now measures real on-disk asset sizes (plugins, themes, uploads) instead of hardcoded estimates, with estimates kept only as fallback for external assets.
* Improved: Asset Detector compatibility checks are memoized per request and cached for 12 hours (invalidation was already event-driven), eliminating repeated template queries on page views.
* Improved: Font Awesome / icon / Swiper detection now uses word-boundary matching — content words like "alfa-romeo" no longer count as icon usage.
* Improved: Animation detection now also recognizes addon animations (WOW.js, AOS, Essential Addons CSS classes and any animation-type widget setting), preventing unsafe "disable animations CSS" suggestions.
* Improved: Asset Usage Map rebuilds automatically on theme switch and now tracks per-page widget instance counts.
* Improved: Self-hosted fonts verify cached font files still exist before serving cached CSS; missing files trigger regeneration instead of broken fonts.
* New: "ElementsBoost — Performance Watch" WordPress dashboard widget showing recent page score drops and improvements.
* New: Admin bar now clearly indicates when Test Mode is on (optimizations visible to admins only) with a link to go live.
* Improved: BuraqOptimizer editor panel — stricter score labels (Excellent now requires 90+ and a clear fix list), DOM-node complexity card with a target scale, page-scoped trend chart labels, a single primary "Fix N findings" action, and findings sorted by severity and score impact with grouped headers.
* Improved: BuraqOptimizer Findings tab — "Apply recommended" now shows the projected score, a potential-savings summary heads the list, fixes applied in the current session collect into a progress group, and clearing all findings shows a celebratory all-clear state.
* Fixed: X-Ray row clicks and "Locate" buttons could highlight the wrong element when findings were filtered or reordered; rows now carry a stable issue reference.
* New: Real-user monitoring — a tiny first-party beacon measures actual visitors' Core Web Vitals (LCP, CLS, INP) and the BuraqOptimizer panel shows the p75 values next to the lab score. No external service; no personal data stored.
* Fixed: "Convert to WebP" now always produces a WebP file (previously it only compressed unless the sitewide auto-WebP toggle was on, so the finding returned on every rescan). Converted images are also remembered by filename so the finding cannot resurrect.
* Fixed: "Couldn't be auto-fixed" escapee rows no longer show a Fix button that re-runs the auto-fix that already failed — they now open X-Ray to highlight the affected images.
* Fixed: Heading hierarchy findings now offer the one-click auto-renumber fix (the backend existed but was never wired to a button).
* Fixed: Admin bar bolt rendered as a giant image when the "Disable WP Emoji" optimization was on — replaced with an inline SVG.
* Improved: Lazy-load output buffer automatically steps aside when ElementsBoost Pro's lazy loading is active; the scanner recognizes WebP files generated by other optimizer plugins; per-row finding points now display exactly once.
* Improved: BuraqOptimizer panel visual polish — consistent spacing, clearer metric cards with units and targets, single primary action.

= 1.7.9 =
* Compliance: Moved all remaining inline `<script>`/`<style>` output to the WordPress enqueue API (`wp_add_inline_script()` / `wp_add_inline_style()`) on registered handles.
* Hardening: Late-escaping applied to all echoed output; admin notice and usage-summary output now escaped at the point of output.
* Naming: Internal transients prefixed with `elementsboost_` for full prefix consistency.
* Compatibility: Tested up to WordPress 7.0. No functional changes.

= 1.7.8 =
* New: Apply Recommended button — after picking a goal, click one green button at the top of the Findings panel to enable every one-click eligible fix at once, instead of clicking three rows individually. Reads the filtered goal-relevant findings and fires the toggles in parallel.
* New: Score-explain "▾ why?" on the page-score gauge — shows which findings are pulling the score down and by how many points. Reframes "73/100" from a judgment into a transparent ledger.
* New: Dashboard "Google PageSpeed" card — replaces the older internal-score sparkline trend chart with Google's real Performance score for your homepage. The internal-score trend chart was misleading (declined whenever users toggled settings during evaluation) and didn't reflect the SEO-relevant number.
* New: Per-page WebP undo — when Pro has converted images on a page, the BuraqOptimizer panel now shows an Undo button next to the green "Active" badge so users can roll back THIS page's images only (e.g., if a brand logo's WebP color-shifted) without affecting other pages.
* New: Celebrated empty state in the editor panel — a clean page now gets a soft green card with the earned score and a "Verify on Google PageSpeed" CTA instead of a tiny system message.
* New: Savings ribbon is dismissible — click the small × on the orange "X KB saved across this site" bar to hide it for this browser. Choice persists via localStorage.
* New: "N images couldn't be auto-fixed (still missing width/height)" and "couldn't be auto-lazy-loaded" Findings rows when the CLS / lazy-load auto-fix is on but some images escape the buffer (external URLs, CDN paths, JavaScript-injected images). Previously those escapees showed in X-Ray with no matching Findings row.
* Fix: Missing alt text now appears as an actionable Finding for Free users — it used to be Pro-only-emitted, so X-Ray promised "Add alt text" but the Findings panel had no row for it. The "Suggest alt text" AI fix has always been Free-available; only the finding was hidden.
* Fix: Site-wide setting toggles now bust every cached per-page scan immediately. Previously, toggling "Disable Google Fonts" on page A still showed the old "Google Fonts present" finding on page B for up to an hour until that page's transient expired.
* Fix: Removed the dead "0/30 fixes used" counter and its upgrade modal — the backend never enforced the cap so the bar was permanently stuck at 0/30 while suggesting a non-existent freemium quota.
* Fix: Saving the full Settings form no longer silently strips `preflight_warnings_enabled`, `auto_revert_enabled`, `plugin_risk_alerts_enabled`, `fix_cls_dimensions`, and `fix_lazy_loading` back to 0. They weren't in the save handler's allowlist.
* Fix: `elementsboost_refresh_risk_plugins` daily cron is now properly cleared on plugin deactivation. Previously it stayed scheduled, fataling on the next tick if the plugin was deleted.
* Fix: Editor panel could TypeError when rendering on a page that had a setting-keyed Findings row, due to a `var` hoisting bug where `activeSettings` was used 500 lines before its declaration.
* Security: Per-user 30-second cooldown on Google PageSpeed test button — prevents any logged-in editor from draining the site's shared anonymous-tier quota.
* Security: PageSpeed test endpoint now rejects URLs that don't match the site's own host — closes a low-impact SSRF vector where a contributor could weaponize the server's outbound HTTP against arbitrary external URLs.
* Security: Per-page WebP undo now requires `manage_options` (was `upload_files`) to match Pro's own restore endpoint. Restoring an image is destructive — it deletes the .webp sibling.

= 1.7.7 =
* New: Goal-based onboarding — on first run, the Findings tab asks "What's your #1 priority for this site?" with 4 plain-English choices (Faster page load · Better Google PageSpeed · Smaller images · Reduce script bloat) plus an advanced "Show me everything" escape hatch. Solves the "20+ findings overwhelm" that drives new installs away.
* New: Once you've picked a goal, Findings filters down to the 3–5 items that actually move that needle. A small "Showing fixes for {goal} · Show all · Change goal" banner keeps the filter discoverable.
* New: Goal preference is per-user (user_meta), so two admins on the same site can have different priorities.
* Improved: First-run picker pulls in your current savings number ("Saved 0 KB so far — let's fix that") so the question feels like a continuation of the savings ribbon, not a separate flow.

= 1.7.6 =
* New: "Saved X KB on this site" headline card on the Dashboard tab — concrete value proof at the top of every dashboard load. Shows total bytes saved since install, optimizations currently active, and images compressed. Real byte deltas from image conversions are tracked exactly; per-page asset transfer eliminated by each enabled toggle is estimated from Lighthouse's published average resource sizes (and labeled as estimated so the number stays honest).
* New: Savings ribbon inside the BuraqOptimizer editor panel — same KB-saved + optimizations-live counter visible inside the Elementor editor so users see their cumulative impact every time they edit a page.
* New: `elementsboost_image_converted` action — fires after every successful image conversion with real before/after byte counts. The savings tracker listens to this so Pro's image work counts toward Free's lifetime headline.
* Improved: Savings counter cleanly reverses when a setting is toggled off — re-toggling on/off doesn't keep inflating the number.

= 1.7.5 =
* New: Google PageSpeed Insights integration — one-click "Run test" button inside the BuraqOptimizer editor panel. Shows the same Performance score, LCP, CLS, TBT, and FCP that Google measures and uses for SEO ranking. Mobile-first by default. No API key required (uses Google's anonymous tier).
* New: Latest PageSpeed result is stored per page and shown inline when you reopen the editor — so you can see "Tested 2 days ago: 84/100" without burning a fresh API call.
* New: Direct deep-link to the full Google PageSpeed report (pagespeed.web.dev) for any tested URL.
* New: Friendly error handling — detects local dev environments (.local, .test, localhost) and tells the user to test from staging/live instead of failing silently; surfaces Google's quota-exceeded error with a link to the free API key signup; explains Lighthouse failures (Cloudflare challenges, 5xx targets) in plain English.
* Improved: Pro can supply its own API key via the `elementsboost_pagespeed_api_key` filter for higher rate limits and auto-scheduled testing (Pro feature).

= 1.7.4 =
* New: Lazy-load auto-fix (on by default) — injects `loading="lazy" decoding="async"` on every below-fold image, including images rendered by Elementor widgets that bypass `the_content`. WordPress core only adds lazy to images inside the content loop; this buffer covers everything.
* New: CLS dimensions auto-fix (on by default) — injects `width=` and `height=` on every image that lacks them, preventing layout shifts. Pre-existing dimensions are never overwritten.
* New: Site Health score breakdown — click the small "▾ why?" next to your Site Health number to see a transparent ledger of which optimizations are earning points and which are available to enable. Removes the "low score = failing" framing.
* New: Findings panel now separates actionable findings from guide-only items. Quick-Fix and toggle items are visible up front; advisory items are collapsed behind a single expandable row.
* New: Per-finding "Disable" buttons on the "CLS fix active" and "Lazy-load auto-fix active" findings — flip the auto-fix off in one click without leaving the editor.
* New: Score-change toast notifications — every Fix or Undo now flashes a `+N Site Health` / `+N Page Score` badge in the corner so you can see the impact of your action immediately. The Site Health number itself animates from old to new value.
* New: Smart Alt Text "Undo — restore original alt text" button — every batch save backs up the previous alt value per attachment so you can revert in one click.
* New: LCP Hero Optimizer "Undo" button — snapshots only the Pro flags that were actually flipped, so undo never touches settings you had enabled for your own reasons.
* Improved: Per-page Pro WebP conversion now activates serving site-wide automatically — previously the .webp files were generated but the HTML kept serving PNG/JPG. The buffer-based rewriter handles Elementor / Bricks / Oxygen / theme pages that bypass `the_content`.
* Improved: Scanner now suppresses "Convert to WebP" and "Too large" issues at the source when a Pro record exists for that image. Both the BuraqOptimizer Findings list and the X-Ray overlay stay in sync.
* Improved: Site-scope finding badges now show the actual Site Health gain (e.g. `+11 pts`) instead of a hardcoded `+2 pts` placeholder. The promise matches the result.
* Fixed: The "Convert N images" button could silently reset to a generic "Fix" label because a shared CSS class let the settings-toggle handler also fire on it. Now correctly excluded from the generic handler, and the handler bails out if a button has no setting key.
* Fixed: Custom fix_type values set by individual checks (`auto_fix_toggle`, `lcp_hero_optimizer`, `pro_image_optimize_page`) were being clobbered to "info" by a fallback in the issue-enrichment loop. Explicit fix_types now survive enrichment.
* Fixed: Smart Alt Text save handler used to inflate the "saved" count by including attachments it couldn't actually write to. Now only counts verified meta writes; unresolved attachments are returned as failures with a clear message.
* Fixed: Elementor auto-generated thumbnails (`/wp-content/uploads/elementor/thumbs/`) are now filtered from image findings — they're cached files, not user-managed images, so flagging them was noise.
* Fixed: New default settings (`fix_cls_dimensions`, `fix_lazy_loading`) now reach existing installs via a one-shot admin_init top-up — only adds keys that aren't already present, never overrides user choices.

= 1.7.3 =
* Fixed: BuraqOptimizer Findings could report "N images can be converted to WebP" with an empty image list when Pro had already converted those images on a prior run. The counters now skip images that already have a stored WebP record, and the "Convert N images" button stays accurate across rescans.
* Fixed: Per-image format issues were being double-counted when an image had more than one matching issue text, inflating the headline number.
* Improved: Thumbnail/resized-image URLs (e.g. `image-300x200.png`) are now resolved to the parent attachment when checking for an existing WebP record, so the title stays accurate for galleries and loops.

= 1.7.2 =
* Fixed: "Convert N images" button in BuraqOptimizer was being silently reset to a generic "Fix" label because a shared CSS class let the settings-toggle handler also fire on the button. The generic handler is now excluded from the per-page image converter and the LCP Hero Optimizer buttons, and bails out if a button has no setting key.

= 1.7.1 =
* New: BuraqOptimizer Findings now show a per-page "Convert N images" action for oversized or non-WebP images. With ElementsBoost Pro active, one click compresses and writes WebP versions for only the images used on the current page (never the whole media library).
* New: When every image used on the current page has already been optimized, BuraqOptimizer shows a clear "Active" state so you know the work is done.
* Improved: The Images check now collects the actual URLs that need optimization and skips any image that already has a stored WebP version, so the Findings list stays accurate after a conversion.
* Improved: LCP Hero Optimizer now re-detects already-converted hero images on rescan so the "Active" pill remains accurate even when sitewide image flags are off.

= 1.7.0 =
* New: Plugin Behavior & Tools panel under Optimization → General with three new safety controls — show compatibility warnings, auto-revert toggles that break the site, and plugin compatibility alerts. All on by default.
* New: One-click buttons to re-run Smart Onboarding and rebuild the Asset Usage Map.
* Improved: Dashboard now leads with performance stats; Settings History moved to the bottom of the Dashboard tab so it no longer dominates the view.
* Improved: Smart Onboarding modal is more reliable — close button, Esc-to-close support, and a clean fallback when the scan finds zero issues.
* Improved: Dashboard and Optimization tab navigation are more resilient on sites where other plugins affect script loading.
* Improved: Conflict Guard is now the Compatibility Warning Engine, with clearer wording that reflects what it actually does — flag known plugin risks before you enable a setting.
* Fixed: "Re-run Onboarding" and "Rescan My Site" no longer trigger a server error on some setups.
* Added: Expanded in-plugin documentation and FAQ covering installation, safety, asset cleanup, compatibility, and privacy.

= 1.6.0 =
* New: Settings History — every settings change is automatically saved as a snapshot. Restore any of the last 30 with one click. A safety snapshot is taken before each restore so you can undo a restore.
* New: Asset Usage Map — a background scan tracks which Elementor pages actually use Swiper, Font Awesome, Animations, and Dialog/Lightbox. Every "Disable X" toggle checks the map for the current page first and keeps assets that are genuinely needed.
* New: Plugin Compatibility Alerts — when you activate a plugin in WordPress, ElementsBoost surfaces a friendly notice if that plugin is known to conflict with Elementor on similar sites. Includes a one-click scan and dismiss.

= 1.5.0 =
* New: Smart Onboarding — on your first dashboard visit, ElementsBoost scans your site (Elementor version, theme, addon packs, header/footer templates, WooCommerce) and recommends which toggles are Safe / Use With Caution / Not Recommended for your exact setup. One click applies the safe set.
* New: Compatibility Matrix — every "Disable X" toggle now declares its known risks so the plugin can warn you before something would break.
* New: Auto-Revert Watchdog — after you enable a risky toggle, ElementsBoost does a quick health check 60 seconds later. If your front-end is broken, it rolls the toggle back and shows you a notice with a "Re-enable anyway" option.
* Improved: Auto-Revert covers Swiper, Font Awesome, Eicons, Animations CSS, Dialog, Disable-on-non-Elementor, and Elementor Pro Hello theme styles.

= 1.4.5 =
* New: Asset Detector — a runtime safety net that scans your Elementor header, footer, single, archive, and section templates. Any "Disable X" toggle that would strip an asset that is actually used is automatically blocked.
* New: Pre-flight Compatibility Check — when you flip on a risky toggle, the plugin checks your site first and shows an inline warning if it would likely break something, with Enable Anyway / Cancel buttons.
* New: Compatibility Matrix detects active plugins that strongly depend on a specific asset (for example, JetMenu requires Swiper) and warns you before the dequeue runs.
* Improved: Safety caches refresh automatically when an Elementor template is saved or deleted, or when any plugin is activated or deactivated.

= 1.4.4 =
* Fixed (critical): Fresh installs no longer break sites with Elementor-built header/footer templates. The "Disable Elementor assets on non-Elementor pages" toggle now starts off — the plugin makes no front-end changes until you explicitly enable a toggle.
* Improved: Added an automatic safety check — even if you turn that toggle on, the plugin detects active Elementor header, footer, single, or archive templates and skips the dequeue to protect them.

= 1.4.3 =
* Compliance: All SVG icons rendered through proper escape helpers per WordPress.org guidelines.
* Compliance: Removed direct PHP runtime modifications.
* Compliance: All form inputs now require proper nonce verification.
* Compliance: Compatibility Warning Engine reads Elementor's experiment settings for diagnostics only — never writes to them.
* Improved: Plugin domain consolidated under elementsboost.com so the privacy policy, terms, and update endpoints all live on the same brand domain.

= 1.4.2 =
* New (Pro): Elementor Lean Mode — analyze per-page widget usage and remove unused CSS/JS libraries page by page.
* New (Pro): Safe Preview — preview the optimized page as an admin (via a private cookie) before applying changes; visitors always see the original until you're ready.
* New (Pro): Live PageSpeed Benchmark — run a Google PageSpeed test from your dashboard with before/after scores and Core Web Vitals.
* New (Pro): Third-party addon bloat detection for Essential Addons, JetEngine, Premium Addons, PowerPack, Ultimate Addons, Happy Addons, ElementsKit, and Plus Addons.
* Improved: Pro upgrade page redesigned with feature comparison.
* Compliance: All bundled assets now load through WordPress's standard script and style APIs.

= 1.4.1 =
* Improved: Scoring math — points from individual findings now sum precisely to the available headroom.
* Improved: Renamed "Issues" to "Findings" for clearer language.
* Improved: Elementor Optimization Score tooltip explains how EOS complements page speed metrics.
* Improved: Data fixes persist in the findings list with full undo.
* Fixed: BuraqOptimizer panel header corners and toolbar icon alignment.

= 1.4.0 =
* New (Pro): Elementor Lean Mode — per-page unused asset detection and removal.
* New: Guided optimization workflow with point-impact estimates.
* New: Animated Elementor Optimization Score that updates as you apply fixes.
* New: X-Ray highlights — visual badges on elements that need attention.
* New: "Locate" button to scroll directly to any element in the editor.
* Improved: Fix buttons disable instantly when applied; undo is one click.

= 1.2.0 =
* New: Scan All Pages — batch scan every page with a per-page report.
* New: Compatibility Warning Engine for known plugin conflict risks.
* New: Fix Editor Loading — automated diagnostics for Elementor editor issues.
* New: Plugin Profiler — groups CSS/JS by source plugin.
* New: Self-host Google Fonts locally (GDPR-friendly).
* Improved: Per-page tracking no longer double-counts on re-scans.
* Security: Hardened input handling, database access, and file operations across the plugin.

= 1.1.0 =
* New: Conflict detection.
* New: Floating optimization panel inside the Elementor editor.
* New: Admin bar status indicator.
* Improved: Dashboard redesign with modern card layout.
* Improved: Settings export and import.

= 1.0.0 =
* Initial release.
* 14 optimization toggles for Elementor and WordPress cleanup.
* Element Manager to enable or disable individual widgets.
* Page Scanner with Elementor Optimization Score.

== Upgrade Notice ==

= 1.7.9 =
Code-quality release for WordPress.org compliance: inline scripts/styles moved to the enqueue API, late-escaping on output, and prefixed transients. No functional changes. Recommended.

= 1.7.8 =
Quality-of-life update: one-click Apply Recommended, score-explain on the page gauge, a real Google PageSpeed card on the Dashboard, per-page WebP undo (Pro), plus PageSpeed security hardening and cron cleanup on deactivation. Strongly recommended.

= 1.7.7 =
First-run users are no longer dumped 20+ findings — they get a one-question goal picker and see only the fixes relevant to what they want. Strongly recommended.

= 1.7.6 =
Adds a "saved across this site" headline to the Dashboard and editor panel so you can see your cumulative impact at a glance. Recommended for all users.

= 1.7.5 =
Adds one-click Google PageSpeed Insights integration inside the BuraqOptimizer editor panel. See the actual score Google uses for SEO ranking — without leaving Elementor. No API key required. Recommended for all users.

= 1.7.4 =
Adds two zero-config optimizations as defaults (lazy loading + CLS dimensions auto-fix), a Site Health breakdown, Fixable vs Guidance findings, and Undo for Smart Alt Text and LCP Hero Optimizer. Fixes a per-page WebP serving bug. Strongly recommended.

= 1.7.3 =
Fixes a counting bug in the per-page image converter — the headline "N images can be converted to WebP" now reflects only images that actually still need conversion, so the Convert button no longer reports "Nothing to convert". Strongly recommended for anyone on 1.7.1 or 1.7.2.

= 1.7.2 =
Fixes a UI bug where the new "Convert N images" button in BuraqOptimizer Findings would visually reset to "Fix" after one click, even though the underlying conversion was already running. Strongly recommended for anyone on 1.7.1.

= 1.7.1 =
Adds a per-page image converter to BuraqOptimizer Findings (Pro converts; Free shows the count and a Pro link). LCP Hero Optimizer "Active" state now stays accurate after rescans. Recommended for all users.

= 1.7.0 =
Adds new safety controls (Plugin Behavior & Tools), one-click Smart Onboarding re-run, Asset Usage Map rebuild button, cleaner dashboard layout, and clearer Compatibility Warning wording. Expanded in-plugin FAQ and documentation. Recommended for all users.

= 1.6.0 =
Adds Settings History snapshots, Asset Usage Map for smarter per-page dequeues, and Plugin Compatibility Alerts when activating new plugins. Recommended for all users.

= 1.5.0 =
Adds Smart Onboarding with per-site recommendations, Compatibility Matrix, and the Auto-Revert Watchdog that automatically rolls back any toggle that breaks your front-end. Recommended for all users.
