=== A. Smith Speed Optimizer ===
Contributors: asmithmedia
Tags: page speed, lazy load, minify, defer javascript, performance
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WordPress speed plugin. Lazy load, minify, defer JavaScript, remove bloat, clean your database. Track a 0-100 performance score. Free, no account.

== Description ==

**A. Smith Speed Optimizer** is a free WordPress speed optimization plugin that bundles the optimizations most sites actually need into one dashboard: lazy loading, HTML minification, JavaScript deferral, WordPress bloat removal, database cleanup, and a 0-100 performance score with a letter grade.

Built for site owners and agencies who want measurable speed improvements without juggling four separate plugins or hand-editing functions.php.

= Key Features =

* **Lazy Loading** – Automatically add `loading="lazy"` to images and iframes. Includes Intersection Observer for background images with `data-bg` attributes so non-image elements lazy load too.
* **HTML Minification** – Strip whitespace, HTML comments, and unnecessary characters from your HTML output. Preserves content inside `<pre>`, `<script>`, `<textarea>`, and `<style>` tags.
* **JavaScript Deferral** – Add the `defer` attribute to enqueued scripts to prevent render-blocking. jQuery is always excluded by default. Custom exclusions supported per-script.
* **WordPress Bloat Removal** – Remove unnecessary WordPress default features individually:
  * Emoji scripts and styles
  * oEmbed/Embeds
  * Query strings from static resources
  * Dashicons on frontend for non-admin users
  * XML-RPC and pingback
  * REST API link from head
  * Shortlinks
  * Windows Live Writer manifest
  * RSD link
  * RSS feed links (optional)
* **Database Cleanup** – Clean up post revisions, auto-drafts, trashed posts, expired transients, spam comments, and trashed comments with one click. Counts shown before deletion.
* **Performance Scoring** – Get a 0-100 performance score with letter grade (A-F) based on your active optimizations, asset counts, and bloat removal status.
* **Email Reports** – Scheduled email digests (daily/weekly/monthly) with your speed score, stats, and recommendations.
* **Dashboard Widget** – See your speed score at a glance on the WordPress admin dashboard.

= How It Works =

1. Install and activate the plugin.
2. Visit **Speed Optimizer** in your admin menu.
3. View your performance score and recommendations.
4. Toggle optimizations on/off from the dashboard.
5. Clean up database bloat with one click.
6. Configure settings for fine-grained control.

= Privacy =

Everything runs locally on your WordPress installation. No external server calls, no data sent to A. Smith Media, no account required.

= Pro Features (Optional Add-On) =

The free version is fully functional on its own. A Pro add-on is available separately at [asmith.media/speed-optimizer](https://asmith.media/speed-optimizer/) with:

* Critical CSS generation for above-the-fold content
* Unused CSS removal to eliminate render-blocking styles
* Automatic WebP/AVIF image conversion
* Performance score history and trend charts
* CDN integration for static assets
* Font preloading and display optimization
* Full page caching with cache rules

== Installation ==

1. Upload the `a-smith-speed-optimizer` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu.
3. Go to **Speed Optimizer** in the admin menu to view your dashboard.

== Frequently Asked Questions ==

= How do I speed up a slow WordPress site without coding? =

Install A. Smith Speed Optimizer and enable the optimizations one at a time from the dashboard: lazy loading first (always safe), then HTML minification, then JavaScript deferral, then bloat removal. Each toggle is reversible with one click. Re-run the performance scan after each change to see your score improve and verify nothing breaks.

= Will this plugin break my site? =

The lazy loading and bloat removal options are safe for nearly every site. HTML minification and JavaScript deferral can occasionally cause issues with specific themes or third-party scripts that depend on render-blocking execution order. The recommended approach is to enable one optimization at a time and check your site after each — this plugin makes that easy by letting you toggle individual features on and off. JavaScript deferral always excludes jQuery by default, and you can add custom exclusions for any other script that needs to load synchronously.

= Can I use this with caching plugins like WP Rocket or W3 Total Cache? =

Yes. A. Smith Speed Optimizer focuses on frontend optimization (lazy loading, minification, JS deferral, bloat removal, database cleanup) — none of which conflict with page caching. It complements caching plugins like WP Super Cache, W3 Total Cache, WP Rocket, or LiteSpeed Cache. If your caching plugin already handles minification, just disable HTML minification here to avoid double-processing.

= What WordPress bloat should I remove? =

The safe defaults: emoji scripts (most sites don't need them), query strings from static resources (helps caching), shortlinks (rarely used), Windows Live Writer manifest (irrelevant in 2026), RSD link (legacy XML-RPC discovery). The optional ones: XML-RPC and pingback if you don't use the WordPress mobile app or accept trackbacks, RSS feed links if you don't run a blog, and Dashicons on the frontend for non-admin users (saves a CSS request for every visitor). Each is a separate toggle so you can enable selectively.

= Does database cleanup delete my content? =

No. The cleanup only removes content that WordPress itself classifies as expired or unwanted: post revisions older than your `WP_POST_REVISIONS` setting, auto-drafts WordPress generated and abandoned, posts in the trash bin, transients past their expiry date, spam comments, and trashed comments. Published posts, pages, custom post types, and active comments are never touched. Always run a backup before any cleanup operation as a precaution.

= Does the free version require an account or external service? =

No. The free version is 100% self-contained with no external server calls. Everything runs locally on your WordPress installation.

= What does the performance score measure? =

The score (0-100) is based on three factors: how many optimizations are enabled, number of scripts and styles loaded on your site, and how much WordPress bloat has been removed. It gives you a quick snapshot of your site's optimization level. For real-world performance numbers (Core Web Vitals, Lighthouse scores), use Google PageSpeed Insights — this score is meant to track which knobs you have turned on, not measure end-user experience directly.

= What PHP version is required? =

PHP 7.4 or higher. WordPress 6.0 or higher.

== Screenshots ==

1. Dashboard view — performance score ring (A-F grade), enabled optimizations summary, and quick-action stats
2. Optimization toggle cards for lazy loading, HTML minification, and JavaScript deferral with descriptive helper text
3. Bloat removal section — 10 individual toggles for WordPress default features you can selectively disable
4. Database cleanup grid — counts of revisions, auto-drafts, transients, spam comments with one-click clean buttons
5. Settings page — full configuration with custom JS exclusions, email report frequency, and per-feature options
6. First-run animated scanning experience that walks new users through detection of their site's current state
7. Weekly email performance report with score trend, page weight reduction, and prioritized recommendations

== Changelog ==

= 1.0.0 =
* Initial release
* Lazy loading for images, iframes, and background images via Intersection Observer
* HTML minification with content preservation
* JavaScript deferral with per-script exclusion support
* 10 individual WordPress bloat removal options
* Database cleanup for 6 item types
* Performance scoring (0-100) with letter grades
* Email report digests (daily/weekly/monthly)
* Dark theme admin dashboard
* WordPress dashboard widget
* Pro bridge hooks for premium add-on

== Upgrade Notice ==

= 1.0.0 =
Initial release of A. Smith Speed Optimizer.
