Although there are quite a few features in this release, I want to talk about what I feel is the most important feature: automatic updates.
It’s a fairly simple – when a new version of WordPress is released, your installation will be updated (almost) immediately. As of 3.7, these automatic updates are limited to minor maintenance releases to make sure they won’t break your theme or plugin.
As WordPress has become more and more popular, exploits against WordPress have grown not just in quantity but also in complexity. As the threats have increased, so have the defenses — automatic security updates is just another step in the right direction. The last thing I want is for your blog / site to be compromised.
So, I strongly recommend updating to 3.7 as soon as existing themes and plugins have been verified to work with it (you’re using a staging environment… right?).
I’ve been playing around with Vagrant recently. It really is a great tool for setting up development environments quickly and cleanly – no more local MySQL databases with 100 separate databases!
There are a few ways to solve this problem that many WordPress developers have:
Regularly clean your databases up and delete old ones.
Use a common WordPress install, switching themes.
Use Vagrant.
I’m going to be talking about the last option, Vagrant, in this blog post. I’ll list out a few reasons why Vagrant was attractive to me in the first place:
Isolation – this was appealing not only to reduce my database clutter, but also to be sure that the development and production environments were as similar as possible (within reason – of course).
Portability – another killer feature of Vagrant. Check out the repository, vagrant up, and you’re ready to go.
Coolness – don’t you love the idea of having contained, automatically managed environments for your projects? No? Well, I do.
It’s a template based on Underscores (_s), a template theme for WordPress themes. I’ve made two modifications: convert the CSS to SCSS, and the JavaScript to CoffeeScript. Grunt, an excellent automation tool, is used to compile the sources into CSS and JavaScript.
I’ve made the template compatible with _s, so just follow the instructions for _s regarding naming your theme, then the directions for getting your development environment set up. If you want to use an existing theme, just drop it inside the theme folder (and don’t forget to update the name in the Vagrantfile!)
I’m always open to new ideas and pull requests – please don’t hesitate to contribute!
Snoopy is a bookmarklet for snooping on web pages. It’s intended for use on mobile browsers (such as Mobile Safari on the iPad) where you can’t view-source to poke around under the hood of sites to see how they’re built. You might find it useful for your desktop browser, too.
This is very cool. I’ll need to put this onto my iOS test devices – it’s a lot faster than plugging in and using the remote debugger.
If you aren’t familiar with Marshal.dump and Marshal.load, you probably should be. It’s used to serialize Ruby objects into binary data – mostly caching.
my_data = Rails.cache.fetch('an_object') do
MyData.where(condition: 1).includes(:user).first
end
my_data.user
# On cache miss:
# => SELECT "my_datas".* FROM "my_datas" WHERE "condition" = 1 ORDER BY "id" ASC LIMIT 1
# => SELECT "users".* FROM "users" WHERE "id" = 1
# On cache hit:
# => SELECT "users".* FROM "users" WHERE "id" = 1
So, I wrote a quick module to make Marshal.dump and Marshal.load dump and load the association data, as well.
Just writing to let you know that I’ve switched servers for this blog! I’ve been meaning to get this on to a faster server that I have control over for awhile, and I finally got around to doing it.
For those of you who are curious, this site is being served by WordPress Multisite, on a Sakura 2G VPS.
That’s it! There is some moderate caching in most layers (WordPress Object Cache, APC, NGINX, etc), but nothing too drastic. It’s much faster now than it was on the previous server – we’ll see how this one holds up.
Thoughts during the Migration Process
MariaDB
I can’t say this enough – really, really, really smooth. Just stop mysql, remove, install MariaDB, then start it up again. All my data was migrated automatically.
One of the things that I’ve built regularly are custom WordPress themes for clients. Let me clarify — a custom theme for each client. One theme per client.
So, I decided to try my hand at making a “proper” WordPress theme — a theme for regular users. And I submitted it to the WordPress themes gallery. Successfully!
There were, however, quite a few catches along the way.
If you are even a lightly experienced programmer, you understand the importance of a uniform code style. This applies here, too. WordPress has a fewcodingconventions that you should adhere to.
If you use _s, you’re pretty much set on this – just follow the conventions that have been established.
Completeness.
Support for comments, post titles, categories, tags, et cetera. You need it all.
Compatibility / interoperability.
This is a big one.
Please don’t design your theme to have any special features.
Since the purpose of Themes is to define the presentation of user content, Themes must not be used to define the generation of user content, or to define Theme-independent site options or functionality.
Ideally, a user should not have the appearance of lost data when switching themes. Switch themes throughout development semi-regularly, just to make sure your users are happy both when they try your theme and when they try other themes.
Edge cases.
This is a little harder – there are quite a few edge cases (long titles, non-breaking text, you know the general culprits).
I strongly recommend using the WordPress Theme Unit Test suite of tools, including a WXR file full of edge cases, against your theme during development.
So?
Quite a few of these catches can be easily overcome by simply building your theme with a steady foundation. I highly recommend _s, a theme that Automattic (the makers of WordPress.com) built. Not only does it get you started with the basic features (think comments, theme hooks, base CSS classes), it will provide a basic template for more advanced features, such as Jetpack compatibility, the live theme editor, among others.
There have been more than a few times where someone needs to send a big file to me. So, I made a quick and dirty tool to allow anyone to upload files directly to a S3 bucket.
No more shuffling links around, worrying about them expiring, and wondering whether the data stored is safe or not.