Accessing SVN Repositories Through A Firewall

If you’re having problems accessing an SVN server through a corporate firewall or caching proxy server then see if the repository offers HTTPS, as well as HTTP, access. The system that would usually blocks HTTP access (because SVN access uses non-standard HTTP methods) can’t inspect the encrypted traffic sent to a HTTPS server so it passes straight through. This is quite handy for posting plugin updates to the wordpress.org plugin repository.

K2 Style Switcher – 1.1.2

Version 1.1.2 of the K2 Style Switcher plugin has been committed to the WordPress plugin repository. This version contains the following enhancements:

  • Added ‘languages‘ folder for l10n files
  • Added German translation (de_DE), many thanks to Julian Manzel
  • Confirmed compatibility against WordPress 2.8.5

As usual, if you’ve got the plugin installed then WordPress should display the fact that an update is available on the plugins menu within 12 hours. The plugin can be manually downloaded from the WordPress repository if you don’t want to wait.

K2 Style Switcher – 1.1.1

Version 1.1.1 of the K2 Style Switcher plugin has been committed to the WordPress plugin repository. This version contains the following enhancements:

  • Added code to allow the current style to specified as a URL parameter called ‘k2ss_target_style
  • Added code to allow the default style for a page or post to be specified using a custom field called ‘k2ss_default_style

As usual, if you’ve got the plugin installed then WordPress should display the fact that an update is available on the plugins menu within 12 hours. The plugin can be manually downloaded from the WordPress repository if you don’t want to wait.

Plugin Localisation Resources

Whilst working on some updates to my WordPress plugins recently I have discovered some excellent resources covering the subject of making plugins translatable:

  • The I18n for WordPress Developers page in the WordPress Codex covers all the basics and should get you started.
  • John Godley (aka. Urban Giraffe) covers the topic in more detail, including the finer points of translating plurals, and the use of printf() instead of _e(). He also provides a companion article that approaches localisation from the point of view of the person doing the translation, something that is often overlooked.
  • Finally Austin Matzko (Pressed Words) provides a succinct summary of internationalisation, including a look at Poedit, a cross platform editor for the translation files.

There is really no reason not to translate your WordPress plugins and themes, it requires minimal effort and can vastly improve the experience for users who’s first language is not the same as yours.

K2 Style Switcher – 1.1.0

Version 1.1.0 of the K2 Style Switcher plugin has been committed to the WordPress plugin repository. This version contains the following enhancements:

  • Encapsulated plugin functionality in a class
  • Consolidated plugin options into an array stored in a single option
  • Cleaned up code to match WordPress Coding Standards
  • Re-wrote admin panel code to use the new options mechanism introduced in WordPress 2.7
  • Made all plugin messages translatable
  • Added footer message to plugin admin panel stating the name of the plugin, the current version and the author’s name
  • Re-wrote plugin activation hook to attempt to pull in existing options from current and previous versions of the plugin as well as removing redundant options
  • Added call to load the plugin l10n / i18n text domain
  • Removed plugin deactivation code to stop configuration options being removed when plugin is deactivated
  • Added uninstall script to ensure that configuration options are removed when plugin is deleted
  • Added plugin widget in a class based on the WP_Widget class introduced in WordPress 2.8
  • Added option to hide specific elements of WordPress & K2 standard footers
  • Prevented styles that are always selected (base styles) from being added to the list of switch-able styles
  • Took out custom WPMU checks. Detection of K2 styles directory and URL is now based on K2 options
  • Added a message to the K2 options page explaining how styles are layered
  • Added code to make sure that the plugin is not loaded if K2 is not active

As usual,  if you’ve got the plugin installed then WordPress should display the fact that an update is available on the plugins menu within 12 hours. The plugin can be manually downloaded from the WordPress repository if you don’t want to wait.

NB: When the plugin is updated it will attempt to keep your previous configuration options and delete any stray options created by previous versions. To ensure that the update process works properly please do not deactivate the plugin prior to updating it. The WordPress plugin update functionality takes care of everything for you.

Restricting Access to the WordPress Dashboard

During his recent talk at WordCamp San Francisco 2009 Matt Cutts mentioned a neat trick for restricting access to the WordPress admin area – adding a .htaccess file to wp-admin.

His technique (mentioned on slide 48 of the presentation slides) allows you to whitelist IP addresses that can access the wp-admin area (your home, workplace etc.) whilst denying access to everyone else. All you need to do is create a .htaccess file with the following content, fill in as many IP addresses as you want whitelisted and upload it to the wp-admin folder of your WordPress blog:

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist home IP address
allow from 123.45.67.89
# whitelist work IP address
allow from 123.45.67.98
</LIMIT>

And your done! You now have full protection against nefarious types accessing your WordPress admin area courtesy of Apache.

2009 Open Source CMS Award: Nominate WordPress

I recently read on Ozh’s blog that WordPress is up for a nomination in the PacktPub 2009 Open Source CMS Award. The list of previous winners is rather dominated by Drupal and Joomla, so it would be good to see a change, especially if it means that more people realise that WordPress is more than just a blogging package.

Vote for WordPress! You can nominate WordPress in the Best Overall Open Source CMS and Best Open Source PHP CMS categories. PacktPub are giving away three 8GB iPod Nanos to three individuals at the nominations stage, and three 8GB iPod Touch’s to three individuals at the voting stage, all selected at random, so you have the chance to get yourself some schwag and do something good for WordPress at the same time. The nominations close on the 11th September, so get voting!

Once you’ve voted for WordPress you should encourage others to do so as well. Blog it, tweet it, spread the word!

Stopping Content Leeches

I noticed recently that I was getting pingbacks from a site called AllAboutWordpress.com every time I published an update post for one of my plugins. It turns out that this is a site that re-publishes content from blogs, seemingly without permission. I have never been contacted to ask permission to republish my content, so I view this as content theft.

Luckily there is a nice plugin called AntiLeech by Owen Winkler that allows you to detect and blacklist content thieves, either by IP address or browser user agent. If a client that is crawling your feed matches the blacklist then you can either choose for them to receive some auto-generated Lorem ipsum text or a customised message. I chose a custom message, informing the (innocent) visitor to the infringing site that the content they were trying to view has been taken from my site without permission. There are links back to the original article permalink on my site to try and provide the potential reader with a good experience, and the content they were actually interested in.

Content theft is never a good thing for an author, hopefully AntiLeech will help to turn the tables.

Last Modified Footer – 1.1.0

Version 1.1.0 of the Last Modified Footer plugin has been committed to the WordPress plugin repository. This version contains the following enhancements:

  • Encapsulated plugin functionality in a class
  • Consolidated plugin options into an array stored in a single option
  • Removed duplicated code from the plugin
  • Cleaned up code to match the WordPress Coding Standards
  • Re-wrote admin panel code to use the new options mechanism introduced in WordPress 2.7
  • Improved the translatability of messages by allowing manipulation of the position of non-translatable elements in messages
  • Migrated from boolean options to named string options for better forward compatibility
  • Added a footer message to plugin admin panel stating the name of the plugin, the current version and the author’s name
  • Re-wrote plugin activation hook to attempt to pull in existing options from current and previous versions of the plugin as well as removing redundant options
  • Added a call to load the plugin l10n / i18n text domain
  • Removed plugin deactivation code and hook to stop configuration options being removed when plugin is deactivated (as opposed to uninstalled)
  • Added an uninstall script to ensure that configuration options are removed from the database if the plugin is deleted (from the Manage Plugins menu)
  • Encapsulated the plugin widget functionality in a class based on the WP_Widget class introduced in WordPress 2.8
  • Re-wrote the widget and admin panel code to conform with the WP_Widget class requirements

As usual,  if you’ve got the plugin installed then WordPress should display the fact that an update is available on the plugins menu within 12 hours. The plugin can be manually downloaded from the WordPress repository if you don’t want to wait.

NB: When the plugin is updated it will attempt to keep your previous configuration options and delete any stray options created by previous versions. To ensure that the update process works properly please do not deactivate the plugin prior to updating it. The WordPress plugin update functionality takes care of everything for you.

Last Modified Footer – Upcoming Changes

Version 1.0.2 of the Last Modified Footer plugin was released yesterday. This is the last version of the plugin that will be compatible with WordPress versions prior to 2.8. The next update will convert the plugin’s widget to use the WP_Widget class introduced as part of the WordPress 2.8 release. This simplifies the widget code and makes it multi-instance capable.




Copyright © 2007-2009 Hugh Johnson

Site last updated Fri 6th Nov, 2009 @ 17:29