FirePunch is a lightweight, high-performance plugin designed to optimize image management in WordPress by automatically converting them into next-generation AVIF and WebP formats.
This tool is built specifically for web developers working with custom themes and image ID fields (such as ACF – Advanced Custom Fields). The plugin intercepts uploads and generates variants asynchronously in the background, ensuring zero impact on server performance during your daily workflow.
Thanks to its native integration with WordPress core functions, any image called via wp_get_attachment_image() will automatically be transformed into a modern, responsive HTML5 <picture> tag.
WP_HTML_Tag_Processor (introduced in WP 6.2) to safely rewrite <img> tags into multi-source <picture> structures.This plugin offers total flexibility for custom theme development. You can display optimized images using three different approaches:
If your theme already uses standard WordPress functions, you do not need to change a single line of code. The plugin automatically filters the output and injects the AVIF/WebP sources:
<?php echo wp_get_attachment_image( $attachment_id, 'large' ); ?>
If you need granular control—such as stripping away default WordPress layout classes or easily overriding loading behavior—use the plugin’s global helper function:
<?php echo wp_avif_img( $attachment_id, $size, $attr ); ?>
Practical Examples:
// Standard output in 'large' size with native lazy loading
echo wp_avif_img( $image_id, 'large', 'lazy' );
// Advanced output with custom CSS classes and specific Alt text
echo wp_avif_img( $image_id, 'full', array(
'class' => 'hero-banner-image',
'alt' => 'Optimized hero cover background'
) );
When creating an Image field in ACF, set the Return Format to Image ID. In your template file, simply write:
<?php
$image_id = get_field( 'your_image_field_name' );
if ( $image_id ) {
echo wp_avif_img( $image_id, 'large', 'lazy' );
}
?>