 Test test you hear me? Yeah, it's on perfect. All right. Thank you misty for the introduction like she said I'm going to be talking about headless and brainless wordpress. I Feel awkward doing my own introduction now because she just said everything I was going to say But most people call me BMO and that's because Ben is too long of a name So BMO it's easier to remember. No. No, you never get to pick your own nickname, right? Some person first day on your job. He's going to shout it at you and for the next five years. That's I mean That's who you are. I don't know if anyone at WP engine knows my real name to be honest Yeah, I'm the CXO BI dev L2 to be exact I'm the only one but I am still L2 and I'm the founder owner and operator of skypress My wife does all of our business administration relations It's clever. I'm foo. She's bar you get it and I like to think of myself as a student of life I enjoyed learning and stretching the possibilities of what we do every single day and Getting out of the mundane this of it Wordpress as we know is growing and changing and evolving and it's not a blogging platform anymore I hope we all know this But with the introduction of the rest API, it's also not just the CMS anymore I believe it has the full power and potential to be a wool full-on Development framework a full platform and so I want to talk to you guys today about how Maybe not entirely how but just doing more with it. Let's build more. Let's stretch the imagination Let's get excited about the possibility of things that WordPress it maybe not Maybe shouldn't be used for but can be used for and With the more input and growth that we can shoot at it one day will be used for I Enjoy WordPress JavaScript in the rest API as a business intelligence developer I was ecstatic when the rest API showed up because I didn't have to use node Which I was struggling to learn Almost had something solid and then the rest API came out and I said well there goes a year worth of work But WordPress in and of itself still has a lot of great potential Even if you're just using the bare bones of it if think about it the user management system came out in 2002 This is the same time WordPress 2.0 same feature release was a Little box in the bottom right of the text area that you can click and resize your text area That was a feature release item for WordPress 2.0 as well as user management And it doesn't mean that it's old and out of dated It means that it has been iterated over and highly secure And I don't know if you've ever tried to hand code an entire user Login log out passwords reset your passwords. You don't want to do it yourself WordPress has it I've also heard WordPress called a giant PHP wrapper for my sequel. I mean when you get down to the nuts and chills of it It's what it is, but it's also very Extendable right all of our plugins all of our themes. That's how it was made. It's how it's designed This microphone is heavy JavaScript is no longer something that you just turn off right JavaScript is everywhere whether you want it or not JavaScript allows you to do very dynamic and user interactive features on your website You can build full mobile applications full web applications. JavaScript is just powerful. It's dynamic. It's great And whenever you start combining WordPress JavaScript and the rest API in there you are unlocking Everything everything that you can think of I mean, we're not just talking about open up Chrome and do something You're getting into the Internet of Things. You're getting into full actual native mobile applications. You're getting into I Don't know Two different servers just talking to each other right you don't ever have to write a line of HTML to be able to use all of this and that's why I've Really inspired to come up with how to do it and there's three different ways that I learned to be able to use JavaScript WordPress and the rest API First one. I'm calling Limless. I Think we've all heard the word headless. It's been around for a very long time and My last solution. I'm coining the term brainless So let's get right into it traditionally when you build a website, it's all PHP rendered on the back, right and You know, it's pretty simple The most common thing that we've all been doing especially with admin Ajax is a limitless sort of style in which little sections of your site are using JavaScript and Calling backwards dynamic. This might be your shopping cart, right? It could be just getting your Twitter feed It doesn't really matter just little snippets The problem with that though is just like this slide every time you go to a new page the whole thing has to rebuild in the back and There's got to be more that we can do with it with all of this super powerful JavaScript frameworks that are out there And it's not really following a very good design pattern for more than websites So I say let the back in back and let the front in front Which leads us on to this really great buzzword of headless So just to set the record straight headless WordPress is WordPress Except for WP admin that only returns data through the rest API That's the bottom line Headless WordPress has nothing to do with React or Angular or anything else When you get down to it a headless solution only returns data through the rest API and that means that you can build whatever you want You can use whatever you want to access that data You can build actual mobile application and you notice it's a it's yellow. That's full JavaScript You can build actual web applications you can Do whatever you want with whatever tool you want even with just non front-end languages like PHP or Python Because it's just the HTTP call to the rest API that is a headless WordPress Everything else is whatever you want it to be It also means whatever you want it to be can use Anything you want it to as long as they also have a rest API still with me the best example of a headless Setup is a mobile app because if you think about it you Have your app installed on all of the phones that means you're not hosting that front-end and All of those phones are making calls back to your actual WordPress site Which may not have any front-end? So that is headless mobile application in tandem downside You're not really using WordPress You're not really using its functionality. You're using some of it You're generating everything on the back and you're just sending out a stateless restful response So when you log in you have to log in on the front-end and Then that front-end has to send its login credentials to the back in order to say hey, can you log me in again? right, it's like a Your daughter she meets a great person in college. You really like them Or she really likes them, but then she brings them home for Thanksgiving and you know she has to ask is that okay as well? Oftentimes, it's great. That's fine, but it's just doubling up work whenever WordPress already has user authentication Plus many others. So that's where I want to talk about brainless notice the dotted white line WordPress on first page load Still uses PHP to generate the HTML, but it's just this tiny little shell It'll help you in queue your JavaScript your localized whatever you want your styling and then it also says JavaScript take the wheel and then from there you build out whatever you want your web application Using whatever you want and every time you click around it's still JavaScript making API calls back to the back But you still get More functionality out of WordPress than just stateless data Still with me. All right Had a really great start I got you laughing and now it's a little client so with brainless You get actual functionality you render a tiny HTML shell but at the same time You're also limiting yourself again You can't do a full native mobile application Using brainless because I don't think you want to ship WordPress to every single person's phone a little bit of summary Headless you control everything Headless means you are responsible for everything You may be you may wind up with two different servers if you think about it your front-end hosted one place You're back in hosted another With brainless you can combine the two You can't do as many great and amazing, you know, Boston robots run it through opening doors But you can still expand beyond what we've been doing with WordPress in the first place and for people who don't like to read Here's another summary Are you inspired? I'm inspired That's right because on the front. It's still going over a rest API so you can shoot it to whatever rest API and if you have Even on the back the business logic, right because PHP has connectors and What's the word? Classes no, that's the right way. You know I'm talking about libraries to connect to many different types of databases So whatever you have set up you can use PHP because WordPress is PHP Make it do whatever you want Write your business logic every one return the data through the chase on rest API and the front-end will consume it It is it was a 4.7. I think all of the endpoints are in core so you If you don't want to use it you have to go turn it off. No, you can't just theoretically the great thing about the rest API is so he's asking about The kind of the possibilities of using JavaScript to go crawl another site bring it back use whatever he needs with it And all of that in tandem as well as potentials to using other types of databases on the back end in order to Generate the responses for your own API. Correct. Okay, so yes in theory. It's all possible at WP engine I have a full portal using this for all of the data that our customer experience uses and it is not using the WordPress database entirely because Our data we record everything that every single tech does every single hour of the day that would destroy a WordPress database But I still use WordPress to gather that data use PHP to gather the data Send all the data back out through the WordPress rest API as you start exploring and expanding I want to remind you that there's no right way of doing this There's no proper way of using angular and WordPress. There's no handwritten you're doing it wrong way of doing react and WordPress or toaster machine Turning on at 8 a.m. With WordPress But I want to inspire you is to remember the philosophy that WordPress is based on So that you can go and shed that share that with the other communities you get engaged in and Then also try and bring some of their philosophies back to us Because the more all of the communities start unifying and working and the better things we're going to build for everyone my name is BMO and I'm here all week. All right full question time now. What you got? So with he's I can are there any other features with the WordPress rest API that I use frequently apart from just user authentication, correct Yes There's some links in there about the the war framework that I was talking introduced with and I've been able to use it to start creating full actual data models with full crud endpoints create read update delete That is all self-maintaining using their own tables in my sequel That I would not have been able to do if the rest API wasn't structured the way it was so The way you can extend out the rest API to do whatever It's absolutely fantastic because building an endpoint. It's just PHP Yes, sir Human-made I think has a plug-in that I need to look at and I sigh because I'm a terrible developer and I don't document anything That is my weakest link I Haven't tried human-made their situation their solution, but I hear it's fantastic. So Yes, sir I'll pull one up. He's asking for an example of a brainless application and while I pull it up. It's your question, sir absolutely the glue If you think about the different requests that you're he's asking He's trying to do single sign-on from one application. He's been running for 10 years and we're pressed correct The rest API absolutely just for the fact that your other application Doesn't really have to know anything about where what WordPress is doing or what it is It just has to know here's the API call to make and here's the payload to send the credentials to send with it so it Definitely simplifies things This is my company skypress. It is a brilliant single page And by single I mean that's the only link and it just drops it down to the form I'm working on a blog But here's why I want to show you all of that. That's the only HTML where press has to generate That's it. It does my scripts my Styles angular CLI is great at being able to bundle it so as webpack and you notice right here app route app route That says angular takeover. Yes, sir Angular 5 Don't worry in two months. Angular 6 is coming out But no, it works with AngularJS as well works with React works with you works with static HTML. I mean it's When you simplify things the when you are simplifying things the less WordPress has to know to render the better and then through the rest API if it's not Generating any content. It's not rendering. It's just saying what's 2 plus 2 oh, it's 4 then that's also simple and Then you can build Yeah, and Angular does everything else Just imagine of all of this was built with PHP Enlarging so on so forth. I think you get the gist. Oh, let's do something fun. You guys might like this I'm gonna contact myself Not a real company did I just kill the mood? All right. You guys ready? Yeah, there it goes. Yay live demos. There's my HP may API call Right straight to the API with a little bit of payload And if I had more setup, I would have gotten an email but right now I just have to go into PHP madman Yes, sir Yes, the majority of it is extending out the API. So that's PHP So you can scrap the front and Angular if you want And just use the API section of it Yes, sir So so the question is if we're doing more and more and more and less and less with WordPress because we're cutting off a lot Of the hard work those put into WordPress to make it generate content quickly and scalably and fast then what's the point in it and my answer is Even just a limbless solution if that's what is right for you then there's nothing wrong with it in fact, I would say Using Angular 5 to build a single page that does nothing that is complete overkill And it would have been a lot easier for me if I just used WordPress all the way through So there's definitely still a place in it. It's just the direction of what you're trying to build out right if you want to build a Chess game you can do it in WordPress now, but WordPress isn't set up specifically to handle turntable game style stuff Yes, he's adding on that. Yeah, this helps open up the door to Create more scalable solutions on WordPress, especially in enterprise realm, but it all depends on what you need it for Right. Why isn't the question why not is the answer though? Yeah, what this you could use your one WordPress site That's just your back-end and manage administration tool and click your buttons and spin up anything else on many other sites Yeah, I had a question over here It's asking what are some of the limitations of using a headless approach both from administration and End user experience On a headless approach depending on what you're building out. You're still having to do all that yourself in a sense There's fantastic fantastic react communities fantastic Angular communities fantastic Python communities They're also not the WordPress community and I have a sweet spot in my heart for the WordPress community From an administration standpoint It's a good one. I think the limitations aren't in what you build Yeah, where presses there question So advice on WordPress and mobile applications Specifically through the rest API and the gap in that right. Oh, Cordova. Okay. Got you I Personally, I don't have experience with that. I'm also watching the entire app like just general applications in closely and Progressive web apps are gonna be taking over soon So I don't know what's going to happen with a phone gap Cordova Ionic even Whenever progressive web applications would be easier and easier to build out Especially when you had like two files and manifest file and now you suddenly have a progressive web app Oh and service workers So modern web technologies are going faster than WordPress right, and it's just a fact of life, but now we can keep up with the Joneses in a sense like peek over the fence and see what they're doing over there and Eventually just tear down that fence and start using it all in tangent Json web tokens For actual API calls, but when you're going with a brainless solution, you can still use standard WP authenticated cooking pass an annonce with it because whenever you're on a brainless WordPress loads the page first and so it already knows everything that's going on so personal favorite json web tokens Uh There is a JWT plug-in. Yeah, anyone else because I'm staying here until they kick me out. Yes. Yeah, the Dream dream away. Yes, sir. Thank you. I appreciate that. I like Pokemon too All right, if that's it you guys have been fantastic, please come see me I can talk about this for days and days and days