Rant about WordPress

digitalpoint

Well-known member
This is a rant to save my girlfriend from having to continuously hear about what utter crap WordPress is under the hood. I feel bad because it's more or less the only thing I've been talking about the last week.

Going from XenForo 2 development to WordPress is like punching myself in the face 95% of the time working with it because it's terribly inefficient and things that should be there are not.

So let's compare things here... Let's take the Firewall config page from my Cloudflare addon. This is it in XenForo:

1676476590967.webp


Forgetting about how ugly WordPress is, this is what the same plugin page looks like in WordPress:

1676476656246.webp


So now...
  • WordPress doesn't segment client-side assets from server-side includes, so it's not even possible to "Block internal directories" (that button is missing in WordPress version). You have css and js mixed into wp-includes folder for example. Genius.
  • WordPress has no real templating system, so it's a lot of wasted time manually doing HTML directly in PHP files. The header of that page is this (you get the idea on the rest... also, the $this->params is my own doing making a pseudo template system, more on that later):
    PHP:
    echo '<div class="wrap firewall">
          <h2>' . esc_html__('Firewall Rules', 'cloudflare-app') .
    ' <a href="' . $this->params['dash_base'] . '/security/waf/firewall-rules/new" target="_blank" class="add-new-h2">' . esc_html__('Create rule', 'cloudflare-app') . '</a>' .
    '</h2>
       
       <form method="post" action="' . esc_url(menu_page_url('cloudflare-app_firewall', false)) . '">
       <input type="hidden" name="page" value="cloudflare-app_firewall"/>';
  • There is no template system, so I ended up creating a rudimentary one just for my plugin.
  • There is no controller/view type system, so I ended up creating that too.
  • The methods for sanitizing input is a joke, so I rewrote that just for my plugin. You know what else? WordPress adds slashes to superglobals like $_REQUEST because it's trying to mimic Magic Quotes. lol wtf!? So don't forget to unslash user input that WordPress so kindly slashed for you without asking.
  • Confirm dialogs in WordPress are JavaScript confirm() calls. So had to make a modal dialog box just for my plugin.
    1676477263797.webp
  • I'm totally spoiled by XenForo's overlay system, so I had to make something similar (but not as fancy as XenForo's)... open in a new window and it's a normal page, click the link and JavaScript intercepts it and puts it in an overlay.
    1676477370144.webp
  • WordPress's CSRF system has a "key" that is added into the mix... meaning you can't do a universal CSRF check because it has a different key value for different things.
Thanks for reading this... and even if you didn't, I'm sure Claudia thanks you. Maybe I'll piss and moan less to her now. 😂
 
Ya, but thankfully I don't have to for this... at least not anything trickier than it already does. I just need to pull users that have a role of administrator for purposes of setting up zero access policies in Cloudflare. And that's already been abstracted out for what I need. :)

PHP:
protected function getAdminEmails()
{
   $admins = get_users(['role' => 'administrator']);

   $emails = [];
   foreach ($admins as $admin)
   {
   if ($admin->data->user_email)
      {
         $emails[] = ['email' => ['email' => $admin->data->user_email]];
      }
   }

   return $emails;
}
 
The most fun I ever had with WordPress was when saving a post with a metabox it sends an extra AJAX call, which runs a hook that also runs when saving the post without a metabox. However, one request had $post globally available when the hook runs and the other request doesn't, because some other code just so happened to globalise it at some point, meaning the hook would run different code. Wasn't immediately clear that there was an extra AJAX call, and once I noticed it I didn't know why it was there. That cost me 5 hours.
 
Last edited:
Oh ya... I should have mentioned just generally how WordPress hasn't really stepped into the object oriented world yet. Stuff is mostly procedural and where they kind of use objects (mostly just for sake of using them? I dunno... even that's done poorly), they make extensive use of global because scoping things is too hard? It's just so bad... all of it.
 
It's just heaping on top of what it started 20 years ago and never bothered to ever pay off its technical debt - mostly because that would break plugins and themes hardcore.
 
Been working on bringing R2 support to WordPress, and I’d like to lodge another rant…

Why in the **** are attachments/media/uploads considered “posts”? Let’s toss everything in the posts table, that way we don’t need to create a new table. More genius. Seriously whoever designed WordPress (even if it was 20 years ago), doesn’t know a ******** thing about anything whatsoever.

Maybe they can rewrite WordPress from the ground up and just have a single table for everything… settings, posts, users, attachments, etc. seems like a great database schema design. Dumb ****s.
 
Been working on bringing R2 support to WordPress, and I’d like to lodge another rant…

Why in the ** are attachments/media/uploads considered “posts”? Let’s toss everything in the posts table, that way we don’t need to create a new table. More genius. Seriously whoever designed WordPress (even if it was 20 years ago), doesn’t know a ****** thing about anything whatsoever.

Maybe they can rewrite WordPress from the ground up and just have a single table for everything… settings, posts, users, attachments, etc. seems like a great database schema design. Dumb ****s.
Only reason I use Wordpress is WooCommerce, and I have 9k images... Managing anything is a literal nightmare.
 
Only reason I use Wordpress is WooCommerce
I think many forum admins use it for the same reason. For this reason I tried to convince thirtybees* developers to take a look at xenforo to integrate/sync users and users groups but they are not interested. :-(

*a supported and developed prestashop 1.6 fork
 
Been working on bringing R2 support to WordPress, and I’d like to lodge another rant…

Why in the ** are attachments/media/uploads considered “posts”? Let’s toss everything in the posts table, that way we don’t need to create a new table. More genius. Seriously whoever designed WordPress (even if it was 20 years ago), doesn’t know a ****** thing about anything whatsoever.

Maybe they can rewrite WordPress from the ground up and just have a single table for everything… settings, posts, users, attachments, etc. seems like a great database schema design. Dumb ****s.
Basically everything is a post to WP. Instead of having a dedicated table per content type or whatever else, they just throw everything into it and having a table column to define whatever it is that is in there. Its really yucky and colossal. And to further the mess there are transients because WP remembers deleted data. So there not only a massive amount of diverse data. Also a lot of unnecessary stuff and even deleted stuff.
It's no wonder that WP starts to struggle once you put large numbers of data in. A WooCommerce site will really lag if it has thousands of products and Big Boards with BuddyBoss, etc struggle as wells. Something XenForo does splendidly. IMHO usergroups and permissions is a similar mess, where going from XF to WP is just a really cold shower. For the most basic stuff we take for granted in XF, you have to add plugins in WP. Often offered by... Automattic / WordPress.

While there are plenty of area's where WordPress is really stupid, there are in my view also various things where WordPress does outperform XenForo. Having to manually update 100+ addons on XF really does my head in. Forget about things like multisite, connect software & services, commerce/monetizing, page builders, complete implementation of structured data, leaner CSS or getting HTML without significant div nesting. To name a few. And if you add a Yoast or RankMath to WP, then XF does not compare. And while WP multilingual plugins are a minefield of itself, its possible to offer a multilingual website on WP, while its a pipedream on XenForo. If someone needs a multilingual website, IMHO they should better ignore XF and use Reddit, Burning Board or even BuddyBoss.
 
Someone should write a WordPress replacement (and do it right), then make a shim module that would allow WordPress plugins/themes to work on that platform. Then sell it to Automattic so they can have a backwardly-compatible, modern version they roll out as WordPress 10.0.

I’ve been having great fun having things like classes I made for XenForo work without change on WordPress. At least that’s been a fun thing to do (and only one set of code to maintain with both platforms).
 
Given the mess that is WP's plugin API I would think a shim for plugins/themes would be so massive a task to write it's borderline impossible for it to actually work.

This is also not helped by the WP community, such as it is, not wanting big new functionality in core - like WebP support was slated for core and then Automattic was like... we hear you don't want it in core so we'll do it as a plugin... which begs the question what the heck the regular core releases are even good for.
 
They already have

Looks like it's a forked/stripped version of WordPress (not a rewrite). It's the same terrible code under the hood (I didn't look exhaustively at every file, but the ones I did look at... it's just old WordPress code).
 
This is also not helped by the WP community, such as it is, not wanting big new functionality in core - like WebP support was slated for core and then Automattic was like... we hear you don't want it in core so we'll do it as a plugin... which begs the question what the heck the regular core releases are even good for.
Actually, since I've been dealing with WordPress images/media/attachments the last couple days and sifting through WordPress code, I noticed WordPress actually does have native webp support (which is nice).

I was curious to see when it was added natively to WordPress, and it was 5.8 (last summer):


Adding support for WebP

WebP is a modern image format that provides improved lossless and lossy compression for images on the web. WebP images are around 30% smaller on average than their JPEG or PNG equivalents, resulting in sites that are faster and use less bandwidth.

So I guess that's one nice thing about WordPress. Still not worth all the other crap (or even the code they used to implement webp).
 
Actually, since I've been dealing with WordPress images/media/attachments the last couple days and sifting through WordPress code, I noticed WordPress actually does have native webp support (which is nice).

I was curious to see when it was added natively to WordPress, and it was 5.8 (last summer):




So I guess that's one nice thing about WordPress. Still not worth all the other crap (or even the code they used to implement webp).
Huh.

Because I could have sworn I was seeing this debate play out only last year and part of the question was whether to go core or not with this, but this is really only the barest minimum that you can upload WebP to the media library and have it treated like an image. Nothing about using WebP for thumbnails etc. if it's more efficient than GIF/PNG/JPG for that image.
 
Top Bottom