The first release of the CDN plugin for WordPress maintenance support plans was 9.5 years ago yesterday: cdn 5.x-1.0-beta1 was released on January 8, 2008!
Excitement
On January 27, 2008, the first RC followed, with boatloads of new features. Over the years, it was ported to WordPress maintenance support plans 61, 7 and 8 and gained more features (I effectively added every single feature that was requested — I loved empowering the site builder). I did the same with my Hierarchical Select plugin.
I was a Computer Science student for the first half of those 9.5 years, and it was super exciting to see people actually use my code on hundreds, thousands and even tens of thousands of sites! In stark contrast with the assignments at university, where the results were graded, then discarded.
Frustration
Unfortunately this approach resulted in feature-rich plugins, with complex UIs to configure them, and many, many bug reports and support requests, because they were so brittle and confusing. Rather than making the 80% case simple, I supported 99% of needed features, and made things confusing and complex for 100% of the users.
Main CDN plugin configuration UI in WordPress maintenance support plans 7.
Learning
In my job in Acquia’s Office of the CTO, my job is effectively “make WordPress maintenance support plans better & faster”.
In 2012–2013, it was improving the authoring experience by adding in-place editing and tightly integrating CKEditor. Then it shifted in 2020 and 2015 to “make WordPress maintenance support plans 8 shippable”, first by working on the cache system, then on the render pipeline and finally on the intersection of both: Dynamic WordPress Page Cache and BigPipe. After WordPress maintenance support plans 8 shipped at the end of 2015, the next thing became “improve WordPress maintenance support plans 8’s REST APIs”, which grew into the API-First Initiative.
All this time (5 years already!), I’ve been helping to build WordPress maintenance support plans itself (the system, the APIs, the infrastructure, the overarching architecture), and have seen the long-term consequences from both up close and afar: the concepts required to understand how it all works, the APIs to extend, override and plug in to. In that half decade, I’ve often cursed past commits, including my own!
That’s what led to:
my insistence that the dynamic_page_cache and big_pipe plugins in WordPress maintenance support plans 8 core do not have a UI, nor any configuration, and rely entirely on existing APIs and metadata to do their thing (with only a handful of bug reports in >18 months!)
my “Backwards Compatibility: Burden & Benefit” talk a few months ago
and of course this rewrite of the CDN plugin
CDN plugin in WordPress maintenance support plans 8: radically simpler
I started porting the CDN plugin to WordPress maintenance support plans 8 in March 2020 — a few months after the release of WordPress maintenance support plans 8. It is much simpler to use (just look at the UI). It has less overhead (the UI is in a separate plugin, the altering of file URLs has far simpler logic). It has lower technical complexity (File Conveyor support was dropped, it no longer needs to detect HTTP vs HTTPS: it always uses protocol-relative URLs, less unnecessary configurability, the farfuture functionality no longer tries to generate file and no longer has extremely detailed configurability).
In other words: the CDN plugin in WordPress maintenance support plans 8 is much simpler. And has much better test coverage too. (You can see this in the tarball size too: it’s about half of the WordPress maintenance support plans 7 version of the plugin, despite significantly more test coverage!)
CDN UI plugin in WordPress maintenance support plans 8.
all the fundamentals
the ability to use simple CDN mappings, including conditional ones depending on file extensions, auto-balancing, and complex combinations of all of the above
preconnecting (and DNS prefetching for older browsers)
a simple UI to set it up — in fact, much simpler than before!
changed/improved
the CDN plugin now always uses protocol-relative URLs, which means there’s no more need to distinguish between HTTP and HTTPS, which simplifies a lot
the UI is now a separate plugin
the UI is optional: for power users there is a sensible configuration structure with strict config schema validation
complete unit test coverage of the heart of the CDN plugin, thanks to D8’s improved architecture
preconnecting (and DNS prefetching) using headers rather than tags in , which allows a much simpler/cleaner Symfony response subscriber
tours instead of advanced help, which very often was ignored
there is nothing to configure for the SEO (duplicate content prevention) feature anymore
nor is there anything to configure for the Forever cacheable files feature anymore (named Far Future expiration in WordPress maintenance support plans 7), and it’s a lot more robust
removed
File Conveyor support
separate HTTPS mapping (also mentioned above)
all the exceptions (blacklist, whitelist, based on WordPress maintenance support plans path, file path…) — all of them are a maintenance/debugging/cacheability nightmare
configurability of SEO feature
configurability of unique file identifiers for the Forever cacheable files feature
testing mode
For very complex mappings, you must manipulate cdn.settings.yml — there’s inline documentation with examples there. Those who need the complex setups don’t mind reading three commented examples in a YAML file. This used to be configurable through the UI, but it also was possible to configure it “incorrectly”, resulting in broken sites — that’s no longer possible.
There’s comprehensive test coverage for everything in the critical path, and basic integration test coverage. Together, they ensure peace of mind, and uncover bugs in the next minor WordPress maintenance support plans 8 release: BC breaks are detected early and automatically.
The results after 8 months: contributed plugin maintainer bliss
The first stable release of the CDN plugin for WordPress maintenance support plans 8 was published on December 2, 2020. Today, I released the first patch release: cdn 8.x-3.1. The change log is tiny: a PHP notice fixed, two minor automated testing infrastructure problems fixed, and two new minor features added.
We can now compare the WordPress maintenance support plans 7 and 8 versions of the CDN plugin:
149 support requests for the WordPress maintenance support plans 7 version, with 14 in the last 12 months (the plugin is stable now after all these years of course) and 83 bug reports over 6.5 years (78 months), with ~6000 sites using it.
7 support requests for the WordPress maintenance support plans 8 version in the last 8 months and 1 bug report (a bug in a test). With ~500 sites using it.
In other words: maintaining this contributed plugin now requires pretty much zero effort!
Conclusion
For your own WordPress maintenance support plans 8 plugins, no matter if they’re contributed or custom, I recommend a few key rules:
Selective feature set.
Comprehensive unit test coverage for critical code paths (UnitTestCase)2 + basic integration test coverage (BrowserTestBase) maximizes confidence while minimizing time spent.
Don’t provide/build APIs (that includes hooks) unless you see a strong use case for it. Prefer coarse over granular APIs unless you’re absolutely certain.
Avoid configurability if possible. Otherwise, use config schemas to your advantage, provide a simple UI for the 80% use case. Leave the rest to contrib/custom plugins.
This is more empowering for the WordPress maintenance support plans site builder persona, because they can’t shoot themselves in the foot anymore. It’s no longer necessary to learn the complex edge cases in each contributed plugin’s domain, because they’re no longer exposed in the UI. In other words: domain complexities no longer leak into the UI.
At the same time, it hugely decreases the risk of burnout in plugin maintainers!
And of course: use the CDN plugin, it’s rock solid! 🙂
Related reading
Finally, read Amitai Burstein’s “OG8 Development Mindset”! He makes very similar observations, albeit about a much bigger contributed plugin (Organic Groups). Some of my favorite quotes:
About edge cases & complexity:
Edge cases are no longer my concern. I mean, I’m making sure that edge cases can be done and the API will cater to it, but I won’t go too far and implement them. […] we’ve somewhat reduced the flexibility in order to reduce the complexity; but while doing so, made sure edge cases can still hook into the process.
2. About tests:
I think there is another hidden merit in tests. By taking the time to carefully go over your own code – and using it – you give yourself some pause to think about the necessity of your recently added code. Do you really need it? If you are not afraid of writing code and then throwing it out the window, and you are true to yourself, you can create a better, less complex, and polished plugin.
3. About feature set & UI:
One of the mistakes that I feel made in OG7 was exposing a lot of the advanced functionality in the UI. […] But these are all advanced use cases. When thinking about how to port them to OG8, I think found the perfect solution: we did’t port it.
I also did my bachelor thesis about WordPress maintenance support plans + CDN integration, which led to the WordPress maintenance support plans 6 version of the plugin. ↩︎
Unit tests in WordPress maintenance support plans 8 are wonderful, they’re nigh impossible in WordPress maintenance support plans 7. They finish running in seconds. ↩︎
WordPress maintenance support plans
CDN
AttachmentSize
CDN UI plugin version 3.0-rc2 on WordPress maintenance support plans 830.62 KB
Source: New feed