34,79 €
Developing WordPress-powered websites is one of the standout trends in the modern web development world. The flexibility and power of the built-in features offered by WordPress has made developers turn their attentions to the possibility of using it as a web development framework. This book will act as a comprehensive resource for building web applications with this amazing framework.
"WordPress Web Application Development" is a comprehensive guide focused on incorporating the existing features of WordPress into typical web development. This book is structured towards building a complete web application from scratch. With this book, you will build an application with a modularized structure supported by the latest trending technologies.
"Wordpress Web Application Development" provides a comprehensive, practical, and example-based approach for pushing the limits of WordPress for web applications beyond your imagination.
This book begins by exploring the role of existing WordPress components and discussing the reasons for choosing WordPress for web application development. As we proceed, more focus will be put into adapting WordPress features into web applications with the help of an informal use-case-based model for discussing the most prominent built-in features. While striving for web development with WordPress, you will also learn about the integration of popular client-side technologies such as Backbone, Underscore, and jQuery, and server-side technologies and techniques such as template engines, RSS feeds, Open Auth integration, and more.
After reading this book, you will possess the ability to develop powerful web applications rapidly within limited time frames with the crucial advantage of benefitting low-budget and time-critical projects.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 455
Veröffentlichungsjahr: 2013
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2013
Production Reference: 1111113
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-075-9
www.packtpub.com
Cover Image by William Kewley (<[email protected]>)
Author
Rakhitha Nimesh Ratnayake
Reviewers
Rudolf Boogerman
Michael Cannon
Geert De Deckere
Benjamin Moody
Doug Sparling
Acquisition Editors
Saleem Ahmed
Sam Wood
Lead Technical Editor
Balaji Naidu
Technical Editors
Manan Badani
Pankaj Kadam
Krutika Parab
Copy Editors
Mradula Hegde
Gladson Monteiro
Kirti Pai
Lavina Pereira
Laxmi Subramanian
Project Coordinators
Abhijit Suvarna
Proofreaders
Maria Gould
Simran Bhogal
Paul Hindle
Indexer
Hemangini Bari
Graphics
Ronak Dhruv
Abhinash Sahu
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
Rakhitha Nimesh Ratnayake is a freelance web developer, writer, and an open source enthusiast.
He also provides technical consultation on large scale web applications to one of the leading software development firms in Sri Lanka.
Rakhitha is the creator of www.innovativephp.com, where he writes tutorials on the latest web development and design technologies. He is also a regular contributor to a number of popular websites such as 1stwebdesigner, the Tuts+ network, and the SitePoint network. Building Impressive Presentations with impress.js was his first book, also published by Packt Publishing.
In his spare time, he likes to watch cricket and spend time with his family. Make sure you visit him online at www.innovativephp.com and follow him on Google+ at http://goo.gl/UiEf5B.
I would like to thank my parents and my brother for the encouragement and help they provided throughout the various tasks in this book. Also, I would like to thank my family members and friends at Providence for consistently motivating me to complete my second book for Packt Publishing.
I would also like to thank the Packt Publishing team members; Parita Khedekar for inviting me to write this book, Erol Staveley and Saleem Ahmed for the support throughout the book as Acquisition Editors, Abhijit Suvarna for being the Project Coordinator of the book, and the reviewers for providing honest feedback to improve the book.
Finally, I would like to thank you for reading my book and being one of the most important people who helped me make this book a success.
Rudolf Boogerman is of Dutch origin, born in England, and has lived in Belgium since 2007. He first studied graphic arts, but learned several programming/scripting languages hands-on, starting from 1990. From then on, he primarily developed multimedia presentations for a wide variety of projects worldwide.
In 1997 he created his first site, www.raboo.info, to show his own artwork. After this first experience on the Web, he got very excited and decided to combine his artistic background with web development. For the past 5 years, he has been primarily working with WordPress and Joomla! and developing plugins/extensions for both platforms.
Rudolf is the founder of Raboo Design (a visual communication agency), Footprint Visual Communication (visual communication agency), Footprint add-ons (extensions for Joomla!), WP 21 century (plugins for WordPress), and Miracle Tutorials (a blog with step-by-step advice on video and audio on the Web).
Michael Cannon, Peichi's smiling man, is an adventurous water rat, Chief People Officer, cyclist, full stack developer, poet, WWOOFer, and a world traveler. At his core, he is the happiest of all being productive, doing something different, living simply, and sharing with people.
Through Aihrus, he supports TYPO3 and WordPress clients; develops software-based products; and provides business, IT, and software development mentoring.
As Axelerant's Chief People Officer, he gets to collaborate with awesome teammates and smart folks as part of exciting open source projects, even as he continues to explore the world.
Germany, India, and Taiwan have been his homes since 2008. He has visited an average of five countries every year since 2005. In 2012, it was 14 countries. In 2013, nine countries have padded his feet or his bicycle wheels so far.
Geert De Deckere is a web developer living in Belgium. Around 10 years ago, he wrote his first lines of PHP. He loves to code and play around with ever-evolving web technologies such as WordPress. Apart from that, he also enjoys cycling (especially in the mountains), cooking, working in his vegetable garden, and playing an occasional game of chess. His personal website can be found at http://geertdedeckere.be/.
Geert was also a technical reviewer of Kohana 3.0 Beginner's Guide, which is published by Packt Publishing.
Benjamin Moody is a web developer who started using WordPress way back in 2005. Since then, he has developed several custom plugins and themes for clients across North America, as well as a number of WordPress-based web applications. When not coding for clients, Benjamin works on personal application projects and can be found providing support at Toronto WordCamp Happiness Bar.
Doug Sparling works as a web and mobile software developer for Andrews McMeel Universal, a publishing and syndication company in Kansas City, MO. As a long-time employee of the company, he has built everything from the GoComics Android app to its registration, e-commerce systems, web services, and various websites using Ruby on Rails. He's now busy building another site in Rails and porting a Perl-based e-mail system to Go. Some of the AMU properties include GoComics.com (http://www.gocomics.com/), PuzzleSociety.com (http://puzzlesociety.com/), Doonesbury.com (http://doonesbury.slate.com/), and Dilbert.com (http://dilbert.com/).
He is also the Director of Technology for a small web development firm called New Age Graphics (www.newage-graphics.com). After creating a custom CMS using C# and ASP.NET, all his work has moved to WordPress since the time WordPress 3.0 was released, eliminating the need to ever run Windows again.
Doug is a passionate advocate for WordPress and has written several WordPress plugins, can be found on the WordPress forums answering questions (and writing sample code) under the username "scriptrunner", and occasionally plays the role of a grammar nerd as a volunteer in the WordPress Codex Documentation team.
His other experience includes PHP, JavaScript, jQuery, Erlang, Python, Magento, and Perl. Doug was also the co-author for a Perl book (Instant Perl Modules) and is a reviewer for other Packt Publishing books, including Mastering Android 3D Game Development and jQuery 2.0 Animation Beginner's Guide, as well as The Well Ground Rubyist, 2nd Edition for Manning Publications.
In his less than ample spare time, Doug enjoys spending time with his family. Other passions include photography, writing music, hitting drums and cymbals with sticks, playing briscola, meditation, and watching countless reruns of Firefly, Buffy the Vampire Slayer, and Doctor Who.
Many thanks to Packt Publishing for giving me the opportunity to review a book on my favorite technology, and a big thanks to the WordPress community for being the best I've ever come across.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Developing WordPress-powered websites is one of the standout trends in the modern web development world. The flexibility and power of the built-in features offered by WordPress has made developers turn their attention to the possibility of using it as a web development framework. This book will act as a comprehensive resource for building web applications with this amazing framework.
WordPress Web Application Development is a comprehensive guide focused on incorporating the existing features of WordPress into typical web development. This book is structured towards building a complete web application from scratch. With this book, you will build a portfolio management application with a modularized structure supported by the latest trending technologies.
This book provides a comprehensive, practical, and example-based approach for pushing the limits of WordPress to create web applications beyond your imagination.
It begins by exploring the role of existing WordPress components and discussing the reasons for choosing WordPress for web application development. As we proceed, more focus will be put into adapting WordPress features into web applications with the help of an informal use-case-based model for discussing the most prominent built-in features. While striving for web development with WordPress, you will also learn about the integration of popular client-side technologies such as Backbone.js, Underscore, jQuery, and server-side technologies and techniques such as template engines and OpenAuth integration.
This book differentiates from the norm by creating a website that is dedicated to providing tutorials, articles, and source codes to continue and enhance the web application development techniques discussed throughout this book. You can access the website for this book at http://www.innovativephp.com/wordpress-web-applications.
After reading this book, you will possess the ability to develop powerful web applications rapidly within limited time frames with the crucial advantage of benefitting low-budget and time-critical projects.
Chapter 1, WordPress As a Web Application Framework, walks you through the existing modules and techniques to identify their usage in web applications. Identification of WordPress features beyond the conventional CMS and planning portfolio management application are the highlights of this chapter.
Chapter 2, Implementing Membership Roles, Permissions, and Features, begins the implementation of a portfolio management application by exploring the features of the built-in user management module. Working with various user roles and permissions as well as an introduction to the MVC process through routing are the highlights of this chapter.
Chapter 3, Planning and Customizing the Core Database, serves as an extensive guide for understanding the core database structure and the role of database tables in web applications. Database querying techniques and coverage of the planning portfolio management application database are the highlights of this chapter.
Chapter 4, TheBuilding Blocks of Web Applications, explores the possibilities of extending WordPress posts beyond their conventional usage to suit complex applications. Advanced use of custom post types and an introduction to template engines are the highlights of this chapter.
Chapter 5, Developing Pluggable Modules, introduces the techniques of creating highly reusable and extensible plugins to enhance the flexibility of web applications. Implementing various plugins for explaining these techniques is the highlight of this chapter.
Chapter 6, Customizing the Dashboard for Powerful Backends, walks you through the process of customizing the WordPress admin panel for adding new features as well as changing existing features and design. Building reusable grids and designing an admin panel are the highlights of this chapter.
Chapter 7, Adjusting Themes for Amazing Frontends, dives into the techniques of designing amazing layouts, thereby opening them for future extension. Widgetizing layouts and building reusable templates are the highlights of this chapter.
Chapter 8, Enhancing the Power of Open Source Libraries and Plugins, explores the use of the latest trending open source technologies and libraries. Integrating open authentication in to your web application and structuring the application at the client side are the highlights of this chapter.
Chapter 9, Listening to Third-party Applications, demonstrates how to use WordPress XML-RPC API to create a custom API for your web application. Building a simple yet complete API with all the main features is the highlight of this chapter.
Chapter 10, Integrating and Finalizing The Portfolio Management Application, guides you through the integration of modules developed throughout this book into a standalone plugin while introducing you to important concepts such as caching, security, and testing.
Appendix, Configurations, Tools, and Resources, provides an application setup guide with necessary links to download the plugins and libraries used throughout the book.
Technically, you need a computer, browser, and an Internet connection with the following working environment:
Once you have the preceding environment, you can download the Responsive theme from http://wordpress.org/themes/responsive and activate it from the Themes section. Finally, you can activate the plugin developed for this book to get things started.
Please refer to Appendix, Configurations, Tools, and Resources, for the application setup guide, required software, and plugins.
This book is intended for WordPress developers and designers who have the desire to go beyond conventional website development to develop quality web applications within a limited time frame and for maximum profit.
Experienced web developers who are looking for a framework for rapid application development will also find this to be a useful resource.
Prior knowledge of WordPress is preferable as the main focus will be on explaining methods for adapting WordPress techniques for web application development rather than explaining basic skills with WordPress.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
In recent years, WordPress has matured from being the most popular blogging tool to the most popular content management system. Thousands of developers around the world are making a living from WordPress design and development. As more and more people become interested in using WordPress, there are discussions and arguments for exploring the possibilities of using this amazing framework for web application development.
The future seems bright as WordPress has already got dozens of built-in modules, which can be easily adapted to web application development using some slight modifications. Since you are already reading this book, you are probably someone who is really excited to see how WordPress fits into web application development. Throughout this book, we are going to learn how we can inject the best practices of web development into the WordPress framework to build web applications in a rapid process.
Basically, this book will be important for developers from two different perspectives. On one hand, WordPress developers of beginner level to intermediate level can get the knowledge of cutting edge web development technologies and techniques to build complex applications. On the other hand, web development experts who are already familiar with popular PHP frameworks can learn WordPress for rapid application development. So let's get started!
In this chapter, we are going to cover the following topics:
In order to work through this book, you should be familiar with WordPress themes, plugins, and its overall process. Developers who are experienced in PHP frameworks can work with this book while using the reference sources to learn WordPress. By the end of this chapter, you will have the ability to make the decision on choosing WordPress for web development.
Way back in 2003, WordPress released its first version as a simple blogging platform and continued to improve, until it became the most popular blogging tool. Afterwards, it continued to improve as aCMS (Content Management System) and has a reputation now for being the most popular CMS. These days everyone sees WordPress as a CMS rather than just a blogging tool.
Now, the question is where will it go next?
No one really knows the answer for this question. But recent versions of WordPress have included popular web development libraries such as Backbone.js and Underscore.js, and developers are even building different types of applications with WordPress. So we can assume that it's moving towards the direction of building applications. It's important to keep an eye on the next few versions to see what WordPress offers for web applications.
Before we consider the application development aspects of WordPress, it's a good idea to figure out the reasons for it being such a popular framework. The following are some of the reasons behind the success of WordPress as a CMS:
These reasons prove why WordPress is the top CMS for website development. But experienced developers who work with full stack web applications don't believe that WordPress has a future in web application development. While it's up for debate, let's see what WordPress has to offer for web development.
Once you complete reading this book, you will be able to decide whether WordPress has a future in web applications. I have been working with full stack frameworks for several years and I certainly believe in the future of WordPress for web development.
In practice, the decision to choose a development framework depends on the complexity of your application. Developers will tend to go for frameworks in most scenarios. It's important to figure out why we go with frameworks for web development. Here is a list of possible reasons that frameworks become a priority in web application development:
Full stack development frameworks such as Zend, CodeIgniter, and CakePHP adhere to the points mentioned in the preceding section, which in turn become the framework of choice for most developers. Now let's take a look at how WordPress fits into the boots of the web application framework.
A vast majority of web development frameworks are built to work with the MVC (Model-View-Controller) architecture, where the application is separated into independent layers called models, views, and controllers. In MVC, we have a clear understanding of what goes where and when each of the layers will be integrated in the process.
So, the first thing most developers will look at is the availability of MVC in WordPress. Unfortunately WordPress is not built on top of the MVC architecture. This is one of the main reasons that developers refuse to choose it as a development framework. Even though it is not MVC, we can create a custom execution process to make it work like an MVC application. Unlike other frameworks, it won't have the full capabilities of MVC. But unavailability of an MVC architecture doesn't mean that we cannot develop quality applications with WordPress.
WordPress relies on procedural event-driven architecture with its action hooks and filter system. Once the user makes a request, these actions will get executed in a certain order to provide the response to the user. You can find the complete execution procedure at http://codex.wordpress.org/Plugin_API/Action_Reference.
In an event-driven architecture, both the model and controller code gets scattered throughout the theme files. In the upcoming chapters, we are going to look at how we can separate these concerns with the event-driven architecture, in order to develop maintainable applications.
As we discussed in the previous section, the quality of a framework depends on its core modules. The more quality you have in the core, the better it will be for developing quality and maintainable applications. It's surprising to see the availability of a number of WordPress modules directly related to web development, even though it was meant to create websites.
Let's get a brief introduction about the WordPress core modules to see how they fit into web application development:
An overall collection of modules and features provided by WordPress can be effectively used to match the core functionalities provided by full stack PHP frameworks.
WordPress comes up with a set of prebuilt components, which are intended to provide different features and functionality for an application. A flexible theme and powerful admin module act as the core of WordPress websites while plugins and widgets extend the core with application-specific features. As a CMS, we all have a pretty good understanding of how these components fit into a WordPress website.
Here our goal is to develop web applications with WordPress, and hence it is important to identify the functionality of these components in the perspective of web applications, so we are going to look at each of the following components, how they fit into web applications, and how we can take advantage of them to create flexible applications through a rapid development process:
Many of us are used to seeing WordPress as a CMS. In its default view, a theme is a collection of files used to skin your web application layouts. In web applications, it's recommended to separate different components into layers such as models, views, and controllers. WordPress doesn't adhere to the MVC architecture, but we can easily visualize the theme or templates as the presentation layer of WordPress.
In simple terms, views should contain the HTML needed to generate the layout and all the data it needs should be passed to the views. WordPress is built for creating content management systems and hence it doesn't focus on separating views from its business logic. Themes contain views, also known as template files, as a mix of both HTML code and PHP logic. As web application developers, we need to alter the behavior of existing themes, in order to limit the logic inside templates and use plugins to parse the necessary model data to the views.
Typically, posts or pages created in WordPress consist of five common sections. Most of these components will be common across all the pages in the website. In web applications, we also separate the common layout content into separate views to be included inside other views. It's important for us to focus on how we can adapt the layout into a web-application-specific structure. Let's visualize the common layout of WordPress using the following diagram:
Having looked at the structure, it's obvious that the Header, Footer, and Main Content areas are mandatory even for web applications, but the footer and comments section will play a less important role in web applications, compared to web pages. The Sidebar is important in web applications, even though it won't be used with the same meaning. It can be quite useful as a dynamic widget area.
Web applications can be categorized as projects and products. A project is something we develop that targets the specific requirements of a client. On the other hand, a product is an application created based on the common set of requirements for a wide range of users. Therefore, customizations will be required on layouts of your product based on different clients.
WordPress themes make it super simple to customize the layout and features using child themes. We can make the necessary modifications in the child theme while keeping the core layout in the parent theme. This will prevent any code duplications in customizing layouts. Also the ability to switch themes is a powerful feature that eases the layout customization process.
In situations where we need to provide dynamic layouts based on user types, devices, or browsers, we can dynamically switch between different themes by writing custom functions.
The administration interface of an application plays one of the most important roles behind the scenes. WordPress offers one of the most powerful and easy-to-access admin areas compared to other competitive frameworks. Most of you should be familiar with using the admin area for CMS functionalities, but we will have to understand how each component in the admin area suits the development of web applications.
The dashboard is the location where all the users get redirected, once they are logged in to the admin area. Usually it contains dynamic widget areas with the most important data of your application. The dashboard could play a major role in web applications, compared to blogging or CMS functionality. We can remove the existing widgets related to CMS and add application-specific widgets to create a powerful dashboard.
Posts in WordPress are built for creating content such as articles and tutorials. In web applications, posts will be the most important section to create different types of data. Often, we will choose custom post types instead of normal posts for building advanced data creation sections. On the other hand, pages are typically used to provide static content of the site. Usually we have static pages such as About Us, Contact Us, and Services.
User management is a must-use section for any kind of web application. User roles, capabilities, and profiles will be managed in this section by authorized users.
Themes and application configurations will be managed in this section. Widgets and theme options will be the important sections related to web applications.
This section involves general application settings. Most of the prebuilt items in this section are suited to blogs and websites. We can customize this section to add new configuration areas related to our plugins that are used in web application development.
There are some other sections such as links, pages, and comments, which will not be used frequently in complex web application development. The ability for adding new sections is one of the key reasons for its flexibility.
In normal circumstances, WordPress developers use functions, which involve application logic scattered across theme files and plugins. Some developers even change the core files of WordPress, which is considered to be a very bad practice. In web applications, we need to be much more organized. In the section The role of the WordPress theme, we discussed the purpose of having a theme for web applications. Plugins will be and should be used to provide the main logic and content of your application. In short, anything you develop for web applications should go inside plugins, instead of theme files.
The plugin architecture is a powerful way to add or remove features without affecting the core. Also, we have the ability to separate independent modules into their own plugins, making it easier to maintain. On top of that, plugins have the ability to extend other plugins.
The official documentation of WordPress refers to widgets as a component that adds content and features to your Sidebar. In typical blogging or from a CMS user's perspective, it's a completely valid statement. In fact, widgets offer more in web applications by going beyond content that populates Sidebars. The following screenshot shows a typical widgetized Sidebar of a website:
We can use dynamic widgetized areas to include complex components as widgets, making it easy to add or remove features without changing the source code. The following screenshot shows a sample dynamic widgetized area. We can use the same technique to develop applications with WordPress:
Throughout these sections, we covered the main components of WordPress and how they fit into the actual web application development. Now we have a good understanding of the components in order to plan the application that we will be developing throughout this book.
Typically a WordPress book consists of several chapters, each of them containing different practical examples to suit each section. In this book, our main goal is to learn how we can build full stack web applications using built-in WordPress features, therefore, I thought of building a complete application, explaining each and every aspect of web development.
Throughout this book, we are going to develop an online portfolio management system for web development related professionals. This application can be considered as a mini version of a basic social network. We will be starting the development of this application from Chapter 2, Implementing Membership Roles, Permissions, and Features.
Planning is a crucial task in web development in which we will save a lot of time and avoid potential risks in the long run. First, we need to get a basic idea of the goal of this application, and its features, functionalities, and the structure of components to see how it fits into WordPress.
Developers and designers who work online as freelancers know the importance of a personal profile to show your skills for an improved reputation. But most people, including experts who work full time jobs, don't maintain such profiles and hence remain unnoticed among co-developers. The application developed throughout this book is intended to provide the opportunity for web professionals to create their public profiles and connect with the experts in the field.
This application is aimed at those who are involved in web development and design. I believe that both the output of this application and the contents of the book will be ideal for PHP developers who want to jump into WordPress application development.
Basically, our application consists of both frontend and backend, which is common to most web applications. In the frontend, both registered and unregistered users will have different functionalities based on their user roles. The following screenshot shows the structure of our application's home page:
The backend will be developed by customizing the built-in admin module of WordPress. The existing and new functionalities of the admin area will be customized based on the user role permissions.
The application consists of four user roles, including the built-in admin role. The following are the user roles and their respective functionalities:
Registration is required for all the four user roles in the Portfolio Management Application.
Our main intention of building this application is to learn how WordPress can be adapted to advanced web application development. Therefore, we will be considering various small requirements, rather than covering all aspects of a similar system. Each of the functionalities will be focused on explaining various modules in web applications and the approach of WordPress in building similar functionality. Let's consider the following list of functions, which we will be developing throughout this book:
While these are our main functionalities, we will also develop small features and components on top of them to explain the major aspects of web development.
If you are still not convinced, you can have a look at various types of WordPress-powered web applications at http://www.innovativephp.com/demo/packt/wordpress_applications.
As with every framework, WordPress has its limitations in developing web applications. Developers need to understand the limitations before deciding to choose a framework for application development.
In this section, we are going to learn the limitations while building simple guidelines for choosing WordPress for web development. Let's get started:
If you are a developer or designer, who thinks these limitations could cause major concerns for your projects, WordPress may not be the right solution for you.
Throughout the previous sections, we learned the basics of web application frameworks while looking at how WordPress fits into web development. By now, you should be able to visualize the potential of WordPress for application development and how it can change your career as developers. Being human, we always prefer a practical approach to learning new things over the more conventional theoretical approach.
So, I am going to complete this chapter by converting the default WordPress functionality into a simple question-answer interface such as Stack Overflow, to show you a glimpse into what we are going to develop throughout this book.
