Live data from Hacker News

The complicated futility of WordPress

coderjerk.com

221–230 of 241 posts

Re: The complicated futility of WordPress

#221
post #64

Earlier quoted context omitted.

My business partner and I hit a wall when we tried to automate WordPress. We tried to implement a plugin where Events in WordPress would be triggered, evaluate Conditions and then execute Actions (Send email, Trigger Webhook at Zapier, Update fields over the triggered record, etc.) Turns out, WordPress is not architecturally ready for this much evolution. And that's when we got disenchanted from WordPress and went to…

This doesn't make any sense or you are explaining it badly. You are basically describing how every WordPress plugin already works via filters and actions (collectively referred to as hooks).

WordPress's fault, in this case, is that event propagation for specific actions to be hooked is poorly architected.

It's impossible to differentiate "Create a post" event from "Update a post"; they propagate the same event. Every minor change on the post also triggers this event type, along with others. Therefore, leading to scenarios where "On post creation" and "On update, this field of this post" would lead to the same workflow triggered. As an Automator, you don't want to trigger the same workflow for another event that you didn't intend to. Our idea was to use the Conditions to judge if this workflow would run or not, but...

We hit another roadblock; another issue was that when an event is triggered and conditions are to be evaluated, WordPress doesn't include in its payload the previous state of the fields, so if you want to do a "diff" (so you can tell which field values change) you then have to store the current state somewhere to be able to do such a "diff" to compare.

We then had two roads:

- Re-tool the core of WordPress with the functionality (with a lot of PHP hackery) that would enable us to run workflows the right way.

- Relying on the existing API and end up with the same feature set that Uncanny Automator plugin currently has.

So, instead of reinventing the wheel, we just dropped the idea.

Re: The complicated futility of WordPress

#222

I'm not a serious WordPress user, so this comes from a perspective of not quite understanding what OP is describing. But. "From the beginning [using wordpress for complicated non-blog sites] has felt like a hack – WordPress is, and always has been a blogging platform at heart," but once WordPress decides to "pull away from this use case completely" [wait, what use case?] to "move the platform to a fully fledged site…

> wait, what use case? Blogging > toward the OP's use case No, they have moved toward general purpose site building, not focused on _blogging_

I thought OP was saying that they did not use WP for blogging, from the start, which always felt like a hack since WP was focused on blogging, but OP made it work anyway.

Did I misunderstand? I don't think so. OP says:

> I build websites for a living. Lots of them. These websites are designed by a team of designers who design complex, bespoke, heavily branded layouts. I take those designs and my team of developers and I turn them into corporate websites, generally for medium sized industrial clients.

> Sometimes the websites are big brochures, sometimes they have complex functionality. Sometimes both. They run to hundreds of pages and posts, composed of multiple layouts, templates and using, typically, 20 or more discrete modules, each configurable in multiple ways by the end user when the sites are ultimately turned over for the marketing staff of these mid sized companies to edit.

> Many of them use WordPress as a CMS. From the beginning this has felt like a hack

OP does not describe what they do for a living as blogging or providing blogs. I see OP saying that they always used WP as a general "CMS", for "websites" that may be "big brochures" or "have complex functionality", which are not mainly blogs. Right?

Re: The complicated futility of WordPress

#223
post #79

Earlier quoted context omitted.

My business partner and I hit a wall when we tried to automate WordPress. We tried to implement a plugin where Events in WordPress would be triggered, evaluate Conditions and then execute Actions (Send email, Trigger Webhook at Zapier, Update fields over the triggered record, etc.) Turns out, WordPress is not architecturally ready for this much evolution. And that's when we got disenchanted from WordPress and went to…

Why would it be WP's fault? Maybe your competence level wasn't on the necessary level to automate WP.

I invite you to try it. We truly wanted this plugin to happen, we finally found a niche where there wouldn't be a zillion competitors, and we found out that WordPress's software design currently looks like it's been all hacked together.

This "hacked-together" situation is not their fault in the sense that they have lacked engineering. I'm sure Automattic has some world-class engineers there. However, their codebase lags by years because of their legacy users. From a business perspective, they are hands-tied because any breaking change will bring hate towards them.

Their userbase is too big to make any significant change, and Gutenberg already fragmented their ecosystem badly. They will need to create a new next-generation product from scratch, just like JetBrains does with Fleet instead of IDEA.

For a more technical answer, I already gave detail at: https://news.ycombinator.com/item?id=30185809

Re: The complicated futility of WordPress

#224

Just today I was looking for a quick way to build a marketing site for my startup that would allow my not super technical co-founder to do the majority of the building. It has been a while since I had used WordPress regularly so maybe there are new sources out there, but I defaulted to checking out ThemeForest to find a decent theme to start with. I consider myself fairly decent at design (though I'm far from an expe…

I was recently in a similar boat, I didn't like the themes on Themeforest, so finally I used the Blocksy theme (free version) and it was perfect for what I needed. Really recommend it: https://creativethemes.com/blocksy/

Re: The complicated futility of WordPress

#225
post #25

I trust Nassim Taleb's "Lindy" concept more than any new tool in this space. It works because it has worked very well for most things for a long time and I don't need any other explanation. (My best guess is that -- content management systems inherently suck, and that Wordpress is one of the few successful ones precisely because it did not set out to be a content management system.)

From Taleb's 2012 book _Antifragile: Things That Gain from Disorder_

> Every year that passes without extinction doubles the additional life expectancy. This is an indicator of some robustness. The robustness of an item is proportional to its life!

"The Lindy effect proposes the longer a period something has survived to exist or be used in the present, it is also likely to have a longer remaining life expectancy"

https://en.wikipedia.org/wiki/Lindy_effect

Re: The complicated futility of WordPress

#226
post #64

Earlier quoted context omitted.

This doesn't make any sense or you are explaining it badly. You are basically describing how every WordPress plugin already works via filters and actions (collectively referred to as hooks).

WordPress's fault, in this case, is that event propagation for specific actions to be hooked is poorly architected. It's impossible to differentiate "Create a post" event from "Update a post"; they propagate the same event. Every minor change on the post also triggers this event type, along with others. Therefore, leading to scenarios where "On post creation" and "On update, this field of this post" would lead to the…

They don't propagate the same event though. `post_updated` vs `wp_insert_post`.

`post_updated` passes the old and new values: https://developer.wordpress.org/reference/hooks/post_updated...

I'm the author of a sizable WordPress plugin (in terms of LoC and integration with WordPress) and nothing you are saying is making any sense to me.

Re: The complicated futility of WordPress

#227

I’ve been a WordPress dev since 3.0. It is a tool. And a very good one. Its market share dominance it not because it is proprietary (it is not) or because of vendor lock in (there is none). It is because it works very well, it is lightweight, it runs pretty much on any host, and is friendly to devs and end users. Part of being a good dev is knowing which tool to use (and when to not use a tool) and how to get the mos…

I have become convinced that words like “lightweight” and “fast” have lost all meaning in software circles. You’ll get two projects describing themselves in similar terms because they’re comparing themselves to wildly different things. (For example: Hexo and Zola both have a heading on their front pages titled “blazing fast”, but for equivalent loads Zola will be much faster than Hexo, probably a minimum of 5–10×, and Zola isn’t even particularly optimised, just written in Rust.)

The WordPress download is 20MB compressed, 63MB uncompressed, containing almost half a million lines of PHP spread across over a thousand files (~16MB; around 55% code, the remainder blank or comments), over half a million lines of JavaScript in over 500 files (~25MB; around 67% code), a couple of hundred thousand of CSS in 700 files (~7.5MB; around 75% code), and the odd spot of other languages. (This is in languages where more code fairly directly means slower, even if faster code can claw that back; whereas in compiled languages, more code just means slower compilation, and runtime performance is comparatively uncorrelated.)

That’s not particularly lightweight.

Conceptually WordPress isn’t lightweight, either. I’ve never used WordPress myself, but I’ve seen three people using it, and in each case they were being drowned in choices and data fields, using two or three fields out of the thirty or more fields it was shoving in their faces; and the themes and plugins and such made matters considerably worse and more complex; and a lot of that complexity didn’t seem well-structured, though my observation has only ever been brief.

Re: The complicated futility of WordPress

#228

Earlier quoted context omitted.

WordPress's fault, in this case, is that event propagation for specific actions to be hooked is poorly architected. It's impossible to differentiate "Create a post" event from "Update a post"; they propagate the same event. Every minor change on the post also triggers this event type, along with others. Therefore, leading to scenarios where "On post creation" and "On update, this field of this post" would lead to the…

They don't propagate the same event though. `post_updated` vs `wp_insert_post`. `post_updated` passes the old and new values: https://developer.wordpress.org/reference/hooks/post_updated... I'm the author of a sizable WordPress plugin (in terms of LoC and integration with WordPress) and nothing you are saying is making any sense to me.

Yes, these are different hooks with different parameters, but these are triggered by the same function[0].

When the function is called, all of these hooks are triggered. To identify what the user was doing (post creation on the first time? post updated? is the status being updated?), unless you have many conditions (potentially nested ifs), it's a cumbersome job.

For example, a user wants a workflow every time the post is sent to the Trash. When a post is sent to the Trash, three things happen:

- A hook is triggered because it's sent to the Trash.

- The updated status one is also triggered (Published -> Trash).

- The Updated post one is also triggered, because yes, this is an update.

Yes, these are different hooks, but these do come from the same function. We tested two other plugins similar to ours and found minimal automation capabilities; we speculate this is because of the reasons I just exposed.

If you check out the source code for wp_insert_post(), you'll find many do_action(). When clicking the "Add Post" button, the post is created at that moment (so it can reserve the permalink, etc.); by the time you save the post for the first time, in reality, it's being updated, not saved for the first time as one would believe.

This is just a single example, but these software design decisions make it not that straightforward to create an automation plugin. By the way, that function calls many others inside, functions that trigger hooks by themselves; therefore, you'll have many workflows trigger attempts many times per second, just by saving the post.

EDIT: Clarity.

--

[0]: https://developer.wordpress.org/reference/functions/wp_inser...

Re: The complicated futility of WordPress

#229

Earlier quoted context omitted.

WordPress's fault, in this case, is that event propagation for specific actions to be hooked is poorly architected. It's impossible to differentiate "Create a post" event from "Update a post"; they propagate the same event. Every minor change on the post also triggers this event type, along with others. Therefore, leading to scenarios where "On post creation" and "On update, this field of this post" would lead to the…

They don't propagate the same event though. `post_updated` vs `wp_insert_post`. `post_updated` passes the old and new values: https://developer.wordpress.org/reference/hooks/post_updated... I'm the author of a sizable WordPress plugin (in terms of LoC and integration with WordPress) and nothing you are saying is making any sense to me.

Addendum to my previous comment (as an in-depth technical review):

Check out the source code of wp_insert_post() [0] on line 4407, you'll see three hooks that trigger: "edit_post_{$post->post_type}", 'edit_post' and 'post_updated').

Then after that, these other ones trigger unconditionally: "save_post_{$post->post_type}", 'save_post' and 'wp_insert_post'.

For the cherry on top: wp_after_insert_post() is called, with several other hooks on their own.

Try to evaluate each configured workflow whenever every one of these hooks triggers. Your WordPress installation will get slow in no time.

Somebody designed this function this way, and that design is inhibiting effective WordPress automation.

--

[0]: https://github.com/WordPress/wordpress-develop/blob/5.8.1/sr...

Re: The complicated futility of WordPress

#230
Surprised no one has talked yet about Ghost, which feels like what Wordpress would have been had it been founded in 2013 instead of 2003. I recently converged from Substack, Convertkit and Wordpress down to just Ghost. It's not perfect but it's damn good. https://www.jasonshen.com/switching-to-ghost/
Post reply on HN