=== One2Image – Image Optimizer ===
Contributors: kameltalbi
Tags: image optimizer, compress images, webp, resize, browser based
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Compress, resize and convert WordPress images directly in your browser, without an external image-processing service. Free. No API key.

== Description ==

One2Image – Image Optimizer compresses, resizes and converts WordPress media in your browser. Unlike cloud image APIs, processing runs locally in the browser Canvas — images are never sent to One2Image for optimization.

**What makes it different**

* Browser-based compression, resize and format conversion (JPEG / PNG / WebP)
* No external image-processing service, API key, account, or quota
* Original Media Library files stay intact — saves create a new attachment
* Works for roles that can upload media; site-wide settings require an administrator

**Local processing**

* Image processing happens locally in your browser.
* Your images are never sent to One2Image.
* No One2Image API key, account, subscription, or quota is required.
* The only network transfer in the main workflow is between your browser and your own WordPress site, when you choose to save.

**Features**

* Dashboard with library stats (no invented “potential savings”)
* Media Optimizer table with filters and search
* Quick Optimize / batch (up to 20 images, sequential)
* Smart format selection (keeps the lightest real result; skips if nothing is smaller)
* Manual optimize: compress, resize, convert (JPEG/PNG/WebP), rotate
* Save as a new Media Library attachment (original always stays intact)
* Settings for quality, max width, preferred format, batch size (administrators only)

**Privacy**

Canvas re-encoding typically strips embedded EXIF / IPTC / XMP metadata. WordPress attachment fields (title, alt text, caption, description) are copied to the new image when you save.

== Installation ==

1. Upload the `one2image` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add Plugin → Upload Plugin.
2. Activate **One2Image – Image Optimizer**.
3. Open **One2Image → Dashboard** in the admin sidebar.
4. Click **Optimize Media Library**, select images, then **Quick Optimize**.

== Frequently Asked Questions ==

= Are my images uploaded to One2Image? =

No. Processing runs in your browser. Images are never sent to One2Image. When you save, the optimized file is uploaded only to your own WordPress site.

= Do I need an API key or account? =

No. The plugin is free and works without an account, API key, or subscription.

= Does it replace my original image? =

No. It only creates a new Media Library attachment. The original remains unchanged.

= Why was an image skipped? =

Quick Optimize only saves a new file when the result is actually smaller than the original.

= Does it optimize uploads automatically? =

Not yet. The setting is reserved for a future version.

= Who can change plugin settings? =

Only users with the `manage_options` capability (typically Administrators). Editors and Authors can still optimize media they can edit.

== Development ==

Human-readable JavaScript / TypeScript sources ship with the plugin in `src/`.

Compiled assets under `assets/js/` are produced with esbuild (see `package.json`).

Rebuild:

1. `npm install`
2. `npm run build:js`

`media-bridge.js` is maintained as readable JavaScript and is not built from TypeScript.

Translations for WordPress.org are managed on translate.wordpress.org (Text Domain: `one2image`).

== Screenshots ==

1. One2Image Dashboard
2. Media Optimizer table and Quick Optimize
3. Manual single-image optimizer

== Changelog ==

= 1.3.0 =
* WordPress.org pre-review: Contributors set to submitting account; settings require manage_options
* Include human-readable JS/TS sources and package.json in the distribution ZIP
* Remove bundled fr_FR translation files (use translate.wordpress.org)
* Document browser-based local processing and the Development build steps

= 1.2.6 =
* Plugin Check cleanup for WordPress.org (translator comments, WP upload/delete APIs, automatic textdomain loading, safer Media Library DOM)
* Plugin URI removed so it is not identical to Author URI

= 1.2.1 =
* Suggest optimization after image upload (Media Library, Featured Image, Gutenberg via REST)
* Batch upload suggestion (single notice, Optimize all / Review / Not now)
* Setting: Suggest optimization after image upload (on by default)
* Automatic optimize on upload remains Coming soon

= 1.1.1 =
* Batch completion UX: success state, clear selection, refresh list, view optimized / optimize more
* Distinguish optimized / skipped / failed in batch summary

= 1.1.0 =
* Top-level One2Image admin menu (Dashboard, Media Optimizer, Settings)
* Library table with filters, search, pagination
* Quick Optimize batch (max 20, sequential, local)
* Smart result selection (skip if not smaller)
* Real optimization stats via attachment meta
* Settings page

= 1.0.0 =
* Initial release
* Compress, resize, convert (JPEG/PNG/WebP), rotate
* Local browser processing
* Save as new Media Library image

== Upgrade Notice ==

= 1.3.0 =
WordPress.org pre-review compliance: settings restricted to administrators; sources included in the package. Processing remains local in the browser.

= 1.2.6 =
WordPress.org Plugin Check compliance fixes. Image processing remains local in the browser.

= 1.2.1 =
Adds an after-upload optimization suggestion. Processing stays in your browser.

= 1.1.1 =
Improves the batch completion experience after Quick Optimize.

= 1.1.0 =
Adds Dashboard, Media Optimizer batch, and Settings. Originals remain untouched.

== Privacy ==

This plugin does not phone home. It does not embed advertising trackers, analytics beacons, or telemetry to One2Image.

Optional links to one2image.com / one2pdf.com are voluntary navigation only and use non-personal UTM parameters (`utm_source=wordpress_plugin`).

When you click **Save as new image** (or batch save), the optimized file is sent from your browser to your WordPress site using the WordPress REST API on your domain.
