=== Watermark on Upload ===
Contributors: snehalpancholi
Tags: watermark, image watermark, media, upload, copyright protection
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically apply a configurable text or image watermark to every JPEG/PNG image at upload time, while preserving the original for easy restoration.

== Description ==

**Watermark on Upload** protects your images the moment they land in your media library. Configure a text copyright notice or an image watermark, choose its position, opacity and size, and every new upload is branded automatically — no manual steps required.

Original copies of every watermarked image are saved so you can restore the unwatermarked version at any time with one click.

**Key Features**

* Auto-watermark on upload — works silently in the background.
* Text watermark — custom text, colour, opacity, font size, and 9-position placement.
* Image watermark — use any PNG/JPEG from your media library, scaled to a percentage of the image width.
* GD and Imagick support — uses Imagick when available for best text rendering, falls back to GD for maximum compatibility.
* Original backup — every watermarked image has its unwatermarked original saved automatically.
* One-click restore — remove the watermark and restore the original from the admin panel.
* Bulk watermark — apply to your entire existing media library in batches.
* Live admin preview — instant CSS preview while you adjust settings; server-side before/after preview using any attachment ID.
* Minimum dimension filter — skip thumbnails and tiny images automatically.
* Lightweight — zero front-end output, assets loaded only on the plugin admin page.
* GPL-2.0+ — suitable for WordPress.org distribution and commercial use.

== Installation ==

1. Download the plugin ZIP file.
2. In your WordPress admin, go to **Plugins → Add New → Upload Plugin**.
3. Upload the ZIP and click **Install Now**.
4. Click **Activate Plugin**.
5. Navigate to **Media → Watermark Settings** to configure your watermark.

**Manual Installation**

1. Unzip and upload the `watermark-on-upload` folder to `/wp-content/plugins/`.
2. Activate the plugin from the **Plugins** menu.
3. Go to **Media → Watermark Settings**.

== Frequently Asked Questions ==

= Can I restore the original unwatermarked image? =

Yes. Every image watermarked by this plugin has its original saved as a backup file (e.g. `image-original.jpg` alongside `image.jpg`). Go to **Media → Watermark Settings → Restore Originals** and click the **Restore Original** button next to any image. The main attachment file is overwritten with the backup and the watermark meta is cleared.

= Does watermarking affect thumbnails and other image sizes? =

By default, only the original uploaded file is watermarked. WordPress generates thumbnails from the (already watermarked) original after upload, so all sizes inherit the watermark. You can change this behaviour in **Settings → Apply To**: choose *Original file only* (default), *Original + all generated thumbnails*, or *Do not auto-watermark* to use the bulk tool manually.

= What image formats are supported? =

JPEG and PNG. GIF and WebP are not currently processed to avoid quality loss and compatibility issues.

= Does it work without GD or Imagick? =

The plugin requires either the PHP GD extension or the PHP Imagick extension. GD is bundled with most PHP installations. If neither is available the watermark will not be applied but images will still upload normally.

= Will the watermark appear on the front end of my site? =

Yes — the watermark is baked into the image file itself, so it appears wherever the image is displayed.

= Can I use a PNG logo as the watermark? =

Yes. Under **Watermark Type**, choose **Image**, then select any PNG or JPEG from your media library. The plugin respects transparency in PNG watermarks.

= Does it slow down uploads? =

The watermark is applied synchronously during upload. For typical web images the overhead is negligible (under 200 ms). Very large images or low-powered servers may take slightly longer.

= Can I watermark images that were uploaded before I installed the plugin? =

Yes. Use the **Bulk Watermark** tab on the settings page to process your existing media library in batches of five at a time.

== Screenshots ==

1. Settings page — general options and watermark type selector.
2. Text watermark panel — text, colour, opacity, font size, and position grid.
3. Image watermark panel — media library picker, opacity, and scale controls.
4. Live CSS preview — instant visual feedback while adjusting text watermark settings.
5. Server-side before/after preview — accurate render using a real image.
6. Bulk Watermark tab — progress bar and per-image result log.
7. Restore Originals tab — list of watermarked images with one-click restore.

== Changelog ==

= 1.0.0 =
* Initial release.
* Text and image watermark support.
* GD and Imagick backends.
* Original file backup and one-click restore.
* Bulk watermark with progress bar.
* Live CSS preview and server-side before/after preview.
* Auto-update check via AddonLogic update server.

== Upgrade Notice ==

= 1.0.0 =
Initial release. No upgrade steps required.
