Running entirely in the background through WordPress Cron, Image Optimizer helps reduce storage usage, lower bandwidth consumption, and improve page loading performance while preserving image quality and original file formats. This release also introduces automatic upload directory cleanup when a manga is permanently deleted, keeping your media storage clean and organized.
Image Optimizer Module
Version 2.7.3 introduces a fully automated background image optimization system.
Approximately 65 seconds after a new chapter is published, WordPress Cron automatically processes its local images using native PHP GD. No external optimization plugins or additional server software are required.
Flexible Optimization Settings
Image Optimizer includes four new configuration options within Theme Settings.
Administrators can enable or disable the optimizer, configure the maximum image width between 400 and 2000 pixels, adjust JPEG and WebP quality from 40% to 100%, and specify PNG compression levels from 0 to 9 to balance visual quality and storage efficiency.
Smart Resize
The optimizer only resizes images when necessary.
Images exceeding the configured maximum width are proportionally scaled down to reduce file size, while smaller images retain their original dimensions and are simply recompressed. This approach preserves image quality while avoiding unnecessary resizing operations.
Full Alpha Channel Preservation
PNG and WebP images maintain complete transparency throughout the optimization process.
By preserving the alpha channel during resizing, Init Manga eliminates the black background artifacts commonly produced by less sophisticated image processing tools, ensuring transparent graphics remain visually correct.
Format-Aware Processing
Every image is processed according to its actual file format rather than its filename extension.
Using MIME type detection through getimagesize(), Image Optimizer accurately identifies JPEG, PNG, and WebP files before writing them back in their original formats, preventing unwanted format conversions and preserving maximum compatibility.
Automatic Upload Cleanup
Version 2.7.3 also improves long-term storage management.
When a manga is permanently deleted, Init Manga automatically removes its corresponding upload directory located under /uploads/init-manga/{manga_id}/, preventing orphaned chapter images from occupying unnecessary disk space.
Safe Directory Removal
Directory deletion is protected by multiple security safeguards.
Every path is verified using realpath(), and removal is strictly limited to directories located inside /uploads/init-manga/. Any attempt to access parent directories or perform directory traversal outside the designated upload location is rejected unconditionally.
Optimized Performance from Upload to Cleanup
Init Manga v2.7.3 goes beyond simple image compression by delivering a complete image lifecycle management solution. With automatic background optimization, intelligent resizing, transparency preservation, format-aware processing, and secure storage cleanup, this release further strengthens Init Manga as a high-performance WordPress platform for modern Manga and Novel websites.
Comments