Celtic Knot Generator – A HTML5 Canvas Experiment

May 17th, 2012

I wanted to familiarize myself with the much-touted canvas element, so I used it to build an interactive celtic knot generator/editor. Give it a try. Launch the celtic knot generator. Note: Requires a fairly modern browser. Instructions When you first load up the knot generator, you will see a 10×10 grid filled with the default [...]

Continue Reading...

Adding A Notification Bubble To An Admin Menu Item

May 3rd, 2012

You’ve probably seen the small notification bubble that shows up in the Dashboard menu when a new update is available. Here’s how you can add a menu bubble to your own custom menu: The resulting menu will look like this:

Continue Reading...

Security Tip: Block Direct Access To Plugin PHP Files

April 27th, 2012

Plugins are usually loaded and executed along with the rest of WordPress. However, since each plugin is physically just set of .php, .css and .js files, it is also possible for someone to bypass the normal load order and execute the plugin files directly.  They just need to type the right URL in the address [...]

Continue Reading...

Cleaning Up Stale Transients

April 17th, 2012

WordPress transients are very similar to DB options but they also support expiration times. The Transients API documentation states: Our transient will die naturally of old age once $expiration seconds have passed since we last ran set_transient() What you might not know if you haven’t explored the source code of the transients API is that [...]

Continue Reading...

How To Convert Your WordPress Blog To A Static Site

February 2nd, 2011

Recently, I found this old question on WordPress StackExchange: I am starting a new WordPress blog, and no longer updating an old one. [...] How can I lock the installation of WordPress down so I don’t need to maintain it? I have seen someone suggest making a static version, which sounds like a lot of [...]

Continue Reading...

Page Load Time vs SEO: My Experience

February 1st, 2011

It is hardly news that the average load time is one of the many factors that Google uses to determine how well your site will rank. But how much does it matter, really? If my recent experience is anything to go by, the answer is “very little”. Over the last two months, I optimized this [...]

Continue Reading...

Lazy-Load Avatars

January 31st, 2011

In my previous post, The Quest For Speed, I mentioned that lazy-loading avatars is a good way to improve your site performance: The overwhelming majority of visitors never leave a comment. Chances are, most don’t even scroll down to the comments section. So why waste their time and bandwidth by loading avatars that they’ll never [...]

Continue Reading...

The Quest For Speed

January 18th, 2011

A little more than a month ago, I logged into my Google Webmaster Tools account and to check if Google had detected any crawl errors or any other problems with my site. Finding everything in good order, I was just about to close the browser tab when I noticed a sidebar link that had somehow [...]

Continue Reading...

How To Quickly Check Domain Availability

January 4th, 2011

Have you ever wondered how those domain suggestion sites can check so many domain names so quickly? This is how. Below I’ve listed three techniques for checking domain availability. They’re ordered (loosely) from fastest/cheapest/least accurate to slowest/priciest/most accurate. Ideally, you would run each domain through all three in order, and only assume it’s available if [...]

Continue Reading...

Where Did That JS/CSS Come From?

December 14th, 2010

If you run a WordPress site, chances are that you use plugins. If you use plugins, chances are that some of those plugins add their JavaScript or CSS files to your pages. And if there’s lots of JS/CSS on your pages, chances are that your site isn’t as fast as it could be, and that [...]

Continue Reading...

Browser Performance Comparison (Updated)

November 3rd, 2010

Most web browsers have gotten an update or two in the 6 months since I posted my previous browser comparison. So lets see how they stack up now, shall we? Click the image for full-size view: Benchmarks Used Kraken JavaScript Benchmark Peacekeeper JavaScript Benchmark (view results) SlickSpeed Selectors Test Acid3 Web Standards Test HTML5 Test [...]

Continue Reading...

A World Without SEO

October 20th, 2010

Search engine optimization gets a lot of flack from the uninformed. While most web developers know (presumably) that applying basic SEO techniques to a one’s site is just common sense, the average web-dweller needn’t be so lenient. For many, “SEO” is a word to be spoken in disgust, a synonym for spam, viruses and other [...]

Continue Reading...

Extracting Plugin Metadata

September 15th, 2010

Have you ever dreamed of extracting useful metadata from WordPress plugins? Probably you haven’t. But if you ever need a way to parse a plugin’s readme.txt, or want to simplify metadata generation for the custom update checker, here’s a couple of utility functions that may come in handy. I originally wrote them for internal use, [...]

Continue Reading...

Fixing “Memory Exhausted” Errors In WP-DBManager

August 25th, 2010

WP-DBManager is a handy plugin that can, among other things, make periodic database backups and send them to a specified email address. I installed it on this blog months ago and up until a week ago everything was working perfectly. Then one day the backup emails simply stopped coming. What Went Wrong? A quick check [...]

Continue Reading...

Towards a Better dbDelta

July 29th, 2010

When it comes to creating and updating database tables, WordPress has what appears to be a very handy utility function – dbDelta. In theory, this function can take one or more CREATE TABLE queries, compare them to the tables already in the database and automatically figure out how to bring them up to date, adding [...]

Continue Reading...

Add New Buttons Alongside “Screen Options” And “Help”

June 30th, 2010

Continuing from yesterday’s post about adding custom settings to the “Screen Options” panel in WP, I will now show you how to add your own buttons alongside “Screen Options” and “Help”. But first, here are a few screenshots – to whet your appetite, so to speak. Want those neat buttons in your plugin? Read on. [...]

Continue Reading...

Adding Stuff To WordPress “Screen Options”

June 29th, 2010

The Screen Options pull-down is the perfect place for those “rarely used but nice to have” settings. It’s unobtrusive and saves screen space. Some plugins could even put all of their settings in this panel and avoid cluttering the Dashboard menu with yet another “Settings” page. While Screen Options were already present in older WP [...]

Continue Reading...

How To Filter The Whole Page In WordPress

May 20th, 2010

WordPress has numerous hooks for filtering posts, comments, feed items and more, but no built-in filter that would let you intercept and modify an entire page. However, you can do that fairly easily with PHP’s output buffering functions. Today I’m going to show you how. Crash-Course In Output Buffering As the name implies, output buffering [...]

Continue Reading...

Web Browser Performance Comparison

April 20th, 2010

To see how the latest versions of the most popular web browsers stack up, I ran five of them – Firefox 3.6, Chrome 5-dev, Internet Explorer 8.0, Opera 10.51 and Safari 4.0.5 – through a number of benchmarks and performance tests. The results are below (click the image to enlarge it). Benchmarks Used SunSpider JavaScript [...]

Continue Reading...

Only 2% Of WordPress Plugins Compatible “For Sure”

March 25th, 2010

Last October, the WordPress.org plugin directory introduced a new “Compatibility” feature that allows users to vote on whether a given plugin version works or doesn’t work with a specific version of WordPress. The idea was to provide a more reliable indicator of plugin compatibility so that you wouldn’t need to worry if upgrading will break [...]

Continue Reading...

Showing Different Ads To Different Visitors

March 9th, 2010

Just today, I decided to run an impromptu experiment to test if visitors who come from search engines are really more likely to click on ads. It’s considered  ”common knowledge” by many bloggers who advise everyone to only show ads to search engine visitors (as a quick Google search will illustrate), but my own AdSense [...]

Continue Reading...

12 Invisible But Invaluable jQuery Plugins

March 5th, 2010

Not all jQuery plugins are about UI and eye-candy. There’s also a class of plugins that aim to make web development itself easier, either by acting as convenient wrappers around hard-to-use JavaScript functionality, simplifying cross-browser compatibility, or providing small but useful utilities and APIs. Below you’ll find a list of 12 great utility-style jQuery plugins. [...]

Continue Reading...

The Barest Page Templates Possible

February 25th, 2010

Some WordPress themes include custom page templates that let you add a custom layout or some nifty feature to specific pages. But sometimes you need the exact opposite – a page to be as bare, unadorned, downright plain as possible. No header, no menus, no nothing – just the HTML that you entered in the [...]

Continue Reading...

Most Popular Words In Plugin Names

February 12th, 2010

Behold, I bring you even more WordPress-related statistics! Today : the most popular words in plugin names. Use them to come up with new plugin ideas, figure out which services/features are over- or under-represented in the WP plugin ecosystem, and more. Here’s a tag cloud of the names of all plugins listed in the WordPress.org [...]

Continue Reading...

The Viralogy Offer

February 4th, 2010

In this post I will explain what the “Viralogy.com script” thing mentioned in the Broken Link Checker survey was all about, discuss the user response and attempt to verbalize my rather unclear thoughts on the issue. Viralogy Script About two weeks ago, I received an offer to bundle a social media tracking script from Viralogy [...]

Continue Reading...

Broken Link Checker Survey Results

February 2nd, 2010

Last week I invited everyone who uses my Broken Link Checker plugin to answer a user feedback survey. The survey consisted of 11 questions covering a number of topics from overall user satisfaction to feature suggestions, monetization options and questions about the user’s server configuration. In this post I will summarize the results and maybe [...]

Continue Reading...

Top 10 Plugin Developers Of 2009

December 28th, 2009

The end of a year is a time for reflection. A time to look back on your accomplishments, and also a time to give thanks to the people who helped you along the way. So, once again, I’ve compiled a list of the top WP developers whose plugins have been an immense boon to thousands [...]

Continue Reading...

Reliably Detecting The WordPress Version

December 2nd, 2009

Sometimes you might want to find out if a website is built with WordPress, and which specific version of WP it’s running. In this post I’ll discuss a number of detection techniques, including ways to deal with sites that hide the fact that they’re running WordPress or spoof the version info. For non-programmers : If [...]

Continue Reading...

15+ Useful Firefox Addons For Web Developers

November 27th, 2009

Everyone already knows and loves Firebug and Web Developer. So instead of another redundant “Top 10″ list, here’s a collection of 15+ great add-ons that you might not have heard about yet. Dust-Me Selectors Dust-Me Selectors helps you find unused CSS selectors. You can use it to test an individual page, or let it spider [...]

Continue Reading...

Detecting Parked Domains

November 13th, 2009

Some time ago, a commenter asked me if it was possible to make one of my WordPress plugins detect and report parked domains. I’ve done some research since then, and while it’s probably not practical to add such a feature to the plugin, I did come up with several ways to programmatically detect parked pages. [...]

Continue Reading...