WordPress is more than just software, its a movement that is becoming the de facto operating system of the web. More than just a blog or a CMS, when you learn how to use WordPress as an application platform youll be at the forefront of the third wave of its growth.
Brian and Jason have grown side by side with WordPress for years, and successfully demonstrate how, for the right kind of app, developers can leverage that engine to build more secure, more performant applications in half the time.
Building Web Apps with WordPress
by Brian Messenlehner and Jason Coleman
Copyright 2020 Brian Messenlehner and Jason Coleman. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Acquisitions Editor: Jennifer Pollock
- Development Editor: Alicia Young
- Production Editor: Deborah Baker
- Copyeditor: Octal Publishing, LLC
- Proofreader: Rachel Monaghan
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Rebecca Demarest
- April 2014: First Edition
- December 2019: Second Edition
Revision History for the Second Edition
- 2019-12-11: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491990087 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Building Web Apps with WordPress, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-491-99008-7
[LSI]
Foreword
For the past several years, Ive spent 15 to 24 weekends each year visiting software developers around the country. After something like 25,000 conversations, Ive become convinced of three things:
Web applications are everywhere
Its difficult to imagine life without web applications in it. Today, we do our banking online. We book hotels and vacations online using web applications; we do our taxes online in what certainly feels like an application; we check in on our phone to Supercuts before we arrive for our appointment using what feels like a simple form, but it, too, is an application. Web applications are everywhere.
Web developers feel completely unable to build them
If you talk to nondevelopers, theyll tell you that their developer friend is a genius who can do anything with a computer. But if you spend time talking to developers directly, youll discover that they see the world very differently.
They look at the web applications that they consider real and the companies behind them, and they have convinced themselves that the people that work over there know things about building web applications that no one else knows.
Theyre convinced that they can build only small applicationsthat they dont know what they need to know to do the stuff that will result in wildly popular web applications.
Whats missing is a little bit of information and a lot more confidence
When you sit with developers to talk about web applications, you quickly find out that the missing element is confidence more than anything else. Writing the code isnt hard once you know what you need to do. But that doesnt mean that developers dont need a bit more insight into the process.
These conversations have taken place across the country at local conferences called WordCamps. These are community events that typically have 200 to 500 participantsequally split between developers and nondevelopers. What they have in common is the use or the intention to use the web publishing product called WordPress.
WordPress, if youve never heard of it, powers a third of the internet sites on the planet. Its primarily used as a content publishing platform. But the truth is that you can use WordPress to kickstart your web application.
Thats what youll find in the pages of this book.
What I love about this book is that it doesnt skimp in the early chapters. It helps readers slowly navigate the early questions. It gives you confidence. And I know how valuable youll find that. It creates a roadmap for how to get from where you are to where you want to be.
But what I also love about this book is that it pushes you deeper into the details of every line of code you need to write. Some of it will be new to you. Some of it wont. But what you wont find is high-level writing that doesnt explain itself and leaves you wondering how to apply your newfound knowledge.
Instead, Brian and Jason introduce you to every part of WordPress that you need to know to use it as a web application framework. There are coding schools today that need to teach from this material. Thankfully, you dont need to pay for those schools, which cost far more than this book.
I cant recommend this book with any more excitement than in this foreword.
Until now you may have thought that there were two kinds of developers. The first is the kind who builds hardcore applications that you never could. The other is the kind like you, who could build small or simple applications.
When youve finished reading this book, there is one thing that I know for sure. When youre done, when youve read the words and played with the code, when youve put it into actionyou will know that theres only one kind of developer: the kind that can build anything they can imagine, and youre that kind of developer.
The fact that youre reading these words now makes that already true. Now its time for you to discover that reality.
Chris Lema
VP of Products & Innovation at Liquid Web
Preface
As we write this, WordPress powers 32% of all sites on the internet, and that number is growing. Many developers want to do more with their WordPress sites but feel that they need to jump ship to a more traditional application framework like Ruby on Rails, Symfony, Yii, or Laravel to build real web apps. This sentiment is wrong, and were here to fix it.
Despite starting out as blogging software and currently existing primarily as a content management system, WordPress has grown into a flexible and capable platform for building web apps. This book will show you how to use WordPress as an application framework to build