Category: Websites

Since starting this blog, some of my post popular posts have been about the WordPress plugins I’ve written. Built as I started learning about PHP, they’ve received hundreds of comments and often generate a spike of pageviews when new versions become available. The most practical of these plugins, Mass Page Maker, has seen multiple iterations as I learned more about the WordPress API. Many people were very happy about the ability to import data using a CSV file, but conversely that generated lots of comments about having difficulty getting the format right.

After many months of struggling to improve it, I’ve buckled down enough to offer a new version, called Mass Page Maker Pro that is now available for sale at $10 (Limited time only!).

There is a reason that I’m charging for this version. After I neglected the plugin for long enough, it was dropped from the WordPress plugin repository. When I approached the staff about getting it reinstated, I was told that the plugin could be abused and cause someone to import too many pages into a WP installation. This is true, but like most useful tools, there will always be a small subset of users who abuse its capabilities. After having an email conversation with one of the plugin users, I made the decision to offer a free and Pro version of the plugin, to hopefully earn a little money for the time I’ve invested in developing it. The free version will not allow CSV importing, and will be limited to 10 pages at a time, so hopefully those restrictions will allow it to be listed in again in the repository so that existing users can receive the update and learn about the situation.

Now that that’s out of the way, let me explain some of the new features in more detail.

duplicate content category

Customized CSV Format

As mentioned, a big problem with the original version was the stiff nature of the CSV format, making it difficult to match the required format the plugin is expecting. I decided to solve this by offering both the default format and allow a totally custom format to leaves out data that is not important. To create a custom format, choose “Custom” from the menu and click the Add Column button. From there, it’s easy to define the order of the columns you want to use. The nice part is that the plugin will merge your data against the default format, meaning you can concentrate on your data.

For example, if you define only a post title and post content column, properties like post type (post), comment status (open) and post date (current date) are added automatically. Drag and drop the columns as required. I think this will be a very well used feature.

CSV form screenshot

Improved Web UI

Since starting this plugin, I’ve learned a lot more about Javascript and jQuery technology and have incorporated a lot of that in this new version. It uses the jQuery UI accordion plugin to display either the CSV input or web form and makes it easy to add tags and custom meta values.

Duplicate and update existing posts with CSV data

Through some user feedback, I added a new column to the CSV format that allows you to update existing pages or duplicate them and overwrite the content. Choose the respective column in the dropdown, and supply either a post title or post ID and the plugin will overwrite that data with what you supply. For example, in the first photo above, that is the correct layout for duplicating pages, overwriting the post content and adding new categories. Those three values should be the first 3 columns in the CSV text.

I’m hoping that this version of the plugin contains all of the properties users might want when importing posts. I spent lots of time testing the plugin, but of course if you run into an issue, use one of these contact methods. There are also example CSV files on that page available for downloading. Please consider purchasing the plugin if you’ve been helped at all by the original version, and I’ll continue to offer new features and bugfixes.

Tagged with: ,

Does your WordPress media library look like this photo? Maybe you don’t have the same affinity for the BMW 1M that I do, but if you’re missing thumbnails, I might be able to help.

After upgrading an important installation to WordPress 3.4, I suddenly noticed that many thumbnails had disappeared, specifically the earlier uploads. After posting to WP support forum and WP StackExchange group and receiving minimal response, I decided to take a look at the database myself.

I ended up finding the problem in the wp_postmeta table. It turns out that prior versions of WordPress didn’t insert the _wp_attached_file meta key when uploading a photo, and the latest version requires it. Since this key doesn’t exist for some uploads, the system defaults to showing the media icon, and refuses to display resized images in other posts.

The solution is to run through the list of attachments and insert this meta key where it doesn’t exist. I wrote code to do so, and it worked for me, but when another user requested it in a more useable format, I wrapped it in a basic WordPress plugin.

Download it here

I can’t provide much in the way of support for it, but if it fixes your problem, leave a comment.

Tagged with: , , ,

Moving web hosts is not something that most website administrators look forward to, and most of the time it is very time consuming and complex. With proper preparation, however, the transition can be smooth and your visitors will never notice the difference.

Recently I moved from Bluehost’s shared hosting plan to MediaTemple’s (gs) Grid Server. This was brought about by a second DDOS attack on my Bluehost box in a few months. The first time it happened it was annoying because I hosted some very important email with them, but this time it was seriously inconvenient because I host about 5 sites in addition to mine, and one of the companies I host for was about to start a critical press release send out before going on an important trip. Downtime was not an option, so I moved to the (gs) to have multiple redundancies as well as lots of room to grow. The (gs) is unique because it relies on dozens, and often hundreds, of servers to host websites, meaning each site has the equivalent of far more powerful dedicated hosting packages for an excellent price.

After I decided to move hosts, I made a list of things that needed to be done, so here’s what you should check before flipping the switch on your new hosting service.

Have a good ‘Net connection
You’ll be doing a lot of uploads during the switch, as files are returned to their places. If you have a local copy of your website you can skip the download process and start right away with the uploading. I mirror all my websites every night, but since I wasn’t at home at the time, I couldn’t utilize the backups. Uploading the files again took a while though, so make sure your connection is strong and free of bottlenecks.

Plan your attack
As with many other daunting tasks, be sure to plan out what you want to do beforehand. Make a list of everything that needs to be done for your users to maintain access. Extra time here thinking hard to remember everything will save headaches later on.

Keep your original hosting package
I’ve made this mistake before. When I moved to Bluehost originally, I actually cancelled my very first package prematurely, and for a few hours my site was completely inaccessible. Purchase your new hosting package, move your files, but don’t change over the DNS records until the very end. You might not get some of the money back from your original host, but you’ll save your visitors many frustrations.

Backup MySQL databases
MySQL is the cornerstone of many online applications now, and they’re easy to forget because they cannot be accessed via FTP. Be sure to log into your account control panel and download the .sql backup files of all your databases. Upload them to your new databases, and you shouldn’t need to make any changes to their content. You will need to update your configuration files for connecting to these databases before you can properly access them. This is a very important step because it can have a huge negative effect on your website when it is running again (You’ve seen those WordPress database errors before).

Check email records (or use Google Apps)
A somewhat of a hidden setting, the MX record of your domain indicates to incoming mail where you’d like it to be sent. If you host email on your own domain, you’ll just have to make sure the same username/inboxes exist on both servers. If you use Google Apps (and you probably should be), make sure the domain name record on the new hosting package is updated to reflect the Google information. This is typically done in the domain list file somewhere in your control panel.

Make the switch
This step is very easy to do, but requires a little though beforehand. If you don’t remember which service is hosting your domain name, you’ll need to use a service like Whois.net to do a Whois query. This will point you to the correct website, where you’ll then need to find the correct log in information. Once you have access, it is as simple as changing the DNS record to the new hosting.

Wait for the changes to take effect
With the DNS record changed, you’re left waiting for the change to take effect. Be sure to follow the website closely so that when the change goes through, you can find anything that might be wrong. The reason for the delay is that your DNS record is cached throughout the internet, meaning a change to one server needs some time to “propagate” through the rest of network. You might even find that some people are able to access the new site before you, which is just because of the way ISPs are connected to the web.

That covers most of the things you’ll need to remember when changing your site. I followed each of these while moving mine over, and so far have had few problems. A hosting upgrade can give you much more space to work with, and provide power for your website growth in the future.

Tagged with: , , , , ,

This is a quick tip about WordPress blog emails. Ever since this blog was started, I received emails about comments from my webhost default address. It was ugly looking and didn’t provide any details about who really sent the comment.

The solution is to create an email account on your server with the address wordpress@domain.com where domain.com is, of course, the domain of your website. Once this change has been made, comment moderation notifications will be from WordPress <wordpress@domain.com> and new comment details will be sent from the actual person emailing.

Tagged with: , , ,

The WordPress community is a great group of people dedicated to furthering a terrific open-source product. After setting up my website originally, I began messing around with plugin code to see what I could do. PHP got more and more interesting, and eventually I was able to release my first plugin, Comment Connection. That got me thinking, and after reading a WordPress forum post, I wrote Mass Page Maker, which now has 3,500 downloads as of July 27.

This post is dedicated to explaining more about the plugin, and chronicle updates I make.

v1.0


The first release was very straight forward. It was basically a form that filled out the information found in the post table of the WordPress database. While it did the job that the initial forum post had suggested, it did not offer category, template or any other details on the page. All supporting entries in the database were basically ignored.

As is the case with most software releases, I added multiple features in the next few releases. Shortly after releasing 1.0, a user requested the ability to add separate titles for each page. This was added to v1.1, along with additional page properties (comments and pings) and a better way to protect from faults, or improperly filled out pages.

Version 1.1.1 and 1.2 mostly smoothed out the code, but also included the ability to add categories. This was not as straightforward as I had hoped, because of the way WordPress associates categories. Rather than simply add a field to the database query, I had to add an additional query to the category table. It was a good challenge to make it work properly, while still making it super fast to add at least 100 pages (my goal throughout writing the plugin was to make it as efficient as possible).

Each of the next versions added an additional feature — mostly those requested by comments to the original post. Page parents were added, and it became possible to add different content to each page. That was another good challenge, because I had to add arrays to deal with the different page data.

Finally, the big deal with version 1 was that someone asked to translate the plugin into German. I really appreciated this because it meant something I made was being used in a different country, and people wanted to contribute. Speaking of that, if you’d also like to translate any of the plugins I’ve made, please email wesg [at] wesg [dot] ca.

v2.0


As should be expected with version 2.0 of any software, this version brought many changes. The primary changes were additions to the date/time handling system of the plugin. Again as a result of comments, I made it possible to add pages with specific dates, either in the past or future. In addition, an interval was added so that pages could be entered with a customizable space between them. This update was complex to write, as the time and date system requires multiple computations to make everything fit together. The biggest issue was the cron system, or the component that publishes posts in the future. There are still slight problems with my implementation, but it’s a work in progress.


Version 2.5 brought a feature that has generated the most feedback I’ve ever had for a plugin. The comma separated values component of the plugin means that multiple posts can be entered at once, all with unique properties. Since many programs can output the format, it makes adding hundreds of pages to the database very easy. Of course, this added a lot of complexity to the plugin. In the end, I was able to build it in such a way that I can now use different methods of entering pages, without changing the major elements.

Continuing with the user comments, version 2.5.3 includes custom field support. The next few updates simply fixed the CSV component of the plugin.

V2.5.6 brought updates that help me as a developer. When the CSV import or web page interface doesn’t work, I have to figure out what failed, and how to fix it for the future. This update included checks while the CSV file is being processed that find errors in the format. By explaining immediately what is wrong, users can more easily enter data.

After hearing about problems with MPM and WP 2.8, I looked them up with version 2.5.8. Additionally, tag support was included. Due to the way WordPress interacts with the database, tags are a very involved process, that require loops, processing and updates. Despite all this, MPM still inserts pages faster than other methods, and offers much more customization.

Version 2.6 finally solved the WP 2.8.x problem. It turns out that WP 2.8 changed the database structure, and the plugin was trying to insert an entry to a column that no longer exists. That is one of the problems with developing a plugin: constant maintenance is required to keep compatibility up.

Like the plugin? Want to help test the latest version and eliminate bugs? Email wesg [at] wesg [ca] to find out how you can help.
Tagged with: , ,