WordPress 3.8 Beta 1

WordPress 3.8 Beta 1 dropped today. It looks great. I really love the new Admin Color Schemes options. In order to charge your color scheme, go to Users → Your Profile and select one of the four options.

WordPress 3.8 Midnight Theme

I’m really digging the Midnight scheme.

See the full announcement here.

The final release date is December 12th, so start testing!

WordPress 3.6 – Native Support for Audio

While I was messing around with WordPress 3.6 and audio capabilities, I decided to the test the native support for audio.

 

Here are a couple things to watch out for:

1. Your host or settings may limit the size of on file uploads. To get around that limitation you can upload the file via FTP. But if you do that the file won’t show up in your Media Library. If this is the case, download the Add From Server plugin. This plugin adds a link in the Media Library which allows you to add file from your server to the Media Library. From there, it’s easy to embed in your post.

An alternative is to use FTP and then wrap the link to the file in audio shortcode. Here’s an example:

[audio mp3="http://www.kmarsden.com/wp-content/uploads/2013/08/Trojans.mp3"][/audio]

2. Get rid of the spaces in your file names. The media player won’t work if the song/video has spaces in the name.

3. Not all browsers will support the mp3 embed. See the Codex for fallback methods.

4. The width of the audio player is set to 100%. You can change this by setting a smaller width in your child theme’s style.css. This is what I did:
.mejs-container {
max-width: 400px;
}

Just don’t go much lower than 200px;

WordPress Local Development – Installing wpshell

This post was in draft status for a few months, but today I was trying to spin up wp-cli and had some configuaration issues. Instead of hacking around, I hopped onto wpshell instead. Since this draft post helped refresh my memory, I decided to finally post it.

I should also note that wpshell isn’t under active development, so in the long run wp-cli is probably the best option.

I first heard about wpshell when I read Danilo Ercoli’s interview on WPDaily. I was immediately interested because I’m working to update a plugin and the process of trying out different WordPress functions is a bit time-consuming.

What is wpshell? Simply put, wpshell allows you to run WordPress and PHP functions from the command line.

The installation is fairly easy. I’m running Mac OS X 10.8.3 and using MAMP for local development. Open Terminal and follow these steps:

First, move to your local WordPress directory. For me it’s: cd Applications/MAMP/htdocs/localdev

Check out wpshell by typing: svn co http://code.svn.wordpress.org/wpshell wpshell

Change to the wpshell subdirectory: cd wpshell

Edit wpshell: vi wpshell

After editing, my wpshell file looks like this:
#!/bin/bash

shell=$(dirname $0)"/wpshell.php"

if [ -t 0 ]; then
while [ true ]; do
/Applications/MAMP/bin/php/php5.3.6/bin/php $shell
if [ $? -eq 0 ]; then break; fi
done
else
set -f
read -s input
echo $input | /Applications/MAMP/bin/php/php5.3.6/bin/php $shell stdin
fi

Only the bolded lines need to be updated.

If you aren’t familiar with VIM commands, press a to edit the file. Enter CTRL + C when you’re done and then :wq to save the file. If you want to exit without saving enter :q! instead of :wq

Next, edit the wpshell-config.php file: vi wpshell-config.php

My config file looks like this:
$_SERVER['HTTP_HOST'] = 'Kevins-MacBook-Air.local';
$_SERVER['SERVER_SOFTWARE'] = 'apache';
$_SERVER['REQUEST_URI'] = '/';
$_SERVER['SERVER_ADDR'] = gethostbyname( $_SERVER['HTTP_HOST'] );
$_SERVER['HTTP_USER_AGENT'] = 'wpshell/1.0';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['REMOTE_PORT'] = '0';
$_SERVER['QUERY_STRING'] = '';

define('ADMIN_PLUGINS', true);

require dirname( __FILE__ ) . '/module-wpdb.php';
require dirname( __FILE__ ) . '/module-fshell.php';
require dirname( __FILE__ ) . '/module-hello.php';
require dirname( __FILE__ ) . '/module-wpreference.php';

require dirname( dirname( __FILE__ ) ) . '/wp-config.php';
chdir( dirname( dirname( __FILE__ ) ) );

~
Only the bolded lines need to be updated updated.

Once you’re done editing the file, enter CTRL + C and then enter :wq to save the file.

If all went well, you should be able to run wpshell. At the Terminal prompt enter: ./wpshell
and you should see the wpshell prompt. At this point you can enter php commands or WordPress functions.

Here are some resources if you’re having trouble installing wpshell

Thorsten’s blog post on wpshell

Daniel Bachhuber’s blog post and presentation slides

Daniel Bachhuber’s WordCamp presentation on wpshell and wp-cli

The video linked in the wpshell WATCHME file

One alternative is to use the Debug Bar Console plugin. Before I went through this whole process, I didn’t know about the Debug Bar Console, but now that I’ve installed it, I’ve found the functionality to be pretty similar.

WordPress Filters

Drew Jaynes just started a cool project called Filters of the Day. He’s planning to review all 1003 WordPress core filters over the next 365 days.

My goal is to keep up with him and test out each one as he reviews them. Drew has already posted six filters and I’ve only messed around with one of them, so I’m already falling behind. See my GithubGist profile for my edits and customizations.

It’s a great project. Check it out.

Change the Author URL

If you want to change your theme’s author link to another page, Justin Tadlock has a simple solution. If you have a single author blog, add this to your function.php file (in your child theme of course):

add_filter( 'author_link', 'my_author_link' );

function my_author_link() {
      return home_url( 'about' );
}

Just change about to whatever page you want to use. I added this to my site and it changed the link from:

http://www.kmarsden.com/author/kevin

to

http://www.kmarsden.com/about

Retiring my iPhone 3GS

I bought the iPhone 3GS on October 6, 2009. That’s 1378 days ago. I’ve put it through the ringer and I didn’t any major problems with it until a few months ago. Now unless it’s plugged in, it will randomly shut off even with a fully charged battery. I was hoping to keep it for a couple more months, but since it’s barely functional, I decided to upgrade. My iPhone 5 arrived in the mail today.

iPhone 3GS

iPhone 3GS and iPhone 5

Before I bought the 3GS back in 2009, I used a cheap flip phone. It did the basics, texting and phoning, but that’s it. Upgrading to an iPhone was a game changer. Instead of just carrying around a phone/messaging device, I now had portable computer in my pocket. A camera, maps, weather, internet browser, games, email, calendar, and more were always within reach. For better or for worse it changed my life. Of course, there were forerunners of the iPhone like the Sidekick or BlackBerries, but for me, my first taste of a multifunctional phone was the iPhone.

RIP 3GS.

Github Gist to Find WordPress Start of Week Date

I signed up for Github well over a year ago. Yesterday I finally added some code.

For a couple of days I’ve struggled to figure out the best way to get the date for the first day of the current week. Yesterday I finally came up with a solution that seems to work. It uses the WordPress function current_time so it takes into account the timezone setting. It also adjusts based on the start of week setting.

Let me know if you know a better way to do this.

Leaving Google – Update One

It hasn’t been convenient moving away from Google products. It’s not hard; just time consuming.

So far I’ve moved on from Gmail, Google Maps, Chrome, and Google Search.

For the time being, I’m using Outlook.com as a replacement for Gmail. It’s much better than the old Hotmail and the current Yahoo! Mail. My only complaint is the keyboard shortcuts don’t seem to work in compose mode while using a Mac. Using Windows they works fine.

I’m using Bing for most searches, while doing some comparison searches with Google. For most searches Bing seems fine, but with more detailed searches, Google seems to be superior. It’ll take more time to tell for sure.

My next goal is to move five years of documents off of Google Drive.

The biggest lesson from this fiasco? Marco says it best here:

And if you care about developing a long-lasting online audience or presence, you’re best served by owning your identity as much as possible.
Investing too heavily in someone else’s proprietary system for too long rarely ends gracefully, but when it bites us, we have nobody to blame but ourselves.

However, I disagree with this assumption:

Want to really stick it to them? Stop using Google. All of it. Search, Gmail, Maps, the works. Delete your account and start using Bing. Ready?
Yeah. That’s the problem. You won’t. I won’t. Nobody will.

Google overestimates our loyalty. We may not completely delete our accounts, but a lot of us are moving from their core services.

RIP Google Reader

Good grief, Google.

With the death of Google Reader, I’m starting to question my reliance on Google products. Here are the ones I use most frequently:

Gmail
Google Maps
Google Reader
iGoogle

Chrome
Google Search
Google Drive
Google Calendar
Google Analytics
Google Voice
Google Hangouts

What are the alternatives?

- Feedly looks promising, but the site seems to be overwhelmed by traffic. And what’s their plan to monetize the service? I want to use a service that will be around for a while.
- NewBlur also looks promising, but it’s going to take them a while to scale to handle the traffic migrating from Google Reader.

Here’s the bottom-line: I’m going to stop relying on Google services. Google doesn’t value me (or anyone else) as a customer. To them we are data they can sell to advertisers.

My first is to dump Chrome and move back to Safari.

See ya later Google.