Ryan Rampersad
Thoughts, opinions, ideas and now links
  • About
  • Podcast
  • Links

Archives

Kickstarter: Ghost∝

Ghost, the future of blogging platforms, is finally on the move again. For two days in November, the world was buzzing about Ghost. Yesterday, the Ghost Kickstarter launched. It is already well over its initial goal of $25,000. If you like blogging, if you like open source, if you love and hate PHP, WordPress and all the frameworks under the sun among other things, then please, consider Ghost as an alternative.

I’ll be talking about this in depth on Friday on my weekly podcast, At The Nexus.

WordPress Botnet∝

There’s a neat story going around about how there’s a WordPress botnet literally taking 16% of the web by storm. If you’re on WordPress at all, CMS or blog, you should really check to see if you need to update your usernames or passwords.

There’s a short list of steps, but I think the most important is to get a real password. Use LastPass if you have to.

The Future of Administration∝

Today, I stumbled across a side project that was initiated by Matt Mullenweg. It’s called MP6 for apparently no reason at all, but it’s definitely great. Take a look.

mp6-dashboard

The new wp-admin theme uses the design language I love so much right now. It’s flat, there’s black, white and gray. It’s simple. My own mockups look somewhat similar. There’s no indication this is true, but I think that this was in some part sparked by WordPress Ghost. The release by Matt of this plugin is probably no coincidense either, because John O’Nolan (the Ghost guy) is also getting ready to display his initial results I think.

You can get the MP6 plugin here.

On Dates∝

WPBeginner wrote about putting dates on articles online.

In the past few months, I have seen numerous internet marketers and SEO’s giving out their verdict against having dates on blog posts. Each have their own reasons, but all follow along the same buzz-word evergreen content.

In my attempt at a linkblog, I did away with dates on every single post in the homepage view of this blog. I did this because if I happened to find a lot of links on any given day, I wouldn’t want to repeat the same line of text six times. Instead, each day is sectioned off from each other with a large date header. I think that’s a fair compromise.

But I do more than just hide dates though. Dates are absent from any kind of list-view of posts — dates are visually cluttering. The exception are posts that I feature because I think they’re great. Those gets dates always, regardless of their view. Moreover, if you click into any post, whether it is a link post, an aside post or a real post of true glory, you will indeed see the date listed, but only in cases where that post is the only post on the page. Again, I think this is a fair compromise.

Twenty Thirteen∝

Sometimes WordPress themes look a little boring. Sometimes they look fantastic. This is one of those times.

At the time of writing, the block spanning content sections (via post formats) look fantastic.

WordPress & Post Formats UI Progress∝

While still in the planning stages, the progress on enhancing the post format UI in the WordPress editor is going well.

WordPress and PDO∝

MySQL via PHP is due to be deprecated in PHP 5.5 (due any month now) so there is intense debate about the future of the database in WordPress. The options are keep safe with through PHP 5.4 until PHP 5.5 and live with MySQL, jump to MySQLi or go to straight up PDO which the PHP documentation insists upon using (which I totally agree with).

WordPress needs to move forward to get shared hosting providers to move on. It’s great. Seriously, WordPress, do it!


Don’t let anyone fool you. Performance isn’t the gain here; it might add a tiny bit. But the true point of this is getting rid of horribly old technologies out of 15% of the Internet. That’s the goal. Or it should be.

WordPress 3.6 Development

So WordPress 3.6, after the holiday break, is gearing back up into development. It’s cycle will be significantly shorter than 3.5′s cycle.

Enhancing the Post Formats UI is definitely my favorite proposal right now. One of my biggest problems is that the Admin UI does not change depending on Post Format, which I find absurd.

Post formats is going to be a major win for 3.6. It’s one of those features that has so much potential, but it really falls short in usability and honestly we haven’t really taken the time to truly show what it can do. We’re going to re-think the admin UI for post formats, similar to what Alex King did with his WordPress Post Formats Admin UI plugin. The goal is to make post formats much more user friendly and then show them off with the 2013 theme.

(And in the comments, Justin Ladlock of Hybrid appears to have slipped some Post Format magic in Hybrid Core already.)

And there are other focuses as well: Autosaving & Locking, Edit Flow, Revisions and Menus. Some of these may change or more might be added.

Happy New Year∝

Here are the final hours of 2012. I would like to thank you for reading. This year, this blog changed, I hope, for the better. It’s been a lot of fun sharing links and posting code snippets. I hope I can keep up with it better next year. You can see my blog’s statistics brought to you beautifully by WordPress.

Have a good one and watch out for cars.


Oh, right. You can also checkout our New Year’s Nexus Special and end of the year episodes of The Universe and Eight Bit.

WordPress URL Rewriting∝

If you’re working with URL Rewriting in WordPress, especially when you’re trying to hook up those custom post types, you’ll want to checkout this invaluable guide written by Christopher Davis. (And, surely, you know there are docs too, right?)

Custom Post Type Pagination Redirects

If you’re trying to paginate on a custom post type, you’re going to run into some trouble. I’ve been paginating a custom query on the biographies at The Nexus. The way pagination works is it listens only to the top level query, and the built in hooks will redirect a any URL like: example.com/person/ryan-rampersad/page/2/ back to example.com/person/ryan-rampersad/ because it doesn’t know any better. Basically, you’ll have infinite redirects without turning off this type of transparent redirection.

From Justin Tadlock of Hybrid fame.

add_filter( 'redirect_canonical', 'my_disable_redirect_canonical' );

function my_disable_redirect_canonical( $redirect_url ) {

	if ( is_singular( 'client' ) )
		$redirect_url = false;

	return $redirect_url;
}

This with this code, you need to change the is_singular call to check your custom post type’s name.

Upon further digging, I found a WordPress trac ticket about this from two years ago. Yep. I spent hours fiddling with my navigation, various types of URL rewriting and more, just to find out another piece of the magical system was pushing its magic into my neighborhood without any warrant.

Adding Shortcode Widgets∝

You know what The-Nexus.tv needs? Something in its footer. Some widget that promotes a show, that promotes a person and more. Something cool like that.

I probably won’t make widgets this way, but it is a good idea.

Adding Jetpack Photon Support

Over the weekend, I decided to add Jetpack Photon support to The-Nexus.tv. Photon is Automattic’s CDN magic image service. It’s neat and a feature I’ve been looking into for a while. Adding it was relatively easy.

The first step is to provide fallback support for the situation where Jetpack or Photon is not installed or oddly disabled.

/**
 * Returns true if Photon from Jetpack is supported.
 * @return bool
 */
function convergence_photon_support() {
  return class_exists( 'Jetpack' ) &&
         method_exists( 'Jetpack', 'get_active_modules' ) && 
         in_array( 'photon', Jetpack::get_active_modules() ) &&
         function_exists( 'jetpack_photon_url' );
}

This function is straight from the Photon docs. It checks to see if the Jetpack class is loaded, if the methods exist and if Photon exists. All of that is very important, but it would be a shame to run this on every single request (while it’s not intensive, it’s yet more overhead), so I hope you have some page caching somewhere along the line too.

/**
 * Returns a Photon based image Photon if Jetpack is enabled and Photon support is on.
 * @param $url the URL of the image to be used in Photon
 * @return bool
 */
function convergence_villain_photon_image($url) {
  $photon = convergence_photon_support();
  if (!$photon) return $url;
  $url = substr($url, 7); // removes the http:// that photon breaks on
  $path = "http://i0.wp.com/$url";
  return $path;
}

This function checks if there is Photon support and if not, returns the given URL unchanged. The substr removes the http:// from the URL because Photon prefers to not have it there. (And, if you’re wondering, no, it’s not mentioned anywhere on the documentation page for Photon. Just saying.)

From there, my theme implements these functions in a simple way. On the homepage of The-Nexus.tv, the following code generates the images int the 2-by-3 grid.

  <?php
    $image = get_the_image(array('size'=>'thumbnail', 'link_to_post'=>false, 'format'=>'array' ));
    $image_url = convergence_villain_photon_image($image['url']);
  ?>
  <a href="<?php echo get_permalink(); ?>" title="<?php echo $image['alt']; ?>">
    <img src="<?php echo $image_url; ?>" alt="<?php echo $image['alt']; ?>" class="<?php echo $image['class']; ?>" />
  </a>

get_the_image is a blessing and a curse from Hybrid, but it is useful nevertheless. I pass in the URL into my fancy-pants function for fetching Photon images and I echo it all over.

Adding Photon is really that easy.


And the name Photon is clever. Like Photo.

Reimagining WordPress For {insert blank here}∝

WordPress creator says:

“We have been reimagining WordPress for a touch interface,” he said, and in ten years, he expects the majority of WordPress.com traffic to come from tablets.

Well, I don’t disagree. The WordPress creation experience is very good on actual computers but just about everything on mobile (phones and tablets) is downright disgustingly difficult.

But I fear another problem elsewhere. The momentum behind Ghost is great and all, but the real force must come from inside. At some point, you must drop the past and make the future way better.

Jetpack 2.0∝

Jetpack updates are generally welcome, but this one is just downright great. Shared hosts are notoriously bad at handling large images. Why? They have a severely low memory limit that essentially cripples WordPress and any image manipulation it wants to do.

Photon Your Images

Have you ever switched themes to find that full-width images break out of the layout and no longer fit your theme? Are you frustrated that images on your blog take too long to load? Jetpack Photon fixes all of that by making the advanced image acceleration and image editing service from WordPress.com available to the broader WordPress community, essentially making every image a fully dynamic object that themes and plugins can transform to their heart’s content without killing your server. In fact, if you enable Photon, you will see your CPU and bandwidth usage plummet as images are served through the global WordPress.com cloud, meaning less load on your host and faster images for your users.

I’ll be looking into this for The-Nexus at least. We serve some really huge images over there for album art, because quality looks nice.

Next>

© 2013 Ryan Rampersad.