Hi everyone and welcome to today's presentation on Acceptance and Commitment Therapy Skills. Over the next little while we're going to discuss the goal of ACT. We'll explore yet again what is mindfulness. We'll talk briefly about how ACT differs from other mindfulness-based approaches and what's unique to ACT. Then we'll move on to talking about destructive normality, who knew, and experiential avoidance. Finally we'll move into therapeutic interventions that are common in ACT. Talking about how to confront the client's agenda, which is generally clients come in and they want us to take away the problem. And ACT wants us to really confront that and say, are we talking about taking something away or just changing the way we perceive it? And then we'll work on thinking about control as the problem. Too often people try to control their depression and control their anxiety and the harder they try to control it, the more out of control it seems. And we will end by exploring the six core principles of ACT. Why do we care? As usual, not every intervention fits every single person. So what we want to do is try to find a host of tools that we can have in our toolbox to present to clients that will build on their strengths. If we hear something that sounds like ACT or CBT or experiential interventions, we will know that that's kind of where we want to go in order to help clients learn how to deal with life on life's terms in a way that's meaningful to them. You can't stop the waves, but you can learn to surf. You can't stop bad things from happening.  But you can learn how to deal with that in a way that is less counterproductive to your health and happiness. Distracting oneself from distress is akin to constantly running away from one's own shadow. I thought about that for a few minutes and it's kind of meaningful. In the attempt to control the negative thoughts and feelings, we are at a loss for control in other life situations. If you're constantly running from that shadow, you're not focusing on anything else that's going on around you, which means other things can kind of deteriorate and will cause additional distress even if you figure out how to get away from your shadow. The ACT acronym, accept your reactions and be present. It doesn't say change them. It doesn't say judge them. It just says accept them. It is what it is. Choose a value direction and then take action. That all seems pretty simple. But it's not. If it was, our clients would already be doing it. ACT is based on relational frame theory, which is a psychological theory of human language, which was developed largely through efforts of Stephen C. Hayes of the University of Nevada, Reno, and Dermott Barnes Holmes at the National University of Ireland, Maynooth. Rational frame theory argues that the building block of higher cognition or reasoning is relating. That is our ability to create links between things. That's a whole bunch of technical mumbo jumbo for when we see things, we articulate it in terms that are meaningful to us. That's scary. That's wonderful. That's amazing. That is very depressing. That is whatever words you use are the way that's going to get kind of conceptualized and stored in your memory. If you conceptualize something as all or nothing, then you may end up perceiving the world in all or nothing terms. What we want to do is look at that language and say, is this the best way to think about this? One of the examples that I've used before is labeling an event or a behavior instead of a person. Children, and I truly believe children are not bad. Children make bad choices. Children do bad behaviors, but children are good. But that's my own humanistic approach to life and recovery and all that kind of stuff. Helping people see that. We're going to look at some more examples of the way our language can really affect how we interpret something. Contextualists seek to understand the complexity and richness of a whole event through appreciation of its participants and features. Now think about functional contextualism. Contextualists say, in this context, when my son was little, we would go to different places and at home, he knew what the rules were. He knew we didn't touch the TV. He knew everything, the way it was supposed to be. But when we went to my grandmother's house, he had never been there before and she had a TV and she had other things and she had knickknacks and stuff we didn't have. So this was a different situation. So the little scientist in him went off and he walked over to the TV because he was trying to figure out in this context, in this situation, how am I supposed to function? Functional contextualism. Let's see where I'm going here. He walked over to the TV and he pointed to it and he looked at me and he said, no touch. I said, that's right, Sean, no touch. He reached out and he touched the TV and he looks at me and he goes, time out. I said, yep, buddy, time out. And he toddled over to the corner and sat down. He just wanted to make sure that those rules still applied and it wasn't anything, you know, I wasn't like, well, he's doing that to be spiteful or he was just trying to figure it out. And as soon as he figured it out, he didn't bother the TV again. So what I want you to get from that is the fact that people will behave differently in different situations. And the reason they behave differently in different situations is because there are different variables in play. I behave differently when I'm presenting than I do when I'm hanging out with my friends at the gym. And I'm sure you behave differently at work than you do at home than you do when you're going out for a night with your friends, you know, on the town. It's all about context and what is the most functional choice of behavior at that point in time. So humans learn language through interactions with the environment. We need to focus on the changeable variables in the context. Some things aren't changeable. At my grandmother's house, we couldn't just take the TV out. Well, we could have, but that wouldn't have been practical. So we needed to work on the changeable variables in the environment. We want to help people create general rules to predict and influence psychological events such as thoughts, feelings and behaviors. Changeable variables in the environment can include triggers. It can include how to interact with different people. You know, maybe somebody has issues with authority figures that will affect how they interact with people at work versus maybe how they interact at home. So we want to take this into consideration when somebody talks about having an anger management problem. Well, I want to know about that problem, but I want to know about it in every single context. When we were talking about personality disorders, we talked about a pervasive pattern of behavior. So this pattern of behavior existed in multiple settings. So I want to know what was the context? What were the variables controlling that behavior in each setting? Since it generally presented as a disorder, we can figure out that the behaviors and the choices that were being made in those contexts were probably unhelpful or inappropriate. The goal of ACT, as with most of our other interventions, is to create a rich and meaningful life while accepting the pain inevitably goes with it. There's going to be times that things just suck, and I'm sorry, it happens.  It's important we help people understand when they're creating this rich and meaningful life. All right, maybe things are not going the way I want them to right now, but let's get back to basics. Who is important to me? Who is it important to me that I'm around, that I support, that is in my life? It could be kids, it could be family, it could be your best friend, it could be all at the above. Then what is important to me? What are my values? If I have to choose between different things, what things are important for me to have in my life? Is it important for me to have a roof over my head? Some people would say yes, some people would say, you know, I can crash on my friend's sofa, or I really don't want to have the confines and regulations of living in some sort of formalized housing, and that is definitely a choice. And what experiences are important to me? Is work important to me? Is travel important to me? What is important? And how could I move toward those goals? Because we want to have our decisions based on values, values-driven decisions. ACT is a good abbreviation because this therapy is about taking effective action guided by our deepest values in which we are fully, present, and engaged. The other thing with ACT we want to remember is just like a lot of other things, our values may change over time. You know, what was important to you when you were 20 likely is not exactly the same as what's important to you today when you are older than 20. We'll just leave it there. What's mindfulness? Consciously bringing awareness to the here and now experience with openness, interest, and receptiveness. Mindfulness does not require meditation. And this is one thing that I really want to drive home to some of my clients because I've had situations where I start talking about mindfulness and clients are like, no, I won't or I can't meditate. And I could try to contradict them and confront them and challenge the resistance. But that's not where they are right now. So I said, okay, how else can we be mindful? How else can we help you become aware of your here and now? One of the things that we used to do in my residential program every morning and every evening, clients had to fill out check-in sheets. They had to identify how they were feeling emotionally, mentally, physically, socially, spiritually, and in general. So I mean, that was a lot of thinking right there. And then they had to identify what stage of readiness for change they were in and why. And they had to identify what behaviors they were exhibiting that supported that theory. And finally, they had to identify three good things that they did during the day or three things that they wanted to do during the day if we were talking about in the morning. We wanted clients to start becoming aware of themselves instead of just getting up and being on autopilot because we've talked about vulnerabilities. We've talked about understanding that some days you can handle more than others. Encouraging clients who are by all rights in early recovery, early or late phases of detox. I mean, they're not feeling so hot. So I want to know how they're feeling because then we can start talking about, okay, you feel sluggish today. How can we help you with that? Because they're going to be times when they're in recovery, when they are out of treatment and two years down the line, when they wake up and they've got the flu and they feel like crap and they feel sluggish, but they've got stuff to do. So let's learn how to deal with that now. So anyway, we're not going to require them necessarily to meditate. Some people think it's the greatest thing in the world and if they can meditate, great because there are so many beneficial aspects to meditation. Some of our clients who have anxiety disorders, who have ADHD or who have extensive trauma histories may have difficulty, at least in the early phases of treatment, with meditation, with quieting their mind. It's really, really scary for them because they spend most of their life just trying to keep their mind busy so they don't mentally go there wherever there is. Fastest to mindfulness, living in the present moment. So again, how are you doing right now? And for a lot of our clients, they look at you and they go fine. And if you're in recovery circles, you know that fine is an acronym. You can look up what it means, but it basically means you're not fine. That's just a knee-jerk response. We want to ask them, in the present moment, emotionally, how are you feeling? Cognitively, how are you feeling? And physically, if you can get those three, you're going to have them really focusing more on the present moment. Encourage them to engage fully in what they're doing rather than just getting lost in their thoughts. So if they're out on a walk, have them pay attention to what's going on. Have them pay attention to the birds, to the leaves, to the kitty cats that are hiding under the trailer. Whatever it is that they see, they hear, they smell. Sometimes we would have clients go out on walks around, we had a, I think it was a three-acre campus, have them go out on a walk and come back. And then they would talk about, as a group, what they saw, heard, smelled, etc. And it would be amazing that you'd send 10 people out and you'd probably get six or seven different perspectives of what was out there. You know, there was a lot of overlap, but there were inevitably things that one person noticed that nobody else did. Mindfulness also means allowing your feelings to be as they are rather than trying to control them. I have a friend right now who's really stressed out, and it's stressing him out that he's stressed out.  Let's just think about it this way. You're stressed out by everything that I know about that's going on in your life. You have a reason to be stressed out. So let's accept it. It is what it is. Where do we want to go from here?  I'm like, not so much. You know, a lot of people couldn't handle that. So as a therapist or a coach or a friend, we want to encourage people to just identify and accept their feelings. Mindfulness skills are divided into four subsets. Acceptance, it is what it is. Cognitive diffusion. I can separate myself from my emotions. I don't have to be my emotions. Contact with the present moment. How am I feeling, thinking, doing right now? And the observing self. I love the observing self because this is the fly on the wall. This is the fly that's sitting over there that's watching you going girl. What are you thinking? How does ACT differ? ACT can be used in a wide range of clinical populations and settings because it's not a manualized protocol that you have to go, well, I don't know if my clients can actually handle this part. It is a technique. It allows therapists to create and individualize their own mindfulness techniques or even co-create them or create them with clients. You can go online and if you type in mindfulness, you will come up with literally hundreds of worksheets, activities and ideas. So if you get stuck, try looking at those. Explore from there. One of the ones I learned and I think we talked about it in the last session was the name five. Name five things that you can think of or that you see right now that are hard. The wall, the floor, the chair. Having people really pay more attention to what's going on in their environment. You remember that game that a lot of us used to play back before there were iPhones when we'd go on long car trips and you'd look at the billboards and you'd find billboards to fit each letter of the alphabet. Whatever keeps you occupied. But it made you to be more aware of what was going on, at least visually around you. What is unique to act? Act does not have symptom reduction as a goal. The ongoing attempt to get rid of symptoms and this is really important. So just bear with me while I read it to you for a second. The ongoing attempt to get rid of symptoms actually creates a clinical disorder. The private experience, which is labeled as a symptom anxiety, produces a struggle with that symptom. So you're trying to control your anxiety and you're getting frustrated because you can't control your anxiety, which makes you feel helpless, which increases your anxiety about the fact that you can't control your anxiety. Does that make any sense? No. A symptom by definition is something pathological and something we should try to get rid of. But in reality, everybody feels anxiety. We are born with the fight or flight reaction. It's a normal feeling. It's what you do with it that can be pathological. So identifying the feeling saying, all right, my body or my brain is perceiving that there's a threat right now. Okay, let's take a look at that. In act, the aim is to transform our relationships with our difficult thoughts and feelings and learn to perceive them as harmless, maybe uncomfortable, transient psychological events. The thought that I can't do this anymore. That's a feeling. That's a valid thought. Now, do we need to hold on to that and perseverate on it or can we just let it go out the window? Destructive normality, I love this term. Act assumes that the psychological processes of a normal human mind are often destructive and create psychological suffering for us all sooner or later. Act postulates that the root of this suffering is human language itself. Now, some of the things that we've talked, you think back to the abandonment class and some of the other classes, a lot of our schemas are formed in early childhood, where we are thinking in concrete terms, where we are learning and relating in concrete terms, all or nothing, focusing on one aspect. So the verbal representation of whatever it is that is scary or threatening tends to be not as functional when you're an adult and you have more skills and more independence and more ability to survive on your own. So it's this language that tells you, I must do this all the time. I should have done that that can cause suffering. Memories, perceptions and schemas are created through analyzing, comparing, evaluating, planning, remembering and visualizing. All of these processes rely on human language. Think about a time when you were a kid. You're thinking about it right now. Most likely you're using words, maybe not out loud, but you're talking to yourself. You're like, I remember that time when I was six and daddy took me on the toboggan across the field.  So now I think of snowboarding and tobogganing as fun because that's the only association I really have for it. Think about this.   So if you think to yourself, I am stupid and really think about that for a while and keep telling yourself that it's pretty depressing. If you think to yourself, all right, I am having the thought that I am just a dummy right now. That's different because thoughts come and go. I can let a thought go. Another example that our clients may experience, I can't go on.  A feeling can come and it can go. I can't come and go. I'm either here or I'm not and, you know, I really want me to stay here for a while longer. So it's, we're looking or we're talking about attributions. We've talked about those before. Global, internal, stable attributions.  It's about me. It's global.    It's global. It's internal. It means it's part of me. So if I get rid of it, then I'm getting rid of part of me. What do I do with that? That's one of the reasons I don't like labeling disorders as because people say I am depressed. You have depressed feelings. You have symptoms of depression right now, but are you depressed? And I've got to be really careful with my language because I'll fall into that trap because it's just shorter to say I am depressed or I am an addict. But then people tend to personify that and I don't want them to do that. Experiential avoidance. Act asserts that human language naturally creates psychological suffering by setting us up for a struggle with our thoughts and feelings through experiential avoidance. There's a problem. I'm feeling anxious. I don't want to feel anxious. My solution, I need to figure out how to get rid of anxiousness or I need to avoid anxiousness and in my attempt to control it, I end up making it worse instead of just accepting that it is and eventually it'll just kind of peter out or making a choice to do something and we're going to talk about the act matrix at the end of this presentation. The more time and energy we spend trying to avoid or get rid of unwanted private experiences, that's thoughts and feelings, anything that's going on in our head, the more we are likely to suffer quicksand. Think about the old movies where somebody fell into a pit of quicksand and the more they struggled, the more they sank. This is what's happening with our clients. The more they struggle with their anxiety with the tools they have at that present point in time, the more they're going to sink. So what we need to help them do is just accept, okay, let me chill out for a second. I'm in the quicksand. Let me think about what I'm going to do. With addiction, the more people struggle to try to control their drinking, to try to control their addiction, the more they obsess about it, the more they think about drinking, the more they think about the pornography, which makes them want to do it. It gives them this really strong desire and then they get frustrated, especially if they do relapse or engage in the behavior, then they get frustrated, they feel depressed, they feel worthless, they want to go back to that behavior because it's a numbing avoidant behavior and then creates this whole dynamic of failure beginning failure. Anxiety and depression are the same way. When people feel them, often they want to try to get rid of them. So they try to pretend that they're not anxious or depressed. They try to confront the anxiety or the depression. Unfortunately, a lot of times they confront it in not so nice ways. So encouraging clients just to accept without judgment and that is so hard. Act interventions focus around two main processes. Developing acceptance of unwanted private experiences, which are out of personal control. When something happens, whatever it is, loud noise goes boom and you startled. That's an anxiety reaction. Now, am I going to get upset because I jumped and I startled or am I going to say I jumped and I startled moving on back to what I was doing?   That was an irrational reaction. It was what it was. It happened. Your body responded. And when we think about it, there's a loud noise you're not expecting. Startles probably a pretty functional response. We just let it go because then your cognitions, your higher level reasoning kicks in and says, no, there's nothing to be worried about. Car backfired or something. And a commitment and action toward living a valued life that is not getting stuck in this never ending quicksand. So the first step, confronting the agenda. The client's agenda of emotional control is gently and respectfully undermined. I like that.  What we want clients to understand and we need to come to an understanding of if we're going to use this technique is that controlling depression, controlling anxiety while doing the same things, it's not going to happen. So we need to try a different approach. Clients identify the ways they've tried to get rid of or avoid unwanted private experiences. This is commonly called creative hopelessness, which I really don't like creating hopelessness, but it highlights the fact that what you've done in the past has not worked. So let's see what we might be able to think of that might work and bring you closer to the life you want. Questions we ask of them. Did it reduce your symptoms in the long term? And of course, I'm hearing Dr. Phil in the back of my mind going, well, how's that working for you? What did this strategy cost you in terms of time, energy, health, vitality and relationships? So okay, you might have fought it for a while or whatever, but at what cost? And did it bring you closer to the life you want? Generally, if somebody is trying to reduce their symptom and it's having a bunch of costs, it's taking them further away from the life they want, because what they're seeing as costs are trade-offs. And trade-offs are generally things we trade off things that we want for other things. Confronting the agenda. All right. So we see that trying to control your depression, anxiety, addiction, whatever it is hasn't worked. You're here. You're ready to try something else. Score. All right. So let's try to think about it this way. Control is not, control is the problem, not the solution. And they're going to look at you like you've got three heads and that's okay. You know, I'm good with that. Clean discomfort is when emotions and reactions are accepted and it leads to a natural level of physical and emotional discomfort. Think about getting a shot. You know, I am a great big old sissy when it comes to getting a shot. Now, if I went into the doctor's office with clean discomfort, I'd just be like, all right, fine, get it over with. The nurse would jab me. It'd be over, but a bang. Oh, but no, no. I dread going there. I don't sleep well the night before. I dread going there. I sit in the doctor's office and I'm like, oh, this is going to hurt. My shoulder's going to hurt for the next three days. Perseverate on it. I get in there. And as soon as she puts the alcohol on my arm, even though I'm trying not to do it, I'm trying to control it. I tense my arm up, which means not only does it hurt more, but it creates a bruise and just cascade of effects. The same problem with emotions. When we start to struggle with our fear or with our depression and we start to lose, then we get angry at ourselves for not being able to control our fear or depression. And then we start to feel helpless and all these negative emotions just compound on each other. Dirty discomfort. Once we start struggling with that emotion, the struggle switch is what they call it in act is turned on. And it says, all right, ready go. Discomfort increases rapidly. The struggle switch is like an emotional amplifier, switch it on. And then not only do we have anxiety, but we have anger about our anxiety, anxiety about our anger, depression about our depression or guilt about our guilt, or all of the above. Some people are really talented and they can have like every negative emotion concurrently. That's not necessarily a beneficial talent, but I have known people who have, you know, basically gone through their behavior chain analysis and identified, you know, that they ended up feeling all of those feelings as a result of the initial negative feeling. So the six core principles. Once the emotional control agenda is undermined. Once people realize that trying to control this, you know, just trying to think it away is not going to work. Then we introduce the six core principles of act to help clients develop psychological flexibility. We all like flexibility. Diffusion sounds just like what it is. We're going to kind of diffuse this moment. Acceptance. All right, I'm going to accept it is what it is. Contact with the present moment. That observing self remember my fly on the wall values and committed action. So let's look at those cognitive diffusion is learning to perceive thoughts, images and memories as bits of language as opposed to something that's dangerous. You know, it's a memory. It's a thought. It can't hurt me now. I can choose to hold on to it. I can choose to magnify it or I can choose to just let it go in and out. Cognitive diffusion means stepping back and recognizing that thoughts are just transient, private, subjective events. What do we mean by that? It's not an objective truth. What happened happened. But what you are remembering is your subjective account of what happened. If you were scared, if you were depressed, think about a race. There are five runners in a race. One person wins and four people lose. The person that won is like score. They remember that event as very positive. The four people that lose, one person says, I need to work on my speed a little bit more. Another person says, I should have done better getting off the block when the gun went off. The third person identifies something else they can work on. The fourth person is like I am a total failure. They all ran the same race. But they all had different subjective interpretations and subjective memories of that event. A simple exercise that came out of some of the readings. Think of a negative self-judgment that takes the form of I am X.  I am lazy. Of course, we're going to think about negative stuff because our clients don't usually come to us and say, I am awesome. Believe it as much as you can. We talked about this earlier. Notice how it affects you when you repeatedly tell yourself that. Some of you are probably thinking back to Stuart Smollig and looking in the mirror and going, I am good enough. I am smart enough and gosh darn it, people like me. But anyway, when people hold on to a negative thought, then they start to sort of personify. They take on that negative thought and it affects them mentally. It affects them emotionally.  How does that work to make you less anxious? Then turn it around or add the phrase, I am having the thought that.  Notice what happens. Once you add that clause in the front or phrase. It's been a while since I had English. People start to notice a distance from the thought. And they also, like I talked about earlier, they're not talking about themselves anymore. It's not this global internal stable thing that they're talking about. It's not them that is X. It's a thought that's telling them they're X. And we can silence thoughts. We can make them go away. Diffusion techniques. Some things, and if you Google these, you can find lots and lots more. The mind. Treat the mind as an external event almost as a separate person. My mind is doing this. I don't have to do it. My mind is interpreting it this way. I don't have to necessarily accept to reject it. I can just observe what my mind's doing and be in awe. I'm having the thought that, helping people learn that thoughts are not causes. It's possible to think that thought as a thought and do X. Is it possible to think that this is really scary? But do it anyway? Certainly. Is it possible to think that I'm never going to get through this and get through it anyway? Absolutely. Thoughts are not causes. They are just interpretations or our mind's best guess about what's going to happen. Another technique is who's in charge here. Treat negative thoughts as bullies.  Have the person treat it like a bully and say, I don't have to listen to you. Or, kind of a radical acceptance approach here. This negative thought comes in my head.  Okay, you're right. So now what? What are you going to do about it? Instead of arguing with it, instead of kind of trying to contradict it, instead of putting it out here, they say, all right, maybe there's something to what you say. How can I fix it? What can I do about it that moves me closer to my values? And in ACT, we always want to have that clause on the end that moves me closer to my values. Acceptance means making room for unpleasant feelings, sensations, urges, and other private experiences. We don't have to let them set up shop there. But we have to understand or accept the fact that they're going to come and then they're going to go.  You know, just don't let them unpack and stay there for a while. We want to allow them to come and go without struggling with them running from them or giving them undue attention. So again, back to that family member. You have Uncle Bob and he is just the worst house-kissed. And he shows up on your doorstep one day and says, hey, I was just passing through town and figured I'd stay the night with you. And you're like, great. So you could you could struggle with Uncle Bob and say, no, you really can't. And he's like, oh, but why use a whole lot of energy trying to theoretically, tactfully tell him no, and he's not hearing about it.  That's not the best reaction either. And it takes a lot of energy or giving it undue attention and getting really upset that Bob had the audacity show up on your doorstep. Probably not going to do any good. So you can just allow him to come and go without struggling with it. Unhook, thoughts and feelings don't always lead to action. You may be really ticked off that Bob did this. But does it mean you have to act out in anger? Does it mean it has to ruin the rest of your evening? Not necessarily. What can you do to unhook your thoughts from your feelings? Identifying the problem. When we're battling with an inner experience, it distracts us and derails us. So if we're debating over something and we're, you know, just constantly going back and forth, and, you know, it's been scary before, but we know we've got to do it. Oh my gosh, I don't want to do it. Going to a reunion with Uncle Bob. Maybe you don't want to go because you know he's just going to get drunk and be loud and obnoxious. You can dread it and battle it and think about it and perseverate on it, but that just uses a lot of energy. So it goes back to that question of at what cost. You can explore the effects of avoidance and how that has worked in your life. You know, if you've tried to avoid Uncle Bob, not answered his phone calls, you know, we saw it didn't work. He just showed up at the doorstep anyway. So, you know, maybe we ought to just figure out a different way to approach it. Defining the problem. Identify what the struggle is against and barriers toward heading in the direction of those goals. I have a friend who just retired from the military and he struggles a lot with feeling okay and self-efficacy and everything. He's used to the military lifestyle. He's used to the camaraderie and it's terrifying to have to take on a whole new life now. So he's struggling against this anxiety and fear and everything that's keeping him stuck. So in ACT, in acceptance, we would look at defining the problem. What is it that you're terrified about? Let's list all those things and let's start identifying the barriers towards heading in the direction of those goals. I'm not saying you don't have a right to be terrified. You are what you are. However, I don't want you to unpack and stay there. And the serenity prayer. Change what we can, accept what we can't and the wisdom to know the difference. Too often people try to change the unchangeable like other people or the weather or a lot of things that we have no control over. So some things, Facebook for example, sometimes you've just got to turn off Facebook. Thinking about Uncle Bob. You've known Uncle Bob for 30 some odd years and he hasn't changed yet. So trying to change him now probably isn't going to work because he's happy the way he is. So we can either continue to try to change him which is not going to work or accept the fact that he's just Uncle Bob. I hope nobody out there has an Uncle Bob. So if you do, sorry, was not meant to actually pick on him. Contact with the present moment. Bringing full awareness to your here and now experience with openness, interest and receptivity. Focusing on and engaging fully in whatever you are doing. So when you're doing it, focus on how do I feel?  What am I thinking about?  Or maybe you've got a patient in 18 minutes and you're trying to figure out, all right, what do I have going on with that patient? Contact with the present moment would theoretically be staying focused right here, right now. And trying to identify things that relate to this presentation. Thinking about clients that that's worked with or thinking about how you might use this in further sessions today. Even if you can't stay completely attuned to my voice. Not everybody's not a Tory learner. I get that. Not a problem. Focus on what physical sensations you're experiencing. You see me sitting in the chair and I am a very active talker. But I also move around in my chair a lot. I'm just that way. Physical sensations can be, are you hot? Are you cold? Is your leg going to sleep? Are you sitting on a hard chair? Think about, you know, we're supposed to think about when we're doing computer work. Are we sitting with good posture and relaxing our neck and shoulders? Describe the environment. Smell, temperature, colors, objects, people, sounds, et cetera. Challenge yourself to take, you know, a break every hour or every two hours. You know, not everybody has the luxury of having an hour to do it. And go through these and just bring full awareness to the here and now for a week. Every hour throughout the day that you're awake for a week. Practice becoming in contact with the present moment. See what happens. It may not have any effect, but my guess is it will. You can also do this through a simple I see, hear and smell blank. And it reminds me of. Whenever I smell pine salt, it reminds me of my grandma's house. So that's a pleasant memory for me. When I smell that, it triggers happy sensations and happy neurochemicals and happy, happy, happy. So guess what I clean my house with? The observing self. You know, I told you I love this little fly accessing a continuity of consciousness that's unchanging ever present and impervious to harm. Have you ever tried to get a fly? I am not good at getting flies. The flies in my house are impervious to harm and they just sit up on the wall and laugh at me. So from this perspective, yes, I've got some paranoid delusions, but we're moving on. From this perspective, it's possible to experience directly that you are not your thoughts, feelings, memories, urges, sensations, images, roles, or physical body. So if you imagine yourself to be the fly on the wall, you can look down at that person of you and go, gee, why is she doing that? Or that's crazy or a score, having a good day today.  So this fly is seeing the peripheral you. This fly is just looking and seeing you act or react the way you do. Think about if you get a new dog, and especially an older dog, a rescue dog, and they have some behaviors and you're like, where did that come from? Contextual. What's going on? What did it get them in the past? But the dog is also sitting there watching you going, are you sure you want to do that? So values, clarifying, what is most important deep in your heart? And some people hate that phrase, but when it comes down to it, what is most near and dear to you? What sort of person do you want to be? What is significant and meaningful to you and what do you want to stand for in this life? Now any of those could be an entire essay, and you could spend, you could have a client do one each week for four weeks to help him or her start identifying their values. Stephen Hayes has a whole series of books that walk you through these six steps there. Guess what? Six books and help you help clients more effectively implement the six components of ACT. But clarifying, he has a whole book on it, so obviously it's not just four bullet points. There are a lot of different ways to help clients clarify their values versus what they were told they should think or should feel. A lack of values or confusion of goals with values can underlie the inability to be psychologically flexible. So if you're confusing a goal with a value, I want to be rich, that's not a value. What is your value? That's a goal. Why do you want to be rich? Why do you value money? Talking about that. The next step in the ACT process is choosing a direction and establishing willingness, identifying motivating values. What direction do I want to go? And again, how does it get me closer to where I want to be and who I want to be with? And establish a willingness to help regain control of life, not necessarily just to control thoughts and feelings. So I'm going to take control of my life and I'm going to understand that there are going to be bumps in the road. But I'm also going to understand that I'll also get to feel the good things because I'm in contact with the present moment. That's right. Committed action, setting goals guided by your values and taking effective action to achieve them. Sometimes this is called purposeful action. Everything you do has a purpose and that purpose is to get you closer to where you want to go, not to set you backwards. And I told you we would end with the ACT matrix and that's a whole different book. There are activities on psychological flexibility that work with this, but to try to kind of put it all into context and tie it up with a handy little bow. On the top of it, you have your behaviors and your five cents experiencing. What's observable to others? When you walk into a room, what do others see? Others see you. Others see the other people in the restaurant. Others see the expressions on your faces. Others can feel the temperature of the room, but they don't know what's going on inside your head and they don't know what you're thinking. Down at the bottom are your thoughts, emotions and internal experiences. Now this project or this activity divides this into four quadrants. So when you're looking at towards the left side, you're moving away from your goals and values. So what do I do that moves me away from discomfort and how is this moving me away from my goals or values? So a lot of times clients will come in and they'll say when I'm really stressed out, I have a few drinks. Okay, that's what you do and we're not judging, we're not doing anything. We're just writing it down. So we put have a few drinks up here. What am I thinking or emotionally experiencing right now that's moving me away from my goals? A lot of times it's fear, depression, anxiety. This is why they're here. So you take that dysphoria. I'm just going to generalize it. And when you feel dysphoric, you drink. So then the person is stuck on this left side of the activity, this left side of the quadrant thingy. Because once they drink, then they've just intensified, they haven't fixed anything, they just escaped for a little while. So then they sober up and they're still dysphoric. Then we move over here and say, okay, what's moving me toward my goals? Well, first I have to know what my goals are. So what and who is important to me? What am I thinking or emotionally experiencing that's moving me toward my goals or values? And these are things like accomplishments, success, happiness, observable things, things that other people can see that are moving you toward your goals and values. What could I do to move me toward who and what is important to me? And what am I doing right now that is moving me toward my goals or values? So when something happens, people are in maybe somebody's in a bad relationship and they decide to break up and it's excruciating and they are just, you know, they're in agony over this relationship loss. So they're down here, they're feeling something negative and they want to escape. But then we say, okay, that is definitely one thing you could do. However, does escaping move you more toward your goals and values? Does it move you toward where you want to be? The answer is probably no. So then we say, okay, what could you do that would help move you toward that? Or maybe they're thinking of getting back in the relationship. That's one of their options.  Now we say, okay, is that going to move you toward your goals of being happy and successful in everything you've identified? Or logically, is it going to move you away from? I mean, this is all just very, I don't want to say clinical, but it's very factual. Encouraging people to just keep that in their head. Every time they do something or have to make a decision or have a thought, if they have a thought that says, you're stupid, they need to ask themselves, is that self talk that's going to move me toward my goals? Or is it self talk that's going to hold me back or worse yet move me further away from where I want to be six months from now? The goal of ACT is to create a rich and meaningful life while accepting that pain inevitably goes with it. It happens. Part of living a meaningful, rich life is being aware and in the present moment, most of the time. I mean, in reality, we're not going to stay completely grounded and present 24, 7, 365 because we get caught up in work, we get caught up in stuff, but if we can encourage ourselves to do it multiple times a day, then we're going to be more aware of where we are, how we are and how we're feeling. Destructive normality is the psychological process of a normal human mind, which can be seen as destructive and create psychological suffering. People start to feel that they're helpless. They're trying to get rid of something that's normal. You feel anxiety. That is a normal feeling. That is a normal reaction. I totally get why you feel that right now. What do we do about it? Actions designed to avoid the experience in the present are not going to be helpful. We want to help people just identify and accept. Therapeutic interventions focus around two main processes, developing acceptance of unwanted private experiences, which are out of personal control. So that automatic thought, that automatic feeling, it happened. Now, there's no need to beat yourself up for it. It happened. Let it go. If you give it attention, it's kind of like a stray dog. If you give it attention, it's going to keep coming back. Trust me, I have more than one stray dog that comes to my house. Whoops. Anyway, commitment and action toward living a valued life. Once you've decided to try to quit controlling the things that you can't control, then you can use all that energy toward making decisions and taking action to move toward where you want to go. How cool is that? If you quit being stressed about being stressed or worried about being angry, you have a whole lot more energy to do what you want to do. This also applies to holding on to resentments. We talk about people using a lot of energy to nurture grudges and resentments. That feeling, whatever that feeling is, is something that they can choose to let go. You don't have to continue feeling resentful. You can choose what to do with it. Confronting the agenda to eliminate distress, you're not going to eliminate it. It's going to happen. Explore sources of distress. Explore prior attempts at removing distress and that effectiveness. How did that work for you in the short term? It may have worked great. How did it work for you in the long term with regard to what was the cost and how did it impact the other areas of your life and did it move you closer to or further away from your goals? Finally, the six core principles of act are diffusion, separating self from the experience. Acceptance is what it is. Contact with the present moment through mindfulness. Observing the self as a fly on the wall. Values identification and then choosing committed action.


All right. Hello, everyone. Welcome to the developer hours. This week we'll be talking about the WordPress Playgrounds. We have Adam, and I'm sorry, I should have got sure how to pronounce your last name before we started as Zelensky. Yeah, Adam Zelensky. Okay. So nice to meet you all. Yeah, that's great. So if you want to be on video, you can. And this will be recorded and put on WordPress TV. I do ask that everybody remain muted during the presentation. We will have a Q&A portion at the end. So I'll invite you to turn on your mics then. In the chat notes, I will be linking to a couple of projects, this specific project and its documentation. For now, Adam, can you just give us a bit of your background and your involvement with WP Playground? Absolutely. So WordPress Playground is a project I started last year in an attempt to be able to teach WordPress on a website. So every single course starts with a setup that takes maybe some hours, maybe some days if you're less familiar with WordPress. And I just wanted to be able to write a course. I couldn't do that. I needed a full WordPress with REST API, all that on a server. That would be insanely difficult to make it available for like give every single student a separate WordPress. So then I thought, what if you could do it in a browser? And it turns out that was possible and that evolved into WordPress Playground. I'm a software developer working with Automatic for the last five years, for the last two years with WordPress. I'm a WordPress core committer also. And WordPress Playground is kind of my dream of solving WordPress setup issue slash accessibility issue. Awesome. Thanks for that information, Adam. Before we begin the presentation, I have a few announcements. WordPress 6.3 is in development at this point. So I look forward to everybody hopping over to track or get up and taking a few tickets and getting involved in however you can. WorkCamp Europe is from June 8th through the 10th. WorkCamp US is August 24th through the 26th. That's a little bit earlier than I spent in previous years. So keep an eye out for tickets. And there's more local work counts being scheduled. I'll share the link to Central WordPress and these other things in the chatroom. So that's just a bed of house cleaning. And we can get over to the presentation of WordPress Playground now, Adam. I'll just turn it over to you. Awesome. Perfect. I'm going to share my screen now and start the presentation. So just a little bit of a setup. All right. So WordPress Playground. And I just to confirm, are my slides visible on the screen right now? Yes, I can see them fine. Perfect. So WordPress Playground. This WordPress is running in my browser and it uses only JavaScript. So there's no MySQL and there's no PHP and there's no server at all. In fact, this is just JavaScript. So it's called the WordPress Playground and I'm about to tell you what you can do with it, how does it work, and how to start using it pretty much today and build something with it right after this presentation. So the primary problem itself is that WordPress is difficult. And I don't even mean building a website with WordPress, but just starting your journey with WordPress. So if I'm a user and I want to start using WordPress, someone told me WordPress is really cool. You should check it out. I'm going to type WordPress in Google. And then I find out this installation page that tells me to install a lot of stuff that I'm not familiar with. I have no idea where to even start installing something like Apache or MySQL. So maybe I'm going to look into something else. Alternatively, I could pay a hosting company, but I don't want to do that just to check what WordPress is. And if I'm a developer, well, I want to learn WordPress, but every single course starts with a setup like this. So I have to go and install a bunch of stuff and set up a local environment and something like Next.js maybe has a live tutorial on the website. Or, yeah, so maybe I'll go and check that instead. Or if I'm in a product team and my friend, my colleague, sent me pull requests to test. Well, I don't have a local testing environment and I don't have a staging server, so I'm kind of stuck. I'm not sure how to proceed with this. Or if my company builds a WordPress plugin and I just want to be able to show it to my potential customers, well, I cannot build that easily. I have to use videos and screenshots because I cannot give everyone their own WordPress that would be pretty expensive. And if I give everyone the same WordPress and WordPress admin access, people will change that content. That's not something I want. So when it comes to WordPress, it is quite hard to install it as a new user. It's hard to start learning it, then test changes and then distribute code. So what's exactly easy about getting started with it? Like, this is a pretty exhaustive list of things I want to do as a newcomer. And there are some existing tools to make that easier, like there's local and WPNV. And they helped me with installation and testing, but I'm not going to embed a local on my online site, on my home page. Or I'm not going to be able to use it in my course as a live thing. And then I need to download things and I need to install them, which means I need a desktop device in the first place. What if I only have a phone? So WordPress Playground is a way of solving all these problems with a single click of a mouse. So installing WordPress, well, click and it's done. This right here is the actual demo on developer.wordpress.org. And all these links and notes are going to be shared in a Zoom chat, by the way. So I can go there, I just chose a theme, a few plugins, and it's already live. This is my own WordPress running in my own browser. It's an actual WordPress installation, right? It's not the same WordPress that everyone else is using. This is my own WordPress installation. If I want to learn how to code with WordPress, well, it can look like this. So this is an article that I have published on my blog. It uses part of WordPress Playground called PHP WebAssembly. I'll be talking about it later on. So this is an article teaching a new API in WordPress 6.0. It allows you to manipulate HTML. Anyway, there's a code snippet right in this article. And I can change it so I can run it. It's going to execute and then I can change part of it. So I can say hello, WordCamp. And if I run it, well, it's going to rerun right in my browser. I didn't have to install PHP. I didn't have to install any development environment. I just visited an article. I clicked it. It worked. Furthermore, if I'm only a prospective developer and I'm thinking about maybe switching careers and I'm learning programming right now, well, I can do it on a phone or on a tablet. I have a break right now. I'm on a train. I have some time. I don't have a full-on laptop, but I have a tablet. Well, sure, this thing works. I can use it on mobile devices. There's no need to install anything at all. And once I'm ready to develop with WordPress locally, I don't have to install the PHP server and my SQL and all of that. I can just go to my Visual Studio Code, install WordPress Playground Plugin, and it's going to give me a WordPress development environment. So I can start modifying WordPress if I want to, if I want to just write a simple plugin like... All right, I don't have that slide. If I want to just write a simple plugin, I can do that. I can develop themes. I only have to click a button, install the extension, and in the sidebar, I'm going to have a start WordPress server button that will do everything for me. So I can start it super easy. Then if I want to test code changes, click and it's done with WordPress Playground. Like this time, when we have a pull request, there is a link in here that goes to playground.wordpress.net, which is the official demo site. And let's take a look what happens when I click it. So this one adds a secret message to WP Admin. And if I go to that link, well, my pull request is already applied there. And I don't have a staging environment. I don't have a server. Well, let's test it on PHP 8. Oh, there's an error here. Well, good thing it was easy to test, right? I only clicked a button and use a different PHP version. So WordPress Playground can also do that. Finally, if I want to showcase my plugin in my home page, make it very easy for people to use, well, instead of using videos, I can just put WordPress in there. So this is a WooCommerce store. I can open a product. I can add it to my cart. I can view my cart, go to checkout like it's an actual WooCommerce store live in my browser. I don't have to, oh, and this is how it's implemented by the way, the live demo takes about 24 lines of code for the developers here. So this is not hard at all, right? WordPress Playground makes these things very accessible. So I'm going to tell you in details how to get started with building these apps. But first, let's take a look under the hood and see how exactly WordPress Playground works, like what makes WordPress usable inside JavaScript. So WordPress, I have a Polish word here. WordPress Playground consists of two parts. There is a PHP that's working in the browser and there's WordPress that's working without a server. So PHP working in the browser is enabled by a new technology known as WebAssembly. WebAssembly is just a way of building the software that we know from regular computers and desktops and servers into JavaScript or a format that JavaScript can understand. So in this particular example, PHP interpreter, like PHP, the programming language, that's also a program and that program is created in a C programming language. So this is how a simple C program looks like. This just prints hello world on my screen. So classically, if I wanted to use that on my desktop, I would need something called a compiler that would create a file and then I could execute that file. So maybe on Windows that file would be called hello.exe. Maybe on a Linux it would be hello.out, but I can run it and when I run it, it prints hello world on my screen. So it turns out if I want to do the same thing for WebAssembly to be able to run this in a browser, I can also do that. I just need a different compiler that can build it to WebAssembly and JavaScript. So that compiler is called mscripten and when I run it, I'll also get executable files, a WebAssembly file and a JavaScript file and then I can execute them anywhere I have JavaScript. So I can do it in Node.js, I can do it in a browser and it's going to print hello world all the same. So now I can take a regular program and make it into a JavaScript program. So back to PHP interpreter. This is a C program in itself and this means I can take a PHP source code and use mscripten to create a WebAssembly program out of it. So then I can take that and execute PHP code in a browser. So I know there's a lot of concepts here. There's a C programs, PHP programs, executing things like the most important takeaway is that I can take PHP, the programming language and I can put it in a browser and then I can run PHP code. Oh, and PHP has plenty of versions and WordPress Playground supports many of them. So this looks more like this, right? We have a set of files for every single PHP version. So switching versions, as we've just seen in the demo when I was testing that pull request, that's actually pretty boring technically because I only tell the browser to download a different WebAssembly file. Like it's just static files. So then we also have WordPress without a server, that was PHP and this one gets even more interesting. So normally when you want to run WordPress, you need to download WordPress, install it and then open it in your browser and start navigating. So downloading WordPress, that's a solved problem. You go to WordPress.org, you click download, you have a zip bundle and the browser can do the same. There is a fetch API, you can use it, you can download zip files, that's fine. However, installing WordPress is a bit more interesting. So classically to install WordPress, we need a MySQL server, right? Database server and then during the installation process, WordPress will ask us what's your database cause, username, password, all these details. Only problem is in the browser, we don't have MySQL. So how do we exactly install WordPress Playground? Well, WordPress needs to store its data somewhere and instead of MySQL, we use a database called SQLite. There is a SQL translation layer in between WordPress and SQLite and by the way, that's an official plugin. You can download it, use it in any WordPress project you have. But in WordPress Playground, we pre-install it and we use it so that WordPress thinks it talks to MySQL but the translation layer actually takes any database query, rewrites it in a different format since it's over to SQLite, gets the results and translates them back for WordPress. So WordPress thinks it has MySQL that it needs, it's a hard dependency, but actually we made it work with a different database. So that's the installation, but we still need to be able to open WordPress in a browser and navigate it. So to do that, we need to solve a problem. Classic WordPress works in this way. We have a web browser, we have a server somewhere in the Internet with PHP and WordPress. So our web browser tells it, I want the homepage of your site and the server renders it, sends it back, all that happens when we type the address in the browser, like mywebsite.com. In case of WordPress Playground, well, there is no server anywhere remotely. So we cannot ask that server through the Internet. So instead, we take that server and we put it inside the web browser. So web browser now has two functions. First, it is a device to browse WordPress, to navigate through the pages, log into admin create posts, but it also plays a vital second role and acts as a WordPress server. So the only remaining problem is how to force that browser to use that server when you type something into your browser address bar. And to do that, WordPress Playground uses something called Service Worker, which is a, well, kind of like traffic controller for your network traffic. So it stands between the web browser and the Internet, and it says, well, this part of the traffic goes to the Internet, but this other part, I want to handle it on my own. So what we do is we redirect every single web request that would normally go to the server back to the browser, to a WordPress server that runs on our device. So that's it. We have a downloaded WordPress. We've installed it with a SQLite as a database. And now we can also navigate it. So what to make out of all of it? Well, let's see how WordPress Playground can be used to build things. So there are four ways, or primary ways to use WordPress Playground. The first one is very simple. It requires no coding at all. And then there are progressively more powerful, but also more difficult APIs you can use. So let's take a look at the no code way. To use Playground without code, you can go to playground.wordpress.net and you immediately get your very own private WordPress instance. And by the way, everything you do there stays in your web browser. The data is not sent anywhere. It's not shared with any external service. So you can import your website there. You can try any risky changes, like switching a theme or updating homepage content or installing 20 different plugins if you want to. It's completely safe. And if you want to start over, you just refresh the page in your browser, you get completely new WordPress. So without a code, you can also do a couple of other things that I'm going to show you in just about a minute. You can build a theme or an entire site and you can save it. And once you save it, you can import the changes to your own website or you can host anywhere you want. You can try a plugin or 20 plugins or a theme. And you can also test your code. If you happen to be a plugin developer, you can test your plugin on multiple PHP and WordPress versions. Then the next way to use WordPress Playground is through something called a query API. And query API is a way to take WordPress Playground and embed it in your application using an iFrame. So this code snippet right here looks like the preview at the bottom. So we put an iFrame on our site, we point it to playground.wordpress.net and we add a little something to the address. In this case, we say theme equals pendant. And this tells WordPress Playground that we want to use the pendant theme from the theme WordPress theme directory. So it's going to download it for us and install it and activate it. And that entire process is automated. So there is more to it than just customizing themes. You can also challenge to pre-install a plugin or multiple plugins. You can challenge to visit a very specific page once it loads or to use a specific PHP or WordPress version. That's just by appending things to the URL. And in fact, the demo on developer.wordpress.org, the one that was on the very, very second slide on this presentation, the one where we were selecting themes and plugins, it is actually built on top of the query API. So whenever I select a theme and a set of plugins, all it does is it prepares this query string that says, oh, plugin coblox and plugin BBPress and theme skatepark. And it uses that to load WordPress Playground and inside that iframe, all this work happens. So these things are downloaded, installed, activated, and then I get to enjoy a site where all of it already works. So in short, like that demo, it is very simple, right? Like all the work happens inside WordPress Playground. The only thing that demo has to do is to come up with the correct address to load it. Another way to use WordPress Playground, the one that's quite a bit more powerful, is so-called blueprints. So blueprints are JSON files that describe all the steps necessary to set up a specific playground instance that I want to have. So with blueprints, you can do everything you can do with query API and more. So we can run PHP code during the setup. Like this blueprint on the screen right now is going to create a post in my WordPress. You can tell it to login. You can create any PHP or any other file you want. You can install plugins not just from WordPress plugin directory, but any plugins at all. And you can do even more than that. There are some use cases described in the documentation and, again, like one of the links on the chat will point to a resource page where that's mentioned. And you have a ton of control over a playground instance. And this API is also quite approachable. You don't have to understand JavaScript. You don't have to know how to code. If you know how to write code, this is perfect. It will help you run pre-configured site with PHP. But you don't have to know that. You can write JSON and declare what you need. And this API can also be tried out pretty quickly. So documentation has some life examples using blueprints that you can just click try out and it will run them. And then you can customize that code and see what happens. And the way to use blueprints, technically, you also don't need to install any node packages or you don't even need to create a HTML page or a JavaScript file. You can literally write a blueprint and then paste it in the URL bar. I will show that in a couple of minutes. So with blueprints, excuse me, with blueprints, one cool thing was built with blueprints. So this on the screen right now, this is called Translations Playground. And it is a website and if you go to it, it will download translation files for WordPress. It will install Glotpress plugin. It will install a plugin of your choice. It will activate it all and set it all up in just the correct way. And then it will allow you to start translating WordPress right in your browser. So we don't need any setup at all. You can just visit a link and it's all there. And once you're done, there is a button to propose these translations for official WordPress translations. I'm not sure that's a proper name. And this even has integration with chat GPT. So you can literally use chat GPT to translate WordPress in your browser with no setup at all. So this was built using WordPress Playground by Alex Kirk. And there's a URL and it will be also mentioned again in the resources section. So finally, the last way to use WordPress Playground is JavaScript API. And this is available through an NPM package. So we have to have a developer and environment and you have to install it or reference it through a package URL. And this one has the highest barrier of entry, but it also gives you the most control. So this on the slide right now, we start Playground connection. We give it an iframe. It loads in there, create a file. We run that file. We can issue a request to WordPress. We can do anything at all. We won't like download anything from any URL. We can install like 50 different plugins and some of them are private. And we can put like 10 themes in there and we can put like a tile layout of 10 Playgrounds each with a different version of WordPress and PHP if you want to install it, if you want to test your things like very efficiently. All these things can be done with the JavaScript API. The downside is that you have to know JavaScript and install it and then like probably read a little bit more carefully through that documentation. So it is an excellent way to use it. And in fact, like Blueprints API and Query API are both built with that. But there are also other APIs that you can use to make it simple. Like in fact, the Translations Playground that I showed like Blueprints are so powerful that this app was built with Blueprints. So this is the last slide that I'm going to show but I also have a short video to share of what you can do specifically with less code or sometimes no code at all. So where is my mouse cursor though? Oh, right, there we go. So with WordPress Playground, you can create... This is WP Admin. It's a Playground that we've all just seen. So we can install plugins in there. And one way to do it is, you know, like if you want to install a Gutenberg plugin and a Query Lock theme plugin and a Skatepark theme, we can literally download them and go to plugins in WP Admin, add new and start. So first thing we're going to see there's a little error and that's because as I mentioned, WordPress Playground is private. It doesn't send any data anywhere. So it cannot communicate with plugin directory. Like that's one downside of this. So we want to be able to see it at least from directory, but we can upload them. And I'm just going to click on this upload button and upload zip files. In there. So... There's one. And we're going to install it and activate that. And we're going to go through this process with the Adder plugin and with a theme.  So we're about to find out what other way there is to do that. And we've already seen it today. So... Here goes a theme. We install. We activate it. And it turns out like... This WordPress already has these things once we did it. So here's a skatepark theme. And in WordPress Admin, we can see there's a Gutenberg position in the menu. We can go there. Yeah, there's the Gutenberg editor demo. So that took a little bit of time. We could do it, which is great, but here's a more automated way. So instead of uploading everything manually, I'm going to start over. So I refresh the page. I have a completely new playground. So right now, in the URL, I'm going to use the query API. So I'm going to say theme equals skatepark and plug in. Did I just drop out? Yes, I was just about to start chatting about something completely different, but you're good. All right, let me... Let me share my screen again. Sorry about that. So once again, I need to rewind this a little bit. Sorry about that. So I'm going to install plugins in an automated way right now. And to do that, I'm going to type theme equals skatepark and plug in equals Gutenberg and plug in equals skatepark theme. And when I press enter, that's all I need to do to tell playground, hey, handle that for me. I don't want to download things, upload them, activate, just do it. Figure this out. And that's exactly what's happening here. This is the exact same website as we've set up manually. Only took like 10, 10 slides. And these plugins are here. Gutenberg demo is active. And I can just start doing whatever I wanted to do. To do with this playground instance. So this is probably one of the most easiest way to start building things with playground. Now let's build a theme inside WordPress playground. So we still have our plugins. There's a Gutenberg create block theme and skatepark. So I go to site editor, and I'm going to inside editor, start customizing the site for a little bit. So I'll change the background. I'll make it blow. Let's make it blow.  And to save you 10 minutes, I sped it up. So maybe different fonts, line heights, all this. So now I'm done. And I can go in options to create book theme. And in the site bar, if I scroll a little bit, there's an export button that I can press and download this entire theme that I just built as a zip file. So this has all the files needed to import that theme in a new WordPress. So if you go to playground WordPress.net, again, this is the new instance, fresh one. We go to appearance themes. We only have one theme right now, but I'm going to upload that file that we just downloaded. And when I do that and I install it and I activate that theme, well, we have all our customizations in place. So I just built an entire theme in Playground. I started by forking an existing theme, made a bunch of changes, downloaded it. And now it's good to go. And any WordPress out there can install it and use it. So that didn't require any setup at all. So this site is a bit empty. And I'm going to import some content to it. And WordPress allows you to export your content and import it. So I'll go to tools and import. And I prepared a file earlier on that and can now upload in the importer. So going to select it is an XML file. It has a testing content for themes. And I'll also have to select the author for all the posts. So once I submit it, first thing we're going to see is a bunch of errors. And that is because these files are remote, right? So WordPress Playgrounds will not go to the Internet and will not download the media files. That's a thing that may be there one day. But other than that, all my content is in place. So I can go through pages. They have a bunch of content. I can just make themes with different layouts and headings and all that. So let's go a step further and build that entire site in Playground. So this is the documentation site for WordPress Playground. Let's recreate that in our new theme using our colors and fonts and global styles. So I'm going to copy that content, find a pattern that seems the most useful. So this is a two column pattern. And I'll just space this content here and do a bunch of other ranking. So again, let's speed it up. I'll put a video here, like some colors, adjust the money. And after a couple of minutes, I'm going to have a website that has that documentation homepage in it. So WordPress Playground, there's a description, there's a video with our buttons. So that looks pretty good. Oh, and notice this is a preview in a new tab. So I want to save it because I wouldn't like to lose it. When I refresh WordPress Playground page, that will be lost. So let's save all of that. So there's a little button in here that I can click. And this is an export button. What it does is it downloads the entire site. I have in WordPress Playground. By entire site, I mean, well, let's open this. So all WordPress core files are in that zip. Did I just stop that video? I might have. Oh, no, it's playing. It's just a very long pause. So I can unzip that file. And all WordPress core files are going to be in there. And that's unsettling movie long. Well, something's wrong with my quick turn. That's me. Oh, they can call issues. All right.  I'm sorry for that. Please give me a second. Well, all right. I'm not going to be able to finish that video. So it seems a little less for that, but I'll use, I'll paint the picture with, with my words, hopefully. So if I take this file and I unzip it, it's going to have the entire WordPress website. All WordPress core files like WP content and WP includes and WP admin in it. There will be all plugins that I installed in there, all themes and even the entire database as a sequel, light file is included inside. This means I can take this zip file and I can host that website on any web host out there and it will work. And I can also take what I just built and I can transplant parts of it to my running site somewhere else. And then once I want, let's say I want to share that with someone, well, I can go to Slack and I can drop that file in there and another person can take my WordPress Playground zip with my site that I just built, open a Playground themselves and they can just import it in there. There's another button in WordPress Playground UI right, right next to the one I used to download this, it's for importing and it accepts this exact type of files. So I can go to WordPress Playground, I can build a site, I can download it, it has everything in it. I can share it with other people and then I can also pause working on it, resume later, re-import it to some more changes, this kind of workflow. So one last thing that I had on a video that I'm going to stop right now was testing Playground with specific PHP and WordPress versions and I already gave a glimpse of that before on the slides. So if I wanted to try my new site with WordPress, let's say 5.9 and PHP 5.6, I could do that by importing it, setting the correct version and then I would see, oh, it looks right on 6.2 and 6.1 WordPress versions, but then on 6.0 that I also really wanted to support, well, there's a visual glitch and maybe on 5.9 it cannot be imported at all, like there's an error. So that's a very useful thing to learn from your own testing. You don't want to build something and then have people tell you there was an error in it. So once you do all that and you want to build yet another site, you can do that by simply refreshing the browser tab. So one last thing I'm going to share visually is the documentation page. And again, like the chat has a link or will have a link. I'll make that a little bigger. So this is WordPress.githubio slash WordPress Playground. And in here, I can click right now that the demo I showed before, I can get started. And in this section, there are all the APIs that we discussed, query API, there's some blueprints, JavaScript APIs. They all have reference here. They all have examples, there are tutorials. You can start using WordPress Playground in five minutes and it covers trying out blogs, themes, plugins, saving your site, all these things. And there are even if I go to get started with blueprints and I go to paste blueprint fragment. Well, the way to use blueprints, as I said, you can just paste them in URL. Like I write some JSON and then I go to playgroundwordpress.net slash I put this little hash sign here. And then I just paste what I wrote, right? No development environment required at all. So one cool thing about blueprints 2 is that a bunch of them have live examples in the docs. So if I click try it out, it will start WordPress Playground instance with this. So right now I can only click it and play with it and see like WordPress 5.9. This is the same version. So right now I can only try this example. In the nearest future, this will be interactive. So we'll be able to also play with it right here. And that's all I wanted to share during this presentation. I think we can open it up for questions. All right. Thank you, Adam. That's really great. So I'm already thinking of ideas. I want to use it myself. But yes, I do want to open up the question and answer portion of this session to everyone. I don't know that we have the Q&A enabled on this meeting, but you can ask directly in the chat or you can, you know, turn off your mic and just ask us any questions you want. Is it possible to export and import Playground files to GitHub? Sure. So there isn't a button that will do that for you, but you can absolutely download your entire site or export parts of it. And then you can put these files on GitHub yourself. What would be, like, what are you thinking of? Like what's your case? Because that sounds interesting. Everything in code. I'm using WordPress Engine, Patent Manager, and I just made some patents. Those are written to my theme, and I just want to make a little commit and push. Oh, gotcha. So let me see if I understood you correctly. So you're working with patterns, and you would like to modify a pattern and then just push your changes to GitHub. Is that right? That's right, exactly. Given that WordPress Engine, Patent Manager plug-in automatically writes patents to the theme. So that's taken care of. Where is that? Where's the code? All right. So I don't know much about WP Engine, Patent Manager, but it writes that to a theme. If that's a local file, like a PHP file, then one of the things I showed on the presentation was the Visual Studio Code extension for WordPress Playground. So this is not in the browser, but if you have Visual Studio Code and you run WordPress Playground there, like it will set up an entire WordPress for you, you'll be able to work with your patterns, preview them, all that, and then commit these local files. If you are looking for in a browser workflow, then I guess you would have to, at the moment you would probably have to download the entire site and work your way from there. But that is an interesting use case. So one of the things we want to do in the future with WordPress Playground is have an entire development environment in one way or another. So there would be a code editor, there would be a terminal emulator, you would be able to use WPCLI, and perhaps there would be even Git integration, right? So then your workflow would look like this. You would go to a website, you would do your magic, and then right there you would have everything you need to project to Git. So it's not so integrated today, but it will be possible in the future. Okay, that's a fantastic answer. And another example very similar would be using the Create Block Theme plugin, where you overwrite with your customizations. You've done some customizations as you showed during your presentation in the site editor, and I just want to get that in code. So I use the Create Block Theme plugin to get that code overwrite using the overwrite option of that plugin. And it does the same thing. It writes to the code. If I did that while I was in the Playground, where would the code go? So Playground, if you use Playground in the browser, it doesn't have access to your local disk yet. That's a feature that's coming. So that will be really cool. But for now, all the files live in memory. So like there's actually like a huge JavaScript object that pretends to be a file system, and there are directories in it and entries that represent files. So whenever you write a file, whenever you update a PHP file in there, it actually updates an entry in that object. And the export function, the way it works is it tells PHP to zip your entire WordPress directory using that file system, that JavaScript object, and then it downloads it. So the files live in JavaScript at the moment in the browser version. If you use the VS Code version, they leave on your disk, and these are your regular files. All right. That's good. We have a question in the chat from Kaiser. Is every WordPress instance we are building in Playground, does it run inside of Docker? Oh, there's no Docker involved at all. That's the magic of WebAssembly. So WebAssembly is this new technology that allows you to run regular programs that you only could run on desktop computers before. It allows you to run them inside JavaScript. So everywhere you have JavaScript, like browsers, Node.js, Visual Studio Code, you can run in this instance PHP. So PHP runs directly in the web browser. I know it seems like magic, but it's actually true. You get that statement right. PHP runs in the browser. PHP runs inside JavaScript. So WordPress Playground runs WordPress, PHP software through JavaScript thanks to WebAssembly. So there's no Docker involved at all. It's just your browser job. And that's why the minute you close your browser tab, your WordPress is wiped and you can start from a clean slate. And that's also how it works on a mobile device. You cannot install Docker on an iPhone or on an Android tablet. But about Android tablet, I'm not sure. Maybe you could jailbreak it and work something out. But point is Playground allows you to just open, go through a link, and that's it. The entire WordPress works there. No prerequisites, no dockers, no Apache servers, no package managers. It just works. Did I answer your question? I hope so. From Kaiser, let us know if you need it. Okay. Yeah, he said yes. All right, so next question from chat. I believe you've maybe already kind of answered this. Will uploaded media also be stored temporarily? Yes, there is no server behind all that. So it's not stored anywhere else. It's not in a cloud. It's not on someone else's computer. In fact, you could argue it's not stored at all. It's just in a memory of your computer. So WordPress Playground has this upcoming feature, that will allow you to use it in a persistent mode, sort of. So like you'll be able to open a special window and it will save everything to local storage in your browser and then you'll refresh it. And this is the very same WordPress that you just left will show up again. Right now it works only as long as you keep your browser tab open. So yeah, it is temporary at the moment or fmrl. All right. Yeah, we'll get some more questions coming in. Are we able to use WP Playground offline somehow or create our own playground. Yeah, absolutely. Yeah, so one of the. All right. So, once I load WordPress in a browser tab. I have the entire PHP runtime downloaded. I have all WordPress PDFs downloaded and I can turn off my internet. And I can go through WP admin. And maybe sometimes I'll see a missing CSS file because the study assets are on a server, but entire application, like the logic. It lives in my browser tab. So, in fact, there was a cloud first hackathon earlier this year where I and me and Daniel backcuber we had a project. Called in browser WordPress development environment. So what we did there was we use stack blitz. And in stack blitz we managed to run WordPress playground because you can run JavaScript there. And then we opened that on an Android phone. We turned off the internet access and we created a tiny, tiny plugin and we could edit the plugin files offline on a phone and then we could go in WP admin, like activate the plugin and our change was there. So yeah, you can absolutely use it online through a browser. Once you load it, eventually it will be a PWA. So you'll be able to open it even like even loaded without internet access provided you loaded it at least once in the past and the visual studio code extension that doesn't talk to the internet at all. It leaves completely on your local computer. So if you download it, you can turn off Wi-Fi and it will just cause the WordPress development environment on your machine. Oh, great. We'll get a great question here from Kaiser again. If a custom plugin tries to create custom tables in the database will playground allow that or we start with say, okay, yeah. It will allow that. Yeah, go ahead. All right. I mean, like, I thought Justin, you wanted to add something to that like I want to expand on it so. Oh, go ahead. The playground will allow that we've been actually running WooCommerce on it, which creates a bunch of custom tables. And it also has more complex SQL queries than vanilla WordPress. Like, it does something called select from dual, which is not available in a in a SQL light. It does complex joins and all these things actually worked. So, I really like this question because the need to support custom tables and complex queries, it actually drove forward the SQLite integration plugin for WordPress. So this is a separate project living in its own repo. We can install it in any WordPress. And as I was adding features to playground, and I was running into roadbox related to database databases. I kept contributing to that SQLite integration plugin.  So this includes custom tables, custom SQL queries. I don't, you cannot run procedures yet. Maybe one day, but you can do a whole lot of interesting things, even though this is SQLite and has fundamentally different set of features than core, than core my SQL. All right, great. Yeah, we still got more questions. Oh, we can keep up with all of them. So, Eduardo asked, are there ways to tie this to our development process like using WP playground within the, that process. He listed an example for, for example, creating demos for pool requests. Absolutely. So I'm going to share my screen for just a second. If I can very quickly find an example of a pool request previewer. Oh, I think I'll be able to. But on a very high level. All right, I'm not going to be able to find it now to but so it's summer in the documentation like more fleshed out example but very quickly to answer that. Yes, you can do that. So the blueprints API that I showed earlier. It allows you to install any WordPress plugin or theme and you can use any URL to do that. So the trick to previewing pool request is that if you have a GitHub repo, and you have a word plus plug plugin or theme there. Well, you probably have some unique tests for that, hopefully. And if you have them, then you may have a continuous integration like CI pipeline there so it will build your plugin run the tests and show a green checkmark. This PR is good. So I built a Gutenberg plugin previewer for with WordPress playground. And here's how it works. It installs a Gutenberg plugin from a special URL and that URL is my custom endpoint that downloads the build file from GitHub CI right so we run tests we build a plugin and then this plugin is exposed to an endpoint. And this endpoint is used by a blueprint. All the blueprint says is, well install a plugin. Here's a URL. That's it playground download that it that URL happens to have the version of a plugin from this specific floor request, and it just works. Right. And again, like there's more about that in the in the doxy that was too fast to quickly. All right, thank you. Okay, we have at least three more questions and we just got just a few minutes left. But let's try to get the get through these from Victor. Can a playground instance be run on something like stack blitz stack blitz. Yes, it can. And a couple of different ways actually so on a stack blitz. One thing you can do is you can use the iframe, and you can embed playground from a playground that work is net. Well, that's not technically running on stack with right we're just sourcing it from somewhere else. So what else you can do is you can run the actual Web Assembly version of playground the full thing inside stack with So to do that, you would have to import an npm package and call this function like pp node pp dot. I think it starts or load one of these and it's all right that that's too much into it. The point is, you can run the node version of playground on stack blitz using their Node.js and I expected that to be very slow but it is actually decently usable. I had some technical problems with running it on stack blitz that are related to stack blitz. As in, sometimes the UI froze. That wasn't a playground like processing thing like I could move around in depth tools and that's very detailed but I had some trouble. Troubles but playgrounds actually work there. So you're welcome to play with it and one of the links in the resources section is a free in browser development environments. I encourage you to check it out. There's a video and some demos of what we build with stack blitz during the cloud fest hackathon. One of these things is exactly playground running in there as a development environment for WordPress. All right, great. All right, over to Roy's question. Let me see. He asked that you please address computer memory requirements for the four different ways to use playground. Sure. They're almost exactly the same in that you always need to load playground. The only difference is that in one way you'll click things and in the other two. All right, so there's no code thing where just use it and there are three different APIs. So all APIs actually do the same things as you would do by clicking manually. Right. You can just automate that preconfigure it make it much, much, much more convenient. So it's only runs a snippet of a JavaScript code internally. If you use the NPM package for JavaScript API. So the last API that I showed, well, it will require you to run some kind of build pipeline, right, like NPM run build or Webpack or ES build or what have you. So this will surely impose some additional memory requirements, but that's not specifically playground itself. That's just the development process. And how much memory does it require also to answer that. It depends how you measure it. I picked some benchmarking and one instance of workplace playground I think took about like 250 megabytes. So I don't quote me on that but that's vaguely what I recollect. Great. All right, let's get you over to David's question. That as I would it be possible to use the browser database index database to persist the WordPress content between a page refresh or example. Yeah, it was, I don't recommend that though. I'm going to post a link to the issue that I just happened to have handy where there are some explorations for persisting file system changes so index DB works but is super super slow. That's the problem with it there are ways to handle that with a local storage or even better origin private file system. I would really like to get there. But for now, this is the, this is an exploratory feature that that will come together index DB, not recommended. We have one last question. And I think we all know the answer to this I am right in thinking the issues and enhancements and enhancements suggestions can be made through GitHub and PRs from contributors, or those welcome. I think everybody's welcome to contribute right. Oh, yeah, like everyone is super welcome and I will totally appreciate it and I'm super happy to brainstorm anything, chat, explain things like even meet for a black chapter or a zoom call even like, I really want you to contribute. So that that question makes me very happy. And if there's anything I can do to help you succeed in playground, let me know. There's a good first issue label in the repo. I'm not sure if there are any issues right now with that label so I could probably do a little bit better on triage, but anything that you find either confusing or a feature that you would like to see but isn't there like even if it's a no bug report, or a code change or a code change or a code change that you would like to make but you don't know how everything is super welcome, and I'm there to help you. Alright, that's great. I did leave the link to the GitHub repo and the chat for anybody who wants to, you know, check it out get involved. But for now, I'm going to, we're going to end this session want to be respectful of everyone's time. And I also want to thank Adam for joining us and the whole presentation and answering everyone's questions. If I want to thank you so much for having me and for for coming here in that such great numbers it's very hard for me to be here with you so thank you. If you want to see Adam again, he will be doing the same presentation at tomorrow in a meet and a separate developer hours meet up. I'm linking in the chat. Realistically, I would like for you to share that with your friends who are like Europe or the Asia Pacific regions. It will be at an earlier time zone. So we're trying to get most of the world covered. So please, you know, share that link on your socials and you and let your friends know who may be on the other side of the world. For now, thank you everyone for joining. Thanks Adam for doing this. You'll have a good day.