Simple Matted Thumbnails Plugin

We have released a new plugin, Simple Matted Thumbnails. This provides a new format for thumbnails in addition to the two that come with WordPress.

Thumbnail Formats

Proportional

This is the default.  The image is resized to fit in the box, the resulting thumbnails will vary on size if images with different aspect ratios are used.
proportional

Cropped

This is a choice available from the media settings for the thumbnails and in the settings of many e-commerce plugins.  The image is cropped to the exact size requested, care must be taken in preparing images to avoid losing important content.
cropped

Matted

This is the new format provided by this plugin.  The image is resized proportionally to fit in the box and then matted out to the size requested for the thumbnail.  The mat is similar to those used to frame photographs and watercolours.  This plugin lets you choose the colour of the mat and add extra matting around the thumbnail image.
matted

Matted with extra matting

This adds a percentage of background colour around the image. extra

Where to Get The Plugin

The plugin is available from the WordPress Plugin Repository at http://wordpress.org/plugins/simple-matted-thumbnails/ and using the Plugins menu in the WordPress admin.  Please let me know of any issues using this plugin and any enhancements that you would like to see.

Simple Promo Code Plugin

I recently released the WordPress plugin, “Simple Promo Code”.  This plugin provides a short code that allows a user ro enter a promo code to access a page or document. The form validates the promo code and tracks its usage.  This can be very useful for tracking access to a document that you are promoting in an email campaign or magazine.

Use of the plugin is described on the Simple Promo Code  page.

Like my other “Simple” plugins it’s well commented and was built with use as an example in mind.  Feel free to pick it up and modify it to your requirements. I will be posting an annotated version of the code as a tutorial in the near future.  In particular this plugin provides a small example of an HTML form that performs validation, updates a database and redirects the user to another page when complete.

 

Using the PHP Session in WordPress

WordPress and Sessions

The WordPress platform is totally stateless and provides no support for the use of sessions outside of the cookie that keeps a user logged in.  This is a very good policy and helps keep your blog light and responsive.  Unfortunately there are times that a session might be convenient to hold some data between requests.  If you search online and in the WordPress forums you will find a lot of discussion of this and a few ideas that point in the correct direction.  

The best of these is Frank Verhoeven’s blog Post on this topic which is short and sweet and contains the basic idea.  The comments on this are the real gold.  What I’m providing here is a summary of the facts I’ve found in those comments and much other online study and experimentation. Continue reading

Simple Error Handler

I recently released the WordPress plugin, “Simple Error Handler”.  This plugin produces a stack trace when a PHP Notice or Deprecation warning occurs.  The administrator can set the error level that is trapped from the admin settings page.  Other than that it could provide a developer with an easy start to make a customized error handler or logger. Continue reading

Simple Changed Files Plugin

 

Today I released the WordPress plugin, “Simple Changed Files”.  The plugin is as simple to use as its name implies, there are no configuration settings and a single action item under tools.

Use of the plugin is described on the Simple Changed Files page.

The code is written in Object Oriented PHP as an example of writing plugins in this style. Like Simple Access Control it’s well commented and was built with use as an example in mind. It was written using the Model View Controller pattern, even though that is overkill for something this small.  However it does provide a small, clear working example of the use of the pattern.  Feel free to pick it up and modify it to your requirements. I will be posting an annotated version of the code as a tutorial in the near future.

 

Simple Access Control Plugin

Today I released our first public WordPress plugin, “Simple Access Control”. The plugin is as simple as its name implies, there is only one optional configuration setting and only one widget to control access.

Use of the plugin is described on the Simple Access Control page.

The code is written in procedural PHP so it can be followed by programmers at any skill level, it’s well commented and was built with use as an example in mind. Feel free to pick it up and use it or modify it to your requirements. I will be posting an annotated version of the code as a tutorial in the near future.