Tag: plugins

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

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

This post was written using Mass Page Maker v2.5.2 and was scheduled to publish at 12:45 EST.

Tagged with: , ,

This post was set up as a test of the scheduled (cron) behaviour of the Mass Page Maker 2.5.1 plugin.

It should be posted at 5:00 PM EST.

UPDATE: It only published after I changed the time in the editor, so clearly I’m missing something important.

UPDATE: The GUID field in the database appears to be the culprit. Version 2.5.2 seems to have brought the plugin up to speed.

Tagged with: , ,

I’d been struggling valiantly with a blog that refused to save properly without giving an error (plug: www.ryersonformulasae.com, check it out!) until earlier today I decided to try modifying the settings until something changed. After deactivating the first plugin–which happened to be of my own creation–the problem was solved.

So now I know the solution, and would like to share it with others: if your WordPress installation is messed up, try deactivating your plugins one at a time and maybe your problem will work itself out.

Tagged with: , , ,