This book is not for people who want to learn how to use WordPress as an end user. There will be brief introductions to standard WordPress functionality, but we assume that readers have already experienced WordPress from a users perspective.
This book is not meant for nonprogrammers. While it is possible to build very functional web applications by simply combining and configuring the many plugins available for WordPress, this book is written for developers building their own plugins and themes to power new web apps.
This book will not teach you how to program but will teach you how to program the WordPress way.
What Youll Learn
Our hope with this book is that you will learn the programming and organizational techniques and best practices for developing complex applications using WordPress.
defines what we mean by web app and also covers why or why not to use WordPress for building web apps and how to compare WordPress to other application frameworks. We also introduce SchoolPress, the WordPress app that we use as an example throughout the book.
covers the basics of WordPress. We go over the various directories of the core WordPress install and what goes where. We also explain each database table created by WordPress, what data each holds, and which WordPress functions map to those tables. Even experienced WordPress developers can learn something from this chapter and are encouraged to read it.
is all about plugins. What are they? How do you make your own plugins? How should you structure your apps main plugin? When should you leverage third-party plugins or roll your own?
is all about themes. How do themes works? How do themes map to views in a typical model-view-controller (MVC) framework? What code should go into your theme, and what code should go into plugins? We also cover using theme frameworks and UI frameworks and the basics of responsive design.
covers custom post types and taxonomies. We go over the default post types built into WordPress, why you might need to build your own, and then how to go about doing that. We also cover post meta and taxonomies, what each is appropriate for, and how to build custom taxonomies and map them to your post types. Finally, we show how to build wrapper classes for your post types to organize your code utilizing object-oriented programming (OOP).
covers users, roles, and capabilities. We show how to add, update, and delete users programmatically, and how to work with user meta, roles, and capabilities. We also show how to extend the WP_User class for your user archetypes like customers and teachers to better organize your code using OOP techniques.
covers a few of the more useful WordPress APIs and helper functions that didnt fit into the rest of the book but are still important for developers building web apps with WordPress.
is all about securing your WordPress apps, plugins, and themes.
covers using JavaScript and AJAX in your WordPress application. We go over the correct way to enqueue JavaScript into WordPress and how to build asynchronous behaviors in your app.
covers the XML-RPC API for WordPress and how to use it to integrate WordPress with outside apps.
covers how to use WordPress to power native apps on mobile devices by creating app wrappers for iOS and Android.
covers some third-party PHP libraries, services, and APIs that are often used in web apps and how to integrate them with WordPress.
covers WordPress multisite networks, including how to set them up and things to keep in mind when developing for multisite.
covers localizing your WordPress plugins and themes, including how to prep your code for translation and how to create and use translation files.
covers ecommerce. We go over the various types of ecommerce plugins available and how to choose between them. We then go into detail on how to use WordPress to handle payments and account management for software as a service (SaaS) web apps.
covers how to optimize and scale WordPress for high-volume web apps. We go over how to test the performance of your WordPress app and the most popular techniques for speeding up and scaling sites running WordPress.
About the Code
All examples in this book can be found at
The sample app SchoolPress can be found at http://schoolpress.me, with any open sourced code for that site available at https://github.com/bwawwp/schoolpress.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, datatypes, environment variables, statements, and keywords. Constant width bold
Shows commands or other text that should be typed literally by the user. Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
Note
This element signifies a tip, suggestion, or general note.
Warning
This element indicates a warning or caution.
Using Code Examples
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.