Book Image

WordPress Development Quick Start Guide

By : Rakhitha Nimesh Ratnayake
Book Image

WordPress Development Quick Start Guide

By: Rakhitha Nimesh Ratnayake

Overview of this book

WordPress is the most used CMS in the world and is the ideal way to share your knowledge with a large audience or build a profitable business. Getting started with WordPress development has often been a challenge for novice developers, and this book will help you find your way. This book explains the components used in WordPress development, when and where to use them, and why you should be using each component in specific scenarios. You begin by learning the basic development setup and coding standards of WordPress. Then you move into the most important aspects of the theme and plugin development process. Here you will also learn how themes and plugins fit into the website while learning about a range of techniques for extending themes and plugins. With the basics covered, we explore many of the APIs provided by WordPress and how we can leverage them to build rapid solutions. Next, we move on to look at the techniques for capturing, processing, and displaying user data when integrating third-party components into the site design. Finally, you will learn how to test and deploy your work with secure and maintainable code, while providing the best performance for end users.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Preface

WordPress is the most widely used CMS in the world. As a developer, WordPress is the ideal way to share your knowledge with a large community as well as build a profitable business. Getting started with WordPress development has been a challenge for novice developers, compared to building everything from scratch in other frameworks. It's very easy to build WordPress sites by connecting bits and pieces without actually knowing what's happening under the hood. Many developers tend to follow this path and face maintenance and security nightmares in the long run. This book is structured to explain the components used in WordPress development, when and where to use them, and why you should be using each component in specific scenarios.

You will begin this book by learning the basic development setup and coding standards of WordPress. Mastering the built-in database is one of the keys to becoming a expert in WordPress development. In this section, you will learn about the database structure, and examine the data usage of the built-in features and their limitations in order to plan the data needs of your application. Then you will move onto an important topic: the theme and plugin development process. In this section, you will learn how themes and plugins fit into an application while understanding basic to advanced techniques for extending themes and plugins.

With the basics covered, we explore the use of the wide range of APIs provided by WordPress and see how we can leverage them to rapidly build solutions. Next, we move onto another essential section, where we explore the techniques for capturing, processing, and displaying user data while integrating third-party components into the site's design. Finally, you will learn how to test and deploy the application with secure and maintainable code, while providing the best performance for end users.

By the end of this book, you will have the ability to choose the right components for any development task and build flexible solutions that work with existing plugins and themes.

 

Who this book is for

This book is intended for web developers and site owners who are planning to build custom websites with WordPress. Also, web developers could use this book as a starting point for getting into plugin and theme development. 

 

What this book covers

Chapter 1, Introduction to WordPress Development, covers the basic installation and configuration process of WordPress. Setting up the development environment, an introduction to WordPress coding standards, and understanding the WordPress file/folder structure are the highlights of this chapter.

Chapter 2, Managing Database Structure, Storage, and Retrieval, introduces you to the existing WordPress database table structure and its role in custom development. Executing basic queries, managing custom tables, and tracking the database usage of various features are the highlights of this chapter.

Chapter 3, Designing Flexible Frontends with Theme Development, explores the role and features of a theme in custom development. In-depth coverage of template hierarchy, custom template design, and custom development techniques in themes are the highlights of this chapter.

Chapter 4, Building Custom Modules with Plugin Development, explores the role of plugins and introduces the basics of developing a simple plugin. Understanding plugin life cycle events, identifying advantages of building plugins, and developing a plugin covering life cycle events are the highlights of this chapter.

Chapter 5, Extending Plugins with Add-ons, Filters, and Actions, focuses on extending existing plugins and core features with the use of add-ons and WordPress hooks. Customizing third-party plugins, integrating multiple plugins, and identifying the extendable features of existing plugins are the highlights of this chapter.

Chapter 6, Practical Usage of WordPress APIs, explores WordPress APIs and their functionality in custom development. Mastering the use of shortcodes, building custom routes with the Rewrite API, and allowing remote connections with REST APIs are the highlights of this chapter.

Chapter 7, Managing Custom Post Types and Processing Forms, explains the primary data capturing and managing process with custom post types and custom forms. Building object-oriented plugins for handling property management site with custom post types and building custom forms in the frontend are the highlights of this chapter.

 

Chapter 8Discovering Key Modules in Development, dives into the process of improving user experience with interactive designs and customized backend features. Integrating UI components, working with page builders, and simplifying backend admin features are the highlights of this chapter.

Chapter 9, Enhancing Security, Performance, and Maintenance, covers the non-functional aspects of development for building quality and reliable sites. Identifying the process of testing, steps for securing sites, migrating sites using plugins, and exploring the primary tasks of maintenance are the highlights of this chapter.

To get the most out of this book

Basic knowledge of PHP, JavaScript, HTML and CSS is required. You also need a computer, a browser, and an Internet connection with the following working environment:

  • An Apache web server
  • PHP version 5.4 or higher
  • WordPress version 4.9.8
  • MySQL version 5.6+ OR MariaDB 10.0+

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/WordPressDevelopmentQuickStartGuide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781789342871_ColorImages.pdf.

Code in action

Visit the following link to check out videos of the code being run:

http://bit.ly/2AzlbTj

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "We need to use the self::$instance object as we are within the static function."

A block of code is set as follows:

add_action( 'plugins_loaded', 'wqcpt_plugin_init' );
function wqcpt_plugin_init(){
  global $wqcpt;
  $wqcpt = WPQuick_CPT::instance();
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

add_action( 'plugins_loaded', 'wqcpt_plugin_init' );
function wqcpt_plugin_init(){
global $wqcpt;
  $wqcpt = WPQuick_CPT::instance();
}

 

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.