Tag: Wordpress

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: , , ,


In March 2010 I took part in a ceremony that all engineers go through once they complete their undergraduate degree in Canada. Called the “Ritual of the Calling of an Engineer“, it serves as a basis for remembering what engineering stands for and how an engineer’s work affects the public. It was written by Rudyard Kipling in the early 20th century to remind engineers of the obligation they have to work that is safe, efficient and ethical. During the ceremony, each graduating member is given a ring made of stainless steel or iron that is worn on the pinky finger of the dominant hand. This is to serve as a constant reminder of this obligation.

It was an interesting ceremony, to say the least, and is one that I will remember for a long time. It was a very nice way to both prepare for a future career and to commemorate the last 4 years of studying. Officially, in June I will receive my degree in Mechanical Engineering, and after registering with Professional Engineers of Ontario, I will be an EIT, or engineer in training. This means that I can begin to work under a fully licensed Professional Engineer and collect experience that is required to receive P.Eng certification.

Since jobs don’t come overnight, and I’d like to enjoy the summer a little bit, right now I’m not focusing that intently on my full-time job search. Instead, I’m using some of the skills I picked up during high school and university related to website development. Right now I’ve joined a site called oDesk.com that connects people looking for results with providers of services. So far I’ve been able to help a few people around the world by building some WordPress plugins to improve their site’s functionality. These include one to display popular tags in the last few posts and another that gives users the ability to vote on photos displayed on posts. Additionally, I’m also working on a number of other websites for friends and family. I currently have about 4 projects of various sizes and complexities ongoing, and most use WordPress as a backend so I’m getting pretty comfortable creating themes, plugins, administration panel pages and interacting with the WP database. Check out www.openticket.ca for the latest project to start up.

More related to engineering, I’m also spending time contributing to our university’s Formula SAE team. As a member of the drivetrain team, I did some work looking at the best differential, sprocket, half shaft and spindle combination to get the most power out of our Yamaha R6 engine. I even got to do some design work, using SolidWorks to create a 3D model of a specific part, test it with the simulation software and then have it sent out to be machined on a CNC mill. It’s very cool to see something built inside a computer become a real part.

In May, the team took the car to Michigan International Speedway where we participated in Formula SAE Michigan 2010, a competition between universities all over the world to see who can design, build and market the more cost effective and highest performing race car. Unfortunately the team ran into some scheduling issues during the school year, when students — rightly so — focused on school work rather than building. Since this is the first of 3 competitions during the summer (I’m hoping to get to California and England later), we took what was built on the car and learned as much as possible. It was very interesting to see what the other teams had done with their time and budgets.

With all that in mind, it’s easy to see why my last post here was a few months ago. I hope to write more in the coming weeks, as I will hopefully have some time to work on projects that can be shared. Engineering is a challenging field of study, but it is very rewarding in both education and contribution to society. Finishing my program and learning more outside of school has helped me realize that I’m in the right field and that the sky isn’t even the limit.

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: , ,