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:
Forgetting about how ugly WordPress is, this is what the same plugin page looks like in WordPress:
So now...
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:
Forgetting about how ugly WordPress is, this is what the same plugin page looks like in WordPress:
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.
- 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.
- 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.