Custom Post Type Plugin for Countries

As a team we’re obviously very passionate about WordPress. And as many of you know we’ve been working hard on the upcoming WP e-Commerce Plugin 3.8 which now utilizes Custom Post Types as means for storing Products in the Database – this is much much tidier then the old solution we “had no choice but to use” in the past.

During that process we have learnt quite a lot about Custom Post Types and as part of our ongoing commitment to WordPress (and to learning in general) we’ve been embarking on what we call an “industry leadership” initiative. What we’ve done is create a new Plugin that lets you import a list of countries into your WordPress site as Custom Post Types. These bad boys have a ton of Custom Meta associated with them ranging from Country Code to Flag Icon. America and Canada have their respective cities included as Custom Meta too (however we’re open to suggestion).

Essentially the goal for a Plugin like this is for it to become a core Plugin that can be used by other Plugins / Plugin developers to wrangle and manage country related information. So for instance for the WP e-Commerce Plugin we can remove tables in the database that store country related information. And we can rely on WordPress to store that data instead. For BuddyPress we would like to see this Plugin being used to enhance BuddyPress Profiles – everybody comes from somewhere!!

Its early days yet but we think it makes a mean proof of concept. If there is any interest in this Plugin let me know. If you can think of a use for this Plugin blog about it or leave a comment. We’re keen to explore all the possibilites with you.

» Download Countries Custom Post Type Plugin V0.1

Update New Download Link

20 responses...

In theory at least, this really sounds like a fantastic idea.

Why have 10 plugins each using more resources and memory to store the same info 10 times in 10 different ways to 10 different extents, when you can have 1 plugin that sits in the middle and manages all of it.

This would also give a unified standard to the way managing country/location related data is stored and handled which would make things endlessly easier for pretty much everyone involved (exept initially the people that have to re-work their plugins. lol).

This sounds like something that would have advantages in uniformatiy (for features, functionallity, and implementation), efficiency, memory usage, and over all ‘just good practice’.

There is a lot of backing, awareness, and respect for wp-ecommerce as well, which means that it gives more ‘clout’ to this project (ie. it’s not just ‘some random guys with a funky idea’). Being a plugin rather than something integrated to the core of wordpress it’s self also means that you are able to release updates/patches/fixes/etc at lot faster and a lot easier which will be especially important in the early days (not that wp-ecommerce has a habbit of quickly releasing a fix for a fix or anything haha :P).

The main thing to keep in mind with this is that with ‘major’ updates, it runs the risk of breaking multiple plugins on a persons website in the event that something goes arse-up. To counter this, you would really need to invest a lot of time into giving people the option of version control – either ‘undoing’ that upgrade they just did, or an easy way to specifically go to ‘version X.YZ’ so they can get a particular plugin to run.

The ‘catch 22’ of this sort of thing is that it may have users end up in the unusual and uncomfortable plugin where they require a specific version of your plugin for ‘plugin X’ to work correctly, but a different version to get ‘plugin Y’ to work correctly (similar to how some plugins only work on WP3.0, and others will only work up to 2.9.2 or whatever).

When your plugin starts to affect software from other developers, things like version control and product testing become significantly more vital than if your plugin is mostly stand-alone. Eg: If wp-ecommerce buggers up, their store might go down. If your country plugin buggers up – their entire site could become dead in the water.

If you guys are able to take on that level of responsibility and the required commitment that comes from creating something that is to become a ‘core’ element to a piece of software used by 20,000,000+ websites world wide – I say go for it… Just don’t bollocks it up 🙂


Thanks for the response Adam. I really appreciate the feedback – you’ve done a good job of validating the concept for me, although that said, I already knew it was a good idea otherwise I wouldn’t have invested in it so much already. Custom Post Types are seriously cool and could be, given the right attention, be actually useful.

I think it should be an open source initiative so its not just our responsibility though, especially if it were to become core. In a dream world somebody like would say, wow awesome, how can we help. I guess we’ll have to wait and see though.

For now I’m happy to keep investing in the idea. But we can’t afford to do it alone 🙂

Good idea, I’ve worked on a few projects where it has been necessary to use countries for a variety of purposes and in each case I’ve ended up creating my own arrays or storing in the database.

What you’ve got now is a great basis and there are many enhancements popping to mind as I’m just clicking around it.

If you can develop a community around this plugin as the WordPress team are trying to encourage with core plugins then I think it would be great to develop this into THE plugin for country support.

The key to it’s success with be minimise bloat and make it extensible through hooks and filters. Keep the core plugin as simple as possible but allow users to override almost everything with filter – for example changing the flag image file.

I’ll certainly be up for contributing 😉

Maybe decimal separator and thousands separator could be added to the meta data for each country? Have a look at Google Code Issue #26 for more information.

Decimal or non-decimal currency.
e.g. US dollars, British pounds are decimal. Japanese Yen, Korean Won are not.

Hey chaps. Thanks for the feedback – Ben as always we’d love your help! I guess by “we” I talk for the entire WP community that will find this type of Plugin useful. The crazy thing is we (this time by we I talk for Instinct) already have a need for it internally 😛

I’m trying to get the Plugin fast tracked through WordPress extend now. I’ve added it and now its just a matter of waiting for it to be approved. Once it is approved then people can start contributing 🙂

An attention-grabbing discussion is worth comment. I feel that it’s best to write extra on this subject, it may not be a taboo subject however typically individuals are not sufficient to speak on such topics. To the next. Cheers

In these days of austerity plus relative anxiety about having debt, most people balk against the idea of using a credit card in order to make acquisition of merchandise or perhaps pay for a holiday, preferring, instead just to rely on the tried plus trusted technique of making payment – cash. However, if you possess the cash available to make the purchase entirely, then, paradoxically, that’s the best time for them to use the card for several good reasons.

I was suggested this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. You are amazing! Thanks!

I do agree with all the ideas you’ve presented in your post. They’re very convincing and will certainly work. Still, the posts are too short for starters. Could you please extend them a bit from next time? Thanks for the post.

The Good lad!
The Useful offer, for present-day day to keep a check on safety, much even currently.It is Enough deepened and unrolled approach, I have studied nearly all your facilities. When they are necessary, shall know where address.
Want you much and good client!

I used to be very pleased to seek out this net-site.I needed to thanks for your time for this excellent read!! I undoubtedly having fun with every little bit of it and I’ve you bookmarked to take a look at new stuff you weblog pos

Comments are closed.