<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: smallPict</title>
    <description>The latest articles on DEV Community by smallPict (@smallpict).</description>
    <link>https://dev.to/smallpict</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4167554%2Febbc3295-cb10-4033-8294-a4c8e5ef9ea3.jpeg</url>
      <title>DEV Community: smallPict</title>
      <link>https://dev.to/smallpict</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smallpict"/>
    <language>en</language>
    <item>
      <title>How We Ship a WordPress Plugin with Confidence: WPCS, PHPStan, and Matrix Testing on Every Commit</title>
      <dc:creator>smallPict</dc:creator>
      <pubDate>Sun, 15 Nov 2026 13:00:43 +0000</pubDate>
      <link>https://dev.to/smallpict/how-we-ship-a-wordpress-plugin-with-confidence-wpcs-phpstan-and-matrix-testing-on-every-commit-3nf2</link>
      <guid>https://dev.to/smallpict/how-we-ship-a-wordpress-plugin-with-confidence-wpcs-phpstan-and-matrix-testing-on-every-commit-3nf2</guid>
      <description>&lt;p&gt;Shipping updates to the WordPress plugin directory comes with real operational weight. Once an update is tagged, it downloads to production websites running every imaginable environment—shared hosting on PHP 7.4, modern VPS setups on PHP 8.3, headless stacks, and multi-site networks.&lt;/p&gt;

&lt;p&gt;A single logic flaw, an unescaped database call, or a missing nonce check doesn't just trigger an error log. It can bring down a customer's checkout flow or leave their media library broken.&lt;/p&gt;

&lt;p&gt;Manual code reviews and local smoke testing are necessary, but they don't scale across multiple PHP runtimes. For &lt;a href="https://smallpict.app" rel="noopener noreferrer"&gt;smallPict&lt;/a&gt; (our WordPress image optimization plugin), code must clear automated verification at two distinct checkpoints: during pull request review, and as a strict pre-deployment gate before any assets touch WordPress.org SVN.&lt;/p&gt;

&lt;p&gt;Here is how our verification pipeline is structured, how we catch bugs before release, and why automated gates protect production.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Three Quality Pillars
&lt;/h2&gt;

&lt;p&gt;We keep our test suite focused on three concrete jobs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WordPress Coding Standards (WPCS / PHP_CodeSniffer):&lt;/strong&gt; Enforces WordPress-specific conventions, input sanitization, and output escaping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static Analysis (PHPStan with SzepeViktor/phpstan-wordpress):&lt;/strong&gt; Analyzes type consistency, dead code paths, and undefined functions without executing the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Unit Testing (PHPUnit):&lt;/strong&gt; Verifies business logic, image conversion fallbacks, and API client behavior.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every pull request runs these checks against a test matrix spanning PHP 7.4, 8.0, 8.1, 8.2, and 8.3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5sqzit7h6olsey9843il.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5sqzit7h6olsey9843il.png" alt="smallPict GitHub Actions CI Matrix Overview" width="800" height="381"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Our PR check matrix: WPCS and PHPStan running across 5 PHP versions in parallel.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note on PHP Version Coverage:&lt;/strong&gt; The pipeline logs and screenshots in this case study show our initial CI matrix covering PHP 7.4 through 8.3. Today, our GitHub Actions test matrix has expanded to validate across PHP 7.4 through PHP 8.5, ensuring continuous forward-compatibility with modern runtimes while preventing breaking changes on legacy installations.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  1. Catching Security Flaws Early with WPCS
&lt;/h2&gt;

&lt;p&gt;WordPress has distinct security requirements that standard PHP linters do not understand. WPCS checks for WordPress-specific conventions out of the box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Superglobal Sanitization:&lt;/strong&gt; Accessing &lt;code&gt;$_POST&lt;/code&gt;, &lt;code&gt;$_GET&lt;/code&gt;, or &lt;code&gt;$_REQUEST&lt;/code&gt; without wrappers like &lt;code&gt;sanitize_text_field()&lt;/code&gt; or &lt;code&gt;absint()&lt;/code&gt; fails immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output Escaping:&lt;/strong&gt; Rendering dynamic data into HTML attributes or templates without &lt;code&gt;esc_attr()&lt;/code&gt; or &lt;code&gt;esc_html()&lt;/code&gt; stops the build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nonce Verification:&lt;/strong&gt; Processing admin actions or AJAX endpoints without verifying request nonces is flagged as an error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct Database Queries:&lt;/strong&gt; Unprepared queries run through &lt;code&gt;$wpdb&lt;/code&gt; trigger warnings, ensuring values pass through &lt;code&gt;$wpdb-&amp;gt;prepare()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Catching these patterns during the pull request prevents security vulnerabilities from ever landing in a release tag.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Catching Logic Errors with PHPStan
&lt;/h2&gt;

&lt;p&gt;Code can follow all formatting standards and still contain fatal logic flaws. PHPStan inspects the codebase to evaluate types, method signatures, and branching logic.&lt;/p&gt;

&lt;p&gt;We configure PHPStan with WordPress core stubs via &lt;code&gt;szepeviktor/phpstan-wordpress&lt;/code&gt;. This provides full static understanding of core functions, global variables, and hook signatures.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vendor/bin/phpstan analyse --memory-limit=2G
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm9xqobkzult3jpfk40jz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm9xqobkzult3jpfk40jz.png" alt="PHPCS and PHPStan Clean Output" width="800" height="376"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Clean pass: PHPCS and PHPStan analyzing files with zero errors across the codebase.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When the codebase is sound, the static analysis step completes in seconds across all 11 core plugin files.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Real Example: Catching a Dead Logic Condition in CI
&lt;/h2&gt;

&lt;p&gt;Static analysis often catches subtle logic mistakes that look completely fine to a developer during code review.&lt;/p&gt;

&lt;p&gt;During recent development on our image processing pipeline (&lt;code&gt;includes/class-smallpict-image-processor.php&lt;/code&gt;), an engineer refactored a condition checking fallback options. On line 626, a boolean condition contained a redundant evaluation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// An example of the logic pattern:&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$is_conversion_enabled&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$always_true_flag&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Locally, the code executed without warnings. Unit tests passed because the intended branch still ran. But PHPStan stopped the pipeline immediately:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjai9hjj3c7ebd44c24w1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjai9hjj3c7ebd44c24w1.png" alt="PHPStan Catching a Logic Error" width="800" height="409"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;GitHub Actions halting the build: Line 626 of the image processor triggered &lt;code&gt;booleanAnd.rightAlwaysTrue&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The error report was unambiguous:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Line  includes/class-smallpict-image-processor.php
626   Right side of &amp;amp;&amp;amp; is always true.
      💡 booleanAnd.rightAlwaysTrue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The runner exited with code 1, blocked the pull request from merging, and alerted the author. The redundant flag was removed, the condition simplified, and the clean commit pushed. No broken assumption ever touched production.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Final Safeguard: Pre-Deploy WPCS Gate
&lt;/h2&gt;

&lt;p&gt;Passing tests on a feature branch is one thing; tagging a release for deployment is another. &lt;/p&gt;

&lt;p&gt;To ensure no unverified code or merge conflict resolution slips through into production, our deployment workflow (&lt;code&gt;Deploy to WordPress.org&lt;/code&gt;) includes a mandatory pre-deploy check.&lt;/p&gt;

&lt;p&gt;Before the &lt;code&gt;Deploy&lt;/code&gt; job can trigger SVN commits to the official WordPress repository, the workflow runs a complete PHP CodeSniffer matrix (&lt;code&gt;WPCS Check&lt;/code&gt;) across PHP 7.4, 8.0, 8.1, 8.2, and 8.3:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7zd0rke8sr84rq9xauq4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7zd0rke8sr84rq9xauq4.png" alt="Pre-Deploy WPCS Matrix Gate" width="800" height="381"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Our pre-deploy gate: All 5 PHP versions must pass PHP CodeSniffer before the Deploy job executes.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If any single PHP version fails a coding standard or security check, the entire deployment stops cold. The &lt;code&gt;Deploy&lt;/code&gt; step never runs, preserving the integrity of the plugin directory release.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why PHP Version Matrix Testing Matters
&lt;/h2&gt;

&lt;p&gt;A WordPress plugin author does not get to choose what runtime their users operate. While modern hosting defaults to PHP 8.2 or 8.3, legacy environments still run PHP 7.4.&lt;/p&gt;

&lt;p&gt;By running our checks across all five major PHP versions in parallel, we catch compatibility issues before release:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functions deprecated in PHP 8.1 or 8.2.&lt;/li&gt;
&lt;li&gt;Syntax or return types unsupported in PHP 7.4.&lt;/li&gt;
&lt;li&gt;Dynamic property deprecations introduced in PHP 8.2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running each version in parallel takes less than 30 seconds total on GitHub Actions. It is inexpensive insurance against midnight rollback emergencies.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building a trustworthy WordPress plugin requires moving beyond manual "it works on my machine" testing. &lt;/p&gt;

&lt;p&gt;By enforcing WordPress Coding Standards for defensive security, running PHPStan for strict type safety, and gating production deployments with a pre-release CodeSniffer matrix, our team can ship updates to &lt;a href="https://smallpict.app" rel="noopener noreferrer"&gt;smallPict&lt;/a&gt; with total confidence.&lt;/p&gt;

&lt;p&gt;How do you handle automated testing and linting in your WordPress development workflow? We'd love to hear your setup in the comments.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
      <category>devops</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Why Modern WordPress Sites Need Dual AVIF/WebP (And How to Cut Image Payloads by 80%)</title>
      <dc:creator>smallPict</dc:creator>
      <pubDate>Wed, 07 Oct 2026 04:43:49 +0000</pubDate>
      <link>https://dev.to/smallpict/why-modern-wordpress-sites-need-dual-avifwebp-and-how-to-cut-image-payloads-by-80-2di4</link>
      <guid>https://dev.to/smallpict/why-modern-wordpress-sites-need-dual-avifwebp-and-how-to-cut-image-payloads-by-80-2di4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://smallpict.app/en/blog/why-wordpress-needs-dual-avif-webp" rel="noopener noreferrer"&gt;SmallPict Engineering Blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Images account for over &lt;strong&gt;60% of total web page weight&lt;/strong&gt; on the average WordPress site. On WooCommerce stores and media-heavy blogs, that number easily climbs past 80%.&lt;/p&gt;

&lt;p&gt;When a mobile visitor opens your website over a cellular connection, downloading multi-megabyte JPEG or PNG hero banners is the single biggest culprit behind failing &lt;strong&gt;Google Core Web Vitals (Largest Contentful Paint - LCP)&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Every additional second of load time directly drops conversion rates, inflates bounce rates, and hurts Google search rankings.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Format Dilemma: JPEG vs WebP vs AVIF
&lt;/h2&gt;

&lt;p&gt;For years, WebP was celebrated as the successor to legacy JPEG and PNG formats, cutting file sizes by roughly 25% to 35%. &lt;/p&gt;

&lt;p&gt;However, &lt;strong&gt;AVIF (AV1 Image File Format)&lt;/strong&gt; represents a much bigger generational leap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Up to 50% smaller than WebP&lt;/strong&gt; at equivalent visual quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Up to 80–85% smaller than original JPEGs&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Exceptional preservation of fine gradients, text sharpness, and high-contrast boundaries.&lt;/li&gt;
&lt;li&gt;Native support for 10-bit and 12-bit High Dynamic Range (HDR) color profiles.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Image Format&lt;/th&gt;
&lt;th&gt;Average Compression Ratio&lt;/th&gt;
&lt;th&gt;Browser Support (2026)&lt;/th&gt;
&lt;th&gt;Visual Fidelity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Legacy JPEG&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Baseline (100%)&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;Degrades with high artifacts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Google WebP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~65% of JPEG&lt;/td&gt;
&lt;td&gt;~97%&lt;/td&gt;
&lt;td&gt;High, slight blur on fine lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Modern AVIF&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~18–25% of JPEG&lt;/td&gt;
&lt;td&gt;~94%&lt;/td&gt;
&lt;td&gt;Exceptional sharpness &amp;amp; color&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  The Trap: Why Single-Format Delivery Breaks Browsers
&lt;/h2&gt;

&lt;p&gt;If AVIF is so superior, why doesn't every WordPress site switch all images to AVIF?&lt;/p&gt;

&lt;p&gt;The trap lies in &lt;strong&gt;legacy browser compatibility&lt;/strong&gt;. While modern Chrome, Safari (v16.1+), and Firefox support AVIF natively, older mobile devices, embedded webviews, in-app social browsers (Instagram/Facebook/X in-app webviews), and legacy operating systems still cannot decode AVIF files.&lt;/p&gt;

&lt;p&gt;If a plugin simply replaces &lt;code&gt;.jpg&lt;/code&gt; file extensions with &lt;code&gt;.avif&lt;/code&gt;, users on older devices or in-app webviews will see broken placeholder boxes or missing images.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Solution: HTML5 Dual Picture Tag Delivery
&lt;/h3&gt;

&lt;p&gt;The standard-compliant, future-proof solution is &lt;strong&gt;Dual Format Delivery&lt;/strong&gt; using native HTML5 &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; tags with progressive source fallback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- 1. Modern browsers download ultra-lightweight AVIF --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/avif"&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"hero.avif"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- 2. Compatible browsers fallback to WebP --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/webp"&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"hero.webp"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- 3. Legacy clients safely render original JPEG --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"hero.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Optimized Hero Image"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"1200"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"630"&lt;/span&gt; &lt;span class="na"&gt;loading=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this markup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Modern devices download the razor-sharp 45KB AVIF asset.&lt;/li&gt;
&lt;li&gt;Intermediate browsers download the 95KB WebP asset.&lt;/li&gt;
&lt;li&gt;Older devices gracefully fall back to the original JPEG.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of this happens natively in the browser's preload scanner without layout shifts (CLS) or JavaScript overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Cloud Quota Waste Problem (And How We Solved It)
&lt;/h2&gt;

&lt;p&gt;Most WordPress image optimizer plugins suffer from a fundamental architectural flaw: &lt;strong&gt;they upload and convert every single thumbnail size to the cloud&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you upload a single image to WordPress, the core system automatically generates 6 to 12 intermediate sub-sizes (e.g., &lt;code&gt;thumbnail&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;large&lt;/code&gt;, &lt;code&gt;woocommerce_catalog&lt;/code&gt;, &lt;code&gt;woocommerce_single&lt;/code&gt;, etc.). &lt;/p&gt;

&lt;p&gt;If a plugin sends all 12 sub-sizes to an external cloud API for AVIF and WebP transcoding, a single photo upload consumes &lt;strong&gt;24 cloud conversion credits&lt;/strong&gt;! Your monthly plan quota evaporates in days.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Zero-Cloud Local Sub-Size Generation Strategy
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F72po5jzhnxo4bknsdc5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F72po5jzhnxo4bknsdc5q.png" alt="Architecture Comparison: Traditional vs SmallPict Cloud Quota Strategy" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To solve this, we architected an upfront dispatch calculator in &lt;a href="https://smallpict.app" rel="noopener noreferrer"&gt;SmallPict&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Only the Master Image is Dispatched&lt;/strong&gt;: SmallPict sends only the original high-resolution master asset to our cloud API for lossless/lossy next-gen conversion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Generation via &lt;code&gt;WP_Image_Editor&lt;/code&gt;&lt;/strong&gt;: Once the optimized master &lt;code&gt;.avif&lt;/code&gt; and &lt;code&gt;.webp&lt;/code&gt; files return to your server, SmallPict reuses WordPress's native local image processor (&lt;code&gt;WP_Image_Editor&lt;/code&gt; / GD or Imagick) to generate all intermediate thumbnail sub-sizes &lt;strong&gt;directly on your local server for free&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Quota Waste&lt;/strong&gt;: A photo with 12 thumbnails consumes only &lt;strong&gt;1 cloud credit&lt;/strong&gt;, saving you up to 90% in cloud processing fees.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Real-World Benchmark Results
&lt;/h2&gt;

&lt;p&gt;We benchmarked a standard WooCommerce single product page featuring 8 high-resolution product photos before and after implementing this Dual AVIF pipeline on a simulated 4G mobile connection:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmjmx5mkdc0pmcl8aib04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmjmx5mkdc0pmcl8aib04.png" alt="WooCommerce Mobile 4G Benchmark Comparison: 41 vs 96 PageSpeed" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Original Image Payload&lt;/strong&gt;: 4.62 MB (JPEGs)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SmallPict Optimized Payload&lt;/strong&gt;: 684 KB (AVIF with WebP fallback)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total Weight Reduction&lt;/strong&gt;: &lt;strong&gt;-85.2%&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile Largest Contentful Paint (LCP)&lt;/strong&gt;: Dropped from &lt;strong&gt;4.3 seconds to 1.1 seconds&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google PageSpeed Mobile Score&lt;/strong&gt;: Jumped from &lt;strong&gt;41 to 96 (Green)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary &amp;amp; Next Steps
&lt;/h2&gt;

&lt;p&gt;Delivering next-generation image formats shouldn't require trading off browser compatibility or burning through expensive cloud quotas. By pairing cloud-grade AVIF encoding with HTML5 &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; fallbacks and local thumbnail generation, WordPress sites can achieve sub-second LCP scores on mobile networks.&lt;/p&gt;

&lt;p&gt;If you are running a WordPress or WooCommerce site and want to test this pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can explore the &lt;a href="https://smallpict.app" rel="noopener noreferrer"&gt;SmallPict WordPress Plugin&lt;/a&gt; (free tier includes 100 images/month).&lt;/li&gt;
&lt;li&gt;Read the full technical documentation and benchmarks on our &lt;a href="https://smallpict.app/en/blog" rel="noopener noreferrer"&gt;Engineering Blog&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have you experimented with AVIF in production yet? What's your current strategy for handling legacy fallbacks? Let's discuss in the comments below!&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>webperf</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
