To really become an expert at something, you have to take it apart and put it back together again. Mechanics do this with cars; computer whizzes do this with hard drives and motherboards; and gamers do this with vintage systems and high-end gaming rigs.

At WP Engine, we do it with WordPress.

A small team of us recently held what we call a “break-a-thon,” an event where we cook up hacks to intentionally break WordPress to help train our support organization. That way, if we ever encounter these breaks in a customer environment, we’re armed with the knowledge to fix it. It’s all about learning by doing.

For this particular break-a-thon, breaks were judged on the following criteria:

  • It had to teach something that is easier learned by doing rather than by reading or being told ahead of time
  • The skill or knowledge gained should be broadly applicable to more than just one specific break
  • It must be relevant in the wild as a common or realistic issue (this was a training exercise, after all)

Dozens for breaks were submitted, here are the top 11:

  1. WP_MAX_MEMORY_LIMIT too low – If this setting is too low, operations in wp-admin may run out of memory. Sometimes plugins or themes will set this using the ini_set() PHP function, which can be tricky to track down.
  2. “Fancy” or “Curly” quote snuck in to wp-config These little buggers show up all the time on websites, and if you copy/paste code that contains them, it can really mess stuff up.
  3. Javascript redirect to mobile – It’s common for plugins to cause redirects, but sometimes Javascript ends up added to the contents of a particular post or page. It can be tough to track down, but fortunately it’s easy to fix once you do!
  4. Database Connection Error – These usually stem from one of two things: MySQL being down, or incorrect settings in wp-config.php. For this break, we focused on the latter. It is generally more common. We have safeguards and scripts in place to prevent this from happening, but it’s still good to know!
  5. PHP Fatal error in plugin or theme – These usually show up pretty clearly in an Apache/PHP error log. It may be a result of PHP version differences or just bad PHP.
  6. Excessive autoloaded data – WordPress (or plugins/themes) considers certain information in the _options table to be important for every page load (autoload=’yes’). However, sometimes it gets a bit out of hand and can really slow things down. Sometimes plugins will even leave a bunch of data behind after being deactivated/uninstalled. In these cases, the fix is easy! Just delete the offending database rows.
  7. Missing .htaccess – The rewrites here are super important, especially for WordPress to use “permalinks” or “pretty URLs”. What happens if .htaccess is just removed? Usually unexpected 404s, which are no fun for anyone. Conveniently, it’s a pretty easy fix.
  8. Bad permalinks – Similar to the last problem, if invalid settings end up in the database for permalinks, you might find weird stuff ending up in your site’s URLs. Permalink settings are always a good thing to check when troubleshooting URL oddities.
  9. Admin bar not showing when logged in – Sometimes (for whatever reason), a theme or plugin may choose to put something like show_admin_bar(false) in its code. Why? Who knows, but it happens. Some plugins might even be designed to do this (for reasons?)!
  10. “Insufficient permissions” in wp-admin – Often this is due to bad settings in _usermeta. Attention to detail is key here — sometimes it’s just a couple of characters from a previously different database prefix!
  11. Bad MIME type in .htaccess – Is your site downloading a file instead of showing a page in the browser? Your .htaccess settings might be at fault.

Breaking (and then fixing) WordPress is just one of the ways we stay ahead of the game and sharpen our WordPress expertise so we can serve our customers better. The break-a-thon was a smashing success.