Building Web Apps with WordPress, by Messenlehner and Coleman (O’Reilly, 2014)

Writers of books on WordPress are presented with a bit of a quandary, I think. On the one hand, one of the best resources for working with WordPress is the WordPress Codex itself, which is free, complete, regularly updated, and can cover a lot more territory than neatly fits within the covers of any one book. On the other hand, writers of WordPress books have to contend with the fact that a phenomenal book on WordPress already exists, Williams, Damstra, and Stern’s Professional WordPress: Design and Development. Messenlehner and Coleman’s Building Web Apps with WordPress enters this crowded field and acquits itself reasonably well. It’s no Professional WordPress, and it’s not the book it might have been, but it is a solid addition.

The book covers a lot of territory, starting from the basics of WordPress as a CMS and an app platform all the way to how to optimize your WordPress performance. The basic idea of the book, then, is that it will take you from some basic understanding of WordPress and WordPress plugins through to scaling and optimizing your wildly successful app in a production environment. Early chapters introduce WordPress and give some rough idea of how it works. Chapters 4 through 8 are the core of the book, and cover themes, custom post types, users and roles, other miscellaneous APIs and objects, and security. Later chapters introduce more specialized, supplementary topics such as mobile WordPress apps, and ecommerce apps.

Despite the clear layout of the chapters, the organization could be better, and important material is hidden in unexpected places. For example, the section of chapter 5 on custom post types does not actually cover the functions used to work with post metadata. Fundamental concepts like the loop, hooks, and the standard WordPress global variables are not in chapter 2, on WordPress Basics, but buried in Chapter 3, on Leveraging WordPress Plugins.

The quality of the chapters varies. Some chapters of the book are introductory overviews while others are advanced discussions; some are crammed full of advice, insight, and helpful code examples while others are essentially a function reference (a wider failing of PHP books, in my experience). Thorough, insightful discussions of WordPress development are scattered through the book: their comparison of custom taxonomies and post metadata in chapter 5, for example, is one of the best discussions I’ve seen. In general, though, I think the book is hampered by the decision to make it cover WordPress from basics to advanced topics. This means that the book competes with Professional WordPress on its own turf (not to mention a whole host of other books that cover the basics of WordPress), rather than striking out for fresher territory.

Messenlehner and Coleman do have experience designing and building apps, and it would have been interesting to get a deeper perspective on the nuances of WordPress app development. For one, there are a range of ways to interact with your data in WordPress, everything from the WP_Query class to the $wpdb object to using custom tables. Some of this is touched on, in chapter 3 and much later in chapter 16. But the commitment of the book to the whole basics-to-advanced gamut means that these discussions are less sustained, and less helpful, than they might have been if they had just dropped the pretense. This might also help to resolve some of the organizational problems the book has: they discuss working with custom tables in chapter 3, but the full explanation doesn’t come until chapter 16. (Part of the explanation has to do with performance when querying post metadata, which is not discussed in the discussions of post metadata in chapters 2 and 5.)

For similar reasons, the book uses a single app as the example throughout the book (their Schoolpress app). As a number of reviewers on Amazon have pointed out, this sample app is not in fact complete (in private beta, at the moment), nor is the code up on github. If this app was in the early design stages when the book was written, one possibility would have been to give more thorough consideration to a range of examples, a range of design possibilities: an app where much of the work is in the theme, and the code in the functions.php file; a middle-of-the-road app, with some custom post types; and a very complex app like Schoolpress. I don’t think the fact that the Schoolpress app is incomplete is entirely fatal, but it seems like a missed opportunity: if the development process of Schoolpress hasn’t gone as smoothly as anticipated, the book might well have been enriched by the lessons of the development process.

Though I’ve dwelt on the book’s problems, the book contains insightful discussions of working with WordPress and making your app work well– though they may not be where you’d expect. With some reorganization, and a clearer sense of the book’s purpose, a second edition of this book may well earn a place next to Professional WordPress as an essential work for WordPress development.

Leave a comment