Humblechildish Media Optimizer

By humblechildish

0+ active installationsVersion 1.0.0

A powerful, secure WordPress media optimization plugin. Auto-compress images, convert to WebP, smart lazy loading, and CDN integration.

Description

Humblechildish Media Optimizer is a modern, lightweight, and security-first media optimization plugin designed to dramatically improve your website loading speed and Core Web Vitals (especially LCP & CLS) without external API subscriptions.

Everything runs on your server using native WordPress APIs (WP_Image_Editor with Imagick or GD). No external third-party servers, no hidden monthly fees, and zero data leakage.

🚀 Key Features

  • 🗜️ Automatic Image Compression: Automatically optimizes JPEG, PNG, and WebP images on upload using customizable quality levels (default 82).
  • 📸 Next-Gen Image Formats: Effortlessly generate .webp and .avif versions alongside your original media.
  • 💤 Smart Native Lazy Loading: Adds native loading="lazy" to images and iframes (the_content and WordPress media attributes).
  • ⚡ LCP Optimization: Intelligently excludes the first 2 above-the-fold images and tags the primary candidate with fetchpriority="high".
  • 🌐 CDN URL Rewriting: Seamlessly rewrites asset URLs to point to your preferred CDN pull-zone (Cloudflare, BunnyCDN, KeyCDN, etc.).
  • 🔒 Security-Focused: Strict MIME-type validation via wp_check_filetype_and_ext(), path traversal protection, strict nonce checks, and zero system shell execution (exec / shell_exec).
  • 🌍 WordPress Multisite Compatible: Full network-activation support and safe uninstallation cleanup.

Installation

Automatic Installation (Recommended)

  1. Log in to your WordPress admin dashboard.
  2. Navigate to Plugins > Add New Plugin.
  3. Search for Humblechildish Media Optimizer.
  4. Click Install Now, then click Activate.
  5. Go to Settings > Media Optimizer to configure your options.

Manual Installation (.zip Upload)

  1. Download the plugin zip file from WordPress.org.
  2. In your WordPress admin dashboard, navigate to Plugins > Add New Plugin > Upload Plugin.
  3. Choose the downloaded zip file and click Install Now.
  4. Activate the plugin and configure it under Settings > Media Optimizer.

FAQ

Does the plugin require any external API key or third-party subscription?

No! The plugin operates 100% locally on your WordPress host server using the built-in WP_Image_Editor (Imagick or GD extension). There are no third-party API limits or subscriptions.

Does the plugin overwrite my original images?

Yes, it optimizes images in-place to save disk storage while creating parallel .webp copies. We always recommend backing up your wp-content/uploads/ directory before enabling image compression.

Does it support AVIF format?

Yes, provided your host server supports AVIF encoding through ImageMagick or PHP GD >= 8.1. The plugin automatically checks your server environment and notifies you if AVIF is supported.

How does the CDN integration work?

When enabled, the plugin hooks into frontend filters (the_content, wp_calculate_image_srcset, wp_get_attachment_url) and replaces your uploads URL with your configured CDN URL. Only https:// CDN URLs are accepted.

Will it break images on old browsers without lazy load support?

No. The plugin includes a lightweight JavaScript fallback utilizing the Intersection Observer API for legacy browsers, with graceful degradation.

Changelog

1.0.0

  • Initial public release.
  • Automated image compression on upload.
  • WebP & AVIF parallel generation.
  • Core Web Vitals LCP optimization with fetchpriority="high".
  • Native lazy loading for images and iframes.
  • CDN URL rewriting support.
  • Optional clean uninstall that removes all plugin options.