Skip to content

spronta/wordpress-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Spronta Images — WordPress Plugin

Automatically serve your WordPress images through the Spronta image CDN. No code changes needed — the plugin rewrites image URLs at render time.

Features

  • Automatic URL rewriting — all <img> tags, srcsets, and attachment URLs routed through Spronta CDN
  • Format negotiation — auto-serves WebP, AVIF, or JXL based on browser support
  • Smart quality — perceptual quality targeting (high/medium/low)
  • Blurhash placeholders — smooth loading with decoded blurhash backgrounds
  • Zero lock-in — originals stay in wp-content/uploads/, deactivate to instantly revert
  • No build step — drop into wp-content/plugins/ and activate

Install

  1. Download or clone the spronta-images/ folder
  2. Copy to wp-content/plugins/spronta-images/
  3. Activate in WordPress admin → Plugins
  4. Go to Settings → Spronta Images
  5. Paste your API key and connect

How it works

The plugin hooks into WordPress's image pipeline at render time:

Hook What it does
wp_get_attachment_url Rewrites attachment URLs → CDN
wp_calculate_image_srcset Rewrites srcset entries with width params, strips WP size suffixes
the_content Rewrites image URLs in post/page HTML

WordPress generates -1024x768.jpg variants. Spronta strips these suffixes and requests the original at the right size:

photo-1024x768.jpg → photo.jpg?w=1024&q=medium

Settings

Setting Default Description
Quality medium high / medium / low
Format auto auto / webp / avif
Lazy loading on Blurhash placeholder toggle
Auto rewrite on Content URL rewriting toggle
CDN URL Custom CDN URL override

Requirements

  • WordPress 5.0+
  • PHP 7.4+

License

MIT

About

Spronta Images WordPress plugin — automatic CDN image optimization

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors