WP Manifestindependent plugin directory
manifest / media / wp-plugin-for-image-compression

Media Compressor Pro

Upload photos/videos of any extension with a compression + format option, and change format anytime afterwards — the plugin regenerates the file and updates every reference to it across posts, pages, custom post types, and the database.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/dhan2501/wp-plugin-for-image-compression/archive/refs/heads/main.zip
Updates itself. It ships its own updater, so new versions appear under Dashboard → Updates.

A custom WordPress plugin for uploading photos/videos of any extension with a compression + format option, and changing that format later across the whole site.

INSTALL

  1. Zip this folder (media-compressor-pro) if it isn't already.
  2. WP Admin > Plugins > Add New > Upload Plugin > choose the zip > Install > Activate.
  3. Go to Settings > Media Compressor Pro to set your site-wide defaults (compression quality, default format, FFmpeg path).

HOW IT WORKS

  1. UPLOAD TIME Go to Media > Add New (or the "Add Media" button in the block editor). A box appears above the drop zone letting you pick, for this batch of uploads:

    • Image compression level (quality 40-95)
    • Convert images to JPG / PNG / WebP / keep original
    • Video compression level (low/medium/high, needs FFmpeg)
    • Convert video to MP4 / WebM / keep original Any file extension is accepted (jpg, png, webp, avif, heic, bmp, tiff, gif, mp4, mov, webm, mkv, avi, 3gp, wmv, flv...).
  2. CHANGING FORMAT/COMPRESSION LATER Open any image/video in the Media Library and click "Edit", or use the new "Change format / compression" link under the file in the list view. Pick a new format/quality and save. The plugin:

    • Re-encodes the actual file on disk
    • Regenerates all thumbnail sizes (images) or the video file
    • Updates the attachment's own database row (file path, mime type, URL/guid)
    • Scans post_content/post_excerpt and postmeta of EVERY post type (posts, pages, and any custom post type) and rewrites the old URL to the new one, including inside serialized data used by ACF fields, page builders, galleries, etc.

REQUIREMENTS / HONEST LIMITATIONS

  • Images: needs PHP's GD or Imagick extension. Nearly every WordPress host has one of these already; Settings page will warn you if not.
  • Video: needs FFmpeg installed on the server and shell_exec enabled in PHP. Many shared hosts disable shell_exec or don't have FFmpeg installed — if so, videos are simply uploaded/kept as-is with no error (the plugin fails gracefully, it won't break uploads).
  • Large videos: transcoding is CPU/time intensive. On shared hosting this can hit PHP's max_execution_time. For production use with lots of video, consider pointing "Change format" at a queue/cron job instead of doing it synchronously (this plugin runs it inline for simplicity — ask if you want a background-job version).
  • DB rewriting covers post_content, post_excerpt, and postmeta (including serialized values). It does NOT rewrite raw URLs saved inside options tables, external caches, CDNs, or search index plugins. For a large/complex site, running "Better Search Replace" afterwards as a safety net is recommended — it's a mature, dedicated plugin for exactly this kind of serialized-data-safe replacement.
  • If ShortPixel or Imagify is active, this plugin defers its own image compression to them (toggle in Settings) so files aren't compressed twice.

FILES

media-compressor-pro.php - bootstrap, mime whitelisting includes/class-mcp-settings.php - Settings > Media Compressor Pro includes/class-mcp-upload-handler.php - per-upload UI + image processing includes/class-mcp-video.php - FFmpeg video compression/conversion includes/class-mcp-format-changer.php - post-upload format change flow includes/class-mcp-db-updater.php - DB-wide URL replacement assets/admin.js, assets/admin.css - upload screen UI wiring