=== Erfika Optimizer ===
Tags: optimization, database, performance, cleanup, diagnostics
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 3.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A local-first Optimization Lab that profiles each WordPress site before suggesting cleanup and conservative optimization actions.

== Description ==

Erfika Optimizer 3.4 is built around an adaptive Optimization Lab rather than a fixed list of generic optimization switches.

The Lab creates a local site profile, measures cleanup opportunities, estimates autoloaded option data through WordPress APIs, generates site-specific recommendations, stores a local baseline, and lets administrators compare later scans against that baseline.

Key features:

* Explainable Opportunity Map: each finding answers what it means, what was measured, and what a non-technical administrator should do next.
* Impact Passport: records Optimizer actions with before/after local measurements so administrators can see what actually changed.
* Read-only heavy-autoload view: surfaces the largest always-loaded options without automatically deleting or disabling unknown data.

* Local Optimization Lab with an on-demand site scan.
* Site-specific recommendation engine based on measured local conditions.
* Baseline and before/after comparison.
* Local scan history (last 10 scans).
* Conservative one-click optimization profile with settings rollback.
* Approximate autoload footprint measurement using WordPress-loaded options.
* Revision, expired transient, auto-draft, trash and junk-comment opportunity detection.
* Cleanup of revisions, expired transients, auto drafts, trash, and spam/trash comments.
* Configurable revision retention.
* Database table optimization.
* Advanced CSS and JavaScript handle controls for experienced administrators.
* Heartbeat controls for dashboard, editor, and front end.
* Optional removal of common WordPress front-end overhead.
* No cloud account and no automatic telemetry.

The Lab Score is an internal prioritization indicator based only on the local conditions the plugin measures. It is not PageSpeed, Core Web Vitals, a hosting benchmark, or a guarantee of performance improvement.

The conservative profile changes only Erfika Optimizer settings and stores the previous plugin settings so they can be restored. Destructive database cleanup remains a separate manual action and is never run by the conservative profile.

== Privacy ==

Erfika Optimizer performs its Optimization Lab scans locally. It does not automatically send site, user, administrator, scan, or performance data to erfika.com or another external service.

== Installation ==

1. Upload and activate Erfika Optimizer.
2. Open Settings > Erfika Optimizer.
3. Run "Scan Site" in Optimization Lab.
4. Review the site-specific findings before changing settings.
5. Use the conservative profile only if its changes fit your site.
6. Create a current backup before destructive database cleanup.

== Frequently Asked Questions ==

= What makes Optimization Lab different from a normal optimization checklist? =

The Lab first profiles the current site and then shows recommendations only when its measured local conditions trigger them. It also stores a baseline and local scan history so later scans can be compared.

= Does the Lab Score represent real-world page speed? =

No. It is an internal prioritization score for the local conditions measured by the plugin. It is not a replacement for browser-based performance testing or Core Web Vitals.

= Does the plugin send scan data to Erfika? =

No. The WordPress.org edition performs these scans locally and does not automatically transmit the results.

= What does the conservative profile change? =

It changes only selected Erfika Optimizer settings, such as conservative revision retention and low-risk WordPress overhead controls. The previous plugin settings are stored for rollback. It does not automatically delete database content.

= Can cleanup actions be undone? =

Destructive cleanup actions cannot be undone by the plugin. Use a current backup before cleanup. The rollback feature applies to the conservative settings profile, not deleted database content.

= Can disabling CSS or JavaScript handles break a site? =

Yes. Asset handle controls are advanced tools and are not part of the automatic conservative profile.

== Changelog ==

= 3.4.0 =
* Added Performance Engine Center with server, persistent object-cache, drop-in, OPcache and image-engine awareness.
* Added Compatibility Guard guidance to avoid stacking a second page-cache or object-cache engine blindly.
* Hardened public Cache-Control so logged-in users and common WooCommerce-sensitive routes are excluded.
* Hardened script defer and HTML minification on sensitive/personalized requests.
* Improved non-destructive action UX so scan buttons no longer show database-deletion warnings.
* Preserved Optimization Lab, Opportunity Map, Impact Passport, Plugin Intelligence, cleanup, lazy media and frontend controls.


= 3.3.0 =
* Added local Plugin Intelligence for installed/active plugin and update visibility.
* Added heuristic overlap detection for cache, minification, image, database and object-cache plugins.
* Added plain-language conflict guidance without automatically disabling other plugins.
* Added optional script defer with protected core jQuery handles.
* Added optional short public Cache-Control response header.
* Added optional asset version query-string removal for advanced compatibility cases.
* Preserved Optimization Lab, Opportunity Map, Impact Passport, autoload inspection, cleanup, lazy media and frontend controls.
* All aggressive front-end options remain opt-in.


= 3.2.0 =
* Added opt-in native lazy loading for images and content iframes.
* Added optional width/height completion for WordPress attachment images.
* Added conservative HTML minification.
* Added same-origin intent-based link prefetching.
* Added optional Google Fonts connection hints.
* Kept all new front-end transformations disabled by default.
* Continued Optimization Lab, Explainable Opportunity Map, Impact Passport, cleanup and advanced handle controls.


= 3.1.0 =
* Added the Explainable Opportunity Map for non-technical administrators.
* Added Impact Passport with before/after records for Optimizer actions.
* Added a read-only list of the heaviest autoloaded options.
* Expanded the local environment profile.
* Rewrote panel explanations in plain Persian, including risk and reversibility guidance.
* Refined the administration UI and improved hero readability.
* Kept automatic optimization conservative; unknown autoload data is never deleted automatically.


= 3.0.0 =
* Introduced Optimization Lab with local site profiling.
* Added site-specific recommendation generation.
* Added baseline and before/after comparison.
* Added local scan history.
* Added a conservative settings profile with rollback.
* Added autoload footprint estimation using WordPress-loaded options.
* Kept destructive cleanup separate from automatic optimization.
* Clarified that the Lab Score is not a speed benchmark.

= 2.0.0 =
* Added the redesigned Persian administration dashboard.
* Added database cleanup, revision management, asset controls, Heartbeat controls, and local diagnostics.
