How to turn plain URLs into clickable links in WordPress

The marvellous P2 Theme has an interesting feature: write out a plain link, and it magically becomes clickable without explicitly adding the a href tag.

This may not be a big deal if you’re writing posts in the visual WordPress editor rather than HTML, but for those of us who like to write in HTML, it’s just one less thing to worry about.

I was investigating this feature recently, and it turns out WordPress has a built-in function that can do this: they call it make_clickable(), and it works with URIs, FTP, Email addresses and anything starting with www. The function is really easy to use too: it only takes one parameter (a string), and returns the clickable HTML code.

$clickableText = make_clickable($plainText);

Let’s see how to use it in context, using the TwentyThirteen theme.

Read more

How to display Jetpack stats per post in WordPress

Some websites employ this or similar technologies to show how many views a single post has had. I was wondering how they did that without starting to count stats that have already been counted for several years, either by Google or by Jetpack.

Yesterday I came across this post by a WordPress dev named Topher about how to render Jetpack Stats: http://wpgr.org/2013/03/02/rendering-jetpack-stats/

I decided to test this in TwentyThirteen, and it works a treat – here’s how to do it. The principle will of course work with any theme.

Read more

Zen Dash – Version 1.5 released

I’ve just released an update to my Zen Dash plugin. Besides adding funky zen-bamboo artwork to the WordPress.org page, I’ve made the following minor amendments: the option to hide the Jetpack menu now only shows up when Jetpack is activated, otherwise it’s hidden I’ve verified compatibility with the immanent release of WordPress 4.4 added funky … Read more

How to burn an ISO image with OS X El Capitan

Sometimes it’s important that things change for no apparent reason. You know, the way they move things around in supermarkets just to drive you crazy. If you’ve tried burning an ISO image to disk in El Capitan recently, you know what I’m talking about: because the option to burn an ISO has been removed from … Read more

How to remove an IP from the CBL (Composite Blocking List)

Today I was introduced to something called the CBL, or the Composite Blocking List. This is one of several Spamhaus projects that’s there to make sure IP’s are blacklisted when they’re sending spam.

You can check if your IP’s are OK at http://www.spamhaus.org/lookup/

The CBL is a separate website in which you can also lookup IPs. Spamhaus will tell you if that’s the case and direct you to the CBL here: http://www.abuseat.org/lookup.cgi

Even though my IP was otherwise fine, it was listed in the CBL, and Yahoo kindly made me aware of this as part of an error message I’ve received when trying to send an email. If ever there is an email problem in CentOS, the first place to look is /var/log/maillog. Here’s Yahoo’s very helpful explanation: https://help.yahoo.com/kb/postmaster/SLN5070.html

Turns out that the hostname was not setup yet, so the box would respond as localhost.localdomain. That’s a big fat no-no as far as the CBL people are concerned. Here’s CBL’s explanation:

This IP address is HELO’ing as “localhost.localdomain” which violates the relevant standards (specifically: RFC5321).

The CBL does not list for RFC violations per-se. This _particular_ behaviour, however, correlates strongly to spambot infections. In other words, out of thousands upon thousands of IP addresses HELO’ing this way, all but a handful are infected and spewing junk. Even if it isn’t an infection, it’s a misconfiguration that should be fixed, because many spam filtering mechanisms operate with the same rules, and it’s best to fix it regardless of whether the CBL notices it or not.

Read more