kieranbarnes Independent PHP, WordPress & CubeCart Programmer

SSH Timeouts on DOCSIS 3 (Virgin Media 50Mb, 100Mb, 120Mb)

Posted on May 15, 2012

Posted by kieran

Since moving to Virgin's 120Mb Broadband my SSH connections would drop after 30 seconds of inactivity. This made some grey hairs appear on the side of my head.

This happens due to the way Virgin handle the Internet traffic on their DOCSIS 3 network, as opposed to lower broadband speeds that use the DOCSIS 1 network.

I've managed to solve this by altering the client time out parameters in the SSHD config on each server.

Secure access to your SolusVM Admin Panel

Posted on May 1, 2012

Posted by kieran

SolusVM users really should protect their Admin Panel (/admincp/) . Although you can add IPs with Configuruation -> Admin CP Access. It didn't make me feel too safe.

Here's how I did it in lighttpd.

Protect wp-admin with Nginx

Posted on May 1, 2012

Posted by kieran

Are you running WordPress on nginx? A massive security win is securing your wp-admin area by limiting IP access. How? Easy.

Drop these lines into your nginx.conf or relevant vhost config file

Loading jQuery in the footer

Posted on April 3, 2012

Posted by kieran

Loading Javascript in the footer has many benefits such as speed, you give priority to visual elements of your site. Your site will render for the visitor, then it will load the Javascript.

By loading Javascript at the end of the page, it immediately has access to the whole DOM, no waiting. If you are really clever, you can do away with your document.ready() function too

With WordPress its really easy to move the Javascript into the footer.

Use the following in your functions.php file

  1. wp_deregister_script('jquery');
  2. wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', false, false, true);
  3. wp_enqueue_script('jquery');
Tagged as: , Continue reading

Adding .html suffix to WordPress Rewrites

Posted on March 22, 2012

Posted by kieran

Here's a quick way to give your WordPress install a static look.

Add this code to your functions.php

Kieran’s Password Generator

Posted on March 6, 2012

Posted by kieran

Here's the random password generator script I wrote. It has a few different options like pronounceable, unpronounceable, Windows 2008 domain safe and outright mean passwords.

Kieran's Password Generator

Filed under: General No Comments

[Snippet] Adding your custom taxonomy to post/page list in WordPress

Posted on March 5, 2012

Posted by kieran

Custom Taxonomies are amazing for organising your post data. Here's a simple way of showing your custom taxonomies on the post/page list in wp-admin.

In the image below you can see we are now showing the custom taxo Brand in the post list.

 

Here's how I did it

Automatic Photo Blogging with WordPress

Posted on March 5, 2012

Posted by kieran

My latest WordPress challenge was to automate a photo blog site. The photo blog post content would just consist of a title and a featured image. No content. As per normal photo blog style sites.

This solution takes an image at random from a folder and posts it in WordPress. It relies on a healthy collection of images to work from.

Really simply, it needed to select a photo at random and post it. Sounds easy, until to you start to code it.

Here's my solution.

Server Side PNG Optimisation with TimThumb

Posted on March 4, 2012

Posted by kieran

A little known feature of TimThumb is that is supports server side PNG optimisation.

Using the OptiPNG program (Available for Linux and Windows) TimThumb can losslessly compress PNGs on the fly.

Quick tests showed an original clients PNG came in at  671Kb, OptiPNG compressed that with no visible difference to 580Kb and nominal server load.

So lets go ahead and use it.

Tagged as: , Continue reading

Removing all comment functionality in WordPress

Posted on February 27, 2012

Posted by kieran

As more and more people adopt WordPress as a CMS, more and more of the original blog functionality is becoming redundant. Comments are one of.

Here is how to conclusively remove all comment functions in WordPress

Page 1 of 3512345...102030...Last »