WordPress-ish JavaScript Code Standard – ESlint Config

I’m spending a lot of time with JavaScript these day, and find linting tools to be invaluable for spotting some mistakes. I started off with JShint plugged in to Sublime Text via this JSHint plugin.

More recently I’ve switched to ESlint. It seems to identify more issues and formatting problems than before, is easy to configure, and is also extensible.

I’m gradually tweaking an ESlint configuration file that somewhat matches the WordPress coding standards (with some of my own amendments), and thought I’d release it here:

https://gist.github.com/johngodley/b2114d8ff65a6b0767b6

It’s not perfect yet by any means, so make of it what you can. Hopefully it will improve with time.

14.7% of the web

14.7% of the top million websites in the world, up from 8.5%, and the latest data show 22 out of every 100 new active domains in the US are running WordPress.Matt Mullenweg, 2011

That’s quite some reach! Better get a few of those plugins updated…

WordPress Rename Media plugin

Another small plugin, this one renames media files that have been uploaded through WordPress. Although you can rename the title of an image, the underlying file still has the original filename (IMG_1234.jpg, for example). This plugin ensures that the filename changes along with the title.

Rename Media plugin.

Extended Comments Widget

One of the widgets that I’ve had running on this blog since before widgets existed (in WordPress land, anyway) is an ‘extended comments’ area. This is similar to the default comments widget, but shows more detail.

I’ve packaged it up and made it available in the WordPress.org plugin directory, naturally called Extended Comments Widget.

PageView 1.5

So my second plugin update in a week, quite a record this year! This time it’s one of the oldest plugins on this site (the readme.txt file said it worked on WordPress 1.3) – PageView.

Enough people were still writing in, all asking the same question – can I make it borderless. Now you can. The plugin has taken a leap into 3.0 and uses the shortcode API, and strips out the stuff that wasn’t being used, while adding a bunch more flexibility.

Redirection 2.2

I’ve just committed a new version of Redirection to trunk on the WordPress.org plugin repository. This isn’t available for auto-download just yet as I want to make sure any problems are ironed out. If you’re a willing test subject then I’d very much appreciate any feedback. The code is running on this site and hasn’t melted anything (yet).

There is little visible difference between 2.2 and 2.1.29, but internally there has been a big cleanup. Large amounts of compatibility code has been cleared away, some of it going all the way back to WordPress 2.3. I’ve optimized the database where possible, and hopefully fixed the annoying bug that surfaced when WordPress 3.0 came out (automatically redirecting your home page is not so good!)

Anyway, the changelog for this version is as follows:

  • Add Dutch translation
  • WordPress 2.9+ only – cleaned up all the old cruft
  • Better new-install process
  • Upgrades from 1.0 of Redirection no longer supported
  • Optimized DB tables

You can grab the new version from SVN:

http://svn.wp-plugins.org/redirection/trunk

If you have time there’s a short survey in the plugin that asks a few questions about how you use it. My aim is to simplify it and focus on the things people actually use, and the only way to do that is find out. You can also take part in the survey directly.

Related Thumbnails with YARPP

I’ve been using YARPP (Yet Another Related Posts Plugin) for some time to add a short list of related links to the end of all posts on this site. The plugin works great, and is written by the capable Mitcho (who gave a very good presentation at WordCamp San Francisco).

I was thinking about the post thumbnail feature of WordPress and wondered if I could get thumbnails to appear instead of text links. A bit of searching later and it seems I wasn’t the only one to think of this, but I thought I’d give my take on it, and explain how I ended up with something that looks like this:

WordPress Plugin Spam

A very curious thing. Someone has registered a domain with the name of one of my plugins, copied the content from the plugin page onto a WordPress blog on the site, and then added a load of adverts.

If that isn’t irritating enough, they appear on the first page of a Google search for the plugin (thankfully at the bottom).

Fun stuff.