The elePHPant in the Room: Wordpress ![rw-book-cover](https://miro.medium.com/v2/da:true/resize:fit:640/1*cdPQ5Ptzqsi83kquumLqmQ.gif) ## Metadata - Author: [[Nico Mercado]] - Full Title: The elePHPant in the Room: Wordpress - Category: #articles - Document Note: ## 📄 Summarize: The article discusses the evolution of PHP and the continued relevance of WordPress in the CMS (Content Management System) landscape. The author highlights the advancements in PHP, which have transformed it into a more powerful and developer-friendly language, contributing to its increasing popularity. However, the language still owes much of its market share to WordPress, even though some developers have reservations about the platform. The article delves into the challenges faced in content management, where rapidly changing client requirements can be difficult to accommodate within traditional systems. It explains how WordPress addresses this issue by offering a flexible framework for editorializing web-ready content with a variable structure and low resistance. The author explores alternative CMS solutions like Drupal, Joomla, boutique-like solutions, proprietary cloud solutions, no-code solutions, and JAMstack. While some of these offer advantages, WordPress remains popular due to its open-source community efforts, including the introduction of Gutenberg as a block editor, ACF (Advanced Custom Fields) for extending content types, and the REST API for interoperability with other systems. WooCommerce also plays a significant role in WordPress's continued success, providing extensibility for e-commerce solutions. The article acknowledges certain setbacks and issues with WordPress and PHP, such as the lack of DOM-aware templating and the challenges of unit testing and backward compatibility. The author suggests potential improvements to address these limitations. Ultimately, the article emphasizes that despite the criticisms, WordPress' market share has continued to grow due to the collective power of the open-source community and its ability to solve content management challenges effectively. ## 📝 Bullet Points: ### PHP and WordPress Evolution - PHP has seen significant improvements, making it more powerful and developer-friendly. - WordPress's market share owes much to its continued popularity, alongside advancements in PHP. - Some developers still hold reservations about WordPress due to certain perceptions. ### Challenges in Content Management - Rapidly changing client requirements pose challenges for traditional content management systems. - WordPress addresses this issue with a flexible framework for editorializing content. ### Alternative CMS Solutions 1. Drupal and Joomla: - Lack of maintenance and reliance on tech intervention for configurations. 2. Boutique-like Solutions (e.g., OctoberCMS, CraftCMS): - More dev-friendly but with a smaller ecosystem and potential disadvantages of proprietary solutions. 3. Proprietary Cloud Solutions (e.g., Adobe Experience Manager, Salesforce Lightning Pages): - Too expensive, restrictive, and difficult to move sites in and out without redesign. 4. No-Code Solutions (e.g., Wix.com, Webflow): - Surprisingly good performance but often oriented towards small businesses. 5. JAMstack: - Aims to overcome common pitfalls of headful CMSs like WordPress. - Offers advantages such as native GraphQL and improved performance. ### WordPress' Success Factors - Open-source community efforts have improved WordPress significantly. - Introduction of Gutenberg as a block editor. - ACF for extending post types and taxonomies. - REST API for interoperability with other systems. - WooCommerce for e-commerce solutions. ### Setbacks and Issues - Lack of a sturdy DOM-aware templating system in PHP affects WordPress. - Testing challenges and backward compatibility issues in WordPress. - Versioning site configuration and lack of data versioning in popular plugins. ### Future Improvements - Consider ending support for older PHP versions. - Provide an accessible path to unit testing in WordPress. - Encourage more plugins to make their data versionable. ## 📃 Paraphrase: 1. "The transformation of PHP in recent years has been remarkable, making it almost unrecognizable for many developers. The language's progress, including performance boosts, syntax changes, and async development, has turned programming into an intellectual task, rather than wrestling with language quirks. However, despite these advancements, WordPress continues to dominate the CMS market and remains relevant due to its unique abilities to solve content management challenges effectively." 2. "WordPress has proven its value in addressing the common problems faced in content management, where rapidly changing client requirements can be a major obstacle. Other software solutions struggle to provide the necessary extensibility for editorializing web-ready content with varying structures, but WordPress excels in this regard, empowering developers and content creators alike." ## 🎯 Conclusion: The article highlights the significant advancements in PHP that have made it a more powerful and developer-friendly language, contributing to its widespread adoption. However, WordPress remains a dominant force in the CMS market, owing to its ability to effectively address the challenges of content management, especially in the face of rapidly changing client requirements. The author examines various alternative CMS solutions but emphasizes that WordPress stands out due to its open-source community efforts, which have led to improvements such as Gutenberg, ACF, and the REST API. WooCommerce also plays a vital role in WordPress's success, providing extensibility for e-commerce needs. Despite its popularity, the article acknowledges certain setbacks and issues with WordPress and PHP, including the lack of a DOM-aware templating system and challenges with unit testing and backward compatibility. The author suggests potential improvements to address these limitations, like ending support for older PHP versions and encouraging more plugins to make their data versionable. In conclusion, the article encourages developers to understand the strengths and weaknesses of WordPress, appreciating its relevance while being open to exploring new tools and technologies to enhance their workflows. ## ❔ Questions: 1. How has the evolution of PHP contributed to its increased popularity in recent years? 2. What challenges are specific to content management systems, and how does WordPress address them effectively? 3. Among the alternative CMS solutions mentioned, which ones offer advantages but may have some drawbacks that hinder their widespread adoption? 4. How do open-source community efforts play a significant role in WordPress's success, and what specific improvements have they brought to the platform? 5. What are some of the limitations and challenges faced by WordPress, and what potential improvements are suggested in the article? 6. How does the performance and extensibility of JAMstack solutions compare to traditional headful CMSs like WordPress? 7. What factors contribute to WordPress's continued growth in market share, despite criticism and competition? ## 🔖 Auto-tagging: PHP, WordPress, CMS, Content Management, Open-source, Evolution, Advancements, Challenges, Alternatives, Gutenberg, ACF, REST API, WooCommerce, Backward Compatibility, Testing, DOM-aware Templating, Future Improvements, Versioning, Community Efforts, JAMstack. ## 📚 References: The author did not explicitly cite any external sources in the article. ## 🔍 Future Research: 1. Further research could explore the specific reasons behind the increasing popularity of PHP and the factors that have contributed to its transformation. 2. Investigate the challenges faced by other CMS solutions and the approaches they have taken to address content management complexities. 3. Examine the impact of open-source communities on various software ecosystems, focusing on how they contribute to software development and user adoption. 4. Conduct research on the best practices and methodologies for unit testing in WordPress and investigate how backward compatibility can be effectively maintained in evolving software systems. 5. Analyze the feasibility and potential implications of ending support for older PHP versions in WordPress, taking into account the potential impact o - Document Tags: [[php]] [[wordpress]] - Summary: There is no denying that PHP took a great leap forward in the last years. The transformation is so generalized that “the PHP experience”… - URL: https://medium.com/@aeropuertomc/the-elephpant-in-the-room-wordpress-77dea35d5d94 ![](https://miro.medium.com/v2/resize:fit:1280/1*cdPQ5Ptzqsi83kquumLqmQ.gif) There is no denying that PHP took a great leap forward in the last years. The transformation is so generalized that “the PHP experience” has become, to many, somehow irrecognizable. It’s hard to point at one single factor. With changes covering from performance boosts, quality-of-life syntax changes (type-hinting, PHPDoc generics) and async development (coroutines, generators), the newer versions make development feel more like the intellectual task that programming should be and less like the constant wrestling with language quirks and hacks of previous years. Quantitatively speaking, the language still owes much of its market share to Wordpress. And that is something we *do not* like to talk about. #### Before you stop here Some developers cringe at the sole mention of Wordpress. I was there, too. I looked down at those poor creatures repeating `add_filter` and `add_action` like a mantra every time they needed to change something in their site. If that is your case, I ask you a favor: give the following paragraphs a caritative read. I will make by best effort to give dimension of the problem that Wordpress comes to solve. ### Why is Wordpress still here? If you ever had to build and maintain a system where a client needs to editorialize an almost infinitely flexible content, you might be familiar with the following situation: ***<Annoying client> says:*** - Can I add an image to this article? ***Two weeks later, <annoying client> says:***- Can we also make it possible to be a self-hosted video? And… can I make it visible only to logged in users? ***Three weeks later, <annoying client>:***Sorry, it won’t be a video. Marketing changed their mind. Now they want it to be a Spotify podcast. Can we make it the same block available in the FAQs section, too? And can we add a transcription field below every podcast? Can we make it translatable? #### But isn’t this common to all software? Yes, changing requirements are no novelty in the world of software development. There are some problems, though, which are *specific to content management* and its inpredictability. No matter how expert the development team declaring that `Article` class is, no matter the level of composition and inheritance of your codebase, it won’t be enough to deliver the changes at the pace required by content creators today. A testimony to this is the fact that many mature CMS solutions still fall short when providing the extensibility to solve many common problems like CDN assets URL replacement, custom fields extension, role-based content restriction, etc. This is a trait of content creation that should not be overlooked when comparing a CMS to other software like a SaaS API. Building a CMS from scratch can quickly become extremely frustrating as there is so much that feels something already done, but you are still implementing it every time. This and nothing else is the known problem that most CMS come to solve: how can a framework allow users to editorialize web-ready content with a variable structure and the least possible resistance. And there are not a lot of good solutions out there: #### **Drupal / Joomla.** The lack of maintenance here is baffling. Also, they will go through the “configuration” route in the “content vs. configuration” dichotomy, leading to every solution needing tech intervention. #### **More boutique-like solutions.** OctoberCMS, a Laravel-based CMS, is an example of a “more dev-friendly” solution. But the ecosystem behind is way smaller. You can see something similar happening with CraftCMS, which is also proprietary, so you lose on the advantages of an OSS solution. #### Proprietary cloud solutions: There are expensive solutions like Adobe Experience Manager and Salesforce Lightning Pages that are either too big, too expensive or too restrictive to be even considered by most companies. Also, they do not offer any way of moving your site in or out without a full redesign. #### No-code solutions In terms of performance, I was surprised when I saw the results of services like Wix.com and Webflow. These webapps allow users to create scalable, modern websites with almost zero programming. Both allow the inclusion of datasources and have some limited scripting to allow more complex behavior. Note the word *limited.* However, I find that these services keep orienting towards the small business. Serious clients and developers are still reluctant to rely on no-code. #### **JAMstack** JAMstack plans to solve many common pitfalls of headful CMSs like Wordpress. With native GraphQL, they circumvent contract issues with the frontend. SEO advantages can be achieved through DOM-aware object hydration. If performance is a do-or-die, GastbyJS and Nuxt often deliver under ~50ms response times, thanks to building static files rather than serving requests. But to many people, a 500ms second load time is acceptable. Even Google considers a page load time of under 2 seconds to be acceptable. If scalability comes into play, high concurrency can be achieved by horizontal scaling. 100USD per month on an autoscaling cloud infrastructure is way less costly than an extra TypeScript dev for 120K+ a year. And for many, the improvements don’t compensate the setbacks: * Vendor lock-in is real. * Not a huge ecosystem. Some of these headless CMS have their “app marketplaces” only kept alive by virtue of paying customers which are a very small, not very agile, group. * The framework will require highly qualified fullstack developers and DevOps pipelines (if dealing with huge amounts of content, you don’t want to rebuild the entire site at every change, so you need to keep track of which pages to rebuild when content changes). ### Wordpress keeps chugging along An ex-coworker who works in frontend asked me some months ago: “is there something going on with Wordpress? I see more and more of these job applications for Wordpress and Woocommerce theme design”. Truth is: despite the constant bashing, Wordpress’ market share has kept growing. From ~15% in 2010, to ~60% in 2023. Much of this can be attributed to the collective power drawn from open source. Community efforts tackle many of the core problems of Wordpress and CMS in general: **The arrival of Gutenberg** as a block editor has been a blessing for creators. I see it every time clients rebuild complex landing pages without asking for any help at all. **ACF as a standard tool** lets you extend post types, options and taxonomies indefinitely. Any complex content structure is just some clicks away with repeater fields, post to post relations, user-role based field groups, etc. **Wordpress’ REST API,** introduced in version 4.4 (circa 2015), has granted a standardized, predictable way of doing interoperability with other systems. Do you need to integrate your custom Python machine-learning scoring service into your e-commerce? Sure, just hit the Wordpress API to bulk update your products. Lastly, the **impact of Woocommerce**. The ability to make your bucks will always be a determining factor. Many clients find that Woo gives them a sweet spot between the low-entry barrier of cloud solutions like “Wix Stores” and the extensibility of a custom system. Thanks to Woocommerce extensions, it’s easy to set up a store with downloadable products, multiple payment gateways, shipping solutions, etc. Lastly, I wouldn’t like to skip the introduction of **Action Scheduler**, which can provide a distributed queueing mechanism to implement any complex set of tasks with proper retry mechanisms and logging. One last factor could be the arisal of many **managed hosting solutions** for Wordpress which have a stake at the framework’s success, making their money due by abstracting the complexity of scaling and networking. Some examples are WPEngine, Cloudways, Pantheon.io, Siteground. ### What is not working Contrary to what I consider the popular belief, some of Wordpress’ disadvantages against other CMS can be traced to PHP itself. There is a lack of a sturdy DOM-aware templating system, something like JSX in the Javascript ecosystem. Maybe because of its origins as a CGI module, PHP has never been too concerned with the structure of the output, only with doing the output. This poses some issues when you want to implement site-wide, consistent features, like lazy-loading for images or to allow search engines to index a single-page application form. These are not shortcomings introduced by Wordpress itself, but an endemic issue within the PHP ecosystem. It would be interesting to see what happens in these aspects in the upcoming years. But *there are* many important setbacks and issues with the framework itself: * The lack of request abstraction in Wordpress makes things impossible to be tested in a vacuum. Unit testing seems like El Dorado. You can sometimes find a post of someone doing it, but the process is so complex and custom that it feels like climbing the Everest. * Backwards compatibility makes Wordpress feel a bit disconnected from the modern development experience. Type-hinting could help prevent many bugs by means of static analysis. There is also a lack of proper OOP practices in the framework. * Versioning site configuration. Funny story: a plugin named Versionpress attempted to solve this some years ago, in what we can now call a heroic but failed attempt. Nowadays, you can do a little bit of versioning: ACF has added the possibility to version your custom fields via an `acf-json` folder. Also, theme.json and block.json files allow you to keep track of your Gutenberg blocks and settings. But many popular plugins still don’t offer any way to keep track of their configuration (templates, settings, etc) in the codebase which, during development, forces you to pull a fresh copy of the entire database if working in a team. And during deployment, it forces the introduction of manual steps that are prone to human error. My suggestion would be that newer major versions of Wordpress make the tough decision to end support for prior versions of PHP. If your site will break if you update PHP to version 7.3, then maybe that is your site’s problem and you should deactivate automated updates. There is no need to keep the framework behind for everyone else. Supporting these versions, even if it is with the purpose of still providing security updates, makes no sense. PHP 7.4 has reached EOL, so these sites running PHP 5.6 are still running a lot of vulnerabilities. If we still want to keep supporting these versions, a way to achieve this could be to split security patches and framework releases (in a Windows sort-of-fashion). You now maintain two major versions: one compatible until 7.4 (maximum unsupported PHP version), and one in sync with PHP versions. If you want to keep moving forward, you must keep your PHP versions up-to-date. This is what every other piece of software on a package registry does. Keeping your infrastructure up-to-date is not so difficult anymore. There are lots of possibilities todays in terms of infrastructure to manage server updates which just weren’t available before. Another possible improvement area would be an accessible, straightforward path to unit testing in Wordpress. Right now, it seems something that only a few people are doing. More plugins should also commit to making their data versionable, like ACF did with the inclusion of the `acf-json/` folder. Recently, I asked the helpdesk of a very famous paid plugin if they ever planned to make their configuration templates versionable, to which they replied with a very dry “no”. This attitude can push serious developers away from your product. ### Conclusion. And some tips for fellow developers I hope I provided my perspective on the situation of the CMS problem in 2023. I’m not sure where things are heading, but I think it’s important to understand where we stand. It’s important not to oversimplify the problem: Wordpress is still popular for a reason. I still don’t see a clear alternative that fits in the gaps that it fills today. It is even probable that those might be addressed by the Wordpress ecosystem itself. I would like to close with some recent findings or explorations I’ve been doing. Hopefully, any Wordpress developers seeking to enrich their workflow can find these tools interesting: #### Managed HTML cache-on-edge via Cloudflare: At least from my experience with several clients, I still don’t see HTML caching being used very often. If it is ever used, it still requires a request to the origin server. Static HTML caching-on-edge can be easily achieved on [Cloudflare via a plugin](https://developers.cloudflare.com/support/third-party-software/content-management-system-cms/using-the-cloudflare-plugin-with-wordpress/), which will hold full pages on their CDN and invalidate caches when content gets updated. In this way, you can get response times along the lines of those provided by JAMstack solutions. If you are using Cloudways or other service running Varnish, you can achieve something similar with this [plugin for managing Varnish cache](https://es.wordpress.org/plugins/purge-varnish/). Unluckily, I haven’t found any good plugins for doing the same on services like AWS Cloudfront or Digitalocean Spaces CDN, #### Managing virtual meta fields via WP\_Post and WP\_User: The `WP_Post`class in Wordpress is declared as `final` . You can’t extend it. But you can add your own computed properties by means of a “virtual meta”. By adding a filter on `get_{$post_type}_meta` you can achieve some form of polymorphism for different user roles or post types, so that they can be consistently accessed, for example, via the API. #### WP migrations for versioning We are exploring [this composer module by Deliciousbrains](https://github.com/deliciousbrains/wp-migrations) to run migrations from WP-CLI. During deployment, we automatically run any pending migrations. That can include database changes, custom code to update posts, pages, roles, taxonomies. #### Plugin management via Composer using wpackagist.com By having [Wordpress installed as a composer module](https://github.com/johnpbloch/wordpress), you can track required plugins and themes as composer modules. Some solutions like Bedrock already provide a boilerplate for this structure. #### Conditional Blocks There is an awesome but still quite unknown plugin, with a lot of potential for more no-code control of block content. A bit too expensive, in my opinion, for a single site but worth considering for various sites: <https://conditionalblocks.com/> #### Pre-built workflow frameworks Solutions like Sage, Trellis, and pretty much everything by roots.io seek to provide standard workflows from development to deployment. Many of those are too opinionated for me, but could be the right tool for you., The elePHPant in the Room: Wordpress, Nico Mercado, 01gvr0jc9v6pccvvsf7xh5myc9.