O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

WordPress Development Quick Start Guide

Book Description

Learn core WordPress concepts and components to create modern WordPress-based solutions

Key Features

  • Learn the foundations of WordPress development and its hook-based architecture
  • Choose the right components for any development task
  • Build flexible solutions that works with existing plugins and themes

Book Description

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.

What you will learn

  • Explore the role of themes, plugins, and built-in features in development
  • Adapt to built-in modules and built-in database structures
  • Write code for WordPress's hook-based architecture
  • Build, customize, and integrate WordPress plugins
  • Extend themes with custom design templates
  • Capture and process data with built-in features and custom forms
  • Improve usability with AJAX and third-party components
  • Manage non-functional aspects, such as security, performance, and migration

Who this book is for

This book is for web developers and site owners who want to build custom websites with WordPress. Basic knowledge of PHP, JavaScript, HTML and CSS is required to get most out of this book.

Downloading the example code for this book 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.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. WordPress Development Quick Start Guide
  3. Packt Upsell
    1. Why subscribe?
    2. Packt.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Code in action
      4. Conventions used
    4. Get in touch
      1. Reviews
  6. Introduction to WordPress Development
    1. Introduction to WordPress development
      1. Posts, pages, and custom post type management
      2. User management
      3. Form data management
      4. Building custom layouts and extending theme layouts
    2. Setting up the development environment
      1. Installing the development stack
        1. Installing and configuring WordPress
        2. Setting up web browsers and code editors
      2. Preparing development tools
        1. Client-side monitoring with browser development tools
        2. Server-side monitoring with WordPress plugins
          1. Query Monitor
          2. Debug This
      3. Working with the configuration file
      4. An overview of advanced configurations
        1. Securing plugins and upload directories
        2. Configuring advanced debugging settings
          1. Script debugging
          2. Logging errors and customizing php.ini rules
    3. Understanding the role of the WordPress file and directory structure
      1. How to choose files and directories for development
    4. A brief overview of WordPress coding standards
    5. Summary
  7. Managing Database Structure, Storage, and Retrieval
    1. Introduction to the WordPress database
    2. Understanding the role of built-in database tables
      1. Posts-related database tables
        1. wp_posts 
        2. wp_postmeta 
      2. Terms-related tables
        1. wp_terms 
        2. wp_termmeta 
        3. wp_term_relationships 
        4. wp_term_taxonomy 
      3. User-related tables
        1. wp_users 
        2. wp_usermeta
      4. Options and comments tables
        1. wp_options 
        2. wp_comments 
        3. wp_commentmeta 
    3. Understanding the importance of database usage
      1. Building existing features on the frontend
      2. Customizing existing plugins
    4. How to track database usage in WordPress
      1. Using MySQL/MariaDB log files 
      2. Comparing database backups 
      3. Creating a manual query logger 
    5. Tracking database usage of common WordPress features
      1. Post creation
      2. Page creation
      3. User creation
      4. Media uploads
    6. Overview of the multisite database structure
    7. Creating and managing custom tables
      1. Creating custom tables
    8. Executing basic CRUD operations on existing tables
      1. Inserting records
      2. Updating records
      3. Deleting records
      4. Selecting records
    9. Executing basic CRUD operations on custom tables
      1. Inserting records
      2. Updating and deleting records
      3. Selecting records
    10. Summary
  8. Designing Flexible Frontends with Theme Development
    1. Technical requirements
    2. Introduction to WordPress themes
      1. Installing and configuring themes
    3. Understanding the role of themes in development
      1. What are application-specific themes?
    4. Understanding built-in theme components
      1. Identifying theme components that are used in existing sites
    5. Getting started with developing themes
      1. What is a child theme?
        1. Creating a child theme
        2. Modifying parent themes with a child theme
          1. Building and customizing designs by modifying template files
      2. Extending theme features through available filters and actions
        1. Steps for extending theme-specific hooks
    6. Working with the WordPress theme template hierarchy
      1. Archive Page hierarchy
        1. Author archive pages
        2. Categories, tags, and custom taxonomy archives
        3. Date Archive pages
        4. Custom Post Type Archive
      2. Singular Page Hierarchy
        1. Static Page Hierarchy
          1. Creating and using custom page templates
      3. Single Post Page hierarchy
        1. Attachment Post hierarchy
        2. Blog post hierarchy
          1. Creating and assigning page templates for posts
        3. Custom post hierarchy
      4. Other Pages in the template hierarchy
        1. Site Front Page template path
        2. Blog Posts Index Page template path
        3. Error 404 Page template path
        4. Search Result Page template path
    7. Conditionally changing template design and content
      1. What is conditional template design?
        1. Adding conditions to theme files
        2. Conditionally loading template files
    8. Summary
  9. Building Custom Modules with Plugin Development
    1. Technical requirements
    2. Understanding the role of plugins
      1. WordPress plugin types based on features
    3. Creating your first plugin
    4. Exploring the life cycle of a plugin
    5. Developing a post attachments plugin
      1. Creating settings upon plugin activation
      2. Implementing post attachment uploads
      3. Uploading attachments and saving attachment data
      4. Displaying uploaded attachments
      5. Displaying attachments in posts
      6. Implementing the post attachments download
      7. Handling plugin version upgrades
      8. Handling plugin deactivation
      9. Uninstalling the plugin to clean the resources
    6. Identifying the advantages of custom plugin development as a developer
    7. Guidelines for building quality plugins
    8. Summary
  10. Extending Plugins with Addons, Filters, and Actions
    1. Technical Requirements
    2. Introduction to addons
    3. Creating addons for plugins
      1. Adding a filter hook for restricting attachments
        1. Adding an action hook for counting downloads
      2. Creating the attachments addon
    4. The WordPress action execution process
      1. The frontend action execution process
        1. Scenario 1 – Using parent plugin features
        2. Scenario 2 – Accessing the WordPress post object
        3. Scenario 3 – Accessing the WordPress query object
      2. The backend action execution process
      3. How to use the priority of actions and filters
    5. Identifying the extendable features of third-party plugins
    6. Customizing third-party plugins
      1. Techniques for customizing third-party plugins
        1. Customizing look and feel using styles
        2. Customizing the features with hooks
      2. Building the WooCommerce product file manager
        1. Adding the file upload field to WooCommerce products
        2. Adding scripts for uploading files
        3. Uploading files to products
          1. Introduction to AJAX in WordPress
        4. Displaying uploaded files in products
    7. Integrating multiple plugins for a continuous workflow
      1. Types of plugin integrations
        1. Custom integrations
        2. One-sided integrations
        3. Mutual integrations
      2. Considerations in custom plugin integrations
        1. Checking the feasibility of integration
        2. Identifying exact data changes and hooks
        3. Checking the impact with other plugins
      3. Implementing multiple plugin integrations
        1. Assigning points for completed orders
        2. Adding users to BuddyPress private groups
    8. Summary
  11. Practical Usage of WordPress APIs
    1. Technical Requirements
    2. A brief overview of WordPress APIs
      1. Using built-in APIs
    3. Introducing shortcodes
      1. Structure of a shortcode
        1. Developer's perspective of a shortcode
        2. Content creator perspective of a shortcode
        3. User's perspective of a shortcode
      2. Using built-in shortcodes
    4. Building custom shortcodes
      1. Creating custom shortcodes
        1. Restricting content using a shortcode
        2. Displaying posts with attachments
    5. Understanding the usage of shortcodes
      1. Tips for using shortcodes
    6. Managing custom routes with Rewrite API
      1. Understanding the need for custom routes
      2. Creating the routing rules
      3. Adding query variables
      4. Flushing the rewriting rules
      5. Displaying content for custom routes
    7. Building remote connections with REST API
      1. Introducing core REST API endpoints
        1. Understanding and testing Core API endpoints
      2. Managing custom routes and endpoints
        1. Creating custom routes for posts
        2. Creating custom routes and endpoints for custom table data
      3. Building the REST API client
        1. REST API client from external site
    8. Summary
  12. Managing Custom Post Types and Processing Forms
    1. Technical requirements
    2. Introduction to custom post types
      1. Why do we use custom post types for modeling data?
    3. Building an object-oriented plugin
    4. Building custom post types for properties
      1. Creating property custom post types
      2. Creating the property types taxonomy
      3. Managing custom fields for custom post types
      4. Building the property fields template
      5. Saving property custom fields
        1. Limitations of storing data as meta values
    5. Introduction to form management
      1. Building custom forms in the frontend
        1. Adding forms using a shortcode
          1. Creating properties using custom forms
        2. Loading forms using custom URLs
      2. Choosing between custom post types and custom forms
    6. Using a form management plugin
    7. Summary
  13. Discovering Key Modules in Development
    1. Technical requirements
    2. UI components
      1. Integrating the jQuery image slider
      2. Building a product image slider
        1. Creating a plugin menu page
        2. Saving slider images using AJAX
        3. Preparing slider images
        4. Integrating jQuery slider
      3. Reusing the slider as a widget
    3. Integrating jQuery accordion
      1. Creating an accordion model and capturing data
      2. Preparing accordion content
    4. Steps for integrating UI components
    5. Simplifying development with page builders
      1. Understanding the features of page builders
      2. Developing components for page builders
    6. Simplifying and customizing admin features
      1. Creating custom dashboard widgets
        1. Registering and building dashboard widgets
      2. Customizing backend list tables
        1. Creating and executing custom bulk actions
        2. Adding custom list columns
        3. Sorting custom column values
    7. Summary
  14. Enhancing Security, Performance, and Maintenance
    1. Introduction to testing
      1. Unit and integration testing
      2. Code quality testing
        1. Using the PluginTests service
      3. Performance testing
        1. P3 - the Plugin Performance Profiler plugin
    2. Securing WordPress sites
    3. Migrating WordPress sites
    4. Maintaining WordPress sites
      1. Backup files and databases
      2. Updating WordPress plugins and themes
      3. Optimizing database tables 
      4. Checking request errors and broken links
      5. Checking error logs
    5. Summary
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think