WordPress Case Study: Building a Membership Application for the Outdoor Power Equipment Institute
We recently wrapped up a sizable development project for the Outdoor Power Equipment Institute (OPEI). OPEI is the association of small engine, utility vehicle and outdoor power equipment manufacturers and suppliers in the United States.
The objectives of the project were:
- Redesign the website, which included a members-only section
- Implement a new content management system
- Implement a new membership application/database with reporting capabilities
- Create and manage events that can members can register for on the website
We began the project with a three week technical analysis and needs assessment, which is what we like to call the Define phase. We spent a portion of each of those three weeks at our client’s office, conducting interviews, understanding their needs in more detail, and studying potential solutions. The primary focus of the analysis and assessment was the membership piece of the project.
During these three weeks, we learned that the membership application needed the ability to maintain a database of organizations that are members of OPEI. Each organization also needed to have a list of contacts (people who are in the organization), and products (to allow visitors to the site to search for organizations by product) associated to it. We also knew that they wanted the ability to manage events and to register organization contacts for these events. Contacts also needed the ability to be associated to committees and assigned to a position within a committee. Most of this data needed to be accessible on the OPEI website - some of it for members only and some for the general public. On top of all of this, the ability to slice and dice and run reports on all of this information is extremely important to OPEI.
We chose WordPress as our solution to achieve all of OPEI’s goals. From a content management standpoint, it was a no-brainer. We have a great track record of migrating and introducing clients to WordPress as a CMS. We also decided to leverage Wordpress because of its custom post types that we knew would allow us to get up and running relatively quickly for the creation and management of Organizations, Contacts, Committees, Products, and Reports.
Another big factor in the decision to use Wordpress were the Events Manager and Events Manager Pro plugins, which gave us most of what we needed for the management of OPEI’s annual meeting and committee meetings, and and registration for these events out of the box. We also were able to leverage some of the other great plugins for requirements that OPEI had like photo galleries (NextGEN Gallery), and associating documents to committees and events (Attachments).
Membership
The Membership portion of the project was primarily built with WordPress custom post types. For each custom post type, there was a fair amount of associated data that OPEI needed stored. For simple data, ie Join Date or Termination Date of an organization, it made sense to use WordPress’s built in post metadata functionality. For more complex bits of data such as addresses, and phone/fax/emails, we decided to create our own tables within the WordPress database and handle the management of this data on our own. As you can see, we have a table to store addresses (used for both organization addresses as well as contact addresses), member-to-committee (one to many, as a member can be on any number of committees) associations, member and organization contact info (phone, fax, email), as well as a table to store which products are associated to which organizations. We will get into opei_member_event when we cover Events later in this post.

To show an example of how this works in the admin (see the screenshot below), for an organization – a user can add/edit any number of websites for an organization as well as select/deselect any number of products. Behind the scenes, rather than manage all of this custom data in the WordPress functions.php file we decided to write our own plugin to keep all of our custom functionality in one place and separated from other site code. Within our plugin, we handle the add/edit/deletes of all of our custom data by adding our own hook into WordPress’s save_post function.

Below is a screenshot from a contact post type. Along with addresses, contact information, join and termination dates, associated organization, we allow OPEI to manage a contact’s committee assignments directly on this page. We add custom sections like this to post types by writing a custom hook into WordPress’s admin_menu() function and for each custom section, like Committees below, we make a call to like such: add_meta_box( ‘opei_contact_metabox_committees’, ‘Committees’, ‘opei_contact_committees_meta_box’, ‘opei_contact’, ‘normal’, ‘default’ ); and within our opei_contact_committees_meta_box() function we place the PHP code to construct the output you see below.

Another interesting aspect to all of the custom data we are managing is that OPEI had very specific data for each post type that they wanted to see on the post list pages (see screenshot below). Of course, out of the box with WordPress you get columns like Title, Author, Categories, Tags for a post. We add our own custom columns by hooking into a handful of WordPress functions. By writing a hook into manage_posts_columns, we are able to customize the names of the columns that appear. Below is an example for the Organization columns you see in the screenshot:

Then, we hook into manage_posts_custom_column to actually display our custom data. Here is an example of how we display an Organization’s type:


On the public-facing part of the site, OPEI wanted to allow their organization members to log in and see and edit their own information, so we created a form to allow the members to edit much of the same information that OPEI could edit in the WordPress admin:

In addition to updating their information and setting their own password, members can see which committees they are on as well as access a private (available only to committee members) page on the site that contains committeee information, documents, and email addresses for other committee members.
Reports
Whereas our other custom post types contain a lot of data that we are storing in custom tables via our own plugin, the Report post type data is all stored entirely in WordPress’s postmeta table. Each report contains fields from all of our custom post types that can be combined in any number of ways to build a report. See below for the Organization fields, which can be combined with filters from Contacts, Committees and Products. All of the “list” fields like Organization Type and Organization Name were required to be multi-select.

While the criteria for building a report was quite complex and the queries that needed to be constructed dynamically got to be quite intense, OPEI only needed to have their reports output in CSV format and the requirements for which fields were in reports were very straightforward. When OPEI needs to run a report, they only need to select which fields to export (they may filter by organization or committees but want to get a list of Contacts for a mailing list for example) and when they click “Run Report”, we build the query on the fly based on the form post data and then output a file back to the browser.

OPEI also wanted the ability to export certain information quickly without having to create and store a bunch of reports so, for example, on the Organization post page we added a section where they could get a one-click report with information like all contacts for an organization or information to print labels for all of an organization’s contacts. Again, these links just post to the reporting engine that we created in our plugin and CSV is the output.

Events
We implemented and modified the WordPress Events Manager plugin to allow OPEI members to register for events on their website (as well as to allow OPEI to register members via the admin).
One great feature of Events Manager is that they allow you to build your own custom forms for events registration. OPEI wanted to mimic the PDF that they had used previously for registration and allow members to fill in data like golf handicap and whether or not they would need to rent golf clubs. Events Manager allowed us to quickly build this form and the plugin also nicely handles the data capture when a registration is submitted.
Where Events Manager required customization is that it is designed to work hand in hand with the WordPress User database and OPEI’s members are stored as custom post types instead of users. When a member logs into the OPEI public-facing site, we set a cookie so we know that they are authenticated. Therefore, we needed to hunt through the Events Manager code and find all of the instances when interacting with WP_User and override this with our own code to pull member information from our custom db tables. It was also helpful for us to store a cross reference when a member RSVPs to an event so we created our own database table to store this, and added a hook into the function where Events Manager saves a booking.


OPEI specifically wanted registration forms to be pre-populated for members with their name, email, address and contact information when logged in. Admittedly, this was a tricky endeavor and we ended up having to alter the Events Manager plugins (Events Manager Pro also!) in quite a lot of places but ultimately we saved countless hours by not attempting to write our own registration/event engine.

OPEI also wanted the ability to manage meetings of their committees through the site. We handled this by creating an Event Category within Events Manager named “Committee Meeting”, to which the client could assign meetings. We also added an additional field to the Event post page with a dropdown of committees that allowed OPEI to select the committee an event was for and then on the public site when we display a committee page, we are able to query for any meetings upcoming for that specific committee only.
Conclusion
Many people are familiar with WordPress, but few think of it beyond a blogging tool or a CMS. Given the positive reaction we receive from clients about updating content through WordPress, we continue to extend WordPress for clients so this positive user experience can expand beyond WordPress posts and pages. OPEI is another example of this, and we can’t wait to begin the next example.