=== Auto WebP Converter & Logger ===
Contributors: babapinnak
Tags: webp, image conversion, image optimization, media, compression
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 1.4
Requires PHP: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically converts uploaded JPEG and PNG images to WebP format for faster performance and logs conversions for transparency.

== Description ==

Auto WebP Converter & Logger is a lightweight, powerful plugin designed to optimize your website's media library. It automatically converts JPEG and PNG images to the WebP format during upload — significantly reducing file size without sacrificing quality. It also logs each conversion (or failure) and supports uploads from both the Media Library and third-party plugins like Instant Images.

**Key Features:**

- **Automatic WebP Conversion:** Converts JPEG and PNG images to the WebP format on upload.
- **Custom Quality Setting:** Define your preferred WebP image quality (0-100).
- **Original File Handling:** Choose whether to delete the original JPEG/PNG after successful conversion.
- **Detailed Logging:** Enable logging of all conversions and errors in a secure log file.
- **GD Library Check:** Automatically detects if the GD library is missing and shows admin notices.
- **Secure and Optimized:** Only images smaller than 10MB are processed for optimal performance.
- **Admin Settings Panel:** Easy-to-use settings page under WordPress Settings > Images to WebP.

**Important:**  
Requires the GD library with WebP support enabled on your server.

== Installation ==

1. Upload the `auto-webp-converter-logger` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to 'Settings' > 'Images to WebP' to configure your preferences.

== Frequently Asked Questions ==

= What image formats does this plugin convert? =

Currently, it supports JPG, JPEG and PNG images.

= Where is the WebP conversion log saved? =

The plugin creates a `autoweco-webp-conversion-log.txt` file inside the `uploads` folder (wp-content/uploads).

= Can I delete the original images after conversion? =

Yes, you can enable or disable this option in the plugin settings.

= What if my server does not support WebP? =

If the required GD library functions are missing, the plugin will display an admin notice. In that case, image conversion will not work.

= What happens if the uploaded file is too large? =

Images larger than 10MB are automatically skipped for performance reasons. The event is logged if logging is enabled.

= Will this work with third-party image upload plugins like Instant Images? =

Yes — the plugin ensures the correct MIME type is saved even if uploads bypass the default flow.


== Changelog ==

= 1.4 =
* Fixed MIME type issue when using external uploaders like Instant Images.
* Added `add_attachment` hook to ensure WebP files are properly stored with correct metadata.
* Improved compatibility and safety during upload process.
* Cleaned up logging and fallback handling.

= 1.3 =
* Updated log file path to comply with WordPress.org directory requirements.
* Removed `load_plugin_textdomain()` for compatibility with WordPress 4.6+.
* Ensured log directory is created automatically if it doesn’t exist.
* Minor code cleanup and adherence to WordPress plugin development standards.

= 1.2 =
* Updated text domain for WordPress.org compatibility.
* Improved MIME type validation during uploads.
* Safer file handling and better permission checks.
* Admin notices added for missing GD library.
* Minor security and performance improvements.

= 1.0 =
* Initial release of Auto WebP Converter & Logger.
* Converts JPEG/PNG to WebP during upload with logging options.

== Upgrade Notice ==

= 1.4 =
Highly recommended update: fixes MIME type issues with third-party plugins, improves metadata handling, and ensures full compatibility with external uploaders.
