At Brave New Media, we’re working on an intranet-style site for one of our big clients. We’re using a combination of WordPress and a custom web-based file management software to build it. The Sales department of this company is divided up into a number of teams, and the user accounts in WordPress needed to have different security levels based on which team the employees belong to. Enter the UserGroups plugin, which I will probably never release to the public. Here’s why.
It started out pretty simply: we only needed a few different security levels, because a lot of the teams could share the same level of access to the site’s content. I made a simple(-ish) plugin that added an extra table to the WordPress install and defined a number of groups (an unlimited number, technically, but we only needed five to start). In the interface, you could choose which WordPress roles each group was equivalent to, and which other groups each one could share access with. For example, the Admin group would include the access levels of the Basic AND Executive groups, while the Executive group would share Basic’s access but NOT Admin, and Basic didn’t share anyone’s access. I even figured out how to add a drop-down menu to the user add & edit forms to choose a group for each user. Everything was as it should be in a plugin: dependent only on the files in the plugin folder.
Since then, UserGroups has ballooned into a monster of epic proportions that now prevents any automatic upgrading of WordPress. Why? Because I had to edit the core WordPress files to make things work in a hurry. The true scope of the project wasn’t clearly defined at the start, so addition after addition came to the list of requirements, and complications popped up in every function I had written in my tiny little plugin. Now the WordPress install has four extra tables, and only the original extra one is even created or destroyed by the plugin install. The core files in the wp-admin folder are altered to insert even more options into the user add & edit forms. There are not only groups now, but also teams, which do not affect security level but still need to be distinguished. There are sub-groups within the groups. It’s all functional, but it’s a complete mess that is in no way compartmentalized. On top of all this, it’s still not complete yet.
The moral of the story? Have a very clear picture of what the end result needs to be before you even start a plugin (or any other project of any kind, really). This could have been a really cool plugin to release as a freebie, and now it’s going to be too much work to dig it out of the piles of trashy code it’s buried in.
This is a pretty short post, but the single piece of information in it is something I consider very valuable knowledge. Everyone has been through it, but I wanted to remind everyone of how frustrating it is and how easily it can be avoided.
Hopefully, the next time a project like this comes along, this little programmer will remember to talk directly to the client about what actually needs to be built before she starts building it…
No related posts.
Ah yes, “Start with the end in mind” are words to live by in the wonderful world of coding.