 The loving dog comment is actually an understatement. I'm like obsessively in love with dogs So if you would like to talk about dogs, that's like my niche ready where to get me So he did a fabulous job of introducing me. So here's really just the same stuff He said also lead organizer for Kent Minneapolis this year Which is really exciting and it's coming together quite well So if you have a desire to come to Minneapolis that that's taking place in August same weekend as the opening state fair So also another reason to come So if you want to reach out to me, I would love for if you shared on social obviously it helps the camp It also helps me it also helps other people see the content feel free to do so Tessa K 22 is my handle pretty much everywhere. You can possibly find me and then use the official hashtag WCDT So I want to talk through this scenario a little bit and why this is important and I'm sure a lot of you Depending on how many of your developers just raising it. Okay. Perfect. Good. That's you're you're the audience I need that will understand this so a team of developers is working That is already on a site that's already live and they're adding additional functionality So we've got multiple developers working on this each developer is working in their own feature branch all likely needing Database to make database changes, right? We all know in WordPress a lot of things are controlled by the database But there are a lot of things in code and kind of trying to manage all of that can be difficult So content from the live environment needs to be tested against new features being created So we've got lots of content that's living in live that client is continuing to add content edit content But we're still trying to work with the database we had And it needs to be it needs to be so that it's not overridden So we're going to talk about and I'm going to come back to this and I'm going to give you some more foundation But what we're going to do is we're going to talk about these three people. They're fictional people Joe Joanna and John are all going to work in different places To do different tasks that we need them to do so Joe is going to actually edit some theme things He's going to use the customizer customizer actually saves all that data into your database Joanna is going to edit our page cache plugin. The the site is coincidentally on Pantheon, which you know, I wonder why but And then John is going to set up a MailChimp plugin that they haven't been using before And so all of these entail code changes as well as database changes So before we start digging into the demo and Joe and John and Joanna and all the code changes they're making Let's talk about some of the basics So what is site configuration? Has anyone worked with? Site configuration or configuration management for yeah, okay cool So site configuration really is the configuration of your site So most of that configuration can be found in the WordPress setting So if you've ever gone to the settings area, you change like the site name the the date format the image where the images are Say like all stuff like that. That's all your your configuration of your site so site configuration includes items that might also be Related to a plugin so plugins have settings correlated to them themes might have settings That's probably about it And all of that stuff is configuration that you're actually setting up in your website. I Just really like this little like me and this is fun Configuration everywhere right so these developers are going to be working on these tasks. They're also doing configuration I don't remember which one but one of them has to set up a MailChimp plugin And there there's an API key that needs to go along with that MailChimp plugin and so that's a configurable item So we've got configuration. We know that we're constantly doing it. We're adding settings. We're changing things So what is configuration management? Has anyone ever worked with Drupal before that's in the room? No, okay, so Drupal 8 specifically is doing a fabulous job of configuration management and it's built into core Wordpress does not have that So configuration management is the act of managing your site configuration in code through version control So basically the things that we are doing to configure that MailChimp plugin We convert that to something that's in code so that we can move that code from one environment to the other So if we've got three developers working on something at the same time if they're pushing that all to a code file We can easily grab that because it's all in code and it's in our get repository Do we have enough configuration management? Probably not So there's an awesome plug-in that is called WPC FM. It is actually slightly outdated However functionality in WordPress has not changed to require an update for that plug-in. It's built by the awesome folks over at forum one I personally have a lot of I love the plug-in. I think it's awesome. That's why I'm talking to you about it And there's been initiatives around updating this plug-in and contributing So if you start to use this and you realize that this is amazing just like I did They're definitely looking for people and can contributors to really help maintain this plug-in Currently like I said a lot of functionally hasn't changed but with Gutenberg coming out There may be some changes to some of the way that the settings Could possibly be saved and there might be some opportunity to expand on it. All right, so the perks of WPC FM Are that there is the less need to copy the database So we talked about these hypothetical developers are all working in different environments if we can do their changes in Code instead of in the database We don't have to try to figure out how to merge databases together and how to make all of those changes work Or overwrite any type of database situation with what they're doing There's no need to manually apply database settings or changes like I just said It's obviously all in code so we can use utilize that code to move it around And then we can track and migrate configuration files So the nice thing about this is if one person does a change and another person does a change There's a version control to that like we we all are probably Who is everyone familiar with version control before I just make assumptions. Okay, awesome So we know that version control allows us to have a history to the things that we do So if someone does some type of configuration and they break something or maybe they do something that's not right We can track back to like what happened who did that like when was this done? We can reverse it all of that information that we may want to know about things that we're actually putting in our database technically So what can it track? I wish it could track everything because that would be amazing But it can only track the things that are in the WP options table So in the options table, they will store things like the general core settings It'll also store things like the customizer like I mentioned earlier Plug-in settings. So as long as the plug-in is built in a way that the settings that you enter are stored in the WP options table Which most of them are if they're built correctly And those plug-in settings will come along Let's see. I think that's that's probably about it from like deep default theme some plug-ins It will also do categories and tags. I believe as well So there's some terminology to this plug-in. So once you install it, you decide that you want to use it It's actually pretty easy to figure out But some of the terminal terminology behind that is a bundle a bundle is a group of settings So you can essentially go in there and say I want to create a bundle And maybe you put all of your theme settings inside of one bundle Which is really just like customizer and other customizer fields And then maybe you say okay cool. I know that I'm working on this mail-chimp plug-in I'm going to create a bundle for my mail-chimp plug-in so that someone else who is working on another site can just pull in those Configurations and then only things that you check off for that bundle will actually get put in there for mail-chimp So I get to a very granular level when I'm doing it because I like to have well a I'm like slightly OCD I'm pretty sure but B I like to have things like very organized and clean So I know that if I'm pulling in a bundle if it's a new change or if it's a change from another developer that I don't Have to pull everything in and I can specifically pull in what I actually need So pushing is the act of exporting your configuration to a JSON file So you do some changes you create your bundle you check the things that you want in that bundle And then you push it and what that does is it pushes it to your server or your version wherever it is that you're working If you're working locally, it's going to create that file And then you'll have that in your version control to be able to commit And then pulling is the opposite so pulling is you go into a new environment and you see that there are JSON files You go in there you can see all of the bundles that are in your in your site files And then you can pull in any of those bundles and then when you pull it in it'll basically say okay cool Do you want to make these changes to the database and then you're like yes? I do and then it'll pull in all of those settings from your bundle to your question It is not the get push and pull so these are words that are inside of the I'm actually going to do a demo in a second But they're actual buttons that are inside of the plug-in but it's actually like Similar to get push and pull obviously you're you know pushing files and then pulling them in but they're not the same Yeah, yep, so it's writing it to a JSON file technically and then all of that is in there And then the buttons are in the dashboard for you to push and pull So coming back to Joe Joanna and John we're actually going to do a live demo Because those never go wrong of course So We'll see how how it goes, but okay So what I've done is that if you're not familiar with Pantheon Pantheon has like this really nice environment set up We've got like dev test and live and you can move stuff around But I we also have this thing called a multi dev Which I can pull things into like essentially what would be considered like feature branches And so each one of these developers has their own environment to be able to work with and make changes So right now we're in let's see. I think we're in Joe's I Have to remember I made all these fake people and then I forgot who was supposed to do what Okay, so Joe is supposed to be working on a theme So we just have the 2017 theme installed I'm just gonna pop over to the customizer here and make like a quick change just so we have something different that we want to push around So let's just change this to Joe's fancy website. We can go ahead and push that or publish that so when we publish that that actually Created a change to the customizer. So in the database this what I put in there has now been pushed over to To our database and so now my database for Joe's site is gonna be different than John's and Joanna's at this point All right, so we made a change. So to get into WPC FM we go to settings and then it shows up at the bottom of our settings I know this is probably slightly small Let's see if I can make this bigger So better Cool, so we're in WPC FM and this is where those buttons were coming in to play with the pushing and the pulling So I'm gonna create a new bundle Joe's job was to change the site name in the customizer So we can say this one bundle is going to be for theme and Then the only downfall to this plug-in is that everything is like machine readable names So you have to like decipher what those are So I actually know that the name of the site is called blog name in the database and as you start to use this You'll pick up on some of them and in one of like the ending slides. There are like cheat sheets for which one maps to wear So we're gonna do blog name in there and then it will just go ahead and save that So in this bundle, we've got just the one thing checked off and it's the blog name So if I push this Then what it just did when I clicked push is it created a JSON file for me of the code change I just made so if we go back to the pantheon dashboard for this site Which is this one we can see that there is now I'm gonna zoom in again There's now a file change that is pending And so down here it created a config directory and then it put a theme.json file inside of that directory So if we click on that we can actually see in JSON format what we change the blog name to So now his changes are inside of a JSON and someone else can pull those in if they need to So we're what we're gonna do is we're going to so these are in multi devs So that means that they're in like basically their own branch So I'm actually going to merge this into our development which is considered our master branch So the other developers can later pick this up because Joe is now done with his work So I go back to dev we can do a merge If I'm in git mode anyways Sorry, this just takes a second to get back into git mode All right cool. So Joe's changes are done. My mouse is being weird All right, so we're gonna merge Joe's code into Actually wait, that's not gonna work yet because I didn't commit it This is my live demos are not a great idea All right, we'll come back to that one actually let's go work on John's so John is supposed to be doing Mailchimp. All right, so I already put installed the No, I didn't you guys I got my people confused already All right, let's just look for a Mailchimp plugin and add it The idea here is to just get a bunch of changes so you can see what it looks like I Think it's one word. All right, so we got a new plug-in We're gonna go ahead and activate it obviously when we activate in the plug-in that's saving to our database the plug-in files are part of our code So now if we go back down to settings go to WPC FM again We can create a bundle and now this time we're not doing something that is actually a core feature So we have to figure out like what database fields are mapped to this plug-in So if we open ACF here again, we can see all of these different check boxes So again, I've gotten pretty familiar with what some of these stand for but if you start to scroll down and maybe even do like a Look at like the name This one is actually called Mailchimp for WP. That's what the plug-in name is called So as you start to get familiar you'll be you'll get to you'll start to realize like what these are So if I check like all of the MCWP ones, I think That's all of them Well, now I can go ahead and save that and then I can push that bundle and then again if we go over to John's environment This time we can actually commit it so now there's 254 changes a big chunk of that is obviously the plug-in, but then we can also scroll down Dun dun dun, maybe it's at the way bottom Nope Way top There we go, we can see that there is a JSON file that is now Basically grabbing the the configuration that is there by default However, we want to change that configuration because we just installed it. We haven't added our API key So if we go in and go to plugins I go to Mailchimp Let's just put fake API Can't type See if it'll let us do that. Oh It says it returned an error, but it did save it. So let's see what happens if we go back So we go back to settings and we're like, okay, cool. We've made a change We need to push that change to our bundle. So we go ahead push the change to our bundle We can go back to our environment for John and there should be an update See what happens here Open our pending files Disappeared where did it go? Sorry, there's like a list of all these files. I gotta find it Probably back at the top again Here we go So I didn't actually save up the API key so I do need like a legitimate API key, but nonetheless like Let's see See if I can come up with one No, it won't let me so We'll just call that good All right, so we've got the settings there that we can go ahead and commit So Mailchimp Go and commit that and then if we go over to Joanna, she's the last one Joanna is working on the advanced page cache plugin So if we go in we actually install this sorry, I'm like that bigger again We install the advanced page cache plugin. This is a plugin that works with Pantheon's like Awesome levels of caching and allows you to like configure that. So she's gonna go in she installed the plugin So we can go back and actually do her commit for installing the plug-in. It'll be easier to see the files then still cache plug-in Well, if we go back to her site now if we go to settings we can find the Pantheon Page cache plugin and then we can just change this to whatever we want So let's just say we want our our time to live for our cache to be 1200 seconds We can go ahead and update that And now if we go to WPC FM we can create a new bundle again this time. It's for the page cache Plug-in and Then again figure out exactly what this is called and I don't remember off the top of my head what it was called So let's try and figure it out Pantheon cache. There we go So we check that hit save changes push it again Pop back into our environment Cool, so we see a file change here Created this file and we can see that at the time to live changed to 1200 seconds instead of the 600 You definitely could So you could just check all the boxes and say that you want to create everything I I just I personally don't do that because then when you pull it in you're pulling everything in so if for some Reason your developer decided that they wanted to tweak something just for their environment Then you'd be pulling in all of those changes too, so I'm pretty particular about which ones I include But you could it's all in version control so you could go back and fix things if you needed to All right, awesome So we've got everything and everyone's different environment, so we've got a change wait hold up Bundle or page cache Go ahead and commit that and then I make sure everything else is committed And then we can merge all of this into our master branch where we can pull all of this in which is what makes it cool All right, I think I committed that one. Let's see This one does not have a bundle for it. See what happened Joe's was the customizer. Maybe I lost it All right, so let's go back up into Joe's site and just make sure that his changes are there Push this. I don't think his bundle got committed Oh Yeah, I already merged it. Okay, so we're good. So I'm gonna merge the rest of these in So Joanna's with the page cache. I thought I did that. Sorry y'all Dev logistics Okay, so we should be good now. So now I can merge in Joanna's So what it's doing is it's basically doing a git merge of the file changes that we did Which is gonna be our JSON files and the plugin files And then now we should be able to do John's Once this is done All right, so now we're gonna merge John's in While that's actually merging I'm gonna pop back over to my slides because I want to make sure that there's not anything else I wanted to share so Well, that's merging essentially I have a step-by-step So I already shared these slides as long as buffer did its job correctly on my Twitter account so you can find the slides But these are the steps to basically set it up install the plug-in add a bundle put all the things that I walked through just now And then some tips and tricks so as you saw I was like digging through those fields to figure out which fields Correlated to like certain fields in the database. There are some tricks to do So there's the options reference in the WordPress codex actually walks you through all of the core fields And then you can also go to whatever your site name is And go to like the WP admin obviously and then go back slash options dot PHP And you'll get to visually see what all of the fields are in your database So it'll show you like what you have for site name or it'll show you what you have for like something else And sometimes that helps me figure out like exactly which one I want to see And then like I had here to create as many bundles as you want create one huge bundle It's entirely up to you on how you want to do your workflow Major security consideration that I want to point out before we get back to the demo This is put in the WP content folder as we all know is web accessible And so it's going to create a config file or folder directory basically And then it'll put all your JSONs in there if you're putting things like API keys in there Like I was just trying to do make sure that you lock down that file from a like a readable standpoint So that others are not getting your like secure API keys And then you can also do some configuration if you wanted to move where that is located as well So WPC li if has anyone used WPC li No, awesome you you all should be because it's amazing So it's a command line tool for WordPress and it'll specifically do tasks inside of your WordPress site for you through command line And there actually are a lot of commands for it So you can do the pulling and the pushing you can check the differences You can look at your list of bundles The only thing you can't do with command line is actually Create a new bundle obviously that takes some intensity to check all the boxes off But if you're trying to do like a more automated script with your WordPress project like Process you could do things like pulling if you were doing kind of like a project to deployment or whatever you can include this into that automated deployment And then cheat sheet so I'm not actually going to walk through all of the cheat sheets because you don't need them But if you want to use this you can use them in my slide deck So we only have like five minutes left or getting close to five minutes So if we pop into my new site now or my master branch essentially all of our developers did their work And then we went ahead and we merged all that into master If I go into settings actually I have to turn this on first So activating it if I go into settings here go to WPC FM. We can actually see the two bundles I must have somehow screwed up the last bundle that happens So what we can do now is we can either individually pull each bundle or we could actually just pull all the bundles in So if I go ahead and do a poll here, it's gonna say do you want to import these settings to your database? I'm gonna say yep. I sure do Now if I were to go over to let's say the page cache one came through so let's check that out So if we go into the page cache, we can see that the 1200 seconds carried over instead of the default of 600 seconds Anyone have questions on that? It's like amazing Part of the Yeah, absolutely I'm only using Pantheon because like they have this nice dashboard That's really easy to show you that I'm doing different environments It is by no means like a sales or selling point for Pantheon It is usable like everywhere you possibly want to use it Cool, I'm gonna replay these and make sure I don't have any like ending slides But for the most part these are all cheat sheets So it's walking through like what it what it actually is in WordPress and what the field is in the database For you to kind of kick off your use with this plug-in Let's see this other one this last one I just had here oops I keep doing too many buttons Nope, we already did that so there is also a way for you to customize this So if you're a plug-in developer, you can actually do some configuration of creating your own Fields for this so if you're building out a plug-in and maybe you're not storing things in the options table But you want to store things in a WPC FM bundle There's actually a custom way for you to go ahead and do that and then you can find that all in their documentation site Helpful resources at Pantheon. We like support anything that makes your workflow easier Which this obviously does that so we've got a couple docs that we've shared you can also hit up forum one Those are the developers of the plug-in and then some other things. I wanted to point out is if has how many of you use advanced custom fields Okay, quite a few of you has anyone like set up the synchronized JSON so you're like field groups automatically go into a JSON file No, well you should because that's amazing. So it's the same concept It's the same concept as this like if you're creating field groups It'll automatically put your field groups in a JSON file And then if you like say that you inherit a project and then other developers like here you go I'm done with it or like maybe you're just picking up because they've set up some things It'll put all the groups in there and you literally just hit sync and it brings all the field groups in from your JSON file So anyway, so that's another like another way to use Basically putting configuration inside of code That's all I have but I if we have like a minute or two I think for questions. Thank you. What a question Yeah, so content is tricky I actually just Like figured out that this there's a plugin called merge bot and I have not used it yet But I was hoping to get time to use it this week because that's always a question that I get is like This is awesome for like the configuration or whatever But how do I do this with content and it looks like merge bot is doing just that It's actually on my my list of things to do this next week So if I make any like progress on that I can share it on Twitter, but feel free to reach out to me as well But that is supposed to be version controlling for your entire database And so that would obviously play to content and some of the other stuff And it's really it looks really cool because you can actually do like selective bringing in So if you're trying to put two databases together, it kind of lets you go through and like check the things you want It has a pretty price point to it But if it's worth it, I think that that would be it's an amazing resource if it if it does what I think it's going to do So that's the short link again the slides and the short link to give me feedback are both on my Twitter account And so I'm test the k-21 Twitter So feel free to download them use them share them whatever and if you have comments or feedback I would love if you'd provide that