Web Optimizer
Contributors: lotgrafix
Tags: performance, optimization, security, webp, avif, svg, caching, headers
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
Speed up your site with WebP and AVIF conversion, SVG support, CSS minification, script deferral, HSTS, security headers, and browser caching.
== Description ==
Web Optimizer is a comprehensive performance, security, and media optimization plugin for WordPress. It converts images to WebP and AVIF, adds native SVG support, minifies CSS, defers JavaScript, sets browser caching rules, and enforces HSTS, HTTPS redirects, and modern security headers. Every feature operates independently through modular controls, so you can tune your site without editing theme files.
== Features ==
🔐 Security & Delivery
– HTTP Strict Transport Security (HSTS): Enforces `Strict-Transport-Security` headers on HTTPS connections.
– Canonical HTTPS & Domain Redirection: Forces secure HTTPS redirects and removes `www` prefixes to maintain a clean canonical URL structure.
– HTTP Security Headers & CSP: Sets `X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`, `Permissions-Policy`, `COOP`, `COEP`, and a pre-configured Content Security Policy (CSP).
⚡ Performance & Resource Optimization
– Smart Resource Hints Filtering: Filters `dns-prefetch` and `preconnect` hints to include only external domains actually referenced by enqueued scripts and styles.
– Custom Preconnect Domains: Allows manual specification of extra external origin domains for preconnecting.
– Script Optimization & Deferral: Switches jQuery core and migrate scripts to minified production versions and appends `defer` strategy attributes to front-end scripts.
– CSS Minification & Clean Loading: Automatically compiles `style.css` into a minified `style.min.css` file and suppresses the unminified parent stylesheet tag.
– Asynchronous Non-Critical CSS: Preloads non-critical stylesheets while preserving inline critical theme CSS.
– Browser Caching Rules: Sets optimal `Cache-Control` response headers for static images, fonts, scripts, stylesheets, and dynamic HTML (disabling caching automatically for logged-in users).
– HTML & Resource Cleanup: Removes empty “ tag.
🖼️ Media, Modern Formats & SEO
– WebP & AVIF Generation: Automatically converts JPEG and PNG uploads into WebP and AVIF formats using ImageMagick or GD.
– Attachment Metadata & Text Preservation: Synchronizes ALT tags and titles from original images during format conversion.
– Quality Adjustment & Compression: Customizable image compression quality applied across primary files and thumbnail sizes.
– Disk Space Saver: Optional automatic deletion of original JPEG/PNG files after successful conversion.
– Native SVG Support: Enables SVG uploads in the Media Library, calculates real dimensions from SVG XML/viewBox markup, and fixes admin preview layouts.
– Dynamic Image Optimization: Automatically assigns `fetchpriority` (“high” for logos/headers, “low” for rest) and native `loading` (“eager” vs “lazy”) attributes while generating fallback ALT text.
– Priority Image Preloading: Inserts `` elements for custom logos and custom header images in the document `
– Open Graph Integration: Injects `og:image`, dimensions, dynamic ALT attributes, and `og:updated_time` metadata for social platforms.
– Google Search Favicon Fix: Adjusts default `site_icon` output to target Google’s recommended `48×48` dimensions.
== Installation ==
1. Upload the plugin files to the `/wp-content/plugins/lotgrafix-weboptimizer` directory, or install directly through the WordPress plugins panel.
2. Activate the plugin via the ‘Plugins’ menu in WordPress.
3. Go to **LOT Grafix → Web Optimizer** in the admin dashboard to configure settings.
4. Enable or disable desired modules and save your changes.
== Frequently Asked Questions ==
= Does this plugin edit my theme files? =
No. All CSS minification, script deferral, and HTML cleanup actions take place dynamically on output without editing theme source files.
= How does WebP and AVIF conversion work? =
When an image is uploaded, the plugin processes it using your server’s ImageMagick or GD library, generating WebP and AVIF versions according to your quality settings.
= Can I delete original uploaded JPEGs or PNGs? =
Yes. Enabling the original image deletion feature will remove the original JPG/PNG files and retain the primary converted format under the same attachment ID.
= What happens if an image format conversion fails? =
If a format fails to generate, the plugin preserves the original source file to prevent broken images.
= How does SVG handling work? =
The plugin permits SVG uploads, parses width and height attributes or viewBox boundaries, and adjusts WordPress attachment metadata so SVG images display correctly in the media library and content area.
= Does AutoCaptcha work with page caching plugins? =
Yes.
== External services ==
This plugin includes the LOT Grafix dashboard, which connects to an external service to display the list of other LOT Grafix plugins.
= LOT Grafix Plugin List =
– Service: https://wp-plugins.lotgrafix.workers.dev (hosted on Cloudflare Workers, operated by LOT Grafix, Inc.)
– Purpose: retrieves the list of available LOT Grafix plugins shown on the LOT Grafix admin page.
– Data sent: no personal or user data is sent. As with any HTTP request, the server receives your site’s IP address and the standard WordPress User-Agent, which includes your site URL.
– When: only when an administrator opens the LOT Grafix admin page and the cached list (1 hour) has expired.
– Terms of Service: https://lotgrafix.com/terms-of-service/
– Privacy Policy: https://lotgrafix.com/privacy-policy/
– Hosting provider (Cloudflare) Terms: https://www.cloudflare.com/website-terms/
– Hosting provider (Cloudflare) Privacy: https://www.cloudflare.com/privacypolicy/
== Screenshots ==
1. Web Optimizer control panel dashboard.
2. Security, performance, and cache settings menu.
3. Modern image conversion and media options.
== Changelog ==
= 1.0.0 =
* Initial stable release.
* Added HSTS, force HTTPS, and security headers support.
* Added CSS minification, async stylesheet loading, and script deferral features.
* Added automated HTML tag cleanup and script consolidation.
* Added Open Graph and Favicon optimizations.
* Added WebP, AVIF, and native SVG media processing modules.
== Upgrade Notice ==
= 1.0.0 =
Initial stable release.


