Git: It’s Not Just For Developers

Version control: It’s one of those handy tools developers use to keep track of changes to a project. It also makes it easier to “code in the kitchen”, as it were, by allowing for small changes we may have come up with while, say cooking dinner or cleaning the house to be made and noted, so that we can come back later and decide if we want to keep the little change, or roll it back without having to dig through lines and lines of code to find and delete it. But did you know that Git (or any other method of version control, for that matter), can also be used for design, and even content writing?

I first came across version control in the form of Murcurial while working on a project last year with Monica that involved adding content to a hand-coded site. To be honest, at first, I thought the owner of the site was crazy for insisting on version control for a hand-coded, relatively simple site, but after having switched my own processes over to version control from plain-old work-as-you-go text files, I’m thankful I was introduced.

So how do you, as a content writer or designer, implement version control? There’s an excellent post over at Flywheel that will get you started. It lays out some reasons why version control, (specifically, Git), is a good for designers, and provides some free resources for getting started. Admittedly, the concept took me a while to get used to, and I ran into some issues while getting everything initially set up, but once I got rolling, I’ve never looked back.

Google Brings Out The Big Stick: Search Results To Indicate Whether Older Technology Is Being Used

Google announced on its Webmaster Central Blog that as of Monday, its U.S. search results would begin indicating whether or not a site is supported on your device. Technologies like Flash aren’t supported on Android 4.1 or higher, as well as iOS, and since smartphone usage is increasing, this is becoming a problem for users. It’s actually been a problem for users for a while now, and Google is finally catching up.

There’s of course a lot of pushback in the comments to Google’s post, but since this is Google we’re talking about, anyone maintaining a website will gripe, but be forced to make the change unless they want to see their search ranking plumet. Google is including its technology notice in the snippits section of search results, which raises the question of whether this was one of the intended reasons for implementing snippits in the first place. I can’t say I’m against this. It’s a great way to encourage the adoption of newer technologies like HTML5.

If You’re Using WPTouch, Update Immediately!

WPTouch is a plugin for WordPress that automatically enables a mobile theme for those who may be visiting your site on a smartphone or tablet. With five million downloads to date, it’s one of the most popular plugins in the WordPress plugin directory. Earlier today, Sucuri reported that WPTouch has a dangerous security vulnerability, and users are strongly advised to update immediately. The short version is, unless you’re running the latest update, WPTouch allows users who do not have administrative priveliges to upload php scripts directly to the server, meaning that someone with not-so-good intentions has the capability to take over any site running anything but the latest version of the WPTouch plugin.

The unpatched version of the plugin uses the “admin_init” hook as its authentication method. As was discussed previously, “admin_init” should not be used as an authentication method because it is invoked not only when an administrative user visits any page within wp-admin, but also when wp-admin/admin-post.php is visited, thus allowing anyone to upload potentially malicious code to an effected site.

If you’re using this plugin to create a mobile-friendly experience for your users, update it as soon as possible. Sucuri made the vulnerability known to the authors of the plugin, and they have uickly released a patch to the plugin directory. the only thing users of the pugin need do is update to the latest version.

How to bulk delete posts in WordPress with MySQL

Every once in a while, we need to spend time pruning our WordPress databases. But if part of your pruning task includes deleting a metric ton of posts, this can become time-consuming if you’re using the WordPress Dashboard to do it. Fortunately, there’s a quicker way to delete those hundreds, or even thousands, of posts without checking a bunch of boxes and clicking a button a couple of hundred times.


WP-Guru has a great tutorial, complete with screenshots and example code, that will walk you step-by-step through creating the queries you need to delete those posts. I’ve used this tutorial myself, and it has saved me loads of time. So head on over and take a look, and if you’re in need try it out.

How To Better Detect Your Mobile Visitors with WordPress’s WP_is_mobile Function

Although WordPress themes typically use Responsive Web Design to tailor websites for mobile devices, sometimes you may need to use PHP (the language WordPress is written in) to detect whether your visitor’s web browser is running on a mobile device. For example, you may want to output certain HTML markup (such as a mobile navigation menu) on mobile devices. Alternatively, you may only want to output a slider containing large images on desktop and not mobile devices. Doing this via PHP (instead of CSS) means that your visitor’s mobile browser won’t have to download all of the slider images even though the slider is never displayed, which also means that your site will load faster for your mobile visitors.

wp_is_mobile() is a function built into WordPress that detects whether the visitor is using a mobile device such as iPhone, iPad, Android, Silk, Kindle, BlackBerry, Opera Mini, and Opera Mobi. This is a conditional function, which means it returns one of two results: true or false. It’s located in wp-includes/vars.php.

The function was introduced in WordPress 3.4, and it can be used in a WordPress plugin or theme.

Here’s a simple example:

if ( wp_is_mobile() ) { // Visitor is on a mobile device} else { // Visitor is on a desktop (not mobile) device}

WordPress core currently uses this function in a few different places:

  • To completely disable the Visual Editor for Opera Mini.
  • To enable jQuery UI Touch Punch in the WordPress dashboard for mobile devices.
  • To detect whether the current device can upload files.
  • To disable the “shake” effect on the WordPress login page when an incorrect username or password is entered using a mobile device.

You can also use this function to hold mobile-specific content, such as the navigation menu mentioned above. <?php if ( wp_is_mobile() ) {
/* Display and echo mobile specific stuff here */
} ?>

How Tony Perez of Sucuri Sets Up His Own Security

there have been a lot of posts about various wordPress security issues over the last couple of weeks, some of them giving good security advice and a lot of others giving not so hot advice. Here’s a post by Tony Perez (who is probably the greatest master of WordPress security) where he talks about what he does when setting up his own wordPress sites. I’m not affiliated with Tony at all, but I’ve heard him talk a couple of times, and he’s extremely knowledgeable when it comes to security. Tony links to a lot of other good posts, so be sure to read those as well.

Wordsesh Starts Tomorrow: Will You Be there?

Tomorrow marks a first in the WordPress community. there are WordCamps and meetups for WordPress all over the world, and at various times of the year. But tomorrow, (or Saturday according to UTC), we’re going to see what I hope will become a continuing trend: A virtual WordCamp called wordSesh. It’s being sponsored by WooThemes, and will be twenty-four hours of completely awesome WordPress content. The schedule of speakers is at the official WordSesh site, and you’ll be able to stream the content from there as well. Recordings of all the sessions will be available as well after the conference is over. I’d like to see if I could attend for the whole twenty-four hours, but I doubt that will happen, no matter how cool it would be. But I’ll definitely be listening to everything and blogging on it as well.

So the only question left is will you be there? I know there are a lot of bloggers using WordPress, and there will be content for everyone from end users to developers. I highly recommend attending. Hope to see you this weekend.