=== Simosa Image Optimization Studio ===
Contributors: vynatics
Tags: image optimization, webp, compression, media library, performance
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A native WordPress image optimization and delivery studio for WebP/AVIF conversion, bulk processing, reporting, and controlled lazy loading.

== Description ==

Simosa Image Optimization Studio is a local-first WordPress plugin. Core image optimization does not require an external API; OpenRouter is optional and used only when AI ALT generation is enabled.

Core features:

* Simple Mode by default with Overview → Optimize → Media Health → Reports.
* One-click “Fix Everything Safely” workflow with automatic before/after reporting.
* Recommended, Maximum Performance, and Maximum Quality optimization profiles.
* Expert Mode keeps all technical media, delivery, AI, cleanup, diagnostic, and CDN controls available without cluttering the default experience.

* Automatic WebP generation for new JPEG and PNG uploads.
* Converts the original attachment, WordPress thumbnails, and custom registered image sizes.
* Bulk optimization studio with pause and resume controls.
* Re-optimization using current quality settings.
* Unified teal product dashboard with estimated transfer reduction, coverage, activity, diagnostics, and Lazy Loading Manager access.
* Dedicated Lazy Loading Manager with Native Browser, Smart Hybrid, and Intersection Observer engines.
* Interactive placeholders, trigger distance/threshold controls, reveal effects, LCP safeguards, exclusions, and WordPress/WooCommerce rules.
* Media Library optimization status and per-image actions.
* Dedicated ALT Text Manager with selectable Smart Local or OpenRouter AI Vision generation, bulk apply/edit/decorative workflows, and automatic processing for new uploads.
* Missing ALT integration in Advanced Media with status badges, a dedicated filter tab, and one-click ALT repair.
* Frontend WebP/AVIF delivery through native WordPress URL, image source, srcset, rendered HTML filters, root-relative upload URLs, and page-builder/CDN-host path recovery.
* CDN & Remote Optimization manager with Custom/Pull CDN, Cloudflare, Bunny CDN, and CloudFront purge support, connection tests, safe origin fallback, and rewrite controls.
* Optional original JPEG/PNG compression.
* Optional protected backups before destructive source compression.
* Restore generated WebP/AVIF variants and source backups.
* Native AJAX batching with nonces and capability checks.
* WP-CLI commands for large libraries.
* Optional CDN delivery and remote optimization with provider-aware cache purge controls; no third-party PHP SDK is bundled.

== Installation ==

1. In WordPress, open Plugins > Add New > Upload Plugin.
2. Upload `simosa-image-optimization-studio.zip`.
3. Activate Simosa Image Optimization Studio.
4. Open Simosa Image Optimization Studio > Diagnostics and confirm WebP support and uploads permissions.
5. Review Simosa Image Optimization Studio > Settings.
6. Configure Simosa Image Optimization Studio > Lazy Loading Manager.
7. Open Optimization Studio and process the existing Media Library.

== Recommended First-Run Settings ==

* WebP quality: 82
* Automatic optimization: Enabled
* Frontend WebP delivery: Enabled
* Rendered HTML rewrite: Enabled
* Original source compression: Disabled initially
* Protected backups: Enabled
* Batch size: 3 to 5 on shared hosting, 10 to 20 on dedicated hosting

== WP-CLI ==

Optimize attachments not previously processed:

`wp vyntic optimize`

Re-optimize every eligible attachment:

`wp vyntic optimize --all`

Limit the run:

`wp vyntic optimize --all --limit=100`

Restore one attachment:

`wp vyntic restore 123`

Show statistics:

`wp vyntic stats`

== File Model ==

The plugin creates WebP files by replacing the source extension:

* `photo.jpg` becomes `photo.webp`
* `photo-300x200.jpg` becomes `photo-300x200.webp`
* `graphic.png` becomes `graphic.webp`

Original files are retained unless source compression is explicitly enabled.

== Compatibility Notes ==

Vyntic rewrites standard WordPress attachment URLs, responsive srcset candidates, rendered image tags, post content, widget text content, and featured image HTML.

Vyntic rewrites standard and page-builder-rendered upload URLs, including alternate hosts when the URL path still maps to the WordPress uploads directory. Images embedded inside third-party external CSS files or opaque JavaScript payloads may still require that builder/cache layer to regenerate after optimization; Simosa clears common compatible caches automatically when a bulk run completes.

== Security ==

* All administrative AJAX actions require a WordPress nonce.
* User capabilities are checked before optimization or restore actions.
* Settings use an admin capability and nonce.
* Backups are protected with Apache and IIS deny rules when the hosting stack honors those files.
* No images or site data are transmitted to external services.

== Uninstall ==

By default, deleting the plugin keeps optimization data and generated files.

Enable "Remove plugin data and generated variants on uninstall" in Settings before deleting the plugin to remove:

* Generated WebP/AVIF files
* Optimization metadata
* Log table
* Plugin settings
* Backup directory

== Troubleshooting ==

If bulk optimization stops, Simosa now reports the server response and a request ID in the dashboard. Check Simosa Image Optimization Studio > Diagnostics first. When WordPress debug logging is enabled, matching technical details are written to `wp-content/debug.log`.

The most common server requirements are:

* GD or Imagick compiled with WebP write support.
* A writable WordPress uploads directory.
* Enough PHP memory for the dimensions of the image being processed.

== Changelog ==

= 1.0.0 =
* Re-baselined the Simosa package as version 1.0.0.
* Standardized the plugin text domain to `simosa-image-optimization-studio` across all translatable strings.
* Removed placeholder Plugin URI and Author URI headers that used a discouraged example domain.
* Prepared a clean WordPress.org Plugin Check compliance release without changing core optimization behavior.

= 1.5.1 =
* Setup Wizard now launches after plugin activation and renders as a full-screen wizard-only experience.
* Added One-click Compatible Setup to Overview and the persistent Simosa header.

= 1.5.0 =
* Added Conflict Detection, Optimization Plan + Safe Auto Fix, Before/After Reporting, Onboarding Wizard and One-click Recommended Setup.
* Added compatibility-first recommended settings and safe automation guardrails.


= 1.4.0 =
* Adds Simosa Media Intelligence: Image SEO, Image Performance, Safe Media Cleanup, Frontend Media Scanner and Media Tools.
* Adds OpenRouter AI metadata, AI budget/usage controls and a background ALT generation queue.
* Adds responsive image generation, focal point + AI subject detection, focal cropping and Visual Quality Guard.
* Adds broken-image/reference scanning, sanitized SVG uploads, HEIC/HEIF conversion, WooCommerce safeguards and page-builder awareness.
* Adds S3-compatible/R2/Spaces/Bunny offload, optional remote media serving, CDN warmup and Image Delivery Debugger.


= 1.3.17 =
* Added selectable ALT generation engines: Local · Smart Local and AI · OpenRouter Vision.
* Added server-side OpenRouter image-understanding integration for actual visual ALT generation, with configurable API key, model, timeout, response-token limit, context sharing, and Local fallback.
* Added OpenRouter connection testing that validates the configured model is available for image input.
* Added automatic ALT generation for new uploads using the selected engine; AI generation is queued through WordPress Cron to avoid blocking the upload request.
* Added AI source/fallback tracking to ALT suggestions and generated ALT status across the manager and Advanced Media Inspector.
* Added OpenRouter privacy/usage warnings and confirmations for AI bulk generation because image data is sent to OpenRouter/model providers and provider charges may apply.

= 1.3.16 =
* Added a dedicated ALT Text Manager page with missing-ALT inventory, search/filtering, manual editing, local suggestions, bulk processing, decorative-image state, and high-confidence auto-fix.
* Added ALT Text settings for upload automation, source selection, preservation rules, maximum length, decorative handling, and confidence threshold.
* Added Missing ALT support to Simosa Advanced Media with badges, a dedicated tab, quick repair actions, Inspector ALT editing/generation, and a Generate & apply ALT bulk action.
* Added Auto ALT to Upload Defaults in both Advanced Media and the Simosa Media Workspace, plus a Missing ALT count on the Overview dashboard.
* Smart Local ALT generation remains available as the fully local engine; OpenRouter AI Vision is optional in 1.3.17.

= 1.2.8 =
* Added custom WordPress-backed Media Library with drag-and-drop uploads, filters, bulk optimization and restore actions.
* Rebuilt Exclusions to the SaaS template with WordPress-aware runtime rules, rule builder, conflict scan, test, export and reset tools.
* Added thumbnails to Analytics recent operations.


= 1.0.4 =
* Rebranded the complete admin experience around the supplied Simosa logo and color system.
* Added a full-screen commercial application shell with a dedicated Simosa sidebar and top navigation.
* Hid the default WordPress admin sidebar, toolbar, footer, and screen controls only on Simosa plugin screens.
* Added direct return links to the WordPress Dashboard and Media Library inside the Simosa navigation.
* Added the supplied Simosa mark as the WordPress admin-menu icon.
* Added responsive mobile navigation, focus states, and improved app-level accessibility.

= 1.0.3 =
* Replaced extension-based palette detection with content-based JPEG/PNG decoding.
* Normalized every indexed GD resource to true color before WebP encoding, including renamed and mismatched-extension files.
* Added direct guarded GD and Imagick conversion engines to avoid the unsafe WordPress/GD palette save path.
* Prevented other plugins from remapping source-compression output to WebP before Simosa normalization.
* Recovered structured fatal-error JSON appended after WordPress critical-error HTML.
* Added per-attachment fatal isolation so one server-level image failure is skipped and the bulk queue continues.

= 1.0.2 =
* Fixed indexed/palette PNG conversion by normalizing to true-color RGBA.
* Prevented palette-image failures from stopping the remaining bulk queue.
* Changed generated filenames to canonical `.webp` extension replacement.
* Migrated legacy `.jpg.webp` and `.png.webp` files automatically.
* Fixed repeated `.webp` suffixes and made frontend URL rewriting idempotent.

= 1.0.1 =
* Fixed bulk optimizer requests that could return an HTML critical-error page instead of JSON.
* Added guarded JSON responses for PHP exceptions and fatal errors.
* Added WebP and uploads-directory preflight checks.
* Added actionable HTTP/server error reporting with request IDs.
* Added adaptive batch timeout protection and live session savings.

= 1.0.0 =
* Initial commercial release.
* Added automatic and bulk WebP generation.
* Added modern optimization dashboard and studio.
* Added Media Library actions, restoration, logs, settings, diagnostics, and WP-CLI.
