๐Ÿงฉ WordPress Plugin ยท v0.1 Beta

A faster WordPress starts with smaller images

Install the TrueSmush plugin and every image you upload gets compressed automatically โ€” your site loads faster, Core Web Vitals stop screaming, and your originals stay safe.

v0.1 beta ยท PHP 7.4+ ยท Tested with WordPress 6.x ยท Source on GitHub

What it does

โšก

Auto-compress on upload

Every image you upload to the Media Library is compressed automatically โ€” original and all thumbnails.

๐Ÿ—œ๏ธ

Only writes when smaller

The plugin never makes things worse: if the compressed copy is bigger, the original stays untouched.

๐Ÿ–ผ๏ธ

Format conversion

Keep the original format (safe default) or convert to WebP / AVIF from the settings page.

๐Ÿ“ฆ

Bulk compress

Media โ†’ Tinypixel page: compress the whole library in batches of 5, with per-file reports.

๐Ÿ”‘

Your API key

Paste your TrueSmush API key in settings. Compression runs on our engine, not your server.

๐Ÿ›ก๏ธ

Safe & reversible

Nonces + capability checks on every request. Never deletes files, ever.

Install in 4 steps

1

Download the plugin

Grab the zip below (v0.1 beta). No dependencies beyond a standard WordPress + PHP 7.4+.

2

Install & activate

WP Admin โ†’ Plugins โ†’ Add New โ†’ Upload Plugin โ†’ choose the zip โ†’ Activate.

3

Paste your API key

Settings โ†’ Tinypixel โ†’ enter your key, pick a default format and quality.

4

Compress

New uploads are handled automatically. For existing media, use Media โ†’ Tinypixel โ†’ Compress all.

Need an API key? Grab one here โ€” during beta the API is free.

Under the hood

The plugin hooks wp_generate_attachment_metadata so compression is part of the upload pipeline โ€” nothing runs on page load.

wp-plugin/tinypixel-compressor/tinypixel-compressor.phpView source โ†’
add_action('wp_generate_attachment_metadata', function ($metadata, $attachment_id) {
    // compress original + every thumbnail via the TrueSmush API
    foreach (image_paths_for($metadata, $attachment_id) as $path) {
        $result = TrueSmush_compress($path);   // returns smaller copy only
        if ($result['smaller']) file_put_contents($path, $result['bytes']);
    }
    return $metadata;
}, 10, 2);