I just wish WordPress actually adhered to development standards, not actively tried to break them.
Using globals everywhere and encouraging spaghetti code with its classic themes, and with its new themes it evidently learned nothing and is encouraging JSON inside HTML comments which obviously has no editor support, is very prone to errors, besides being just plain stupid (like seriously, some senior engineers I assume decided to have templating inside HTML comments as JSON?). If I had my tinfoil hat on, it's almost as if they actively try to kill the freelancer or digital agency market and push everything to its WYSIWYG site builder on WP.com.
They encourage lots and lots of bad practices. I mean, just look at themes and how they are built by default. Comments in a CSS file describe the theme metadata. Using concattenation instead of composition everywhere, so that parts of HTML are not reusable. CSS,
inside JS inside HTML inside PHP ...
Part of it is this implicit structure it defines, which file it loads adter ehich other file to make a whole page. It seems convenient at first, if only you know it, but it encourages people to not properly finish all their HTML elements on the same file, but split them up stupidly and end them in other files, never to be reused.
It all seems very beginner-mistake like. But I guess they are stuck with this now, because thousands of themes rely on this, instead of having a structure based on composition. Contrast this for example with how one uses Jinja2 templates rendering blocks and macros.
Kill the freelancer? I'm a freelancer and my favorite thing to tell cheap potential clients for the past 15 years is do their site with Wordpress and to go find a Wordpress "expert".
It exists for the broke and the cheap who are under the illusion that they need a simple website, which itself is a dead letter.
It's too bad you didn't go into using WordPress for higher-end sites. We're seeing huge growth on the enterprise side, which Automattic calls VIP, including taking significant share from Sitecore, Drupal, Magento, Adobe, and many others in sites with budgets in the seven-figures and beyond.
I would say the main gating factor is the number of agencies and developers who can handle bigger clients including governments.
I have worked with themes that used Timber and it has its own set of quirks.
I also have an opinion that using things like Timber in WP themes just adds to the inconsistency instead of helping it. Taking over website with Timber when you never heard of it is fun.
I don't want discourage, use what you like. Just my 2 cents.
I am by no means a Wordpress expert, but I have had to deal with moving clients sites from time to time and I have vivid memories of hardcoded absolute file system paths in the database embedded in serialized PHP that broke when trying to move their installation to a new server with mildly different pathing.
If you adhere to development standards your users aren't locked in to your platform. They could move to better working, more manageable CMSes instead of begrudgingly having to pay someone or, better yet, move to your hosted solution to keep the platform from tripping on its own feet.
Unfortunately that could negatively affect your "Our platform powers 43.4% of all websites" marketing pitch.
Actually market effects these days make it so that clients themselves demand WordPress, and are unwilling to try any alternative platforms at all. So either I decline the client and make no money or have to use WP.
I agree that WordPress has often failed to live up to development standards, but those aren't them, those are ones that can legitimately vary between platforms.
The use of comments alongside the HTML was the result of a very long (and honestly very public) discussion, ultimately, it boils down to those reasons:
- Comments exist to define a block boundary.
- JSON inside a comment exists to load up user preferences for things that can't be easily parsed from the HTML.
- HTML has to be the final result and representations, and it has to be the source of truth.
- The outcome has to be portable to any other platform or system, you can't move the website tomorrow and get a bunch `[xyz_shortcode]`.
I encourage you to read this post by one of the senior engineers who worked on the project since its inception:
Quick judgments and strong opinions have unfortunately become part of the community.
Having spent the last 2-3 months working excessively on WordPress development, I would like to say a word about the excellent isolation of code with blocks ("Gutenberg"). As standalone plugins or in combination with Advanced Custom Fields, these allow for perfect, modular websites and development flows (design system), where even the HTML is 100% in your own hands. I can recommend everyone to understand and learn WordPress properly.
I'm doing what you're proposing literally right now.
I have a fascinating error 500 on production because somehow, somewhere, today Gutenberg and ACF w/Blocks are having a disagreement on parsing the content of a nested media field. Which could be ranging from "the user added an image description where he shouldn't have" to "a global object from a plugin is polluting other global objects passed to acf_register_block_type()".
Maybe I should call the already irate client and tell him he should avoid quick judgments and strong opinions.
By the way, the issue was cunningly appropriate for this thread: Considering that in wordpress EVERYTHING is stored in the DB as an article in the WP_POST table (Yes, even stuff like attachments, images, and the menus) an hook from a slider plugin was messing up with the image descriptions, which are stored as...the main body text of an article. Which is actually an image.
In a classic wordpress install this would just cause some weird garbage in the output, but given that in a gutenberg+ACF setup the content data is passed to the React/Block rendering engine, it would absolutely go crazy.
I think most peoples judgments have been formed over 21 years. WordPress initially gained a reputation for being a fast and easy way to setup a website, then gained a reputation for being a security nightmare.
Maybe its not anymore but people are right to be sceptical. I sure do see a lot of CVEs in the weekly update I check - maybe they're all low risk, or relate to rarely used plugins.
I think the root of bad reputation was due to various plugins and their usage pattern:
lots of non-tech users heard that they can use plugins X Y Z for fun and profit, so they started to use them, but no one told them that managing dependencies requires some skill or at least discipline; that the fact some 3rd party pluggable software exists doesn't automatically mean it's good, viable, maintainable and safe; and that things in IT don't work by means of cargo cult, copy-pasting without underdstanding and by crossing fingers. So, there was a fallacy: these people believed (and many believe until this day) that they can remain being non-tech users while maintaining their wordpress-with-plugins installation, but it's impossible; one needs to become tech-aware in the process.
I am not sure what WP community did to dissolve this fallacy; maybe they did something. maybe didn't.
One of my first programming moments when I was a child - I naïvely opened the wp index.php to understand how it works. I remember I couldn't understand a thing except the comment in the top of the file "code is poetry".
Dear op thank you for changing my mentality about code, inspiring me and pushing me into it.
It sure seems that way until you need to get just a little bit deeper and you realize what a dumpster fire WordPress is.
You want metadata on posts, you install ACF. You want to filter on that metadata, good luck if it's over a couple filters simultaneously, the SQL queries will time out. Take a look at WP's insane schema to figure that one out.
Gutenberg promises to have WYSIWYG editable React components, which is a big deal, but they made insane decisions like storing the attributes in HTML, rendering HTML in the database, and requiring component developers to keep an array of deprecated changes when they want to modify anything on the component.
There are some people trying to untangle Wordpress by refactoring and bolting Laravel onto it[1], but every layer is just a nightmare; the authors of different parts can barely assess why things randomly break.
You might find WP appealing for the plugin ecosystem, but the plugins are completely random in implementation, so you're likely to get a bloated scramble of CSS and JS pushed to your users.
I moved to Directus and Astro, but I would probably use a Laravel-based CMS like October or Statamic for more generalized PHP deployment.
Can you recommend some of the better ways to understand and learn it properly?
(Worked with it extensively 2009-2011, including authoring/modifying plugins, but never felt like I really understood it, only vaguely understood/appreciated it)
What's the best skeleton theme to build your own theme on in 2024, that supports Full site editing, Gutenberg etc?
After a decade away from WP I wanted to set up a new site. The default 2024 theme doesn't meet my needs, and I couldn't find a modern skeleton theme where I could add in Tailwind and build what I wanted. I've used https://roots.io/sage/ previously but they're moving further and further away from the WP way of doing things.
Edit: or instead of a skeleton theme, a good free FSE theme to build on?
This was a bit of a reaction to other CMSes that were creating dozens or hundreds of tables, which creates a different set of problems for things like search or overly complex joins.
I love Wordpress. People install it on their own, install dozens of useless, unsecure and buggy plugins ("it's easy, just clic clic clic... I love my admin panel !") and after a while their websites break and then we can charge them for a more secure and resilient solution.
Back in 2011, I had the pleasure to take a peak at the sociable plugin (#2 on their plugin ladderboard) and it was one of the more brittle and bloated piece of code I ever saw. Felt like an unfinished weekend project that dragged too long and ended up published, 5 screens long for loops over massive globals, duplicated to then do whatever.
They sure made it enticing to install plugins, if not just by putting this UI to the forefront. Also, when images aren’t compressed by default, it’s a perfect alliance with the various SEO analyzers which mandate you to compress them…
WordPress is my favorite example of "It doesn't have to be perfect, it just needs to work"
So many cool projects die because people over-complicate the first steps. You can always make it better later if people start using your thing, but first you gotta ship.
Funny, I think it proves the contrary. Wordpress effectively made their whole code base the public API, so now they’re stuck with the legacy code they have for eternity, unable to meaningfully improve it, as plugins may depend on the existing state.
It’s so bad, the PHP language developers are unable to implement some features/fixes in the language, as the Wordpress team refuses to migrate their code, which makes for a huge chunk of PHP usage. Imagine that.
This is stability. Stability is good. There is no need to change code that works just because it collides with modern taste.
If WordPress has a stabilizing influence on php that's even better. All the breaking changes of the new versions are a nightmare for an established project I work on.
Wordpress requires at least PHP 7.0... and will complain about it if it's not above 7.4 (which was released in 2019).
So this to me looks like WP is progressing with PHP, just slowly.
Frankly I don't have a massive problem with this.
The speed of Laravel's PHP baseline change may be appropriate for Laravel, because it is git-managed, more easily run in a container etc., but it's absolutely inappropriate for WordPress to chase the edge.
Compared to trying to stay up-to-date with needless Node.js changes and frameworks that get EOL'd as soon as there's something more fun to play with, it's a paradise.
Why don't people build things with a decade of life in mind?
WP is the perfect tool for 95% of the job with the last 5% of tweaking being incredibly frustrating. I've used it extensively and it's longevity is a testament to its usefulness may it be around for another 21yrs.
To be honest, I never found WordPress easy to use. It's all flowers and rainbows as long as I can find good themes and plugins. However, it starts going south as soon as I need to make a very small custom change.
I've always considered myself an above average web developer, my friends would always have Wordpress websites, and ask me if I can just tweak a few things.
Without hesitation, I'd proclaim I could easily make those changes!
Then I'd load their site, load their plugin/theme code and css files, struggle for hours to get the desired effect, and even if I got it to work, I would break every other part of their site.
---
Denigrating anecdote aside, good job Matt, loved the story at the end.
I had the exact same thing happen years ago and I've never felt so helpless. Simple banner / color change. Ended up rebuilding the entire site from scratch it was easier.
Once you spend some time in the codebase and understand a bit of its legacy history it gets easier over time. A lot of plugins and solutions are aimed towards non-technical users and a lot of overlap. Where we might just write up some custom HTML others might install 3 plugins to make it work.
Initial setup of wordpress is super easy, but it gets very hard to maintain after a while. Updates require manual intervention, themes must be fixed, plugins deprecate. All of this adds a burden I am not willing to accept, which is why I moved all my sites to Hugo/Jekyll/Mkdocs (etc.) since about 2017.
I switched to ghost, at first it was a bit rough around the edges, but since they made the global cli. It has being quite nice. For blogs, would rather use that than WP. Of course I also prefer JS instead of PHP.
What I find remarkable is that multiple people can say 'I am a Wordpress Developer' and it will translate into very different experiences and skillsets.
For some it means clicking around installing theme, plugins then writing the content of pages through the Wordpress admin.
For others it means old school php code to customize Wordpress behaviour with PHP template to write the HTML. This is called classic theme.
For yet other people it means writing JS+React with docker, CI/CD,... This is the new block theme.
This isn't true at all. The vacation policy is "Our time off policy is short: take the time that you need" and "There is no minimum or maximum, but we encourage you to take at least 25 days of time off per year".
Using globals everywhere and encouraging spaghetti code with its classic themes, and with its new themes it evidently learned nothing and is encouraging JSON inside HTML comments which obviously has no editor support, is very prone to errors, besides being just plain stupid (like seriously, some senior engineers I assume decided to have templating inside HTML comments as JSON?). If I had my tinfoil hat on, it's almost as if they actively try to kill the freelancer or digital agency market and push everything to its WYSIWYG site builder on WP.com.
Part of it is this implicit structure it defines, which file it loads adter ehich other file to make a whole page. It seems convenient at first, if only you know it, but it encourages people to not properly finish all their HTML elements on the same file, but split them up stupidly and end them in other files, never to be reused.
It all seems very beginner-mistake like. But I guess they are stuck with this now, because thousands of themes rely on this, instead of having a structure based on composition. Contrast this for example with how one uses Jinja2 templates rendering blocks and macros.
It makes them extremely friendly to non-technical users, which I think is the majority of their userbase.
However, it makes it impossible for them to change technical decisions made in the past.
It exists for the broke and the cheap who are under the illusion that they need a simple website, which itself is a dead letter.
I would say the main gating factor is the number of agencies and developers who can handle bigger clients including governments.
https://timber.github.io/docs/v2/
I also have an opinion that using things like Timber in WP themes just adds to the inconsistency instead of helping it. Taking over website with Timber when you never heard of it is fun.
I don't want discourage, use what you like. Just my 2 cents.
Unfortunately that could negatively affect your "Our platform powers 43.4% of all websites" marketing pitch.
Deleted Comment
- Comments exist to define a block boundary.
- JSON inside a comment exists to load up user preferences for things that can't be easily parsed from the HTML.
- HTML has to be the final result and representations, and it has to be the source of truth.
- The outcome has to be portable to any other platform or system, you can't move the website tomorrow and get a bunch `[xyz_shortcode]`.
I encourage you to read this post by one of the senior engineers who worked on the project since its inception:
https://lamda.blog/2018/04/22/the-language-of-gutenberg/
The documentation is in itself very expansive and throughout, you should give it a read:
https://developer.wordpress.org/block-editor/explanations/ar...
Gutenberg in itself is a very versatile tool and isn't locked to WordPress btw, you can build your own editor if you want (all JS, no PHP):
https://wordpress.org/gutenberg-framework/
Having spent the last 2-3 months working excessively on WordPress development, I would like to say a word about the excellent isolation of code with blocks ("Gutenberg"). As standalone plugins or in combination with Advanced Custom Fields, these allow for perfect, modular websites and development flows (design system), where even the HTML is 100% in your own hands. I can recommend everyone to understand and learn WordPress properly.
– no relation or connection to WordPress.
I have a fascinating error 500 on production because somehow, somewhere, today Gutenberg and ACF w/Blocks are having a disagreement on parsing the content of a nested media field. Which could be ranging from "the user added an image description where he shouldn't have" to "a global object from a plugin is polluting other global objects passed to acf_register_block_type()".
Maybe I should call the already irate client and tell him he should avoid quick judgments and strong opinions.
In a classic wordpress install this would just cause some weird garbage in the output, but given that in a gutenberg+ACF setup the content data is passed to the React/Block rendering engine, it would absolutely go crazy.
I think most peoples judgments have been formed over 21 years. WordPress initially gained a reputation for being a fast and easy way to setup a website, then gained a reputation for being a security nightmare.
Maybe its not anymore but people are right to be sceptical. I sure do see a lot of CVEs in the weekly update I check - maybe they're all low risk, or relate to rarely used plugins.
lots of non-tech users heard that they can use plugins X Y Z for fun and profit, so they started to use them, but no one told them that managing dependencies requires some skill or at least discipline; that the fact some 3rd party pluggable software exists doesn't automatically mean it's good, viable, maintainable and safe; and that things in IT don't work by means of cargo cult, copy-pasting without underdstanding and by crossing fingers. So, there was a fallacy: these people believed (and many believe until this day) that they can remain being non-tech users while maintaining their wordpress-with-plugins installation, but it's impossible; one needs to become tech-aware in the process.
I am not sure what WP community did to dissolve this fallacy; maybe they did something. maybe didn't.
The real problem is the plugin ecosystem, which is not impossible to navigate for the disciplined, but at times bears resemblances to the Wild West.
So, what ends up happening is:
1. Cheap ’experts’ install every plugin under the sun.
2. One of these plugins inevitably gets pwned.
3. Headline: ‘WordPress backdoored’.
Dear op thank you for changing my mentality about code, inspiring me and pushing me into it.
You want metadata on posts, you install ACF. You want to filter on that metadata, good luck if it's over a couple filters simultaneously, the SQL queries will time out. Take a look at WP's insane schema to figure that one out.
Gutenberg promises to have WYSIWYG editable React components, which is a big deal, but they made insane decisions like storing the attributes in HTML, rendering HTML in the database, and requiring component developers to keep an array of deprecated changes when they want to modify anything on the component.
There are some people trying to untangle Wordpress by refactoring and bolting Laravel onto it[1], but every layer is just a nightmare; the authors of different parts can barely assess why things randomly break.
You might find WP appealing for the plugin ecosystem, but the plugins are completely random in implementation, so you're likely to get a bloated scramble of CSS and JS pushed to your users.
I moved to Directus and Astro, but I would probably use a Laravel-based CMS like October or Statamic for more generalized PHP deployment.
[1]: https://roots.io/
(Worked with it extensively 2009-2011, including authoring/modifying plugins, but never felt like I really understood it, only vaguely understood/appreciated it)
https://fullsiteediting.com will help you.
It's a great project.
After a decade away from WP I wanted to set up a new site. The default 2024 theme doesn't meet my needs, and I couldn't find a modern skeleton theme where I could add in Tailwind and build what I wanted. I've used https://roots.io/sage/ previously but they're moving further and further away from the WP way of doing things.
Edit: or instead of a skeleton theme, a good free FSE theme to build on?
I am tempted by Anders Norén's Björk, which is also FSE:
https://andersnoren.se/teman/bjork-wordpress-theme/
I think I did most of my learning with Carolina's own Jace theme.
(FWIW I have always thought the roots.io stuff is a mistake, conceptually.)
The fact that people use it for something else is what create strong opinions.
Example : woo commerce.
Products ? In the WP_POST db. Orders ? In the WP_POST db.
And in every post about WP it says that using WP_POST for storing your data is good practice.
Well I don't think it is (but it's only my opinion. A strong one).
And the problem is that a LOT of plugins and themes are like that.
> Orders ? In the WP_POST db.
No longer true, at least for new installations: https://woocommerce.com/document/high-performance-order-stor...
So many cool projects die because people over-complicate the first steps. You can always make it better later if people start using your thing, but first you gotta ship.
It’s so bad, the PHP language developers are unable to implement some features/fixes in the language, as the Wordpress team refuses to migrate their code, which makes for a huge chunk of PHP usage. Imagine that.
If WordPress has a stabilizing influence on php that's even better. All the breaking changes of the new versions are a nightmare for an established project I work on.
So this to me looks like WP is progressing with PHP, just slowly.
Frankly I don't have a massive problem with this.
The speed of Laravel's PHP baseline change may be appropriate for Laravel, because it is git-managed, more easily run in a container etc., but it's absolutely inappropriate for WordPress to chase the edge.
Compared to trying to stay up-to-date with needless Node.js changes and frameworks that get EOL'd as soon as there's something more fun to play with, it's a paradise.
Why don't people build things with a decade of life in mind?
Without hesitation, I'd proclaim I could easily make those changes!
Then I'd load their site, load their plugin/theme code and css files, struggle for hours to get the desired effect, and even if I got it to work, I would break every other part of their site.
---
Denigrating anecdote aside, good job Matt, loved the story at the end.
Once you spend some time in the codebase and understand a bit of its legacy history it gets easier over time. A lot of plugins and solutions are aimed towards non-technical users and a lot of overlap. Where we might just write up some custom HTML others might install 3 plugins to make it work.
A lot of the stuff you want to do can be maintained at the command line. And it even gives you a way to do some fleet management.
Deleted Comment
For some it means clicking around installing theme, plugins then writing the content of pages through the Wordpress admin.
For others it means old school php code to customize Wordpress behaviour with PHP template to write the HTML. This is called classic theme.
For yet other people it means writing JS+React with docker, CI/CD,... This is the new block theme.
if they have chosen a diverse enough clientbase.