In: On: 2010 / 08 / 13 Short URL: http://ozh.in/t7

My practice and what I recommend doing when coding plugins is not to bother about backward compatibility, to always code for the latest stable release available or against the trunk version, and not to support plugins coded for old, deprecated and insecure versions of WordPress.

This said, there can be situations where you need to backport something, or to make sure it will work with both older and newer versions of WordPress. If you happen to be in a situation like this, good news fella: I've just updated my handy WordPress Functions Implementation History Tool, which lets you know when a particular function was introduced in WP (or removed from WP if applicable). The tool comes with a full list of all 3920 functions that existed through WordPress' history in various formats. Enjoy!

The bad news: in 8 days as of writing, Twitter will be shutting off basic authentication for third party applications. No more entering your login/password, but a more secure OAuth system that redirects you to Twitter's site and confirm you're allowing access to your account. All this, honestly, kind of sucks.

The good news: I've updated my YOURLS: WordPress To Twitter plugin to now support OAuth, as well as a lot of other improvements. Go check it now! Update and play, you've got 8 days to return feedback if something is not working as you were expecting :)

Speaking of YOURLS, version 1.5 is coming along nicely. No, no ETA. Check out this screenshots: YOURLS interface (notice a new menu?) and, as an example of a bundled plugin, a "social" toolbar. The trunk version, labeled 1.5-beta, is stable enough if you want to play with it (I've been using it for weeks now). Join the fun and code some plugins!

I honestly don't give a whatever to soccer and the ongoing World Cup, but for the last few days I received a few really hilarious emails with pics mocking the South African vuvuzela (for a great inspiration and laugh, the dedicated subreddit is a good start)

I could not miss the opportunity for a silly plugin. After a quick web search for images and sounds, here it is. Meet the Vuvuzelator, yet another plugin that will make your blog pay tribute to the real star of this World Cup. With image and sound. Oh my, sound. (Readers can easily opt out with a single click, hopefully :)

Weeks ago, Ronald Huereca sent me a complimentary copy of his ebook WordPress and Ajax and I finally took some time to read it. I knew Ronald can craft good things (you've read stuff from him on WLTC) so I was curious but, hey, a whole book just about Ajax?

Six word review

It did not waste my time!

More than six word review

The ebook clocks in at 252 pages of a rather unusual format (15×21 mm or A5). Not sure if this is to be more convenient when printed or to be faster to read :) The layout of the book is pleasing, colorful and attractive. One excellent point: all code snippets are syntax highlighted. This makes reading code much easier and should be *mandatory* for all ebooks (not to mention blogs and any online media, of course). My only gripe regarding the format is that the rather small page width induces quite some line breaks in code blocks.

The first chapters of the book cover the Ajax basics: properly adding Javascript into WordPress, how to internationalize the scripts, a short introduction to jQuery, why and how to pay attention to security.

After setting the foundations, the book goes through three very detailed examples of real world applications, ending with a fairly complex Paypal Buy Now button and associated Coupon codes.

Reading the book is actually kind of fun and not boring for a second. The writing style is casual yet accurate, a bit like attending a very detailed and sharp conference, where you get a glimpse of the author's personality as well as a bit of his knowledge.

As in everything related to coding, there's more than one way to do it, and the book shows a few, from quick hacks that will do when working on a client's site (case in which you know what environment you're working in, the paths to directories etc..), to working on a plugin that will be run anywhere.

In short, the book introduction itself is pretty accurate:

The goal of this book is to provide you a rock-solid foundation for using Ajax with WordPress. After the foundation has been laid, you will be walked through several real-world examples. By the end of the book, you should not only have a thorough understanding of Ajax, but how Ajax functions within WordPress itself.

This book is for people who want to take time to understand how to build things, through step by step examples, rather than for people who want a quick cut and paste snippet. Given the amount of things you'll learn if you're willing to, I think its price ($24) is quite a bargain. If still unsure, there a sample chapter for you.

Disclaimer: no affiliate code use here, I say I like the book because I do. If you want to buy it through me, feel free to use this link.

There's a cool (and underused by plugins) API in WordPress: the Transients API. Transients are temporary options, ie options set with an expiration time. Anytime you're storing options and they have a short life span, you should use transients instead.
Read More

Matt Harris, Developer Advocate at Twitter, posted in the wp-hackers mailing list some important information about the Twitter API. In substance,

On the 30th June the Twitter REST API will stop supporting Basic Authentication and instead switch to OAuth. This means all user authenticated requests to the API must be OAuth signed, preferably using OAuth headers.

If you're a WordPress plugin developer (or less specifically a hacker of any kind) who's playing with the Twitter API, be sure to upgrade your code. There is a number of plugins out there (including mine) that are not using oAuth but just sending login and passwords in HTTP requests because, well, it's just easier for the lazy :Þ

To get you started on the oAuth authentication mechanisms:

A few days ago, Twitter published a new tool that lets you embed a tweet on your site, simplifying the old school way: take a screenshot, crop the picture, upload it, embed it.

The problem is: this Twitter tool is way too lame. Basically you need to cut and paste a lengthy code snippet full of HTML and CSS. How ugly. Compared to the way you can embed a Youtube video in WordPress (just pasting a video URL, on its own line) this is seriously cumbersome.

Hey, wouldn't it be cool if you can embed a tweet just as easily? You would just paste its URL and let WordPress transforms it into a nicely presented tweet with links and everything? OK, let's do a plugin for this. And guess what, it's going to be fairly easy, using WordPress' oEmbed API implementation.


Read More

Justin Tadlock just sent out a funny and honorable tweet:

This is honorable because, yes, everybody was a clueless noob at some point and that's something to be remembered when you're asked what looks like stupid questions. Even when it seems like a trivial waste of your time, your answers might help today's noob become tomorrow's leet.

And this is funny because, well, it's just too funny to read something like "I'm not particularly skilled at php" from someone who is now one of the most knowledgeable people around and who blogs high class stuff about WordPress (heh, obviously)

So I went for some hunting and found what seems to be my first post on the WordPress forums. Heh :)

What was your first forum post about? Go and find some embarrassing questions you once asked!

In: On: 2010 / 03 / 05 Short URL: http://ozh.in/rt

yourls-logo Straight from the Shrink-Your-URLS-With-A-Custom-Branded-Self-Hosted-Solution Department: if you're following my tweets, you already know that I released YOURLS 1.4.1 yesterday. What's in there? Good stuff for sure, but even better stuff are on their way :)
Read More

At first I tried to answer in less than 140 characters but Twitter has its limitations. Plus, for the record, posterity, or anybody new to Gmail (you mean there is still someone out there not using it?), I thought this might be of some interest. So here it is: my shuper shmart aweshome Gmail label and filter strategy. You've read all this a million times before, but this time it's from me ;)
Read More