Building Complicated Sites with WordPress & Pods

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
you're listening to a recorded session at odds camp 2016 in Austin Texas sponsored by WP engine welcome to building a complicated site WordPress and pods introducing our speaker Nick bike so well welcome good morning and yeah everybody have a good time yesterday was here everybody excited who who wasn't here yesterday excited being here great so I'm Nick paddock and I have now rewritten my presentation well I forgot how many times I've rewritten my presentation because I was watching yesterday and there was there was a number of what's and some lots and lots of how but it occurred to me as we were going through this that one of the things that we have not talked about is the why so so what is the big you know what is like why are we learning pods wire why are we using it and and awe like that so I thought I'd put some some of this into perspective because after all I'm the wise guy so the but um so so one of things I wanted to talk about was that a lot of the discussion has been hey I can extend a post type I can add a taxonomy to something that that you know like I can add these little additions to my site but in my mind this is this is kind of like using a Maserati to go to the end of your driveway to pick up a newspaper it's uh it may be a lot of fun but there's there's a lot more power that if you just cut it loose you will you will the dental bit that you you know you'll get more more fun and more benefit so one of the things I wanted to do is was talk about and give you a scope of what you can do with pods so I'm going to I'm going to paint you a big picture here the I like to start with a story now some years ago I took a business course and one of the instructors there had made his fortune in men's clothes and he said let me tell you will dark a little secret about this particular industry he said beyond $1,200 there's not a single thing that you can do to a man's suit to add value that's that that's the finest material that's the silk linings as they hand-carved elk antler buttons to hold it I mean that's it you top out at 1,200 bucks is it beyond that it's just label it's just the name so conversations have come up in a number of instances from from from a lot of people as we're talking about the higher priced websites the the issue of so how much bling how much how much visual flops do I need to add to a website to get somebody to pay fifty thousand a hundred thousand two hundred thousand dollars for a website what do I have to do to get into that ballpark I mean it's the you know is sing sing and dance so I got balancing 3d stuff and and and all and the answer to that is none of it you we're going for the for the for the boring side of the equation and one things to understand is the motivation of why businesses do what they're doing when you're advertising and marketing for example if you're making 10 cents of profit on a widget you have to sell 9 widgets to break even 10 widgets to make profit so meaning if you spend $100,000 on a website you have to have a million dollars worth of sales to make profit so very few businesses are going to do that that's that's just not a realistic thing on the other hand if you if you look at expenses if you can eliminate $100,000 worth of expense in that organization it's the equivalent to adding a million dollars worth of sales so when you present to businesses the idea of I can help you improve your back-end processes to the point that you're you're going to lower your labor expenses you're going to improve the speed of operation you're going to capture more sales all the things that you're going to do then that's a very easy sale for a lot of businesses so what we're really looking at doing is helping businesses improve the way they run their business and what that is the number of components that that involves so so there's the business processes how you do what you do there's a business of the methods so walking through and and step-by-step going through through all this the business owner the CEOs the managers and so on how do you take your your vision your mission you painted this big picture when you want your business to do one of the neat things that you can do as that business owner is by systematizing your business you now sort of enforce this structure this is how I want things to happen so this is what the back end of my website does you fill in these particular box of information you have to have this done and before you can go to that so it's it's it's creating a structure for things so that the vision mission is not just this thing you've printed up on a business card now actually you're implementing it is as part of your operation you got the administrative part so how do the different parts of your organization for example communicate with each other we all know that every every business has its great hierarchy and and theoretically it's it's you report to your boss who reports to his boss he reports to his boss who requests to see you know a CEO who then talks to one of his his delegates on the one down and we know that none of ins these two guys at the bottom talk to each other in hallway and that's the so that's where that's where business really happens so the idea of implementing that reality in the back of your site so that information goes to who needs to to have it from who needs to - to supply it is one of the tools that we can do course the analytics we all know from from our Google Analytics the idea of you know who's landed on a page who's clicked on a thing who's abandoned a shopping cart information like that but there's a lot of analytics that happen within or can happen within a business itself there's a style of business management known as business by ratios where the idea is if you know what your expenses are and your revenues if you know how long things are supposed to take then you can have for each unit of your operation a ratio that I know that it's supposed to take this long and supposed to make this much money if it and if numbers get off anywhere then all of a sudden you start to see aberrations in your ratios you can pinpoint parts of your operation that are not working as efficiently as you expect of course the business intelligence part of this too is all the I mean lots of lots of tracking information how many you know how many things have you did you sell this this week as opposed to to selling this last week or this time a year before or whatever the circumstances and things have changed so pretty much what we're looking at is the idea of integrating the whole back-end operations of a business through a WordPress website now put this in perspective there's got this out of a business site for I forget the name of the site anyway what was talking about the integrated back-end packages are available so Microsoft for example has their Microsoft Dynamics which as they were explaining is that you know that one of the cheapest out there with average cost of operation of about a half a million dollars sa P as most people who have ever dealt with it know is is in the million dollar and up range so if companies are willing to spend a million dollars to integrate their back-end operation they're certainly willing to spend and 10% of that or 20% of that to do it on a platform like WordPress that's that just makes all the sense in the world so what we're going to do is work so things for example so that so the question is explaining the idea of the integrated backend so here's the case of if you have your HR management your document management your sales and marketing not just from the standpoint of of how do we sell but but your your support for your sales team so information and your internal communications the your accounting and Finance that that all of you you in essence have one dashboard now in in most cases were familiar with you go into a company you have this dashboard or you have these apps on your computer which are installed locally and what I'm talking about is let's take that local application off of your computer that you know or is networked through through a company let's take it off of there let's put it up on the cloud and stick it as part of your website now interestingly enough your your internal operations your intranet and your public Wi-Fi a public site is now integrated into one that that when your sales team when your marketing people when your CEO is traveling and just signs in his WordPress dashboard can see everything that's going on inside the company so even things like you know rather than necessarily having email having an internal chat internal communication thing that's that's built into WordPress so that it's not a case of you know you can direct it specifically to who you want to and you can follow that communication path so so things like data or car them that make sense that's that's the high end that's the enterprise level clients but we're we're looking at is probably in in the the as businesses and and typically where we're looking at say the professional enter you know the professional lawyers doctors and so on like that probably the low end would be five hundred thousand two to a million in revenue typically once you once you cross that million dollar mark so the one one to ten million in revenue range would classically was known as the small business as opposed to the emerging business they're wanting and needing this type of that typically that's where you you have enough employees that that somebody has to remind you what what that person's name is because you know you've now grown beyond just just you know three three people in a garage so so what I'm going to do then is we're going to start with a case study and because it's a it's Austin we're going to start with a case study for a nonprofit because uh because nonprofits doesn't mean that they don't have profit it just means that they can't share it with the you know they they don't issue stock means that they still need to make money and run their operation like a real business so this particular case study is for the Austin disaster relief network one of things I'm going to do here is just sort of quickly lay out what it is that they do as an organization so that we can then begin to to zero in and take a look at what are the parts of this that we would automate and how we would go about this so first and foremost it's a disaster relief agency what they do is in times of disasters fire floods tornadoes hurricanes whatever that that they go in and they first they provide emergency meeting emergency stuff so of articie housing food shelter replacing clothes getting people you know into safe environments medical care if it's necessary and things like that on top of that the they're one of the few organizations that does extended aid so what they will do is actually stay with they'll assign people to stay with a family because there's a lot of folks say Red Cross for example or FEMA and will come in they'll be there for a week or two they'll they'll help get you out of the immediate danger but things like replacing all of your lost ID replacing you know your your critical medications or medical devices or things that were may have been lost in the fire or flood getting you into a housing getting you new furniture household items things like that so it's kind of walking through also includes emotional support so the little kids who wake up and panic in the middle of night everytime it rains now that will get them some some care and counseling that type of thing the it is a very interesting organization they have seven part paid people in five thousand volunteers so it's almost entirely volunteer run and part of a big part of what they do is the training that they need to make sure the people who go out in the field actually know what they're doing so they have conflict intervention stress management training the community emergency response training the natural incident management training and so on like that so they can interface with the police fire department FEMA homeland security I mean so so you is a very intense training process also the idea of personal readiness because the best way to to serve in times of disaster is not to be part of it so things that you need to do to prepare yourself and they it's it is a faith-based organization so it works to the churches with the understanding that you prepare churches to become emergency shelters to supply extra extra food reserves emergency supplies for the volunteers and so on the so when a disaster occurs this whole big operation just spins up so they have a call center operation that they do they for example during the last Halloween flood that they fielded 35,000 phone calls in in about a three week period they have the donation center so because because everything that they do is through donations they've got the warehouse operations the emergency supply center is the volunteer deployment that they they have to track because actually there's federal requirements that every person who's out in the field in terms of times of disaster you need to know their whereabouts how long they were there who they reported to what they did all of that because because FEMA being a wonderful government and organization actually charges the states and locales for their services so volunteer time can be charged back against that fee so some very real reporting needs and requirements and of course the survivor management part of this the now one of the things because this particular model has been so successful various places that they have responded like the city of West in in Texas where the the plant plant explode exploded and and and all those people were killed they went there that and the City of West basically said this you you were one of the most effective aid agencies that has helped us can we build can you help us develop a local one like this Moore Oklahoma after the tornado hit similar request they just got back from from some serving some some profoundly underserved areas that got hit by the floods in Louisiana so there's a request from all these areas saying can we have something like this so we looked at that and said you know what this would be a perfect application for multi-site that we could basically create this one site and somebody else says hey can we have one like it click-click done there you go now you've got you know as fast and easy as that so so we looked at that and because of the complexity of the information the amount of information to start with but with the complexity the interaction we decided that pods was just about the only way that we could do this so first step was the process analysis we had to go through and just look at the whole operation how all the parts were tied together and this is sort of just uh this is this is a high-level overview of their their operation the back back end so as we start to see we had to break it broken down into seven basic parts with there's the volunteer component of it which which is the who who has done what who has trained what what qualifications they have what certifications they have so unlike that there's actually the training module itself so putting together the curricula and managing the the training courses there's the document management part of it because there's a there's all kinds of documentation because doing things like helping families recover lost medication helping families recover lost documents there's personal identifiable information there's HIPPA and PCI compliance and all like that so the management of who gets to see what when under what circumstances for how long and when that gets revoked is a nightmare but it's a bit but that that's a big piece of it the the disaster component management component of it that spins up and all the operations that go into place the donation center which which cat covers both the cash donations the physical so people who say I've got clothing I've got furniture I've got you know whatever the even even you know like Walmart that's applied five thousand shovels and wheelbarrows for helping you know clean clean out houses and stuff so so the physical donations and then there's the in-kind service donation so somebody who says I've got a warehouse I've got trucks I've got front-end loaders so if you need them type of thing so all the tracking is that that goes in the and then the the final pieces this or last two pieces the survivor intake component of it which which is matching the survivors with the resources that they need and also doing things like data validation because one of the problems that they have is just because it's a time of disaster doesn't keep people from from doing nefarious things because they what they found in in tracking because up tier two four it's all been a paper-based system is they would have people miles away from a disaster coming into the disaster centers going you know my house was washed away and then they get these these checks and these benefits and then we find out you know really like four weeks later that it's like you know with anywhere near it you know but of course by that time the money has been spent so so doing real-time data validation to say you know are you in the desert you know so so so matching addresses two to two things in the field and the executive management side of this where are my people what are they doing how much money has been spent how many people have we put into hotels you know remember that kind of stuff so so a lot of very critical real-time information need to be captured so our second step was doing the rapid prototyping so here's where we took the information that we gathered in process and started building out our rough wireframes of these are the different components this is how the back end of the system is going to hang together so when somebody signs into their dashboard depending on a lot it's all role and responsibility based access to to this so who are you within the organization who are you during a time of deployment so you may take on a new role a a sector Lea or something like that where suddenly you need to have access to certain parts of it the internal communications so that you can see what's uh you know where your team is at and what they're doing so a lot of information that goes on there also for the people who are assigned to Shepherd the the families through their various recovery efforts they need to be able to enter information see who's there there was a instances of again going back to fraud where where families would send multiple family members through different lines each each one getting stuff and and it wasn't caught until like four four different people were assigned to the same family and they went hey hey hey you know that's a I think so a lot a lot of that goes on so so this is this was a big part of of the need the there was a data analysis part of it because they currently had information in a database but to my perspective we're doing everything backwards so it was all information was filled out on pieces of paper so everybody did handwritten forms in the field all those forms came in there were bunches of people who typed like crazy doing their best to to read Scroll scroll handwriting on on wet pieces of paper in you know at three in the morning so that that would be available you know sometime relatively soon for the you know for the for the next group of people and lots of problems there that information was then being entered directly into the to to my sequel database by someone doing data entry with PHP myadmin so there was no data validation no verification stuff was getting entered into wrong field so there's a lot of they actually had 92 tables in the database very few relationships between the tables lots of duplication there's 14 different tables where an address would be entered and for the same person there'd be variations in the address so so things like that that we needed to to analyze that data figure out how to to connect it cleaned up and so on so so one of the things I wanted to do here is the this isn't so so here's where we're getting into the pods part of this we're going to look at the training module so we start out we know that we have a training class so this this this essentially is our curriculum to that we've got our training event so each class is going to be taught several several times and each time that it's taught there's going to be multiple days so it may be there's there are some one-day classes but most of them are for day or 10 day or you know several weeks there's the location so for the community emergency response training there's for classroom days and then there is a disaster simulation where team people go out create this this five you know they find a field create this nice disaster scenario hide things and and you know set up different scenarios and people get to actually go and use the training that they learn in a simulated disaster situation so we have four classroom locations one that's that's somewhere off subtract so connecting locations with with the with which user sessions now we're going to factor in our users because obviously users need to register for this and the user registration is includes do they have the prerequisites did they pay their money do they have it all it's all the things that they needed for signing up and did they attend all the sessions so now we'll start to organize this this is now our thought process in the pods structure so we know that we need to connect the training event to the training class and so we have this relationship now this is a one-to-many relationship we have one class and we'll have multiple instances where it's taught the this is going to get a little geeky here but but that's a figure you're you're out for it first thing on a Saturday morning and so next thing we want to do is we want to connect our events or our sessions to the event itself so here again we'll have a one-to-many relationship there's going to be one event there will be four classes or ten classes as it with each of those events and we'll have our training locations now we've got a one-to-one relationship between the event in the location because it's only at one spot maybe different of course different spot for each each to each session but or for each there may be multiple spots for the training event itself a free session is only going to be at one now we could set up a relationship between the the training event and all those locations so and and what this is this is this is one of the things that in setting up database relationships typically you know we look at how do how are we going to establish our connections between the things that we want to relate but this is not necessary with pods because pods has what's referred to as traversals so we're going to get to that in in just a little bit we're going to hook in our user pieces so we've got our user we've got our user registrations and user registration is going to so one user registers for the course that registration has one connection to the to the event itself and finally we've got our attendance so the attendance is going to be a connected to our sessions so here we're starting to build out our structure so as we're looking at our pods looking at relationships and and they talked about yesterday the relate related fields so now this is what we have done is we have now mapped out what are the related fields for for this now going back to the the idea of overthinking our databases which is one of the common problems the idea of thinking okay well we need to connect one user to all our users we need to have all our users connected to all of our registered users we need to have a ridges a connection between all the registered users and that and the training events we need to have all the attendees so single attendees connecting to the full attendee list and the attendees to all the sessions and my point here is that absolutely none of that is necessary because pods itself can traverse these tables so what does and the idea of for example user to user attendance we already have a natural connection there because both of those tables are going to have a user ID so when we talk about relational databases it's basically where we just say I have one field in this in this table I have one field in this table if the content of this field in the content of this field match we have a relationship that's it a massive relational database in 36 seconds so the what the idea of the traversals here is user connects to user registration registration connects to training event training event gets me my connection to my sessions sessions gets me my connection to my location so now I have a chain that I can follow that I can go from user to registration from registration to event from event to to session from session to location that gives me I can I can now traverse that that full chain and get to any information in that that I want so question of course is how do I go about doing that well there's this is this is where we get into some of the geeky code the so what we see here is this is where we set up our R reversal so I uh coffee hasn't had yet here so so here we have user registration dot training event dot post title now post title is the field that's provided by WordPress as a natural built in WordPress that's our basically the you know where you put your title in but what what we're doing here is we're saying okay go and go and get my registration find the training event that's connected to that registration and get the name of that training event so I say registration find parameters so I'm looking for my November training so now just by following this chain and I can stretch this out as far as I want so I could have user registration training event dot event session dot location and I can I can follow that that chain if I wanted to for example you know I could do user to user registration to training event to event session to user attendance but like I said I already have a natural connection here with with the user ID so I don't have to traverse it in this way now for those people who are more familiar with the WP query notation the same thing also applies where here I can have because you don't understand it's a key value type type of thing so I can say my key is user registration dot event so I can I can follow this and I'm looking for this is the name of this course my value and you can you can cascade these so so you can have multi so and so it can be this event and a user name is like can and attendance is complete and and and in and in so I can just have just repeat that array down and down and down and down down no I'm strictly a back-end guy so so I leave I leave the fine friend to the to the experts yes yes no no so this would like me so can conceptually in this particular case you are going to see this this is this is in and maybe not a particularly good example here because all I'm displaying is the course name or they or the instance name but what um it's a problem with rewriting a course in the middle and it's uh you know what multiple times but the idea is is that that yeah so in this case all I'm going to be displaying is event but if I hit go on one step further if I had dot event sessions net then then I would show here here are the classes or here here the week 1 week 2 week 3 week 4 so the idea of what what information am I getting from this so I can get for example like what you know what would the dates that this particular you know of this dis this event so I can get the name of the course I can get when it was taught and who attended and where it was located where each of the sessions was located so it's a and I can occur okay rich this gap okay if you will just look at the pot diode little page and the list of schedule so it kind of gives you an idea whether you come in patience presenter all that comes together to display the page well yeah so I have a calendar a on display right page so that all the information usually mmm so typically for my front end people I'm concerned with how do I get the data to them that they can format so so I let the CSS people do with the what is it going to look like hard but what just bearing in mind that you can jump into this picture essentially anywhere so if I have curves it say it for example current user ID so with everyone that's logged in you by definition have your current user ID so any table where you have a user ID I can say using current user ID from from attendance find my sections find in my location for each of my sessions so where am I supposed to show up next week where am I supposed to show up that week after that that sort of thing as Thank You DP that was a very good example the or going going backwards if for example I'm looking for because I want to display on the users dashboard information that may be contained within the basic training class itself so obviously within the curriculum I've got my description I'll also have the course syllabus I might have things that you need to do to prepare for it so if I want to going backwards from from either registration or from attendance go back and pull that out so so for this session you will need to bring the following things or you need to prepare the following so I can have that I can pull that from just just follow that particular chain so prototyping or even another scenario uh well this is the in general it is it is prototyping but in the same way that the gym true was when he was doing the magic tags and things like that so so putting together the rapid you know temp templates there this is if you're the content analysis where Jim works with the magic tags and so on in the in the built in putting this is this is the information that you actually put if you if you were editing the WordPress template page itself so if you were editing single dot PHP or post out of that PHP pages that PHP that's where you would put that code the now this kind of gives us a basic framework of now we know that we can navigate from table to table as long as as we have a chain of connections so so now we need to look at some of our database decisions how how are we going to start well first first off like what are all of the tables that we're going to create so so in our training table we just saw that we needed six six of them there well five of them technically and now we're going to go back and look at sort of the rest of the organization so this is more of the information structure some of this is is missing because they can consider it you know proprietary but this it's a in general these are these are the different database tables that need to be created and how we connect them through various relationships so that gives us and if you look pretty much you can get to anywhere from anywhere through through that whole process now making decisions about the tables so there's information about the volunteers that we need to capture additional information so date of birth because if they're lower than a certain age we need minor consent form and so on like that gender I want to have a security you know security question security answer because a lot of people lose their password so we need somebody in there to verify that yes you are who you are so what's your security question blown so we can reset your password if you lose it that kind of information stuff that's not normally in the WordPress user table now here's our decision point we can always create new tables I could I could make a decision to say I'm going to put all my user information in a it's very own table for a user but because WordPress gives us a user table and there's actually lots of built-in functions to get in WordPress to get information out of that we can just use the function you know use user meta and field name as Jim pointed out yesterday where WordPress gives you will function gives you those capabilities use it don't don't invent the new a new wheel just simply because it seems like a good idea so here we made decisions about what goes into the user table and this is things such as the title what church they belong to because you're only going to have one one Church that somebody goes to the what their current status is their birthday so information that is all this this is going to be very user specific typically not going to change or we're not going to change very often and is is going to be when whenever we do queries about a user is going it's I mean if it's if we have get user ID then we can get user ID date of birth and etc so that's a that was a very easy decision next one was the idea of taxonomy so as we understand taxonomy ZAR just simply a fancy word for categories now the this is this is the various things where titles certifications things like that so once somebody has gone through a particular set of training and they have that certification now we can connect it so so we just have that certification name that training name that title that whatever we can attach that to that individual we don't need any other information about it the fact that they have completed the trainings and got the certification so so it's very easy to make is a taxonomy there's not additional information that we need other than you got it the things like user interests for example is all the certifications you would like to have what don't have currently well the advantage of that is now we can do a very easy search on that to say when a course is coming up we can now contact you directly and say we have just scheduled the following course you expressed interest in and so on like that so it's it's so we're looking at not only nice things from the standpoint of the user that they can go into their profile they can check I want to do this I want to do this I'm going to do this but now from the standpoint of the of the training staff they can very easily very quickly find the people who have expressed interest they can also do things like say how many people have we have that they have expressed interest in it because once we passed a certain threshold now it might be worth our time to schedule that course so no sense scheduling I definitely only have two people that expressed any interest so and one of the things that Jim had talked about yesterday was the idea of facet searches and and facet WP okay so so understanding tack so this is one of the great advantages of what taxonomy x' do for you and have that set up so what i want to do here is whoops nope go back i don't do this area that's how we click on it like so is over my shoulder so the idea of facet searches and these are these facets are basically just taxonomy information that's pulled out of here so say for example I'm interested in just Acuras I can click that and this will display just Acuras or I can say that I'm looking for vans okay there's 12 ends and I just want four vans and there's my two Ford vans so we understand now that again going back to our training thing we can say who's expressed interest in this click a button presto now we see we have two people who have expressed interest or we've had you know 50 people who have expressed interest in this so this is a very quick and easy way to to find the kinds of information that we're looking for against uh you know to do things by you know sort sorting sorting information whether we want to you know two wheel four-wheel types drive there's a this number of MOS of doing this sort of thing so Fergus for example a power plants so if we are interested in just the solar power plants okay so the and something that's that's beneficial to to you know for us is the hierarchical taxonomy z-- so you know that tags are not hierarchical but categories are so here's here's the case over here we have a Northwest region and say we just want Maryland so we find our one instance that's in Maryland well this is this is a way to if for in the case of a DRN as they're looking for for example volunteers or people who are trained with a certain certification who live in a particular area who have a certain level of experience who can who are available during during certain times so all the criteria that they're looking for this is all can can be set up just through that the user portal and taxonomy x' now it's it's literally of just a few seconds to find the people that we need to to to contact to go in various places or decide to to train a course or can teach our coach reports or whatever it is that that needs to be done so kind of give you a sense of how this this is starting to all connect together okay so hopefully hopefully this part was exciting so now we're looking at our standard custom post types now here was a decision that needed to be made and this was uh you know I mentioned yesterday that I needed to have a you know a long chat with with with with Scott about how to structure particular data one of which is and and to talk about for people familiar with with the advanced custom fields there's repeating fields and so you can have a repeating field with with within you know that that you just click a plus sign to add a new field click the plus sign add a new field type of type of thing so we thought about there's there's information that is going to be in essence repeating fields for for a number of instances so addresses people will have their home and address their business address they may have a vacation address they may have an emergency contact address something like that same thing with phone numbers people always have more than one phone number you got your landline you've got your work phone you got your cell phone and there's information about you know call me at this time of day call me on this number at this time today call me on this number like this time of day don't call me on any number you know type type of thing also with email addresses multiple email addresses and so on like that and one of the things that we also have is the issue of not not only people having multiples but also multiple people sharing so how how do we know for example if we have a number of people in the same household who are there you have matching addresses between between them we have the same phone number they so some matching phone numbers so one of the things that we decided that we needed to do and and this was conversation with Scott is rather than putting this in a repeating field within the user table which we could do splitting out the address table the phone phone number sector numbers emails very various various things and into their own tables the advantage of that is that again going back to the built in functionality in WordPress it's very easy to structure a WP query search in a table now the issue with how do we how do we find if multiple people live at the same address because if you've got you know Bob Smith and Jane Smith you don't necessarily know that they're related however if both of them in the profile enter the same address but what happens if they enter it differently Bob Bob writes out the word street and and Jane abbreviates it for example so so using the USPS a P I we can get standardized address now there's and this is not necessarily a directly Pods related thing but the the we decided to hash the addresses phone numbers emails and so on so what that does is so so everybody know what a hash is yes no not really okay - okay so basically what this is a PHP function it takes a text string does a mathematical operation on it and turns it into a unique identifier which if you think of like a dart board where where each each hashes is like a hole in that dart board and and it scatters everywhere but the beauty of it is that you can now because it's print a string search it's a very expensive operation what the database has to do is it literally goes through every field and says does this field match does this record match does this record match does this record match to this record match you got a lot of records that search takes a long time with a hang it basically says I'm going to take the all the information that string I'm going to turn it into a key because if you think about for example when you say get user ID equal 1 2 3 database only has to go one place it knows where to find user 1 2 3 if you say get record with hash equal this it has one place to go to find that now so it becomes an indexed string that David can go to immediately it's a very very fast search it's adding a unique identifying component 2 2 to that so so it takes the full address turns it into a unique identifier that the database can go to instantly and that way in the profile now somebody enters an address and it says Bob Jones two people are sharing this address Bob can click on it and go really okay I'm not married so you know um but but it's a what this is all this is also the mechanism that 2 2 to 208 fraud so family comes in they got four people in line the first person comes in enters their there there you know name and address system can do an address lookup very very quickly and when the next person who comes comes in says that address has already been entered because there should only ever be one unique key for that address so now the idea of people trying to escape the system and go through the line multiple times is not going to work so so this was the the decision that was made on how to construct those particular tables now odds also has what's known as advanced content types now this is for those people who have done database work this is more the traditional table that you're used to this is where you have one record that has some some number of fields and the advantage of this is is that on advanced content type it means you do want you read one record and it gives you all the fields that you you want because with it with with metadata for example going back to going back to - - this how wordpress stores it is there's one record per user ID one record for address one one record for address two one record for city one four state one for county zip code and so on so so each of these fields is actually a unique record so for WordPress to give you that complete information it needs to do it needs to read about 20 records the the advantage is of course that WordPress has built-in search facilities and things like that for those those fields so it's very easy to use on the advanced content type you have all of those fields in one record there's only one record read so it's faster in the database the disadvantage is that it's not searchable through WordPress so here we had to make decisions about there's information that we gather about individuals here that are not necessarily going to be things that we would search on we need to know example is somebody you know they they gave permission for a bad background check that the background check well you know they agreed to the terms and terms and conditions that the background check was done that they passed their background check that they were actually approved based on that they're not a sex offender that they've they're you know they've passed I mean as all kinds of you know requirements and stuff that they have to go through so it's it was necessary from the standpoint of all of that information was basically check offs it had to be done once that's done they get a flag in their profile that says presto you know you're you're good to go okay so it's never it's never anything is that searchable you know searched on it's just something that in composite it sets a your the the status for the for the user so we made decisions there based on on and and that's that's a lot of fields so simply doing that as a single database read has has an advantage there it also makes it easy from the standpoint of the user profile that or actually from the administrative profile that somebody can check off those boxes very quickly and very easily save that one record and you're done so essentially yeah yeah the and yeah so the advanced content based basically saves saves as as a serialized string the thank you I'll lose my worst day this is a you know it's amazing what have some video can up sleep it so anyway the but with with with these decisions made now we can begin sort of looking through the process of you know constructing all of those tables making decisions about okay so so what existing wordpress tables we have like the user table we can put our information in what information can go into the the posts and post meta table that we want searchable and that we want to do those those kinds of like the facet facet searches on what information is going to be just it needs to be there it needs to be gathered needs to be entered and perhaps sets a status or flag or something but is not going to be information than we need to query on a particular basis and going through all of the tables all the connections all the information that we're gathering put that together and so that's the decision process so basically in summary it's like it's about looking at the data structures of the organizations then using pods to build those relationships and to navigate those relationships understanding again that all you need is a connection from this table to this table this table to that table that table to that table and you can follow you can traverse those relationships so you can get to anywhere from anywhere as long as those does you have those kinds of keys and that also and and and this hasn't been touched on I think nearly enough the idea of if you have existing plugins in your site that create a post type or a taxonomy or meta fields you can use pods basically you can extend that post type and now it becomes part of the evening they have to add any fields or pods all you have to do is you go in and create a new extend post type in in pods and and save that it can be an empty pod but by virtue of the fact that it is now sort of meant you you you you said you know just just pull this into my family here it's pods will now manage these traversals so if you have a okay like advanced custom fields exactly yeah so so any if you've got advanced custom fields that are part of you know some some other post type or if you've got an image image management post type if you've got any a calendaring post type in there by including that by extending it with pods now you can traverse those relationships and you can find things add things update information and so on directly through through pods so and the idea that pods makes pulling complicated information together easier so I I did you can go either way whatever whatever you whatever you're comfortable with so I'm a sequel guy so I tend to write the sequel statements but if you're familiar with WP query and then that format works identically it's uh there's there's no one you can mix and match I mean you you do evidence that the yeah so it's so the idea of do you need just sequel statements you need just WP query statements you could if you wanted I don't think you can do it yet now you couldn't you couldn't combine them both on the same search but but if you had say complex information on on Oh on it why page say it's going back to Jim's idea of an authors page where you may have here's the author here's the books the author has all you know has has done here's the articles the author's contributed to here's the events that the author has done in finding and speaking at boom-boom-boom-boom-boom you could do what is a sequel search and and - as the queries well and actually typically it winds up is a combined type of thing so you're going to take for example a membership plugin and that's what's going to allow your employees and your staff and all twos to sign in and see you restrict access that way as there's no sense rewriting membership rolls and stuff like that and that might create fields that you're referencing as well things like WP ERP or or WP project manager great you know plugins that do that sort of thing any kind of you know I mean yeah you're right I'm is a number of CRM type plugins that are out there and you might incorporate those in and they will handle generally speaking the general business functions I wouldn't write a an accounting a thing from the ground up I'd use one of one of the existing ones and I would I would factor that into this equation what you're what we're looking at here and this was a case where the the needs and requirements were so specific there simply wasn't an off-the-shelf solution available to them now now the things like the again is is I didn't bother getting into this but the the HR components the accounting components yeah that was off-the-shelf component that we just factored those in so it's a so so again going back to to to pull in pull in some existing solutions if you can find them and then and then implement the rest custom it builds it built it it's a be good and and in reality is it not not a complicated thing based basically it's a here's here's unions again going back to - you know what one of the great solutions in the world is gravity forms so so integrating gravity forms with with with is it's very easy to take the information from a gravity form and populate pods fields directly with it and forms of course can be set up in such a way that people has dia they can be multi-screen forms in which case all that information is buffered until not not only not only dis Atilla til somebody hit submit but also so that in some instances we do to do the checking and make sure that that that you had the prerequisites for this course you can't just sign up for this course because you haven't completed your prerequisites so the information is not even saved until the validation is done so so gravity forms excellent solution for put that kind of stuff so anything else any other questions well in this case it wouldn't be necessarily be a traversal because what because you're in your your in your post type so so this is this is essentially interested get meta that so mm-hmm what an actual connect in connecting yeah so so so um II we doing on time as a matter to him okay oh what's your what's your you feel name oh good or looking for so so are we looking for just specific instances or just a like hey or or or oh okay so so so so so actually here's who's just it - yeah so basically the first take this way I need to be facing the wrong direction [Music] how much it yeah so and it's a like like like like the the get meta I can also um [Music] cursor them okay so so I can do you know single is true or false if I wanted to return multiple values if there's if there's multiple valleys in the field so pretty much pretty much the same same syntax as plus get meta thanks eyes okay yeah I mean it really in many instances actually built your mirrors the the built in pods functions so are built in WordPress functions so okay anything else anybody else all right oh I almost forgot the most important part go build a positive base alright thank you for watching this recording from pods camp 2016 in Austin Texas as always you can get help with pods on our website at HTTP pods EO / forums you can also get help on our slack chat at pods that io / chat we're inside the hashtag support channel Monday through Friday Mondays and Fridays all day and my Tuesday through Thursday the first hour of each day you can also get help on our WordPress org support forum at wordpress.org slash support slash plugins slash pods
Info
Channel: Pods Framework
Views: 5,325
Rating: undefined out of 5
Keywords: WordPress, (Software), Pods, PodsCamp 2016, Multisite, Advanced Workflows
Id: r8MbjjcnXPo
Channel Id: undefined
Length: 68min 48sec (4128 seconds)
Published: Sat Oct 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.