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

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

I’ve received a lot of feedback for the CSV feature I added to my Mass Page Maker WordPress plugin. Most of the responses were positive, about how much time users will save, which I really like to hear. There were also comments about invalid CSV files, making the job significantly harder.

To try to solve those problems, I’ve made a page on the site that generates text that can be saved in a CSV file, based on the same elements the plugin uses. While still requiring manual user input, it can save time by ensuring the file works properly with the plugin on the first try. It will escape all characters that require it.

I’m still working on automatically generating the actual file itself, but the current page should help to build files that work properly with the plugin.

Tagged with: