 and welcome to WordPress Multi-Site 201, Session 3, Sustainable WordPress. Here again with Tom Woodward and Taylor's joining us again today. And we're going to talk all about keeping your WordPress Multi-Site sustainable. And there's a few different ways we're going to talk about it. One is kind of the principles of what makes something sustainable as somebody who, you know, as the team that's responsible for your WordPress, whether that's you and a bunch of other people or just you or a third of you, whatever that kind of ends up being. And then we'll also get into some technical stuff that Tom has built to help people figure out longevity for their WordPress Multi-Site. So with all that said, I'll pass it on over to Tom. Right. So even though this is a round two with WordPress, we're going to start with kind of the human touchy-feely side of things, right, when we talk about sustainability. Because a chunk of this really is like if you create a thing that is, I don't know, very sustainable but makes you miserable every time you interact with it, that's not sustainable. So and the tricky part too is humans, you know, their sense of time was bent by how pleasant or unpleasant something feels. One of the things that always like really amazed me back in the day when UMW was first starting out with its blog site was Jim Groom would comment on what felt like every blog on the site whenever anyone would write anything, right. And that wouldn't have been sustainable for me, but he seemed to get some sort of mad joy out of it. And then he would write blog posts about it. Mad joy. It's a great way to describe Jim. Yeah. Yeah, that kind of like manic energy though, like was really cool to see. And I think it helped shape the culture of that site and made it something that he loved to do. And I think that's one of the things I really encourage people starting to think through this to do to figure out like what aspects of this really energize you and what drain you and then how do you kind of balance this accordingly. Because it can't all be, you know, rainbows and sunshine, but you shouldn't create a thing that just punishes you either. You have to look at that balance and you have to think about how much time am I spending doing what. Otherwise, you quit. You know, I know you probably all have jobs like that, right? When it becomes a certain point of misery versus joy, you're just like, I'm not, I'm not going to do this anymore. And you move on. And the same thing can happen with these types of communities. Well, and as you said, like in your example, that was something clearly energizing for Jim or maybe, you know, and maybe it wasn't when he first started that. I don't know. I suspect it was, but like maybe it became energizing, but those things are different for everybody and everybody has sort of, you're, everyone's wired up differently for different tolerances with that stuff, right? Like, like I'm the type of person that if I see something that I feel like is a repetitive task that could be not repetitive, it just, it just grinds my process to a halt, right? But not everyone's like that because I have a high tolerance for, you know, the opposite, which is like, can we systematize this, right? And yeah, identifying those problems is step one. Yes. Yeah. Know thyself. If you've got other people working with you, maybe they like, say, writing documentation, believe it or not. Like, I hate it, but there are people who find joy in composing and making order. One of the things that I kind of regret doing is when I ran rampages, I had left comments on on the main homepage initially, and people would write things there, all sorts of things that didn't belong there at all. You know, like how do I, and I think this is the right place and like stuff like that. And honestly, I got a big kick out of answering the questions there, you know, what they'd be like, Hey, I'd reply with some sort of ridiculous GIF or whatever. And eventually I shut it off because we were structuring things and we were going to do support tickets over here and we created a form and we did automate that and make it a lot more efficient. But I regretted it because I actually enjoyed that and I felt like to some extent it was like part of art of making the culture and trying to making it fun. And if I were given the choice again now, I don't know, I don't know if I would have shut them off. You know, I might have the structure way too, but there was just something about that that I really liked and I liked that it was on the homepage and that it was a little bit crazy and disorganized. What if you had a forum that just put a comment on the homepage? Yeah, yeah, I think I'm something, something, but you know, I think thinking through how you're spending your time actually log it every once in a while to see if it's really happening or if it's just your perception. You know, looking at your team as a whole and figuring out who likes to do what, whose skills lie where. I think that's all part of building a sustainable process. When you mentioned logging time, is there a particular method that you prefer when you're logging that kind of work? I know some people use apps. Some people count certain types of work in that time, but not other types of work. So just wondering. Yeah, me personally, I've used a variety of apps to do like logging. I never do it long term. I think that way is a different kind of miserable death. You know, at least for me personally, I'm like, yeah, I need too much time logging this stuff or you guys start logging the time logging, you know, right, right. Exactly. I think it's more just to get some snapshots every once in a while. And I tended to do it when I'm like, oh, why do I feel so miserable? And then I'd look at it and be like, what am I doing? You know, at the end of the day, what did I spend all this time doing? Oh, I spent an hour and a half writing an email ever so carefully. You know, like, maybe that's why. And am I balancing this stuff out? I think that's what you think through. What are the things that you have to do that helps me categorize it, chunk those things, say it's even email, response around a particular type, you know, faculty support versus student might be a thing. I need to suss it out. Maybe I just need to know support stuff. You know, those are the things you're just thinking through, like how you want to think about your time. And then what are those blocks? And then, you know, when I look at it visually, how much my life is by dirty gray things that I don't like versus bright sunshiny colors for things that I do like. I love that. So, you know, it's simple in certain ways, but like, it helps me. And I think that that is like the key to sustainability, the human side of sustainability. It's like, you got to like it at the end of the day. Right. I mean, I mean, y'all deal with like, tons of people in all the support tickets. And if you're not finding some joy in helping people in a particular way, or, you know, you're not balancing things, then life, it's visible in your responses to people, you know what I mean? It becomes evident in the community. And especially things like this, where you're trying to build something, if you don't love it and enjoy it, then that comes across. It's a big deal. So, I think some of this too is, all right, we got our people, we're trying to balance like, life and happiness. We're also trying to think long term, where do we want to develop our skills at? Like, what do we want to become good at? Where are we concentrating effort? Because there's a million ways to do all this stuff, right? And there only is more and more as time goes on, right? Until recently, I didn't have to think about Gutenberg or full site editing, but now it exists. So I kind of have to think about it. Is that where I want to invest my time? Maybe I've already invested tons of time in learning Elementor or some other visual builder, and I've got lots of content in that. This is an ongoing balancing act, but you're trying to decide where is my team going to build expertise? And then your team, like we said at the start, might be you, might be a third of your position, in which case you have to make different choices depending on your knowledge, your own proclivities. Lots of choices there, but they also impact your happiness. Maybe you just want to learn JavaScript. And that's a thing that you personally want to do, but it might impact the things that you're going to invest time in here as a system, building your own plugins versus only using ones that exist. A lot of overhead in that. And you've seen even companies like WordPress multi site decide there's too much overhead and too many plugins, we're going to get rid of them. And they're basically a plugin company. So really have to think hard about these investments and then how it's going to work long term. One thing I know we really focused on is like we eventually had three people on our team, myself, two other people, Matt Roberts, Jeff Eberhardt. It's who knows what and how do we make sure if somebody leaves that knowledge doesn't disappear. That's a tricky thing here, both internal to the community and how stuff works and then anything you build custom or build with things. And especially like ranking or prioritizing, hey, what here is custom that won't work if one person leaves or will take so much time as to not be worth fixing? And what does that actually mean? Right? Like, does it just mean our process has to change? Does it mean something is busted in a fundamental way? So that's no good. Like those are complex decisions, but the consequences are part of the decision too, right? Like if we leave it, well, we could always just go with this alternative. Okay, well, then maybe it's not a terrible decision to make to do something custom there. But you have to think of that ahead of time, even as you're building it so or before. Right. Right. And it's how much is kind of built entirely on its own, you know, kind of bespoke things that we made just for our thing, versus stuff that might be built on top of something like if I customize an interaction on gravity forms, what does that mean? You know, I've given up this level of complexity, but I've taken on the idea that if gravity forms changes, it may or may not break the thing I built on top of it. So there's no easy answers in any of this. And it's really just something you have to figure out in an ongoing way with the people you're working with. And even with the most careful thought, mistakes are going to happen. We thought we were being so smart. We talked for hours about whether we were going to do entirely new themes or do child themes of this thing. We said, we're super smart. We're going to do child themes. And then one day, like something about the source theme broke and it broke so many things across our whole spectrum that we all had to fix that we never did that again. Yeah. And that could have been us doing something wrong, but it was just, you know, it's just an example of like, even with the best intentions, mistakes are going to happen. Roll with it. Most of this stuff, it'll be fine, but it's a dependency decision, right? Like there, in that case, you had a dependency of this theme and the trouble with that is that it will update at any time, potentially, depending on how you have things set up. And you could say the same thing about PHP, right? You could be like, okay, if we had a custom theme, PHP updates could break it. But if you, the visibility that may be different, right? Like a change to PHP is something you probably planned and are testing potentially. Whereas the theme update thing you might not have been planning for that. In this case, clearly not. And most people, I wouldn't, we, you know, it's a smaller thing. So, but it can still sneak up on you. Yeah. Yeah. And it's the little details sometimes that get to you. And, you know, throughout this whole thing, you're looking at different aspects of this community and how you're supporting it and what that means. It can be something like documentation. Like, are we going to create our own documentation? Are we going to link out to documentation that might live at WordPress or some other site? Like, and what does it mean when we do that? You know, I joke a little bit sometimes about the 80-20 rule, but like, it is to some degree that. Well, the documentation you link out to be perfect and just what you want, probably not. You know, like, I remember redoing documentation at a big public school system because each school wanted their own colors and logo like on the documentation. And that's what we did for 67 different locations. Was that a good use of time? I did not think so. You know, like that gets back to like 80. What if we use JavaScript to determine programmatically what colors to use? Is that a good use of time? Still probably not. Who knows what that was and that might have been in Appleworks back in the day. So, maybe we could have scripted it with AppleScript. But, you know, I mean, you can get stuck in these like really minute conversations and a lot of times it doesn't matter. So, figure out what doesn't matter. Focus your time and energy there. You'll be happier. I think things will be better. And it's an individual, unfortunately, discussion and path to finding out what that is. One of the big questions people have been asking is kind of how to determine the health of subsites. And that could mean lots of things. And there are lots of chunks of data that might be involved in that. So, I thought it might be fun to take a look first at the database where this stuff lives. And then we can look at some of the stuff built in the WordPress to help kind of pull it out. There are always going to be issues with degrees of scale here. So, what we're going to look at isn't an example of pagination. So, a few thousands and thousands of sites. You don't want to think about this a little bit differently. But for, you know, hundreds, maybe this stuff would work right out of the box because it depends too a bit on your server and some of the dynamics there. But at the very least, we can look where the data lives. And then we have a million different paths to get it out, combine it in different ways, look at it in different ways. Cool. That sounded all right? Oh, yeah. All right. So, if you would share my screen, we'll start with the database part. Let me know. Is that pretty legible for you? I think you can make it a little bit bigger. It's okay for me, but... Yeah, that's better. That's good. So, what you can see is in a normal install, you're going to have a bunch of tables down here on the left. And I'm looking at this at, I think, Adminer. Yeah. And there's my PHP admin. You can do this in the terminal if you wanted to. There's a variety of SQL clients you can use to access this stuff. You have lots of different options. It'll all look sort of like this. What happens, though, that you're going to care about is for each blog, the sub-blog that's created sub-site, you get a new series of tables associated with the ID. So, you can see that all these things are made for the blog with the ID 100. And you can kind of get an idea what they are, because that stuff's all the same. And then this is the part we're looking at. So, comment metadata, fusion forms. Some of these are created by plugins. That's fusion forms. You know, relevancy, which I always want to say is a pasta dish, but that's not what it's spelled like. Those are things. Anyway, the one we care about and want to look at is called options. And so, I want to see the data. And this option table has three columns. There's an ID, an option name, and an option value. So, the majority of this stuff is going to be created by default. And it's pretty easy to read. You know, site URL. Okay. That's the site URL. Phone, blog name, blog description. You know, there's some stuff like users can register. Zero and one is kind of like true and false, with zero being false, but not always. Like start of the week being one is not false. So, that could be a little bit messy. But in any case, I'm not going to go too deep into that. We can kind of scan this stuff and just kind of scroll down here. And then we see one thing that people have said they care about, which is called active plugins. And it looks a little bit gibberishy over here, but it's parsable. Like you can see that is advanced custom fields pro. This is dlink general, you know, et cetera, et cetera. So, there's a bunch of stuff in there. This is where that data lives. If we wanted to look at it a little more closely, there we go. So, this is like serialized data. And I think maybe in one of round ones things, I showed how to break this out and break it down. You know, if not, you want to see it again. Let me know. But we won't be messing with it now. I just wanted to show that it exists there. And that's how you know for this particular site with the ID 100, you know, the dlink site, for instance, those are the plugins that are turned on. We can access that. Am I making sense? Yeah. And the same thing is true with two different aspects of themes, so template and style sheet. This can get a little bit messy when you have child themes involved. I can't remember which is going to get you to the truth. I think its style sheet will be. But that's how you know. Does this particular site have a particular theme activated? So, the theme in this case is Aveda, but it's listed as template and style sheet. So, it doesn't say theme explicitly. Right. Actually, yes. Yes. Good point. Like, they expect you to know the code. Right. And so, these things are named, however, and you can kind of create your own. Let's see if there's anything else useful here. I mean, it's not a bad idea ever to just kind of look around in here every once in a while. Because sometimes you're like, oh, that's where that lives. And if it ever got broken, I had to manually change it. I could. Or maybe I want something and it's not available to me in any other way. I know where it lives in this table and I could figure out a way then to get it. Right. And what may not be apparent is that I have four pages of this stuff. You know, there's a lot of different information in here. And just keep in mind, you can do stuff like there's an option called post count. So, I know that this site has one post, which is not very many. And so, this is a great section to go through if you want, if you're interested in creating your own kind of function or plugin. Right. Because this is kind of where you can see all of those variables that you would be using and calling on. Right. It's a great place to look and go like, all right, before I start making stuff from scratch, what already exists? Right. And that's important because you don't want to be creating a lot of duplicate. You'd be reinventing the wheel if you invented a post count thing that wrote the data someplace. You don't need to do that. It's here. It's a gift. Well, and it helps you break these problems down into smaller components. Right. A lot of times, I know, I'm, well, this just comes with being less familiar with a piece of technology, but I certainly do this. I think a lot of people do this when they're less familiar with something as you go, okay, I have, I need to do this. So, I need to write something or find something that does this. It's like, well, maybe, you know, but here what we're learning, say if post count is the example is that the data exists. And what we really need to do is find a way to conveniently read that data, depending on our needs. If it's just, I tailor want to be able to find out that information. It's like, okay, problem solved. It's in the database. And I know how to go look at that. But maybe you need to present it to someone else. You've now turned your problem into a smaller problem, which is I need to find a way to read this thing from the database and put it somewhere. At which point you maybe you know how to do that. Maybe you can find out how to do that. Maybe you have someone in your team who works with databases all day and doesn't know a thing about WordPress is like, I don't, I don't know what a WordPress is, but they go, yes, this I can help you with. We can write something. We can read something from a database and put it in a text file. Easy. Yeah. Absolutely. Again, it's, it's what you're identifying. What's, what's my goal? What exists? Who are my people who have the skills and these things to help me solve that thing? And it's, you know, it's, it's all little tiny problems that are solvable. If, if you don't panic about it, like it's easy to look at all this and be like, none of this makes any sense. Right. I certainly felt that way. I can't tell you, like when I first tried to deal with this stupid serialization stuff, I was like, what is this? What is this magical code? But when it's broken down, it's, it's very, very understandable. It has a logic to it. Yeah. This thing right here is saying there are five elements in this array. This first one is seven characters long, you know, like that's the pattern. But if you don't know it, it's just looks like gibberish, right? Yeah. And I've never really parsed that serialized data. But now that you've explained that to me, I'm like, oh, that's a little bit like they're trying to put JSON into a database. Exactly what they're doing. Okay. It feels very awkward. It's like, uh, this, this doesn't feel quite right. Sure. And, and, you know, whether, but that helps you inform a decision of like, I want to mess in this world, right? Of like, okay, if this exists in this format, I may not want to touch it potentially, right? Yeah. Maybe you're not ready for it, or maybe that deserialization is more hassle than you want for a particular thing. Cause you can write your own, uh, little functions that update site options or other stuff or write your own custom table. Those are all possibilities. I think the question you're always asking yourself is when is it worth it for me? When is it worth it for me? Like, for instance here, WordPress is going to give us a function called get sites. And so this is another thing that like takes some getting used to. It's like, all right. You know, when I'm looking through this developer documentation, does this make any sense to me? One thing, um, and I think I may know an answer to this, but, um, but so something like this, where we're looking at a PHP function or I'm sorry, a, uh, is this technically, yeah, it is a function. Um, but, you know, for someone who's getting started at this and is not very comfortable, has maybe not done much at all. What would you be? Is the, what would you think would be like the simplest or maybe fastest? I don't know, it sort of depends. Um, but of path to, I'm looking at a function and I want to play with it to kind of see like what its output looks like. I'm not maybe ready to integrate this into a whole thing. Is it a plugin? Is there a console? You know, what, what, what do Yeah, I think, I think plugin is usually the easiest way to do it. Um, so let's, you know, one thing I'm kind of asking just cause I know I've seen some of your stuff, particularly around gravity forms where you've got like, uh, sort of boilerplate plugin, right? Where you're like, I start here and then, you know, can kind of mess around from there. Um, but maybe that's not the best way. I don't know. But yeah, I guess I can only say like, that's what I tend to do is if I want to just like bang around on something and I'm not already in a theme. So I guess it would depend too on what I'm doing. I suppose a theme function would also, you could go edit your theme functions and then just, you know, if you're like me and terrified of doing anything in there for fear of breaking things cause I have, um, just undo what you've done when, so. You just remove wherever you call it and you can leave like an absolutely atrocious function in there as long as you don't call it anywhere. Sure. You know what I mean? Which I wouldn't suggest you do that, but you can. Uh, for instance, right now, like I could write in something crazy here. And as long as I don't add the short code Taylor to any post or page, the function will never run and it can be helpful to do things like, you know, if you look down at the bottom a lot of times, they'll have a little demo things, which you can then run, you know, um, and I like the idea of a short code because you're even unlikely to break anything as long as you're not visiting that page. Basically, you know, worst case scenario, you probably just have to go back to your dashboard and delete that post. And so let's, let's, let's see what happens when we maybe use this one and we'll use that short code and see what happens. So we can say sites, we name that variable and we say get sites. And then we'll just do this. This is the equivalent of console log. If you're a JavaScript person, um, it's kind of as close as PHP gets our dump, which sounds kind of gross, but it does just like throw everything out there on the page, no formatting or anything. And so what I've done here is just add a short code. The short code itself is Taylor and it runs the function Taylor test, which is right here. And all Taylor test is doing is doing our get site thing and then spitting all that stuff out. So let's see what happens when we actually do this. I, uh, I'm glad you stepped through it like that. One of the things that, um, was, was always a trick for me getting, and I'm still not real comfortable in this stuff, but, um, I've done it a little bit to know, like, you know, some folks are gonna be coming at this from a perspective of, okay, what are we even talking about with a function and, you know, and, and variables? I think people kind of know what variables are, but the idea that in a lot of stuff in PHP, you're going to be writing some code that's in a function and then later you're going to call it. So it's not, it almost looks nonlinear, even though it isn't technically, but, um, in this case, right? But, um, that is, um, the sort of non-trivial in sort of demystifying that. So, um, yeah. And like what, what I hope people understand is like I came to this not knowing how to do anything, like feeling every bit is ignorant and terrified and confused as anyone I think could feel. And just bit by bit over a number of years, I mean, I don't know how long I've been doing this now, like a thousand years probably. You know, I eventually have gotten to the place where I at least feel like I can do something most of the time. Now, am I a magical, like, real programmer, whatever that is? I don't feel like that. But compared to where I was, I'm worlds of different, different. But at the same time, I still feel, you know, fairly fraudulent and going like, well, I don't even really understand object-oriented programming or why you would, how you would do blah, blah, blah, like all sorts of crap. So I mean, there's always a million more things to learn. So like just don't, don't let it get in your way if you want to do it. If you also, if you have no interest in programming, like, that's okay. You know, cool. Not everyone has to be a programmer. I have no interest in lots of things. But this is kind of fun and I like it because it lets me do what I want. And if you are really particular about things, programming will get you to what you want in ways that you just can't with the way other people do it for you. But so what we've just seen is this is spitting out all this stuff. Look at all this stuff. Lots of stuff. Very exciting. And it's just throwing it out there right now. But it lets you kind of go through and they're like, all right, when it gets sites, what's it getting me? Oh, by default, it gets me registered and last updated. That's kind of useful. But it doesn't get me by default anyway. A lot of the other stuff I wanted from WP options. What else I found was this felt a little bit slow compared to some other ways I might do it, given that really what I'm getting out of this that I want is the blog ID and maybe these two fields registered and last updated. So I was like, are there other ways to get something like that? And there are. There are lots of them. Like you can see here, that's what I did initially. And then I commented it out and I said, well, can I just pull the IDs from someplace else? And that's what this is. There's like WPDB is more direct database queries. And you can do some stuff that way. And all I did in this case was get the blog ID. And then I can make a loop and get a bunch of stuff. I can get that site URL and get the blog name. And you see I'm getting that with get blog option. So that's the other piece here is you're kind of going through and you get better and better at kind of guessing at what they're going to call these things or getting close enough that it turns up in the search, you know, and maybe chat, whatever string of characters is going to help you in the future, either make this or at least find this stuff faster. But it's a little bit of vocabulary acquisition. And so that's always the trickiest thing. And I would say that vocabulary stuff, right, like looking at this and deciding what it's returning is an array. And my question is, I need to know how to get the third element of an array, the keyword being array, if you don't know, you know, and, and my, my main recommendation, because that's where I find myself most of the time getting hump up is turn terminology stuff like that, not knowing it. You know, it sucks, but like you have to kind of fully read some of these documentation things sometimes. And it sounds like I'm being condescending, but I'm the worst like perpetrator of not doing that. Because usually you'll find some negative Oh, I don't exactly know what that word means. And that was the one I was looking for. Okay. Well, and if you're anything like me, you'll skim it and not actually read it. I'm even worse. I'm like, okay, code example, great. I'm not even going to read what this does. It's fine. You know, so I'll figure out what it does later. There's something to be said for pasting it in and seeing what happens and then going from there. And that's my favorite thing about programming, right, is that it's hard like I'm learning how to I own a house. I'm learning how to do stuff around the house. I can mess up stuff around my house in a way that I cannot fix it. That is possible. It is almost impossible to do this with programming. If you're in a proper environment where you're not going to like delete someone's data, you know, right. I think my kids laughed at me one time because I accidentally created an unending loop that generated like 10,000 blog posts on my dev environment. But even then you can, you could restore a backup, right? Like there, there, as long as you're confident and no, hey, reclaim has backups or you're doing this yourself, you know how your backup system works. Even that is solvable, not, not ideal. But I wish I could back up my house in software. That would be awesome. I guess that's what really rich people do. But well, in this one, we can kind of see and it's worse and like, all right, so this thing kind of gives it to you in condensed form, right? There are three things you can mess with in, when you ask this function, get blog option. And then it tells you a little bit more about it. Like the first one is the idea of the blog you're asking for details about. So I want to get the options for the blog with ID, whatever. And if we remember from our good friend back here, our ID in this one was 100. And this is the options thing. So this is the table it's asking about. It's not always the structure, but in this case, this is the structure that we're dealing with. And then we want to get a particular thing. Again, the option name is going to be what we call in that second variable. And then the third thing is optional. See required, you got to have the ID so we know which blog to ask about, you got to have the name of the thing we want to ask about. But this value, if it doesn't exist, is optional. So you could put like, nothing loser, or you don't have to fill it in at all, you just leave it blank. And that's fine. So you can see when I start to call things here, let's see, you see me asking in the same pattern, site URL, blog name, current theme. Right. This is the same stuff that we had back here, blog name, you know, all that sort of stuff. So I'm just asking this database to give me the information for that particular blog ID, because what this is doing is this is a for loop that goes through. I got all the IDs, and then for each ID, it's going to do this stuff, which is just asking for all this stuff that I want. And then it's going to spit it out in a table. And that's what all that crap is, right? Nice. And that's, that's just plain HTML pretty much that's within the PHP. Yeah. Yeah. And even here, like, like smarter people or like fancier people would be like, I would do this at a different one. Absolutely. Probably. But like for me, this is simple, straightforward. It makes sense in my head. And that's why I do it this way. And I make no apologies. Well, and I'm looking at that. So you've got basically an object that you've assigned, you've given the HTML there. And like, I mean, I've done that kind of thing in way worse ways, right? Where I'm just kind of like echoing HTML out. And not worse in that, well, it is probably in a lot of ways, like objectively worse, but like, it's also just harder to deal with. You're always going to learn about a better way to do something. That's how working with any tool works. And PHP is a tool, WordPress is a tool in this case. And that's okay, right? You use the tools that you have and that you, that meet your needs. Well, and again, you just keep evolving over time. And you are like patient and kind with yourself in that evolution. Like, do I look back at stuff I wrote a year or two ago, or sometimes like a week or month ago and go like, oh, that's embarrassing. But I try not to, you know, because like it's okay to like learn new stuff and to get better over time. Like that's what we say we want for all these people, like give that same latitude to yourself. And so this is it gets a bunch of stuff. And we can go through like one of the things I'm getting is active plugins. Remember, that's like a messy thing, right? And so I might have to do something to like make that better. You know, like I might have to write another function that takes that stuff and makes it into something legible. And that's what I do, you know, with some of this. And this is how I'm navigating the arrays. And you know, like there's a bunch of stuff we didn't learn. Yeah, yeah, and these things are are looped. But let's let's get to the maybe the juicy part. So that people can decide. So one, I'll refresh it. And it wasn't instantaneous, but it wasn't bad. And this is all of the stuff loaded. I don't remember how many sites I have on this thing. But I have considerable. And so it's just writing it to each column of this table. And I used a JavaScript library, the same one I used on the domain of one's own data called I think awesome tables or no, what's it called? I'll tell you how I'm data tables. So that's what this stuff is is loading the JavaScript and CSS to make the data tables work. And it just makes a table interactive. So I could be like, show me advanced whatever. So now says I have 60 entries with something advanced in the title. You know, I could go on to advanced custom fields. Pro. And now I have 56 entries. So it's a way one of the requests was how do I know what sites have what blow what plugins active. This is one way you could do it because I'm writing the plugins here and I can search for them. I did this at the end of each plugin name so that like if I had three plugins with the same initial stem, which some of them do like gravity forms x gravity forms why I wanted to be able to search for just one. And that's one way you could do it. You know, it's a lazy way. But like it may be good enough for me in this particular scenario, I could get fancy or I could make every plug in a button and click on it and plug in and then it would restrict the found set. Is it worth it? You know, it's kind of up to you again. What's your audience? What's your goal? And kind of like Taylor was saying earlier, you know, while you may be able to as an individual go in and look at these values in the database table, this kind of upfront work that you do here can just make it so much faster for you to actually see this stuff instead of, you know, going in even if you're not showing it to anybody, right? So it doesn't have to be the prettiest thing in the world. But if you can understand it and it can get you your data as fast as you can, then that's a win. Well, and think about, you know, what this enables you to do too. In this particular example, you know, like you're totally right, Amanda, this could be a huge time saver for you if this data you need to get to often. But it also this because we're leveraging a platform or a tool that is, you know, that's built already WordPress, this is on a page and we can do all kinds of things with it. Now that's on a page, right? We can put this on a site that only administrators have access to or we can put this on a site that only five people have access to that aren't administrators and we don't want to be administrators, right? Because it's in WordPress and WordPress knows about user accounts and things. So that's huge. If you needed to build a whole user account system, you've just made a lot more work and probably work you don't want to do in terms of like security and things that you don't want to be in the business of doing is what I mean. So, you know, you're, you're putting these Lego pieces together to build something really cool and you spent the most time on the part of it that is the most specific to you, if that makes sense? Like you want this data. That's a that's a Taylor problem that I want this data. The idea of authenticating users is the problem everyone has when they're making an application. Let's let's use the solved version of that already. I think that mentality is the main reason I use WordPress to build a lot of this stuff. I could do a lot of things from scratch and I use WordPress at all but it already solved a bunch of problems that I don't want to deal with and I want to deal with user management. I don't want to build a whizzy wig editor on top of this thing or, you know, something to save revisions and stuff like that. That sounds awful. I just want to do this part of it. So that's that balance again. Like where do you want to spend your time and energy? You can take that that philosophy or the sorry the opposite philosophy of building all of it to logical extremes that, you know, would make sense to nobody of course, right? Like because it's like, well, why are we even using PHP? We'll make our own language. Like obviously, but I do think some people when they're new to this think that that's like not a legitimate way to solve the problem if they haven't encountered that. I certainly had thought of programming that way before I'd done stuff with WordPress. I was like, oh, I don't know how to do it all the way through. So not doable. Great. Moving on. It's like, no, there are things you can leverage here. Yeah, you don't have to build your own song, right? You know what I mean? Use the tools that are provided you and, and like, that's cool. Might there come a day when you need to build a special song? Maybe I haven't run across it yet. But like, I'm sure there's somebody out there who needed a bizarre thing like that. And in any case, like this is just, you know, proof of concept more than anything else. We can get this data and show it interact with it. We can do different things. We could do it an entirely different way entirely focused on plugins where we break it down by plugin and then count and then just list the things to the side that use it. That's another way we could organize the same data. So it's just there's a lot of choice here. We just need to understand this data lives here. There's a way to get it. And then we can build the interactions and displays that we want. And if the data doesn't exist, so we can take a quick look here about how we might write it and why we might write it into a particular place. So in the same way that we can get stuff from the options table, and if we're getting a bunch of other stuff from there, we might want to write some extra data to the options table. So that way, you know, our questioning pattern stays the same and it's easier to kind of maintain that sort of stuff. So we can see that, you know, other plugins made entries here, right? We saw that with relevancy, whatever the hell it's called. And some other things, ACF, I think writes some data here. We can too. We have that power. Avada or Aveda, whatever it is, writes some data to this. We commerce. So if we want to do something similar, like for instance, it gives us a post count, but it doesn't give us a page count. And I was like, well, to determine health adequately, I'm probably going to want to know pages too. And so let's take a look. I think I wrote that on my generic, I wrote on my generic network activated plugin. And it's another good example why one of these is handy, because it's like, I want, from now on, whenever somebody updates a page to do the count and write it to the options table in the same way. And that's what this does. It essentially says, all right, this one is going to do call the function WP count posts. It's only going to count the post type page. And it's only going to count those that are published. Maybe that's a bad idea, because some weird faculty member someplace is only going to put posts in draft mode and write 7000 posts. And then they'll be mad when you think that site's abandoned. But in my case, I just figured that that's the path I'm going to go. And then this stuff just says like, hey, if it already has a data page count thing in the database, update it with the new count. If it doesn't add it and give the page count, because it's only going to happen, like for all my blogs that already exist, this data hasn't been entered. The variable in the table doesn't exist. So what I want now is, all right, from this moment on, every time a post has transitioned status, run the page count thing to enter the data. And that's what's going to go on. So this saves. So what should happen is I make a new page here. I'm going to publish that. Now, one thing I want to know is, all right, this is a terribly named thing. You can see what happens when I'm making fake names for things. FAQ or take two. Figure out where it is. I need to know the ID, right? So I'm going to search for it or it was, there's 12398B to see I hate myself. There we go. There it is. And if I go over edit, it's going to show me down there in the bottom at the very bottom. That's ID 127. See, edit gives me ID 127. So I can drop over here and go down to WP 127. I can go to options, select data. Probably be the last one. If I recall correctly, we have post count and there's data page post count. So two. So that's what's right in it. That's lazy, you know. But useful. Well, and if we look at, to go back to something we talked about a long time ago, I think I have this in this one. I made something that would write WP multi-site details. In this case, I was looking at stuff like maybe I want to be able to, when I create a site, say it's going to be a permanent site. And that it's associated with a project. And so I can make that part of both the interaction pattern. Maybe when someone creates a site through a form, it enters this data. Or I could do it as part of like an admin view of the site. I can add this content. But it gets then into like, what's your data? What do you need to look at? How are you thinking about this? And then you're just writing it to the same place. Different methodology. But then part of that comprehensive view you're starting to build for yourself that's going to answer the problems and questions that you have. So we've got about a little less than 10 minutes left. Was there anything else you wanted to cover before the end of the hour? Oh yeah. I don't think we're going to do anything big, but I mean to just take notice of little things like this. Remember we talked about, like I showed you how to get the ID way over here. I also wrote something at one point or copied somebody's Stack Overflow code to make the ID show up here because that's easier, right? And it's easier to talk to people if it's some place visible and relevant and obvious. Like that is not a great interface pattern, right? Your directions when you say, if you just mouse over the title and move down to edit and look in the lower left-hand corner and at the very end of the URL after the equal sign, you'll see the number 127 or I could say in the thing ID column. So this gets into this concept I think too of like proactive action versus reactive. If I find I'm having to tell people a lot of stuff or it's really hard continuously to get people to get a certain thing and I have to keep sending out documentation or I have to keep showing somebody a thing, can I fix the source of the problem? And that's where programming can become like a little bit addictive. It's like, oh, I could not get any of these emails if I could just fix this one thing. Well, and you know, there can be, you know, not that I want to advocate too much fear because I think this session is more about optimism and trying things. But when you are trying things and you first sit for instance, this is maybe not a very good example, but for instance, you made a plug-in that puts the ID column in and you googled around, you found someone that did it and you're like, cool, I can do that. It's worth keeping those plug-ins, those little one-off things in mind, you know, like document that you did that somewhere. Of course, it'll show up in the plug-in list as well. But document, if you've got a place you're taking notes because you can reuse it, A, but B, if you do have weird problems, I mean, I've seen weird things from weird plug-ins. Like, I've seen plug-ins where someone made a thing that lets you filter the post table by a specific field and what it, it wasn't made very well. They found some code out there and it was actually running a query across every post in the multi-site, every single time, every page loaded. And so, the whole site was pretty slow because of it and eventually I tracked it down to this one little tiny plug-in and my point being, it's a very solvable problem. Like those things are trackable, A, you can use things like query monitor, which is a plug-in that lets you see like database queries and various PHP things that might be slowing the website down. And then we deactivated it, it was no big deal. But my point is, you may not notice those things right away because in this case, I'm sure that thing was made when there were like 100 posts and then suddenly there's thousands, right? It's a very different story or tens or hundreds of thousands. So, it is good, I think, beyond, you know, to document, you know, think, I was, you know, document as if it's someone else reading it. That's what has kind of been instilled in me because guess what? Even me in one year is basically someone else reading it. So, you know, plan for that because that will pay off, even if it's like, hey, I made a plug-in that does this and it works by querying this. That could be enough information for someone who's troubleshooting years later. Why are there all these queries on the database that it's getting overloaded? It might be enough for someone to look into something. Absolutely. And I do it in one other place as well. So, there's kind of like your maybe Google Docs kind of style documentation where you're like, here's these plugins and why they are. And then within the plugins themselves, it's really helpful to write stuff, especially if you get something from someplace else. I keep the URLs in there. I think I learned this pattern from Alan Levine, maybe. It's both to honor the people that you got it from. Maybe it's a Stack Overflow link, whatever. But it also lets you get back to it in the future. Like if something broke, I remember I now know where I got it from and go back. And this is a good example too of like proactive stuff. What this does is it got rid of Google Docs span tags. It left all the other HTML stuff. But I kept having people cutting and pasting from Google Docs. And it would do the like font size 400 and all that kind of crap of span tags. And people would then be like the font isn't the right size when they get published on their blog. And this thing makes it so that doesn't happen on the cut and paste. So there's that idea of both like tell people what this is and what it does and solve this problem that was super annoying at the source rather than having to go back through. And if you've ever had to cut and paste out the span tag stuff and Google stuff is super annoying. But I have a theory that the biggest mistake we've made in computing in the first, let's say 40 years of home computing. So I'm going to end this at like the early 2000s because there's all kinds of mistakes since then is paste without formatting isn't should paste without formatting should be the default paste with formatting is a bad choice. Anyway. Well, hopefully this this gets people kind of interested, you know, at worst wander around a little bit explore. Just don't you know, don't be scared of certain things. But be informed and cautious in the way you move forward. You know, but give yourself some latitude as well to learn stuff and just to have a little bit of fun with it. For sure. With that, you know, I think we're at an hour's silence. I don't want to pull another hour. That's probably for the best. But you know, in the office hours later this week, we can always bring up some of the things we couldn't we didn't have time for in this hour. So people can make sure they catch that. And yeah, thanks for joining. Next week is going to be the last session and it's going to be a fun one because we're going to have Tom with two special guest speakers as kind of in a in a conversation with each other about their experience with WordPress multi site and this, you know, kind of building off of the sustainability idea as well. So make sure you check that out. See you next time.