SlideShare a Scribd company logo
Building Web Apps with WordPress WordPress as an
Application Framework Brian Messenlehner
download
https://textbookfull.com/product/building-web-apps-with-
wordpress-wordpress-as-an-application-framework-brian-
messenlehner/
Download more ebook from https://textbookfull.com
We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!
WordPress Genius Guide Coll.
https://textbookfull.com/product/wordpress-genius-guide-coll/
WordPress fundamentals A comprehensive beginner s guide
to WordPress 3rd Edition Kathleen Peterson
https://textbookfull.com/product/wordpress-fundamentals-a-
comprehensive-beginner-s-guide-to-wordpress-3rd-edition-kathleen-
peterson/
WordPress for Beginners Imagine Publishing Ltd
https://textbookfull.com/product/wordpress-for-beginners-imagine-
publishing-ltd/
Wordpress plugin Development 2nd Edition Williams
https://textbookfull.com/product/wordpress-plugin-
development-2nd-edition-williams/
WordPress Security Made Easy 1st Edition Niko Guruli
https://textbookfull.com/product/wordpress-security-made-
easy-1st-edition-niko-guruli/
Server Side Swift with Vapor Building Web APIs and Web
Apps in Swift 3rd Edition Raywenderlich.Com Tutorial
Team
https://textbookfull.com/product/server-side-swift-with-vapor-
building-web-apis-and-web-apps-in-swift-3rd-edition-
raywenderlich-com-tutorial-team/
Practical Node.js: Building Real-World Scalable Web
Apps Azat Mardan
https://textbookfull.com/product/practical-node-js-building-real-
world-scalable-web-apps-azat-mardan/
Progressive Web Apps with React Create Lightning Fast
Web Apps With Native Power Using React and Firebase 1st
Edition Scott Domes
https://textbookfull.com/product/progressive-web-apps-with-react-
create-lightning-fast-web-apps-with-native-power-using-react-and-
firebase-1st-edition-scott-domes/
Introducing Play Framework Java Web Application
Development Second Edition Prem Kumar Karunakaran
https://textbookfull.com/product/introducing-play-framework-java-
web-application-development-second-edition-prem-kumar-
karunakaran/
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
1. Foreword
2. Preface
a. Who This Book Is For
b. Who This Book Is Not For
c. What You’ll Learn
d. About the Code
e. Conventions Used in This Book
f. Using Code Examples
g. O’Reilly Online Learning
h. How to Contact Us
i. Acknowledgments
3. 1. Building Web Apps with WordPress
a. What Is a Website?
b. What Is an App?
c. What Is a Web App?
i. Features of a Web App
ii. Mobile Apps
iii. Progressive Web Apps
d. Why Use WordPress?
i. You Are Already Using WordPress
ii. Content Management Is Easy with
WordPress
iii. User Management Is Easy and Secure
with WordPress
iv. Plugins
v. Flexibility Is Important
vi. Frequent Security Updates
vii. Cost
viii. Responses to Some Common Criticisms
of WordPress
e. When Not to Use WordPress
i. You Plan to License or Sell Your Site’s
Technology
ii. Another Platform Will Get You “There”
Faster
iii. Flexibility Is Not Important to You
iv. Your App Needs to Be Highly Real
Time
f. WordPress as an Application Framework
i. WordPress Versus Model-View-
Controller Frameworks
g. Anatomy of a WordPress App
i. What Is SchoolPress?
ii. SchoolPress Runs on a WordPress
Multisite Network
iii. The SchoolPress Business Model
iv. Membership Levels and User Roles
v. Classes Are BuddyPress Groups
vi. Assignments Are a CPT
vii. Submissions Are a (Sub)CPT for
Assignments
viii. Semesters Are a Taxonomy on the Class
CPT
ix. Departments Are a Taxonomy on the
Class CPT
x. SchoolPress Has One Main Custom
Plugin
xi. SchoolPress Uses a Few Other Custom
Plugins
xii. SchoolPress Uses the Memberlite
Theme
4. 2. WordPress Basics
a. WordPress Directory Structure
i. Root Directory
ii. /wp-admin
iii. /wp-includes
iv. /wp-content
b. WordPress Database Structure
i. wp_options
ii. Functions Found in /wp-
includes/option.php
iii. wp_users
iv. Functions Found in /wp-includes/…
v. wp_usermeta
vi. wp_posts
vii. Functions Found in /wp-
includes/post.php
viii. wp_postmeta
ix. Functions Found in /wp-
includes/post.php
x. wp_comments
xi. Functions Found in /wp-
includes/comment.php
xii. wp_commentsmeta
xiii. Functions Found in /wp-
includes/comment.php
xiv. wp_terms
xv. Functions Found in /wp-
includes/taxonomy.php
xvi. wp_termmeta
xvii. wp_term_taxonomy
xviii. /wp-includes/taxonomy.php
xix. wp_term_relationships
c. Hooks: Actions and Filters
i. Actions
ii. Filters
d. Development and Hosting Environments
i. Working Locally
ii. Choosing a Web Host
iii. Development, Staging, and Production
Environments
e. Extending WordPress
5. 3. Using WordPress Plugins
a. The General Public License, Version 2, License
b. Installing WordPress Plugins
c. Building Your Own Plugin
d. File Structure for an App Plugin
i. /adminpages/
ii. /classes/
iii. /css/
iv. /js/
v. /images/
vi. /includes/
vii. /includes/lib/
viii. /pages/
ix. /services/
x. /scheduled/
xi. /schoolpress.php
e. Add-Ons to Existing Plugins
f. Use Cases and Examples
i. The WordPress Loop
ii. WordPress Global Variables
g. Free Plugins
i. Admin Columns
ii. Advanced Custom Fields
iii. BadgeOS
iv. Posts 2 Posts
v. Members
vi. W3 Total Cache
vii. Yoast SEO
h. Premium Plugins
i. Gravity Forms
ii. BackupBuddy
iii. WP All Import
i. Community Plugins
i. BuddyPress
6. 4. Themes
a. Themes Versus Plugins
i. Where to Place Code When Developing
Apps
ii. When Developing Plugins
iii. Where to Place Code When Developing
Themes
b. The Template Hierarchy
c. Page Templates
i. Sample Page Template
ii. Using Hooks to Copy Templates
iii. When Should You Use a Theme
Template?
d. Theme-Related WordPress Functions
i. Using locate_template in Your Plugins
e. Style.css
i. Versioning Your Theme’s CSS Files
f. functions.php
g. Themes and CPTs
h. Popular Theme Frameworks
i. WordPress Theme Frameworks
ii. Non-WordPress Theme Frameworks
i. Creating a Child Theme for Memberlite
j. Including Bootstrap in Your App’s Theme
k. Menus
i. Navigation Menus
ii. Dynamic Menus
l. Responsive Design
i. Device and Display Detection in CSS
ii. Device and Feature Detection in
JavaScript
iii. Device Detection in PHP
iv. Final Note on Browser Detection
7. 5. Custom Post Types, Post Metadata, and Taxonomies
a. Default Post Types and CPTs
i. Page
ii. Post
iii. Attachment
iv. Revisions
v. Navigation Menu Item
vi. Custom CSS
vii. Changesets
viii. oEmbed Cache
ix. User Requests
x. Reusable Blocks
b. Defining and Registering CPTs
i. register_post_type( $post_type, $args
);
c. What Is a Taxonomy and How Should I Use It?
i. Taxonomies Versus Post Meta
ii. Creating Custom Taxonomies
iii. register_taxonomy( $taxonomy,
$object_type, $args )
iv. register_taxonomy_for_object_type(
$taxonomy, $object_type )
d. Using CPTs and Taxonomies in Your Themes
and Plugins
i. The Theme Archive and Single
Template Files
ii. Good Old WP_Query and get_posts()
e. Metadata with CPTs
i. add_meta_box( $id, $title, $callback,
$screen, $context, $priority,
$callback_args )
ii. Using Meta Boxes with the Block
Editor
f. Custom Wrapper Classes for CPTs
i. Extending WP_Post Versus Wrapping
It
ii. Why Use Wrapper Classes?
iii. Keep Your CPTs and Taxonomies
Together
iv. Keep It in the Wrapper Class
v. Wrapper Classes Read Better
8. 6. Users, Roles, and Capabilities
a. Getting User Data
b. Add, Update, and Delete Users
c. Hooks and Filters
d. What Are Roles and Capabilities?
i. Checking a User’s Role and Capabilities
ii. Creating Custom Roles and Capabilities
e. Extending the WP_User Class
f. Adding Registration and Profile Fields
g. Customizing the Users Table in the Dashboard
h. Plugins
i. Theme My Login
ii. Hide the Admin Bar from
Nonadministrators
iii. Paid Memberships Pro
iv. PMPro Register Helper
v. Members
vi. WP User Fields
9. 7. Working with WordPress APIs, Objects, and Helper
Functions
a. Shortcode API
i. Shortcode Attributes
ii. Nested Shortcodes
iii. Removing Shortcodes
iv. Other Useful Shortcode-Related
Functions
b. Widgets API
i. Before You Add Your Own Widget
ii. Adding Widgets
iii. Defining a Widget Area
iv. Embedding a Widget Outside of a
Dynamic Sidebar
c. Dashboard Widgets API
i. Removing Dashboard Widgets
ii. Adding Your Own Dashboard Widget
d. Settings API
i. Do You Really Need a Settings Page?
ii. Could You Use a Hook or Filter
Instead?
iii. Use Standards When Adding Settings
iv. Ignore Standards When Adding
Settings
e. Rewrite API
i. Adding Rewrite Rules
ii. Flushing Rewrite Rules
iii. Other Rewrite Functions
f. WP-Cron
i. Adding Custom Intervals
ii. Scheduling Single Events
iii. Kicking Off Cron Jobs from the Server
iv. Using Server Crons Only
g. WP Mail
i. Sending Nicer Emails with WordPress
h. File Header API
i. Adding File Headers to Your Own Files
ii. Adding New Headers to Plugins and
Themes
i. Heartbeat API
10. 8. Secure WordPress
a. Why It’s Important
b. Security Basics
i. Update Frequently
ii. Don’t Use the Username “admin”
iii. Use a Strong Password
iv. Examples of Bad Passwords
v. Examples of Good Passwords
c. Hardening WordPress
i. Don’t Allow Admins to Edit Plugins or
Themes
ii. Change Default Database Tables Prefix
iii. Move wp-config.php
iv. Hide Login Error Messages
v. Hide Your WordPress Version
vi. Don’t Allow Logins via wp-login.php
vii. Add Custom .htaccess Rules for
Locking Down wp-admin
d. SSL Certificates and HTTPS
i. Installing an SSL Certificate on Your
Server
ii. WordPress Login and WordPress
Administrator over SSL
iii. Debugging HTTPS Issues
iv. Avoiding SSL Errors with the “Nuclear
Option”
e. Back Up Everything!
f. Scan, Scan, Scan!
g. Useful Security Plugins
i. Spam-Blocking Plugins
ii. Backup Plugins
iii. Firewall/Scanner Plugins
iv. Login and Password-Protection Plugins
h. Writing Secure Code
i. Check User Capabilities
ii. Custom SQL Statements
iii. Data Validation, Sanitization, and
Escaping
iv. Nonces
11. 9. JavaScript Frameworks and Workflow
a. What Is ECMAScript?
b. What Is ES6?
c. What Is ES9?
d. What Is ESNext?
e. What Is Ajax?
f. What Is JSON?
g. jQuery and WordPress
i. Enqueuing Other JavaScript Libraries
ii. Where to Put Your Custom JavaScript
h. Ajax Calls with WordPress and jQuery
i. Managing Multiple Ajax Requests
j. Heartbeat API
k. WordPress Limitations with Asynchronous
Processing
l. JavaScript Frameworks
i. Backbone.js
ii. React
12. 10. WordPress REST API
a. What Is a REST API?
i. API
ii. REST
iii. JSON
iv. HTTP
b. Why Use the WordPress REST API?
c. Using the WordPress REST API V2
i. Discovery
ii. Authentication
iii. Routes and Endpoints
iv. Requests
v. Responses
d. Adding Your Own Routes and Endpoints
i. register_rest_route( $namespace,
$route, $args, $override );
ii. Setting Up the WordPress Single Sign-
On Plugin
iii. Adding the /wp-sso/v1/check Route
iv. Bundling Basic Authentication with
Our Plugin
v. Using the Endpoint We Set Up to
Check User Credentials
e. Popular Plugins Using the WordPress REST
API
i. WooCommerce
ii. BuddyPress
iii. Paid Memberships Pro
13. 11. Project Gutenberg, Blocks, and Custom Block Types
a. The WordPress Editor
b. The Classic Editor Plugin
c. Using Blocks for Content and Design
d. Using Blocks for Functionality
e. Creating Your Own Blocks
i. Minimal Block Example
f. Using Custom Blocks to Build App Experiences
i. Enabling the Block Editor in Your CPTs
ii. Block Categories
iii. The Homework Blocks
iv. Limiting Blocks to Specific CPTs
v. Limiting CPTs to Specific Blocks
vi. Block Templates
vii. Saving Block Data to Post Meta
g. Tips
i. Enable WP_SCRIPT_DEBUG
ii. Use filemtime() for the Script Version
iii. More Tips
iv. Learn JavaScript, Node.js, and React
More Deeply
14. 12. WordPress Multisite Networks
a. Why Multisite?
b. Why Not Multisite?
c. Multisite Alternatives
i. Multiple Authors or Categories on the
Same WordPress Site
ii. Custom Post Types
iii. Totally Separate Sites
iv. Use a WordPress Maintenance Service
v. Multitenancy
d. Setting Up a Multisite Network
e. Managing a Multisite Network
i. Dashboard
ii. Sites
iii. Users
iv. Themes
v. Plugins
vi. Settings
vii. Updates
f. Multisite Database Structure
i. Networkwide Tables
ii. Individual Site Tables
iii. Shared Site Tables
g. Domain Mapping
h. Random Useful Multisite Plugins
i. Gravity Forms User Registration Add-
On
ii. Member Network Sites Add-On for
Paid Memberships Pro
iii. More Privacy Options
iv. Multisite Global Media
v. Multisite Plugin Manager
vi. Multisite Global Search
vii. Multisite Robots.txt Manager
viii. NS Cloner: Site Copier
ix. WP Multi Network
i. Basic Multisite Functionality
i. $blog_id
ii. is_multisite()
iii. get_current_blog_id()
iv. switch_to_blog( $new_blog )
v. restore_current_blog()
vi. get_blog_details( $fields = null,
$get_all = true )
vii. update_blog_details( $blog_id,
$details = array() )
viii. get_blog_status( $id, $pref )
ix. update_blog_status( $blog_id, $pref,
$value )
x. get_blog_option( $id, $option,
$default = false )
xi. update_blog_option( $id, $option,
$value )
xii. delete_blog_option( $id, $option )
xiii. get_blog_post( $blog_id, $post_id )
xiv. add_user_to_blog( $blog_id,
$user_id, $role )
xv. wpmu_delete_user( $user_id )
xvi. create_empty_blog( $domain, $path,
$weblog_title, $site_id = 1 )
xvii. Functions We Didn’t Mention
15. 13. Localizing WordPress Apps
a. Do You Even Need to Localize Your App?
b. How Localization Is Done in WordPress
c. Defining Your Locale in WordPress
d. Text Domains
i. Setting the Text Domain
e. Prepping Your Strings with Translation
Functions
i. __( $text, $domain = “default” )
ii. _e( $text, $domain = “default” )
iii. _x( $text, $context, $domain =
“default” )
iv. _ex( $title, $context, $domain =
“default” )
v. Escaping and Translating at the Same
Time
f. Creating and Loading Translation Files
i. Our File Structure for Localization
ii. Generating a .pot File
iii. Creating a .po File
iv. Creating a .mo File
g. GlotPress
i. Using GlotPress for Your
WordPress.org Plugins and Themes
ii. Creating Your Own GlotPress Server
16. 14. WordPress Optimization and Scaling
a. Terms
b. Origin Versus Edge
c. Testing
i. What to Test
ii. Chrome Debug Bar
iii. The WordPress Site Health Tool
iv. Apache Bench
v. Siege
d. W3 Total Cache
i. Page Cache Settings
ii. Minify
iii. Database Caching
iv. Object Cache
v. CDNs
vi. GZIP Compression
e. Hosting
i. WordPress-Specific Hosts
ii. Rolling Your Own Server
f. Selective Caching
i. The Transient API
ii. Multisite Transients
g. Using JavaScript to Increase Performance
h. Custom Tables
i. Bypassing WordPress
17. 15. Ecommerce
a. Choosing a Plugin
i. WooCommerce
ii. Paid Memberships Pro
iii. Easy Digital Downloads
b. Payment Gateways
c. Merchant Accounts
d. Setting Up SaaS with Paid Memberships Pro
e. The SaaS Model
i. Step 0: Establishing How You Want to
Charge for Your App
ii. Step 1: Installing and Activating Paid
Memberships Pro
iii. Step 2: Setting Up the Level
iv. Step 3: Setting Up Pages
v. Step 4: Choosing Payment Settings
vi. Step 5: Choosing Email Settings
vii. Step 6: Choosing Advanced Settings
viii. Step 7: Locking Down Pages
ix. Step 8: Customizing Paid Memberships
Pro
18. 16. Mobile Apps Powered by WordPress
a. Mobile App Use Cases
b. Native and Hybrid Mobile Apps
i. What Is a Native Mobile App?
ii. What Is a Hybrid Mobile App?
iii. Why Hybrid over Native?
iv. Cordova
v. Ionic Framework
vi. App Wrapper
vii. AppPresser
19. 17. PHP Libraries, Web Service Integrations, and
Platform Migrations
a. PHP Libraries
i. Image Generation and Manipulation
ii. PDF Generation
iii. Geolocation and Geotargeting
iv. File Compression and Archiving
v. Developer Tools
b. External APIs and Web Services
i. Elasticsearch
ii. ElasticPress by 10up
iii. Google Vision
iv. Google Maps
v. Google Translate
vi. Twilio
vii. Other Popular APIs
c. Migrations
i. Host Migrations
ii. Platform Migrations
iii. Create a Data Mapping Guide
20. 18. The Future
a. Where We’ve Been
b. The REST API
i. WordPress Plugins Will Focus More on
APIs
ii. Headless WordPress
iii. GraphQL
c. Gutenberg
i. The Administrator Interface Will Move
to React/Gutenberg
ii. Gutenberg Will Power a Frontend
Editing Experience for WordPress
iii. Block Templates Will Replace Themes
iv. Blocks Will Replace Plugins
d. WordPress Market Share Will Increase and
Decrease
e. WordPress Will Become a More Popular
Platform for Mobile Development
f. WordPress Will Continue to Be Useful for
Developing Apps of All Kinds
21. Index
Praise for Building Web Apps with WordPress, Second
Edition
“WordPress is more than just software, it’s a movement that
is becoming the de facto operating system of the web. More
than just a blog or a CMS, when you learn how to use
WordPress as an application platform you’ll be at the
forefront of the third wave of its growth.”
—Matt Mullenweg, Cofounder of WordPress
“Brian and Jason have grown side by side with WordPress for
years, and successfully demonstrate how, for the right kind
of app, developers can leverage that engine to build more
secure, more performant applications in half the time.”
—Jake Goldman, President and Founder of 10up
"Building Web Apps with WordPress is a great resource for
developers looking to learn or currently working with the
PHP-oriented approach to creating WordPress web apps.”
—Dave Mackey, Web/Software Developer, Liquid
Church
Building Web Apps with
WordPress
WordPress as an Application Framework
SECOND EDITION
Brian Messenlehner and Jason Coleman
Building Web Apps with WordPress
by Brian Messenlehner and Jason Coleman
Copyright © 2020 Brian Messenlehner and Jason Coleman. All
rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway
North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or
sales promotional use. Online editions are also available for
most titles (http://oreilly.com). For more information, contact
our corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Acquisitions Editor: Jennifer Pollock
Development Editor: Alicia Young
Production Editor: Deborah Baker
Copyeditor: Octal Publishing, LLC
Proofreader: Rachel Monaghan
Interior Designer: David Futato
Cover Designer: Karen Montgomery
Illustrator: Rebecca Demarest
April 2014: First Edition
December 2019: Second Edition
Revision History for the Second Edition
2019-12-11: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491990087
for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media,
Inc. Building Web Apps with WordPress, the cover image, and
related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the authors have used good faith
efforts to ensure that the information and instructions
contained in this work are accurate, the publisher and the
authors disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting
from the use of or reliance on this work. Use of the information
and instructions contained in this work is at your own risk. If
any code samples or other technology this work contains or
describes is subject to open source licenses or the intellectual
property rights of others, it is your responsibility to ensure that
your use thereof complies with such licenses and/or rights.
978-1-491-99008-7
Discovering Diverse Content Through
Random Scribd Documents
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except
for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you
discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.
1.F.4. Except for the limited right of replacement or refund set
forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the
Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.
Section 2. Information about the Mission
of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.
Section 3. Information about the Project
Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.
The Foundation’s business office is located at 809 North 1500
West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.
The Foundation is committed to complying with the laws
regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.
While we cannot and do not solicit contributions from states
where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot
make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.
Please check the Project Gutenberg web pages for current
donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.
Section 5. General Information About
Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.
Project Gutenberg™ eBooks are often created from several
printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
This website includes information about Project Gutenberg™,
including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
back
back
back
back
back
back
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
back
back
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
back
back
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
back
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
back
back
back
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
back
Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner
back
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
textbookfull.com

More Related Content

PDF
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
PDF
Wordpress as a framework
PDF
Best Wordprees development company in bangalore
PDF
Website development PDF which helps others make it easy
PPTX
WordPress DK at DrupalCamp Copenhagen 2009
PPTX
From WordPress With Love
PDF
Word camp Raleigh 2017 - Wordpress for Beginners
PPTX
Introduction to WordPress
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Wordpress as a framework
Best Wordprees development company in bangalore
Website development PDF which helps others make it easy
WordPress DK at DrupalCamp Copenhagen 2009
From WordPress With Love
Word camp Raleigh 2017 - Wordpress for Beginners
Introduction to WordPress

Similar to Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner (20)

PDF
Important Topics for wordPress Interview.pdf
PPT
WordPress Complete Tutorial
PDF
eMusic: WordPress in the Enterprise
PDF
WordPress Beginners Workshop
PPTX
Meeple Communications Introduction to WordPress April 2017
PDF
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
PDF
WordCamp Raleigh 2018 - Beginner's Guide to Wordpress
DOCX
Wordpress WebDevelopment services in lahore
PPTX
Part1 learn thelingo
PPTX
Web design basics_03
PPTX
The WordPress University 2012
PDF
Learn word press-from-scratch
PDF
Wordpress course
PDF
All about word press
PPTX
Wordpress
PDF
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
KEY
WordPress Developers Israel Meetup #1
PPT
Internet Librarian Slides
PDF
Wordpress Guide
PPSX
WordPress Theme Design and Development Workshop - Day 2
Important Topics for wordPress Interview.pdf
WordPress Complete Tutorial
eMusic: WordPress in the Enterprise
WordPress Beginners Workshop
Meeple Communications Introduction to WordPress April 2017
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Raleigh 2018 - Beginner's Guide to Wordpress
Wordpress WebDevelopment services in lahore
Part1 learn thelingo
Web design basics_03
The WordPress University 2012
Learn word press-from-scratch
Wordpress course
All about word press
Wordpress
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordPress Developers Israel Meetup #1
Internet Librarian Slides
Wordpress Guide
WordPress Theme Design and Development Workshop - Day 2
Ad

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Institutional Correction lecture only . . .
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Pharma ospi slides which help in ospi learning
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Basic Mud Logging Guide for educational purpose
PDF
Business Ethics Teaching Materials for college
STATICS OF THE RIGID BODIES Hibbelers.pdf
Institutional Correction lecture only . . .
O5-L3 Freight Transport Ops (International) V1.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Pharma ospi slides which help in ospi learning
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
VCE English Exam - Section C Student Revision Booklet
Module 4: Burden of Disease Tutorial Slides S2 2025
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
RMMM.pdf make it easy to upload and study
Microbial diseases, their pathogenesis and prophylaxis
Basic Mud Logging Guide for educational purpose
Business Ethics Teaching Materials for college
Ad

Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner

  • 1. Building Web Apps with WordPress WordPress as an Application Framework Brian Messenlehner download https://textbookfull.com/product/building-web-apps-with- wordpress-wordpress-as-an-application-framework-brian- messenlehner/ Download more ebook from https://textbookfull.com
  • 2. We believe these products will be a great fit for you. Click the link to download now, or visit textbookfull.com to discover even more! WordPress Genius Guide Coll. https://textbookfull.com/product/wordpress-genius-guide-coll/ WordPress fundamentals A comprehensive beginner s guide to WordPress 3rd Edition Kathleen Peterson https://textbookfull.com/product/wordpress-fundamentals-a- comprehensive-beginner-s-guide-to-wordpress-3rd-edition-kathleen- peterson/ WordPress for Beginners Imagine Publishing Ltd https://textbookfull.com/product/wordpress-for-beginners-imagine- publishing-ltd/ Wordpress plugin Development 2nd Edition Williams https://textbookfull.com/product/wordpress-plugin- development-2nd-edition-williams/
  • 3. WordPress Security Made Easy 1st Edition Niko Guruli https://textbookfull.com/product/wordpress-security-made- easy-1st-edition-niko-guruli/ Server Side Swift with Vapor Building Web APIs and Web Apps in Swift 3rd Edition Raywenderlich.Com Tutorial Team https://textbookfull.com/product/server-side-swift-with-vapor- building-web-apis-and-web-apps-in-swift-3rd-edition- raywenderlich-com-tutorial-team/ Practical Node.js: Building Real-World Scalable Web Apps Azat Mardan https://textbookfull.com/product/practical-node-js-building-real- world-scalable-web-apps-azat-mardan/ Progressive Web Apps with React Create Lightning Fast Web Apps With Native Power Using React and Firebase 1st Edition Scott Domes https://textbookfull.com/product/progressive-web-apps-with-react- create-lightning-fast-web-apps-with-native-power-using-react-and- firebase-1st-edition-scott-domes/ Introducing Play Framework Java Web Application Development Second Edition Prem Kumar Karunakaran https://textbookfull.com/product/introducing-play-framework-java- web-application-development-second-edition-prem-kumar- karunakaran/
  • 5. 1. Foreword 2. Preface a. Who This Book Is For b. Who This Book Is Not For c. What You’ll Learn d. About the Code e. Conventions Used in This Book f. Using Code Examples g. O’Reilly Online Learning h. How to Contact Us i. Acknowledgments 3. 1. Building Web Apps with WordPress a. What Is a Website? b. What Is an App? c. What Is a Web App? i. Features of a Web App ii. Mobile Apps iii. Progressive Web Apps d. Why Use WordPress? i. You Are Already Using WordPress ii. Content Management Is Easy with WordPress
  • 6. iii. User Management Is Easy and Secure with WordPress iv. Plugins v. Flexibility Is Important vi. Frequent Security Updates vii. Cost viii. Responses to Some Common Criticisms of WordPress e. When Not to Use WordPress i. You Plan to License or Sell Your Site’s Technology ii. Another Platform Will Get You “There” Faster iii. Flexibility Is Not Important to You iv. Your App Needs to Be Highly Real Time f. WordPress as an Application Framework i. WordPress Versus Model-View- Controller Frameworks g. Anatomy of a WordPress App i. What Is SchoolPress? ii. SchoolPress Runs on a WordPress Multisite Network iii. The SchoolPress Business Model iv. Membership Levels and User Roles
  • 7. v. Classes Are BuddyPress Groups vi. Assignments Are a CPT vii. Submissions Are a (Sub)CPT for Assignments viii. Semesters Are a Taxonomy on the Class CPT ix. Departments Are a Taxonomy on the Class CPT x. SchoolPress Has One Main Custom Plugin xi. SchoolPress Uses a Few Other Custom Plugins xii. SchoolPress Uses the Memberlite Theme 4. 2. WordPress Basics a. WordPress Directory Structure i. Root Directory ii. /wp-admin iii. /wp-includes iv. /wp-content b. WordPress Database Structure i. wp_options ii. Functions Found in /wp- includes/option.php iii. wp_users
  • 8. iv. Functions Found in /wp-includes/… v. wp_usermeta vi. wp_posts vii. Functions Found in /wp- includes/post.php viii. wp_postmeta ix. Functions Found in /wp- includes/post.php x. wp_comments xi. Functions Found in /wp- includes/comment.php xii. wp_commentsmeta xiii. Functions Found in /wp- includes/comment.php xiv. wp_terms xv. Functions Found in /wp- includes/taxonomy.php xvi. wp_termmeta xvii. wp_term_taxonomy xviii. /wp-includes/taxonomy.php xix. wp_term_relationships c. Hooks: Actions and Filters i. Actions ii. Filters
  • 9. d. Development and Hosting Environments i. Working Locally ii. Choosing a Web Host iii. Development, Staging, and Production Environments e. Extending WordPress 5. 3. Using WordPress Plugins a. The General Public License, Version 2, License b. Installing WordPress Plugins c. Building Your Own Plugin d. File Structure for an App Plugin i. /adminpages/ ii. /classes/ iii. /css/ iv. /js/ v. /images/ vi. /includes/ vii. /includes/lib/ viii. /pages/ ix. /services/ x. /scheduled/ xi. /schoolpress.php e. Add-Ons to Existing Plugins
  • 10. f. Use Cases and Examples i. The WordPress Loop ii. WordPress Global Variables g. Free Plugins i. Admin Columns ii. Advanced Custom Fields iii. BadgeOS iv. Posts 2 Posts v. Members vi. W3 Total Cache vii. Yoast SEO h. Premium Plugins i. Gravity Forms ii. BackupBuddy iii. WP All Import i. Community Plugins i. BuddyPress 6. 4. Themes a. Themes Versus Plugins i. Where to Place Code When Developing Apps ii. When Developing Plugins
  • 11. iii. Where to Place Code When Developing Themes b. The Template Hierarchy c. Page Templates i. Sample Page Template ii. Using Hooks to Copy Templates iii. When Should You Use a Theme Template? d. Theme-Related WordPress Functions i. Using locate_template in Your Plugins e. Style.css i. Versioning Your Theme’s CSS Files f. functions.php g. Themes and CPTs h. Popular Theme Frameworks i. WordPress Theme Frameworks ii. Non-WordPress Theme Frameworks i. Creating a Child Theme for Memberlite j. Including Bootstrap in Your App’s Theme k. Menus i. Navigation Menus ii. Dynamic Menus l. Responsive Design
  • 12. i. Device and Display Detection in CSS ii. Device and Feature Detection in JavaScript iii. Device Detection in PHP iv. Final Note on Browser Detection 7. 5. Custom Post Types, Post Metadata, and Taxonomies a. Default Post Types and CPTs i. Page ii. Post iii. Attachment iv. Revisions v. Navigation Menu Item vi. Custom CSS vii. Changesets viii. oEmbed Cache ix. User Requests x. Reusable Blocks b. Defining and Registering CPTs i. register_post_type( $post_type, $args ); c. What Is a Taxonomy and How Should I Use It? i. Taxonomies Versus Post Meta ii. Creating Custom Taxonomies
  • 13. iii. register_taxonomy( $taxonomy, $object_type, $args ) iv. register_taxonomy_for_object_type( $taxonomy, $object_type ) d. Using CPTs and Taxonomies in Your Themes and Plugins i. The Theme Archive and Single Template Files ii. Good Old WP_Query and get_posts() e. Metadata with CPTs i. add_meta_box( $id, $title, $callback, $screen, $context, $priority, $callback_args ) ii. Using Meta Boxes with the Block Editor f. Custom Wrapper Classes for CPTs i. Extending WP_Post Versus Wrapping It ii. Why Use Wrapper Classes? iii. Keep Your CPTs and Taxonomies Together iv. Keep It in the Wrapper Class v. Wrapper Classes Read Better 8. 6. Users, Roles, and Capabilities a. Getting User Data
  • 14. b. Add, Update, and Delete Users c. Hooks and Filters d. What Are Roles and Capabilities? i. Checking a User’s Role and Capabilities ii. Creating Custom Roles and Capabilities e. Extending the WP_User Class f. Adding Registration and Profile Fields g. Customizing the Users Table in the Dashboard h. Plugins i. Theme My Login ii. Hide the Admin Bar from Nonadministrators iii. Paid Memberships Pro iv. PMPro Register Helper v. Members vi. WP User Fields 9. 7. Working with WordPress APIs, Objects, and Helper Functions a. Shortcode API i. Shortcode Attributes ii. Nested Shortcodes iii. Removing Shortcodes
  • 15. iv. Other Useful Shortcode-Related Functions b. Widgets API i. Before You Add Your Own Widget ii. Adding Widgets iii. Defining a Widget Area iv. Embedding a Widget Outside of a Dynamic Sidebar c. Dashboard Widgets API i. Removing Dashboard Widgets ii. Adding Your Own Dashboard Widget d. Settings API i. Do You Really Need a Settings Page? ii. Could You Use a Hook or Filter Instead? iii. Use Standards When Adding Settings iv. Ignore Standards When Adding Settings e. Rewrite API i. Adding Rewrite Rules ii. Flushing Rewrite Rules iii. Other Rewrite Functions f. WP-Cron
  • 16. i. Adding Custom Intervals ii. Scheduling Single Events iii. Kicking Off Cron Jobs from the Server iv. Using Server Crons Only g. WP Mail i. Sending Nicer Emails with WordPress h. File Header API i. Adding File Headers to Your Own Files ii. Adding New Headers to Plugins and Themes i. Heartbeat API 10. 8. Secure WordPress a. Why It’s Important b. Security Basics i. Update Frequently ii. Don’t Use the Username “admin” iii. Use a Strong Password iv. Examples of Bad Passwords v. Examples of Good Passwords c. Hardening WordPress i. Don’t Allow Admins to Edit Plugins or Themes ii. Change Default Database Tables Prefix
  • 17. iii. Move wp-config.php iv. Hide Login Error Messages v. Hide Your WordPress Version vi. Don’t Allow Logins via wp-login.php vii. Add Custom .htaccess Rules for Locking Down wp-admin d. SSL Certificates and HTTPS i. Installing an SSL Certificate on Your Server ii. WordPress Login and WordPress Administrator over SSL iii. Debugging HTTPS Issues iv. Avoiding SSL Errors with the “Nuclear Option” e. Back Up Everything! f. Scan, Scan, Scan! g. Useful Security Plugins i. Spam-Blocking Plugins ii. Backup Plugins iii. Firewall/Scanner Plugins iv. Login and Password-Protection Plugins h. Writing Secure Code i. Check User Capabilities ii. Custom SQL Statements
  • 18. iii. Data Validation, Sanitization, and Escaping iv. Nonces 11. 9. JavaScript Frameworks and Workflow a. What Is ECMAScript? b. What Is ES6? c. What Is ES9? d. What Is ESNext? e. What Is Ajax? f. What Is JSON? g. jQuery and WordPress i. Enqueuing Other JavaScript Libraries ii. Where to Put Your Custom JavaScript h. Ajax Calls with WordPress and jQuery i. Managing Multiple Ajax Requests j. Heartbeat API k. WordPress Limitations with Asynchronous Processing l. JavaScript Frameworks i. Backbone.js ii. React 12. 10. WordPress REST API a. What Is a REST API?
  • 19. i. API ii. REST iii. JSON iv. HTTP b. Why Use the WordPress REST API? c. Using the WordPress REST API V2 i. Discovery ii. Authentication iii. Routes and Endpoints iv. Requests v. Responses d. Adding Your Own Routes and Endpoints i. register_rest_route( $namespace, $route, $args, $override ); ii. Setting Up the WordPress Single Sign- On Plugin iii. Adding the /wp-sso/v1/check Route iv. Bundling Basic Authentication with Our Plugin v. Using the Endpoint We Set Up to Check User Credentials e. Popular Plugins Using the WordPress REST API i. WooCommerce
  • 20. ii. BuddyPress iii. Paid Memberships Pro 13. 11. Project Gutenberg, Blocks, and Custom Block Types a. The WordPress Editor b. The Classic Editor Plugin c. Using Blocks for Content and Design d. Using Blocks for Functionality e. Creating Your Own Blocks i. Minimal Block Example f. Using Custom Blocks to Build App Experiences i. Enabling the Block Editor in Your CPTs ii. Block Categories iii. The Homework Blocks iv. Limiting Blocks to Specific CPTs v. Limiting CPTs to Specific Blocks vi. Block Templates vii. Saving Block Data to Post Meta g. Tips i. Enable WP_SCRIPT_DEBUG ii. Use filemtime() for the Script Version iii. More Tips iv. Learn JavaScript, Node.js, and React More Deeply
  • 21. 14. 12. WordPress Multisite Networks a. Why Multisite? b. Why Not Multisite? c. Multisite Alternatives i. Multiple Authors or Categories on the Same WordPress Site ii. Custom Post Types iii. Totally Separate Sites iv. Use a WordPress Maintenance Service v. Multitenancy d. Setting Up a Multisite Network e. Managing a Multisite Network i. Dashboard ii. Sites iii. Users iv. Themes v. Plugins vi. Settings vii. Updates f. Multisite Database Structure i. Networkwide Tables ii. Individual Site Tables iii. Shared Site Tables
  • 22. g. Domain Mapping h. Random Useful Multisite Plugins i. Gravity Forms User Registration Add- On ii. Member Network Sites Add-On for Paid Memberships Pro iii. More Privacy Options iv. Multisite Global Media v. Multisite Plugin Manager vi. Multisite Global Search vii. Multisite Robots.txt Manager viii. NS Cloner: Site Copier ix. WP Multi Network i. Basic Multisite Functionality i. $blog_id ii. is_multisite() iii. get_current_blog_id() iv. switch_to_blog( $new_blog ) v. restore_current_blog() vi. get_blog_details( $fields = null, $get_all = true ) vii. update_blog_details( $blog_id, $details = array() ) viii. get_blog_status( $id, $pref )
  • 23. ix. update_blog_status( $blog_id, $pref, $value ) x. get_blog_option( $id, $option, $default = false ) xi. update_blog_option( $id, $option, $value ) xii. delete_blog_option( $id, $option ) xiii. get_blog_post( $blog_id, $post_id ) xiv. add_user_to_blog( $blog_id, $user_id, $role ) xv. wpmu_delete_user( $user_id ) xvi. create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) xvii. Functions We Didn’t Mention 15. 13. Localizing WordPress Apps a. Do You Even Need to Localize Your App? b. How Localization Is Done in WordPress c. Defining Your Locale in WordPress d. Text Domains i. Setting the Text Domain e. Prepping Your Strings with Translation Functions i. __( $text, $domain = “default” ) ii. _e( $text, $domain = “default” )
  • 24. iii. _x( $text, $context, $domain = “default” ) iv. _ex( $title, $context, $domain = “default” ) v. Escaping and Translating at the Same Time f. Creating and Loading Translation Files i. Our File Structure for Localization ii. Generating a .pot File iii. Creating a .po File iv. Creating a .mo File g. GlotPress i. Using GlotPress for Your WordPress.org Plugins and Themes ii. Creating Your Own GlotPress Server 16. 14. WordPress Optimization and Scaling a. Terms b. Origin Versus Edge c. Testing i. What to Test ii. Chrome Debug Bar iii. The WordPress Site Health Tool iv. Apache Bench v. Siege
  • 25. d. W3 Total Cache i. Page Cache Settings ii. Minify iii. Database Caching iv. Object Cache v. CDNs vi. GZIP Compression e. Hosting i. WordPress-Specific Hosts ii. Rolling Your Own Server f. Selective Caching i. The Transient API ii. Multisite Transients g. Using JavaScript to Increase Performance h. Custom Tables i. Bypassing WordPress 17. 15. Ecommerce a. Choosing a Plugin i. WooCommerce ii. Paid Memberships Pro iii. Easy Digital Downloads b. Payment Gateways
  • 26. c. Merchant Accounts d. Setting Up SaaS with Paid Memberships Pro e. The SaaS Model i. Step 0: Establishing How You Want to Charge for Your App ii. Step 1: Installing and Activating Paid Memberships Pro iii. Step 2: Setting Up the Level iv. Step 3: Setting Up Pages v. Step 4: Choosing Payment Settings vi. Step 5: Choosing Email Settings vii. Step 6: Choosing Advanced Settings viii. Step 7: Locking Down Pages ix. Step 8: Customizing Paid Memberships Pro 18. 16. Mobile Apps Powered by WordPress a. Mobile App Use Cases b. Native and Hybrid Mobile Apps i. What Is a Native Mobile App? ii. What Is a Hybrid Mobile App? iii. Why Hybrid over Native? iv. Cordova v. Ionic Framework
  • 27. vi. App Wrapper vii. AppPresser 19. 17. PHP Libraries, Web Service Integrations, and Platform Migrations a. PHP Libraries i. Image Generation and Manipulation ii. PDF Generation iii. Geolocation and Geotargeting iv. File Compression and Archiving v. Developer Tools b. External APIs and Web Services i. Elasticsearch ii. ElasticPress by 10up iii. Google Vision iv. Google Maps v. Google Translate vi. Twilio vii. Other Popular APIs c. Migrations i. Host Migrations ii. Platform Migrations iii. Create a Data Mapping Guide 20. 18. The Future
  • 28. a. Where We’ve Been b. The REST API i. WordPress Plugins Will Focus More on APIs ii. Headless WordPress iii. GraphQL c. Gutenberg i. The Administrator Interface Will Move to React/Gutenberg ii. Gutenberg Will Power a Frontend Editing Experience for WordPress iii. Block Templates Will Replace Themes iv. Blocks Will Replace Plugins d. WordPress Market Share Will Increase and Decrease e. WordPress Will Become a More Popular Platform for Mobile Development f. WordPress Will Continue to Be Useful for Developing Apps of All Kinds 21. Index
  • 29. Praise for Building Web Apps with WordPress, Second Edition “WordPress is more than just software, it’s a movement that is becoming the de facto operating system of the web. More than just a blog or a CMS, when you learn how to use WordPress as an application platform you’ll be at the forefront of the third wave of its growth.” —Matt Mullenweg, Cofounder of WordPress “Brian and Jason have grown side by side with WordPress for years, and successfully demonstrate how, for the right kind of app, developers can leverage that engine to build more secure, more performant applications in half the time.” —Jake Goldman, President and Founder of 10up "Building Web Apps with WordPress is a great resource for developers looking to learn or currently working with the PHP-oriented approach to creating WordPress web apps.” —Dave Mackey, Web/Software Developer, Liquid Church
  • 30. Building Web Apps with WordPress WordPress as an Application Framework SECOND EDITION Brian Messenlehner and Jason Coleman
  • 31. Building Web Apps with WordPress by Brian Messenlehner and Jason Coleman Copyright © 2020 Brian Messenlehner and Jason Coleman. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Jennifer Pollock Development Editor: Alicia Young Production Editor: Deborah Baker Copyeditor: Octal Publishing, LLC Proofreader: Rachel Monaghan Interior Designer: David Futato
  • 32. Cover Designer: Karen Montgomery Illustrator: Rebecca Demarest April 2014: First Edition December 2019: Second Edition Revision History for the Second Edition 2019-12-11: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781491990087 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Building Web Apps with WordPress, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. 978-1-491-99008-7
  • 33. Discovering Diverse Content Through Random Scribd Documents
  • 34. law in creating the Project Gutenberg™ collection. Despite these efforts, Project Gutenberg™ electronic works, and the medium on which they may be stored, may contain “Defects,” such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment. 1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the “Right of Replacement or Refund” described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg™ trademark, and any other party distributing a Project Gutenberg™ electronic work under this agreement, disclaim all liability to you for damages, costs and expenses, including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE. 1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund.
  • 35. If the second copy is also defective, you may demand a refund in writing without further opportunities to fix the problem. 1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PURPOSE. 1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions. 1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg™ electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg™ electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg™ work, (b) alteration, modification, or additions or deletions to any Project Gutenberg™ work, and (c) any Defect you cause. Section 2. Information about the Mission of Project Gutenberg™
  • 36. Project Gutenberg™ is synonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life. Volunteers and financial support to provide volunteers with the assistance they need are critical to reaching Project Gutenberg™’s goals and ensuring that the Project Gutenberg™ collection will remain freely available for generations to come. In 2001, the Project Gutenberg Literary Archive Foundation was created to provide a secure and permanent future for Project Gutenberg™ and future generations. To learn more about the Project Gutenberg Literary Archive Foundation and how your efforts and donations can help, see Sections 3 and 4 and the Foundation information page at www.gutenberg.org. Section 3. Information about the Project Gutenberg Literary Archive Foundation The Project Gutenberg Literary Archive Foundation is a non- profit 501(c)(3) educational corporation organized under the laws of the state of Mississippi and granted tax exempt status by the Internal Revenue Service. The Foundation’s EIN or federal tax identification number is 64-6221541. Contributions to the Project Gutenberg Literary Archive Foundation are tax deductible to the full extent permitted by U.S. federal laws and your state’s laws. The Foundation’s business office is located at 809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up to date contact information can be found at the Foundation’s website and official page at www.gutenberg.org/contact
  • 37. Section 4. Information about Donations to the Project Gutenberg Literary Archive Foundation Project Gutenberg™ depends upon and cannot survive without widespread public support and donations to carry out its mission of increasing the number of public domain and licensed works that can be freely distributed in machine-readable form accessible by the widest array of equipment including outdated equipment. Many small donations ($1 to $5,000) are particularly important to maintaining tax exempt status with the IRS. The Foundation is committed to complying with the laws regulating charities and charitable donations in all 50 states of the United States. Compliance requirements are not uniform and it takes a considerable effort, much paperwork and many fees to meet and keep up with these requirements. We do not solicit donations in locations where we have not received written confirmation of compliance. To SEND DONATIONS or determine the status of compliance for any particular state visit www.gutenberg.org/donate. While we cannot and do not solicit contributions from states where we have not met the solicitation requirements, we know of no prohibition against accepting unsolicited donations from donors in such states who approach us with offers to donate. International donations are gratefully accepted, but we cannot make any statements concerning tax treatment of donations received from outside the United States. U.S. laws alone swamp our small staff. Please check the Project Gutenberg web pages for current donation methods and addresses. Donations are accepted in a number of other ways including checks, online payments and
  • 38. credit card donations. To donate, please visit: www.gutenberg.org/donate. Section 5. General Information About Project Gutenberg™ electronic works Professor Michael S. Hart was the originator of the Project Gutenberg™ concept of a library of electronic works that could be freely shared with anyone. For forty years, he produced and distributed Project Gutenberg™ eBooks with only a loose network of volunteer support. Project Gutenberg™ eBooks are often created from several printed editions, all of which are confirmed as not protected by copyright in the U.S. unless a copyright notice is included. Thus, we do not necessarily keep eBooks in compliance with any particular paper edition. Most people start at our website which has the main PG search facility: www.gutenberg.org. This website includes information about Project Gutenberg™, including how to make donations to the Project Gutenberg Literary Archive Foundation, how to help produce our new eBooks, and how to subscribe to our email newsletter to hear about new eBooks.
  • 39. back
  • 40. back
  • 41. back
  • 42. back
  • 43. back
  • 44. back
  • 46. back
  • 47. back
  • 49. back
  • 50. back
  • 52. back
  • 54. back
  • 55. back
  • 56. back
  • 58. back
  • 60. back
  • 61. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! textbookfull.com