Why WordPress Sucks, and what you can do about it

While great as a CMS, wordpress really sucks as your forward facing production environment. After one week in production with our redesigned wordpress site, we had already racked up 8 hours of downtime due to database failures.

Also, we’re paying a hefty $43 bucks per month to host the Apache/PHP/Mysql monstrosity on Amazon EC2.

When I play the word association game with WordPress these are the things that come to mind:

  • Downtime
  • Database failures
  • Hackers, and hack bots from all over the Internet
  • Slowness
  • Scaling issues
  • Expensive

Also, WordPress has made some very bizarre design decisions around absolute URLs that I would describe as “dumb”.  Here are some actual forum topics on the subject.

How I fixed WordPress

The only thing that can fix bad technology is good technology, so I came up with a solution that involved using Amazon S3 and Node.js/Phantom.js to build a rock solid, high performance frontend for super cheap.

wordpress

By using Phantom.js and Node.js, I was able to crawl the entire site, and pull every single resource from wordpress and the pipe it over to S3 for Static Web Hosting.

If you’re looking for a tutorial on static web hosting, read this excellent post by Chad Thompson.

Life on Amazon S3 is Nice

So now, my production environment on Amazon S3 has these wonderful qualities:

  • 99.99% Uptime
  • $0.01/month Hosting Cost (based on 100MB of data)
  • Fast response times
  • Scales automatically with traffic
  • Built to sustain the loss of two concurrent data centers
  • Hackers now have to hack Amazon (good luck with that)

If you go to the new site, and open up a javascript console, you should see this:

Notice, it’s all the familiar URLs from wordpress, /wp-content and /wp-content/themes, but all coming from Amazon’s rock solid S3 service.

As an added bonus, I have the option of doing additional processing of resources as they are piped, so I could compact and minify JS and CSS resources, or create 2X size images for retina displays or any other kind of processing without ever touching the backend of the wordpress site.  Pretty cool.

Side Note: If you’ve got a WordPress site, and you’re interested in hearing more about this, please feel free to contact me.

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Brad Carleton

Brad is a rockin' fun JavaScript coder who enjoys building cool stuff and long walks on the beach. As the Founder/CTO at TechPines, he has worked with large companies and startups to build cutting-edge applications based on HTML5 and Node.js. He is the creator of Bone.io, a realtime HTML5 framework, and is the author of Embracing Disruption: A Cloud Revolution Manifesto.
This entry was posted in aws, javascript, node.js, phantom.js, wordpress. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Maxime Hardy

    You may want to look at Varnish and NginX as reverse-proxy to achieve these kind of optimisations. There are some WP plugins to handle assets through S3 (I don’t know at which extent they manage CSS and JS minification).
    Your solution sounds a bit of overkill from an operational point of view as there are plenty of existing solutions to scale WP.

    However from a developer and hacker point of view, that looks really fun! ;)

    • techpines

      Cloning the frontend of a web application to a static hosting provider is a good idea in my opinion.

      I think you’re right that a caching layer with Varnish and Nginx would be a good solution towards scaling WordPress. But then you have to worry about keeping your caching servers up and running, as well as WordPress/PHP/Mysql. That is more of an “operational hassle” in my opinion.

      This type of solution can be good for not just WordPress, but other CMS’s. So instead of learning how to scale WordPress, Joomla etc. You just replicate the frontend to an already cheap, high performance, and scalable solution like S3 or a CDN.

  • iamkoch

    Have you taken a look at WP Super Cache? http://wordpress.org/plugins/wp-super-cache/

  • http://trickortip.com/ Andrés Felipe Díaz

    What a wonderful idea Brand, can’t wait to try it out myself as well. You are right that wordpress does have the issues that you meant and this is definitely a great work around.

    However, what I like the most is the benefits of the solution that you would definitely not get even spending months trying to optimize wordpress.

    • techpines

      Thanks, but my name is Brad :)

  • http://mikaelkoskinen.net/ Mikael Koskinen

    Thank you for the post.

    I’ve been trying to achieve the same (generating static HTML files from WordPress) and there’s couple WP Plugins which promise to do that, but they all have had some problems. It would be great if you could post your Phantom.js & Node.js solution somewhere.

    • techpines

      Sure, we’re looking into open sourcing a tool around this. Will let you know.

  • markotom

    Great idea! I’ve considered to do something like that with Node.js using a WordPress plugin that provide me a REST API to my web app, do you recommend use this kind of alternatives to solve the poorly performance of WordPress?

    • techpines

      I recommend it as far as you’re comfortable working with it. I think that the underlying concept of moving a “basically” static site like a WordPress install to a static hosting provider like S3, makes good sense.

  • Andrew Corkery

    Seeing as you’re using AWS, did you consider CloudFront caching? http://aws.amazon.com/cloudfront/dynamic-content/

    I’ve used this on simple sites such as this and it works pretty well. You’ve a lot of control over what gets cached and for how long using HTTP headers. Very easy to set up too with no custom deployments.

    Interested to know why it’s preferable to build your own crawler, apart from just for fun!

    • techpines

      You could use CloudFront directly, but you might run into some awkward problems with the absolute URLs.

      For instance let’s say your CloudFront website is at example.com, and you’re worpdress server is at wp.example.com. All the pages that get grabbed by CloudFront would reference wp.example.com, because of the absolute URLs.

  • rsanchez1

    I work on several sites using WordPress, where we work on a dev environment and push to production. Never have I had issues with images using absolute URLs. We upload all the images on our site using the Media Library. We change the home urls between dev and production. Doing this, we have no issues with absolute URLs.

    Additionally, we solved all those word association issues you mentioned with WordPress by using Varnish. No need to get Amazon involved, no need to set up node.js to crawl the site. Once you set up Varnish, your site is set. No DB downtime, no slowness, best of all Varnish is free to use.

    • Mike Lewek

      One environment can pull images from the other? I’ve uploaded images to both the media library and in a post, and came into absolute urls.

  • Tim Selaty Jr.

    For the $43/month setup, I think you’re referring to the m1.small instance, which has a low CPU count and is throttled on CPU priority/elasticity. That’s your largest bottleneck in performance. Sadly, even a simple switch over to something like Linode.com’s deluxe $40/month plan would yield likely x3-x4 the immediate speed. You’ll have to worry about less of your CPU being stolen too. AWS will still charge an arm and a leg for outgoing bandwidth from your server if you have a heavy and steady traffic flow (images will be the price gouge).

    You’ve developed a brilliant and affordable plan, which is great. For those not so daft, some optimization on the same server could be done to achieve similar results. As others have mentioned dropping Apache for Nginx would immediately help for server static resources and assets as Nginx’s “sendfile” allows it to bypass a lot of the memory overhead that Apache has. It’s ultra-fast and scaleable. Secondly, Varnish is ideal for serving pretty much everything (setting up invalidation is tough, but worth it). It’ll serve both your pages AND assets through memory, which is blazing fast.

  • Hiron Roy

    Great idea Brad. Any movement on open sourcing the node+phantomjs tool? What benefits has cloning using node+phantomjs provided over using a tools like httrack or comparable site cloners? I’d definitely like to hear more about the details.

    Thanks for posting.

  • Kavan Lyles

    What about using multisite with buddypress?

  • NoBoz0s

    WordPress is nothing but a bloated pile of sh*t, designed to fail so that WordPress “developers” can make money off “support”.

    If you can’t do what you need to do with HTML and Javascript, then stay the hell off the net.

    • rohiiijeee

      you stay off the net, you script kiddie

    • Argument Avenger

      Ah, yes, only people with coding skills should be able to speak their opinions or run a business online. If you can’t code, then you don’t deserve a website.

      ^ My above comments ought to be satire, because they’re so ridiculously stupid, but they’re exactly what you said–save that my version is a bit more polite! New proposal: If you can’t make a comment without being an exclusionary dick, then stay the hell off the net.

    • Jay Jay

      I never realized someone could be this stupid and still be able to type

  • Ripulryu

    I will definitely try this out.

  • http://www.snipcart.com François Lanthier N.

    Well that explains part of the animosity of the devs on our team when I mention WordPress I guess.

  • YemSalat

    Why bother with WordPress at all?

  • ArcAiN6 .

    lol.. let me just point out a few things wrong with this entire rant.

    1) Database downtime due to failures == poor database administration. wordpress only connects to the database, and adds / edits entries in the database tables. Nothing more. If you have a failure, it’s due to 1 of 3 things:
    a) poor custom code
    b) poor database administration
    c) poor database configuration

    2) Hack attempts happen against almost ALL popular CMS’s. If you are actually being breached, the core wordpress isn’t at fault, one of these are more likely:
    a) unsecured ports to services such as database, ssh, etc..etc..etc..
    b) easily guessed / brute forced passwords
    c) poor custom code that doesn’t sanitize / strip js, html, php, etc from comments or posts
    d) poor custom code that doesn’t check extension against content.. i.e. uploading blah.php.jpg and it being executed as php when directly called
    e) poor file atributes / permissions (chmod 777 to all files is derpy)
    f) poorly secured environment, e.g. not forbidding su_exec, exec from php, etc..

    2) If your wordpress is slow, try removing un-used plugins, scripts, and includes. I have seen way too many sites that load everything on all pages, when the js file is only used one 1 page. This is silly, and will lead to overhead.

    2a) Learn to utelize gzip compression, and caching of non-dynamic content. This will releave some of the loading overhead

    2b) Load your js includes at the BOTTOM of the page, not the top, that way the innitial page loads faster, i.e. images, text, content etc.

    2c) optimize your database table, memory, and indexes.
    2d) optimize your apache by removing unused modules, and tuning memory, workers and threads.

    3) Scaling issues. I’ve not seen any, se previous comments about poor / shoddy custom code, and optimization.

    4) Expense.. WordPress is FREE. You chose to use the expensive hosting solution. you can host it on a machine at home if you have the bandwidth to support the traffic.

    5) Absolute URLs.. The only time absolute URL’s are used is with poorly coded themes, and images that have been uploaded. The only time you would experience any issue with this, is when you change the domain name, a simply 1 line sql statement can fix this ” select *.* from * and update “www.domain2.com” where “www.domain1.com” ” or something similar. Other than that, all other links within the wordpress environment are populated from database settings.

    and finally.
    Adding another layer of hardware and software to ” fix ” something that isn’t broken is silly at best.

    I currently host 38 domains, 114 subdomains, and 86 wordpress installs with out breaking a sweat. If you aren’t sure of how to use Apache/PHP/MySQL , or how to optimize, and secure your environment, perhaps self hosting isn’t for you.

    Before complaining about ” cost ” and ” downtime ” try to get to the root of the issue before blaming the entire project.

    The ” redesigned ” site was obviously redesigned poorly if you’re having that much trouble with it.

    The ” cost ” is due to hosting, wich is not any fault of wordpress. The “Apache/PHP/Mysql monstrosity” (commonly called LAMP – Linux Apache, PHP, MySQL) is the industry standard. Things such as ISS, and ASP are far less common.

    • YemSalat

      Trying to defend wordpress is funny, seriously I’ve seen the code – its crap, say whatever..

      • Mike Smith

        Exactly. It’s really not good.

      • Jay Jay

        I am assuming you’ve done better? Let me guess… you code with chalk?
        1) WP is an open source project. Unless you are really that retarted, you should understand that means the code is open for public scrutiny, addition/retraction/correction. Do us a favour and please help. Oh mighty one!
        2) If you can say “I have seen the code and it’s crapy”, the same code trusted by developers of companies as big as Time.com and mashable.com, many universities and the likes, the chances are, YOU DON’T CODE AT ALL ! You probably change a theme and you think you’ve coded. Prove me wrong and post some of your “not so crappy” code here. Let’s say “Hello world”?
        3) WordPress doesn’t need defending. F*c*tards like you who think by bashing someone’s efforts makes u a man somehow, is what the Internet needs less of !
        4) If you are a good coder, I challenge you to HACK THE CRAPPY WP CODE at wordpress.com… thanks….. NOT!

        • YemSalat

          1) The hell is wrong with you? Yes I don’t think wordpress codebase is any good and I am quite a decent coder. But no, I won’t help just cause its open source. I don’t have the time and I just don’t want to, is this ok with you?
          Hate this 2-dimensional logic. There are tons of open source project that I’m not a fan of – shall I go and help every one of them?

          2) There are other things to consider when building a website apart from code quality.

          3) Oh, I see, you’re just immature, ok I’ll stop now then.

  • whitehawke

    The main problem with WordPress is the people that “design” with it tend to be 100% clueless to web technology. They are conning people into converting good performing conventional sites, created by professionals, to ‘blog-tech’ WordPress, and wrecking the client’s hard earned web presence.

    I have documented two cases where some slick talking fool from a “big box” agency talked a client into the switching. They both dropped like a rock.

    “SEO plug-ins” are hilarious. The WordPress people don’t understand how page rank is achieved, so when they take over a site they don’t know to redirect the ranking pages – they literally start the client from scratch.

    There is no shortcut to knowing the business you are in. If you want to be a web professional, take a course in html, it really isn’t that hard. Then use logic and common sense – that’s the part that evades the masses today.

    • Jay Jay

      “If you want to be a web professional, take a course in html, it really isn’t that hard.” I wanna cry… HTML is not even a programming language. It’s a scripting language hahaha
      Wordpress is NOT language. It is a Content Management System. You can use it 100% entirely with “good old” PHP or use its theming system. The fact that you can say so much nonsense about it, tells me you don’t understand it in the first place!

      • idkwpatall

        HTML is a MARKUP language…

  • Zaakir Mungrue

    oh god i love this! WordPress is a pile of shit. lies to make you feel it free then you have to pay for fonts then image effects, then you MUST pay for SEO then the upgrades are endless and even with 1 million updates wp will still have bugs. They have completely destroyed the true meaning of open source. I used to love webdesign check out http://www.ttslice.com its mines. After my wordpress experience I hate webdesign I even hate computers now. To hell with the technology of man I for god plants and animlas now. I hate webdesign now thnaks to wp.

  • Levente Nagy

    What i mostly hate about it is not following any pattern.
    Its just a bag of function collections, it totally reminds me of the early 2000 years coding style, not to mention you cannot do a lot of things without poking the core files a few times, what most of the time break after an update.

    I built lot of sites for clients based on wordpress, and when they needed to upgrade they where terrified, because not always but 85-90% of the time, something broke.

    So i coded my own CMS, an thrown WP in the trash.

    And for you fanboy’s, keep loving it, but dont try to convince us, because we dont want a huge pain in our butts

  • Simon Nicol

    Dear EVERYONE,
    You do all realise that THIS site and that THIS post is WordPress don’t you!? LOLOLOLOLOLOOLLOLOLOL

  • Jay Jay

    With all due respect to Brad, thought you have the right to complain about anything on your web space, I am sorry but you completely missed it and I dare to challenge you that there is so much you have no clue about as far as wordpress is concerned. Here’s why:

    1) WordPress is a content MANAGEMENT SYSTEM. With that, its main role is to “manage the content”, organize it,…Fortunately for some, it comes with the theming system, but you can actually use WordPress FULLY without ever loading a theme. Hence the define(‘WP_USE_THEMES’, …. ); parameter that can set to true or false. In that case, if you set it to false, you can use wordress 100% as a backend system and pull the content with “old PHP” entirely. You can ask more and I would explain. I have a client’s website that runs wordress but you can’t know at all because it’s loaded 100% from another location. You don’t need to move from EC2 to S3 !!!

    2) I managed more than 100 clients on AWS and some have servers as small as 1tier instance to extra large monstrosities. One such instance runs a website with 50,000 daily views and it DOESN’T crash. So, again, it all comes to your level of server administration. If you are used to using shared hosting where everything is taken care of for you and then you move to having to do it manually, package after package, parameter after parameter, then messing things and blaming wordpress is common occurrence. All respect due !!

    3) You said “Notice, it’s all the familiar URLs from wordpress, /wp-content and /wp-content/themes, but all coming from Amazon’s rock solid S3 service.”
    First of all, there is no such a thing as “rock solid” this or that. It’s as rock solid as the admin makes it!!!
    Secondly, /wp-content and /themes can always be altered by defining more parameters.

    define( ‘WP_PLUGIN_DIR’, …. );
    define( ‘WP_PLUGIN_URL’, …. );
    define( ‘PLUGINDIR’, …. );
    You can even move the uploads DIR from /wp-content to wherever you please by defining…
    define( ‘UPLOADS’,…. );

    There is so much more I can show you right here, but but I have created installations that run on WORDPRESS and yet are not perceived as such because it gives you that flexibility. If you don’t know how to take advantage of it is another story, but you shouldn’t complain about someone’s coding based on your sloppy admin abilities.

    In the end, WordPress itself is NOT bad. The admins of the platforms it is hosted on are sometimes another case, and the choice of plugins/themes can also lead to vulnerabilities. You can’t blame the car’s chassis maker for a type that exploded due to more than enough air pressure!! WP is like the chassis and motor. It can run smooth if you put the right tyres, the right pressure,… However, if you wanna put chains on it like a tank, it will blow in your face !!