Kevin Pirnie' Articles

Post revisions This is a weakness of WordPress. On this site there are over 30,000 revisions for the 14,000 posts. That makes the table bigger and it's slower to search in it. WordPress users realized this three years ago. Tip #1 We backed up the the wp_posts table and then used a simple MySQL command to remove old post revisions. This decreased the table size from 400MB to 120MB: DELETE FROM `wp_posts` WHERE post_type = 'revision' AND post_date NOT LIKE '2012-%' Long-term solution There are WordPress plugins which can limit the number of revisions per post. We think that the WordPress code should be improved and the revisions should be stored in a different table to maximize speed. You can support this on WordPress bug… Read More
I have become quite the ModX lover lately, I use it to run my site, as well as a great number of client websites and find that it is extremely speedy, easy to use (from my perspective), and easy to teach. There are a few things I don't like about it, but this post is not about that (well... at least not all of them :)).  This post is about SEO and URL Friendliness. Now ModX has a great built-in way to allow us to have friendly URLs for our content resources, however, by default all HTML content pages are given the .html extension.  While this normally is not a big deal, I am a bit of a stickler when it comes to my URL's.… Read More
Hey folks, since PDO is taking over, I figured it was prime time for me to jump the bandwagon of direct db access, and take the plunge into PDO.As a result, I have built myself a nice and simple PDO Wrapper class and some extra functions to do all the work that one would need to do against a MySQL database.So we are going to split this up into the 2 files I have setup for my testing and environment, all are commented, and if you 'do not get it', well, maybe you should seek other hand holders to guide you through the basics of programming for the web ;-PWithout any further ado: db.class.php <?phpclass o7thDB { /* ------------------------------------------------------------------ */ // Public Properties /* ------------------------------------------------------------------… Read More
Today, boys and girls we'll be talking about how to do a Zip Code Radius Search in MySQL; how to set it up, and how to use it.This has been tested in MySQL 5.1+, so please do not try it in anything lower than this, because it probably will not work.Now, you may ask... 'Why do I need a ZipCode Radius Search?', even though I do not know the answer to your question, I do know why I needed it.  Simply put as a store locator service for a client.  Since there are a few ways to do this, I will only be showing you how I did it (as I found and tested other methods, this method seemed to be the most accurate while… Read More