A few notes on the conversion of DigitalHam to WordPress
DigitalHam started life written by hand in html and php using MySQL as a database. It had several facelifts but I was never satisfied with the appearance or site navigation. I’d seen WordPress recommended as an easy to use blogging or simple content management system and decided to give it a try.  The current site is the result and I’m pleased with the outcome although realise that tastes vary and what suits me may not please others. As this is a WordPress site if you think DigitalHam sucks you can tell me why. Of course as I’m site admin your views may not go public but the chances are they will and either way I’ll take note of any criticism. I’ve used the same basic style for a new blog I decided to produce based on my experience of using WordPress over the past week or so producing the current DigitalHam. Here is my I Don’t Believe It blog inspired  by Gus de Silva’s complaints about the Northampton waste recycling system.

The actual conversion was a tedious slog as there is no easy import from html so far as I can see so each WordPress page was constructed from scratch by manual copy and paste from the original site. To retain the Google ranking earned by the original site WordPress was an add-on. So I could develop the new WordPress site alongside the old I simply changed the WordPress index.php to pick up the original for any IP other than my own. Once I was happy with the result I changed the index.php back to standard and uploaded a shedload of 301 redirects in place of the original pages. Sadly what I failed to do was upload the standard index.php leaving the site broken for half a day until I finally realised what was wrong.

Installed Plugins
404 Redirected
A smart 404 redirection plugin that provides the ability to log incoming 404 URLs in real time, automatically redirect visitors to most relevant content, and provides page suggestions when relevant content can not be found. Admins can also manually add redirects to system and control automatic deletion of old redirects when they are no longer being used.
Version 1.2 | By Weberz Hosting | Visit plugin site

I had to remove this plugin as I have used the  Do not link to this page in the navigation bars option on a number of pages which are only menu placeholders. Unfortunately this results in redirection errors should anything access those pages by their URLs. I may just rely on the Google webmaster tools and my webserver stats or I may track down an alternative.

Used by millions, Akismet is quite possibly the best way in the world to protect your blog from comment and trackback spam. It keeps your site protected from spam even while you sleep. To get started: 1) Click the “Activate” link to the left of this description, 2) Sign up for an Akismet API key, and 3) Go to your Akismet configuration page, and save your API key.
Version 2.5.5 | By Automattic | Visit plugin site

I’d say that this is pretty much an essential plugin for everyone. DigitalHam is attracting several hundred spam comments a day and I simply don’t have the time to sort the wheat from the chaff.

Allow PHP in posts and pages
Allow PHP in posts and pages allows you to add php functionality to WordPress Posts and Pages whilst still retaining HTML tags
Version 2.3 | By Hit Reach | Visit plugin site

An essential plugin for me. Without this or something like it transfer of the antenna search would not have been possible.

Simple Google Sitemap XML
Generates a valid Google XML sitemap with a very simple admin interface
Version 1.4.4 | By iTx Technologies | Visit plugin site

Having a sitemap helps search engines index your site. I used to produce one manually. Having this do the job automatically further cuts down the work needed to add content.

WordPress Backup to Dropbox
Keep your valuable WordPress website, its media and database backed up to Dropbox in minutes with this sleek, easy to use plugin.
Version 0.9.4 | By Michael De Wildt | Visit plugin site
Only just installed this one but it looks to be good. Automatic scheduled backup of entire site and database to a DropBox account – I took a free 2GB account which I’m hoping will cover my WordPress websites.

Stopped working on update to v1.1 replaced with..
WordPress Backup and more…
Version 2.1.11 | By Daniel Hüsken | Visit plugin site

Amended to require MySQLi which was not available on my server so replaced with..
UpdraftPlus – Backup/Restore
Backup and restore: your site can be backed up locally or to Amazon S3, Dropbox, Google Drive, (S)FTP, WebDAV & email, on automatic schedules.

If you aren’t familiar with DropBox it’s an excellent free online storage site and application giving you at least 2GB free online storage where you can keep anything you like safe – I guess photos are the obvious suggestion. You can increase that free space by following a few easy to do steps including referring the service – for instance if you’d be so kind as to sign up for it through my referral link then that will give me an additional 250MB.

This plugin helps you to keep your database clean by removing post revisions and spams in a blaze. allows you to rename your admin name also. Additionally it allows you to run optimize command on your wordpress core tables (use with caution).
Version 0.9.4 | By Ruhani Rabin | Visit plugin site

As it says in the blurb above. This is an excellent plugin however I noticed that it was leaving the Akismet data in commentmena for spam comments it had deleted. This site attracts lots of spam so that amounted to a lot of data so I’ve set up a cron job to run the sql below every hour. For security my dropbox tables are prefixed as indeed yours should be but I have removed that prefix from this example.

$del_query = 'DELETE FROM comments WHERE comment_id IN (SELECT comment_id FROM commentmeta WHERE meta_key = "akismet_result" and meta_value = "true")';
$del_res   = mysql_query($del_query);
$del_query = 'DELETE FROM commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM comments WHERE comment_id is NOT NULL)';
$del_res   = mysql_query($del_query);
$opt_query = 'optimize table commentmeta, comments';
$opt_res   = mysql_query($opt_query);

WP Wunderground
Get accurate and beautiful weather forecasts powered by Wunderground.com for your content or your sidebar.
Version 1.2.5 | By Katz Web Services, Inc. | Visit plugin site

WP Cookie Law
WP Cookie Law is a wordpress plugin which installs instantly onto your wordpress enable website. Whenever anyone visits your site for the first time since the plugin was installed – a popup or a slide down will appear specifically asking their consent to use cookies on their machine. Within a few minutes you can be fully compliant. By Andrew Lewin.
A plugin which possibly allows sites to comply with laws set by regulators who haven’t a clue how websites actually work. I have used this plugin on all my WordPress sites and the same technique on my others.

Having noticed that the Virgin Media website dumps over 100 cookies on a first visit to their home page many of which are advertiser tracking cookies and their only token compliance to the new regulations is a tiny button at the bottom of the page leading after a couple of clips to a very bland and glib generalisation of what cookies are I’ve disabled this and just put up a graphic to my cookie page as that is far less intrusive. With only a single day it’s impossible to be certain but it did look like my honesty and prominent banner on my sites about the cookies used until a button was clicked cost me traffic.
Facebook Likes You!
Facebook Likes You! is simple plugin which makes it easy to add Facebook Like button and widgetable Like box. It’s fully configurable, so you can decide where to append the button.
Version 1.5.4 | By Piotr Sochalewski | Visit plugin site

Stopped working

Well it wasn’t all sweetness and light…
I added a cache plugin which must have clashed with something else because the result was a totally blank site. On reflection what I should probably have done is used the direct WordPress admin link but I didn’t – I just deleted the plugin code from the wp-content/plugins folder. That was a big mistake – it brought back a visible website but I couldn’t access the admin pages and the error message was singularly useless – “You do not have sufficient permissions to access this page” It seems that this is a blanket error message that gives no clue as to the cause. Suggestions were that there was something astray with the file permissions in wp-content. Fiddling around with those didn’t help and nor did restoring the php files from a backup. I think I really screwed it up by attempting a database restore.

To cut a long story short I created a new WordPress site on a different domain but using the old database with a different prefix. Once that was up with a basic config I exported all the tables concerned with comments posts and terms, changed their prefix names in the export file and imported them to the new WordPress site. Once I was sure that most of the site looked good I did some more configuration then altered the domain back to digitalham.co.uk in the general settings and pointed the webserver to the folder I did the fresh install in. There are still some scruffy looking pages where the restore process inserted some line feeds. That must have been the editor I used to change the table names – I’ve since found that if I’d used Windows notepad I’d probably have been alright – at least I’ve done some further messing with other sites I now have on WordPress and didn’t see that issue.

I don’t know exactly what caused this problem but it was an absolute nightmare and has dented my trust in my backup regime. I’ll be testing it out using a different domain and database to make sure I can produce a working site from the backups without relying on the existing site and database still being available.

I have since found that as well as the wp-config.php file specifying the database tables prefix there are also rows in the options table where the option_name contains the prefix and also the meta_key in the usermeta table. If those don’t tie up you’ll be getting the “You do not have sufficient permissions to access this page” error message.


 Leave a Reply