Atnaujinkite slapukų nuostatas

Building Web Apps with WordPress 2e: WordPress as an Application Framework [Minkštas viršelis]

4.36/5 (22 ratings by Goodreads)
  • Formatas: Paperback / softback, 400 pages, aukštis x plotis x storis: 232x181x24 mm, weight: 792 g
  • Išleidimo metai: 30-Nov-2019
  • Leidėjas: O'Reilly Media
  • ISBN-10: 1491990082
  • ISBN-13: 9781491990087
Kitos knygos pagal šią temą:
  • Formatas: Paperback / softback, 400 pages, aukštis x plotis x storis: 232x181x24 mm, weight: 792 g
  • Išleidimo metai: 30-Nov-2019
  • Leidėjas: O'Reilly Media
  • ISBN-10: 1491990082
  • ISBN-13: 9781491990087
Kitos knygos pagal šią temą:
WordPress is much more than a blogging platform. If you have basic PHP, HTML, CSS, and JavaScript experience you can use WordPress to develop fast, scalable, secure, and highly customized web apps, mobile apps, web services, and multisite networks of websites. Along with core WordPress functions and database schema, youll learn how to build custom plugins, themes, and services for just about any kind of web or mobile application.

In this updated second edition, Brian Messenlehner and Jason Coleman cover new features and functionality added to WordPress up to version 5.4. All code examples in the book are available on GitHub.

Compare WordPress with traditional app development frameworks Use themes for views and plugins for backend functionality Get suggestions for choosing or building WordPress plugins Register custom post types (CPTs) and taxonomies Manage user accounts and roles, and access user data Build asynchronous behaviors with jQuery Use WordPress to develop mobile apps for iOS and Android Integrate PHP libraries, external APIs, and web service plugins Collect payments through ecommerce and membership plugins Learn how to speed up and scale your WordPress app Extend the WordPress REST API and create custom endpoints Learn about WordPress Gutenberg blocks development
Foreword xvii
Preface xix
1 Building Web Apps with WordPress
1(20)
What Is a Website?
1(1)
What Is an App?
1(1)
What Is a Web App?
1(4)
Features of a Web App
2(1)
Mobile Apps
3(1)
Progressive Web Apps
4(1)
Why Use WordPress?
5(6)
You Are Already Using WordPress
5(1)
Content Management Is Easy with WordPress
5(1)
User Management Is Easy and Secure with WordPress
6(1)
Plugins
6(1)
Flexibility Is Important
6(1)
Frequent Security Updates
7(1)
Cost
7(1)
Responses to Some Common Criticisms of WordPress
8(3)
When Not to Use WordPress
11(2)
You Plan to License or Sell Your Site's Technology
11(1)
Another Platform Will Get You "There" Faster
11(1)
Flexibility Is Not Important to You
12(1)
Your App Needs to Be Highly Real Time
12(1)
WordPress as an Application Framework
13(3)
WordPress Versus Model-View-Controller Frameworks
13(3)
Anatomy of a WordPress App
16(1)
What Is SchoolPress?
16(1)
SchoolPress Runs on a WordPress Multisite Network
16(1)
The SchoolPress Business Model
17(1)
Membership Levels and User Roles
17(1)
Classes Are BuddyPress Groups
17(1)
Assignments Are a CPT
18(1)
Submissions Are a (Sub)CPT for Assignments
18(1)
Semesters Are a Taxonomy on the Class CPT
18(1)
Departments Are a Taxonomy on the Class CPT
18(1)
SchoolPress Has One Main Custom Plugin
18(1)
SchoolPress Uses a Few Other Custom Plugins
19(1)
SchoolPress Uses the Memberlite Theme
20(1)
2 WordPress Basics
21(48)
WordPress Directory Structure
22(2)
Root Directory
22(1)
/wp-admin
22(1)
/wp-includes
22(1)
/wp-content
23(1)
WordPress Database Structure
24(38)
wp_options
24(1)
Functions Found in /wp-includes/option.php
24(3)
wp_users
27(1)
Functions Found in /wp-includes/...
27(4)
wp_usermeta
31(4)
wp_posts
35(1)
Functions Found in /wp-includes/post.php
36(4)
wp_postmeta
40(1)
Functions Found in /wp-includes/post.php
41(4)
wp_comments
45(1)
Functions Found in /wp-includes/comment.php
45(5)
wp_commentsmeta
50(1)
Functions Found in /wp-includes/comment.php
50(3)
wp_terms
53(1)
Functions Found in /wp-includes/taxonomy.php
53(4)
wp_termmeta
57(2)
wp_term_taxonomy
59(1)
/wp-includes/taxonomy.php
59(1)
wp_term_relationships
60(2)
Hooks: Actions and Filters
62(3)
Actions
62(1)
Filters
63(2)
Development and Hosting Environments
65(2)
Working Locally
65(1)
Choosing a Web Host
66(1)
Development, Staging, and Production Environments
66(1)
Extending WordPress
67(2)
3 Using WordPress Plugins
69(38)
The General Public License, Version 2, License
70(1)
Installing WordPress Plugins
70(1)
Building Your Own Plugin
71(1)
File Structure for an App Plugin
72(6)
/adminpages/
73(1)
/classes/
74(1)
/ess/
74(1)
/js/
75(1)
/images/
76(1)
/includes/
76(1)
/includes/lib/
76(1)
/pages/
76(2)
/services/
78(1)
/scheduled/
78(1)
/schoolpress.php
78(1)
Add-Ons to Existing Plugins
78(1)
Use Cases and Examples
79(10)
The WordPress Loop
79(1)
WordPress Global Variables
80(9)
Free Plugins
89(3)
Admin Columns
90(1)
Advanced Custom Fields
90(1)
BadgeOS
90(1)
Posts 2 Posts
91(1)
Members
92(1)
W3 Total Cache
92(1)
Yoast SEO
92(1)
Premium Plugins
92(1)
Gravity Forms
93(1)
BackupBuddy
93(1)
WP All Import
93(1)
Community Plugins
93(14)
BuddyPress
94(13)
4 Themes
107(30)
Themes Versus Plugins
107(2)
Where to Place Code When Developing Apps
107(1)
When Developing Plugins
108(1)
Where to Place Code When Developing Themes
109(1)
The Template Hierarchy
109(2)
Page Templates
111(4)
Sample Page Template
111(3)
Using Hooks to Copy Templates
114(1)
When Should You Use a Theme Template?
115(1)
Theme-Related WordPress Functions
115(3)
Using locate_template in Your Plugins
117(1)
Style.css
118(2)
Versioning Your Themes CSS Files
118(2)
functions.php
120(1)
Themes and CPTs
120(1)
Popular Theme Frameworks
121(2)
WordPress Theme Frameworks
121(1)
Non-WordPress Theme Frameworks
122(1)
Creating a Child Theme for Memberlite
123(1)
Including Bootstrap in Your App's Theme
123(2)
Menus
125(2)
Navigation Menus
125(1)
Dynamic Menus
126(1)
Responsive Design
127(10)
Device and Display Detection in CSS
127(1)
Device and Feature Detection in JavaScript
128(3)
Device Detection in PHP
131(3)
Final Note on Browser Detection
134(3)
5 Custom Post Types, Post Metadata, and Taxonomies
137(36)
Default Post Types and CPTs
137(2)
Page
137(1)
Post
137(1)
Attachment
138(1)
Revisions
138(1)
Navigation Menu Item
138(1)
Custom CSS
138(1)
Changesets
138(1)
oEmbed Cache
139(1)
User Requests
139(1)
Reusable Blocks
139(1)
Defining and Registering CPTs
139(10)
register_post_type($post_type, $args);
140(9)
What Is a Taxonomy and How Should I Use It?
149(7)
Taxonomies Versus Post Meta
149(2)
Creating Custom Taxonomies
151(1)
register_taxonomy($taxonomy, $object_type, $args)
151(4)
register_taxonomy_for_object_type($taxonomy, $object_type)
155(1)
Using CPTs and Taxonomies in Your Themes and Plugins
156(4)
The Theme Archive and Single Template Files
156(1)
Good Old WP_Query and get_posts()
156(4)
Metadata with CPTs
160(4)
add_meta_box($id, $title, $callback, $screen, $context, $priority, $callback_args)
160(3)
Using Meta Boxes with the Block Editor
163(1)
Custom Wrapper Classes for CPTs
164(9)
Extending WP_Post Versus Wrapping It
166(1)
Why Use Wrapper Classes?
167(1)
Keep Your CPTs and Taxonomies Together
167(1)
Keep It in the Wrapper Class
168(2)
Wrapper Classes Read Better
170(3)
6 Users, Roles, and Capabilities
173(22)
Getting User Data
174(2)
Add, Update, and Delete Users
176(3)
Hooks and Filters
179(1)
What Are Roles and Capabilities?
180(4)
Checking a User s Role and Capabilities
181(1)
Creating Custom Roles and Capabilities
182(2)
Extending the WP_User Class
184(2)
Adding Registration and Profile Fields
186(5)
Customizing the Users Table in the Dashboard
191(1)
Plugins
192(3)
Theme My Login
193(1)
Hide the Admin Bar from Nonadministrators
193(1)
Paid Memberships Pro
193(1)
PMPro Register Helper
193(1)
Members
194(1)
WP User Fields
194(1)
7 Working with WordPress APIs, Objects, and Helper Functions
195(42)
Shortcode API
195(4)
Shortcode Attributes
196(1)
Nested Shortcodes
197(1)
Removing Shortcodes
198(1)
Other Useful Shortcode-Related Functions
199(1)
Widgets API
199(8)
Before You Add Your Own Widget
200(1)
Adding Widgets
201(3)
Defining a Widget Area
204(2)
Embedding a Widget Outside of a Dynamic Sidebar
206(1)
Dashboard Widgets API
207(5)
Removing Dashboard Widgets
208(1)
Adding Your Own Dashboard Widget
209(3)
Settings API
212(4)
Do You Really Need a Settings Page?
212(1)
Could You Use a Hook or Filter Instead?
213(2)
Use Standards When Adding Settings
215(1)
Ignore Standards When Adding Settings
215(1)
Rewrite API
216(5)
Adding Rewrite Rules
217(1)
Flushing Rewrite Rules
217(1)
Other Rewrite Functions
218(3)
WP-Cron
221(5)
Adding Custom Intervals
223(1)
Scheduling Single Events
223(1)
Kicking Off Cron Jobs from the Server
224(1)
Using Server Crons Only
225(1)
WP Mail
226(2)
Sending Nicer Emails with WordPress
227(1)
File Header API
228(5)
Adding File Headers to Your Own Files
230(1)
Adding New Headers to Plugins and Themes
231(2)
Heartbeat API
233(4)
8 Secure WordPress
237(32)
Why It's Important
237(1)
Security Basics
238(2)
Update Frequently
238(1)
Don't Use the Username "admin"
238(1)
Use a Strong Password
239(1)
Examples of Bad Passwords
239(1)
Examples of Good Passwords
240(1)
Hardening WordPress
240(5)
Don't Allow Admins to Edit Plugins or Themes
240(1)
Change Default Database Tables Prefix
240(1)
Move wp-config.php
241(1)
Hide Login Error Messages
242(1)
Hide Your WordPress Version
242(1)
Don't Allow Logins via wp-login.php
243(1)
Add Custom htaccess Rules for Locking Down wp-admin
244(1)
SSL Certificates and HTTPS
245(7)
Installing an SSL Certificate on Your Server
245(3)
WordPress Login and WordPress Administrator over SSL
248(1)
Debugging HTTPS Issues
249(1)
Avoiding SSL Errors with the "Nuclear Option"
250(2)
Back Up Everything!
252(1)
Scan, Scan, Scan!
252(1)
Useful Security Plugins
252(3)
Spam-Blocking Plugins
253(1)
Backup Plugins
253(1)
Firewall/Scanner Plugins
254(1)
Login and Password-Protection Plugins
254(1)
Writing Secure Code
255(14)
Check User Capabilities
255(1)
Custom SQL Statements
256(1)
Data Validation, Sanitization, and Escaping
257(5)
Nonces
262(7)
9 JavaScript Frameworks and Workflow
269(22)
What Is ECMAScript?
270(1)
What Is ES6?
271(1)
WhatIsES9?
271(1)
What Is ESNext?
271(1)
What Is Ajax?
271(1)
What Is JSON?
271(1)
jQuery and WordPress
272(3)
Enqueuing Other JavaScript Libraries
272(2)
Where to Put Your Custom JavaScript
274(1)
Ajax Calls with WordPress and jQuery
275(4)
Managing Multiple Ajax Requests
279(2)
Heartbeat API
281(5)
WordPress Limitations with Asynchronous Processing
286(1)
JavaScript Frameworks
286(5)
Backbone.js
287(1)
React
288(3)
10 WordPress REST API
291(28)
What Is a REST API?
291(5)
API
292(1)
REST
292(1)
JSON
292(1)
HTTP
293(3)
Why Use the WordPress REST API?
296(1)
Using the WordPress REST API V2
297(10)
Discovery
297(1)
Authentication
298(5)
Routes and Endpoints
303(1)
Requests
304(2)
Responses
306(1)
Adding Your Own Routes and Endpoints
307(5)
register_rest_route($namespace, $route, $args, $override);
308(1)
Setting Up the WordPress Single Sign-On Plugin
308(1)
Adding the /wp-sso/v1/check Route
309(1)
Bundling Basic Authentication with Our Plugin
310(1)
Using the Endpoint We Set Up to Check User Credentials
311(1)
Popular Plugins Using the WordPress REST API
312(7)
WooCommerce
312(2)
BuddyPress
314(1)
Paid Memberships Pro
315(4)
11 Project Gutenberg, Blocks, and Custom Block Types
319(14)
The WordPress Editor
320(1)
The Classic Editor Plugin
321(1)
Using Blocks for Content and Design
321(1)
Using Blocks for Functionality
321(1)
Creating Your Own Blocks
322(2)
Minimal Block Example
322(2)
Using Custom Blocks to Build App Experiences
324(6)
Enabling the Block Editor in Your CPTs
324(1)
Block Categories
325(1)
The Homework Blocks
326(1)
Limiting Blocks to Specific CPTs
326(1)
Limiting CPTs to Specific Blocks
326(1)
Block Templates
327(2)
Saving Block Data to Post Meta
329(1)
Tips
330(1)
Enable WP_SCRIPT_DEBUG
330(1)
Use filemtime() for the Script Version
330(1)
More Tips
331(1)
Learn JavaScript, Node.js, and React More Deeply
331(2)
12 WordPress Multisite Networks
333(26)
WhyMultisite?
333(1)
Why Not Multisite?
334(1)
Multisite Alternatives
335(1)
Multiple Authors or Categories on the Same WordPress Site
335(1)
Custom Post Types
335(1)
Totally Separate Sites
335(1)
Use a WordPress Maintenance Service
336(1)
Multitenancy
336(1)
Setting Up a Multisite Network
336(3)
Managing a Multisite Network
339(3)
Dashboard
339(1)
Sites
339(1)
Users
340(1)
Themes
340(1)
Plugins
341(1)
Settings
341(1)
Updates
342(1)
Multisite Database Structure
342(4)
Networkwide Tables
342(3)
Individual Site Tables
345(1)
Shared Site Tables
345(1)
Domain Mapping
346(1)
Random Useful Multisite Plugins
347(2)
Gravity Forms User Registration Add-On
347(1)
Member Network Sites Add-On for Paid Memberships Pro
347(1)
More Privacy Options
347(1)
Multisite Global Media
347(1)
Multisite Plugin Manager
347(1)
Multisite Global Search
348(1)
Multisite Robots.txt Manager
348(1)
NS Cloner: Site Copier
348(1)
WP Multi Network
348(1)
Basic Multisite Functionality
349(1)
$blog_id
349(1)
is_multisite()
349(1)
get_current_blog_id()
349(1)
switch_to_blog($new_blog)
350(1)
restore_current_blog()
350(1)
get_blog_details($fields = null, $get_all = true)
350(2)
update_blog_details($blog_id, $details = array())
352(1)
get_bk>g_status($id, $pref)
353(1)
update_blog_status($blog_id, $pref, $value)
353(1)
get_blog_option($id, $option, $default = false)
353(1)
update_blog_option($id, $option, $value)
354(1)
delete_blog_option($id, $option)
354(1)
get_blog_post($blog_id, $post_id)
355(1)
add_user_to_blog($blog_id, $user_id, $role)
355(1)
wpmu_delete_user($user_id)
355(1)
create_empty_blog($domain, $path, $weblog_title, $site_id = 1)
356(1)
Functions We Didn't Mention
356(3)
13 Localizing WordPress Apps
359(12)
Do You Even Need to Localize Your App?
359(1)
How Localization Is Done in WordPress
360(1)
Defining Your Locale in WordPress
360(1)
Text Domains
361(2)
Setting the Text Domain
361(2)
Prepping Your Strings with Translation Functions
363(3)
___($text, $domain = "default")
364(1)
_e($text, $domain = "default")
364(1)
_x($text, $context, $domain = "default")
364(1)
_ex($title, $context, $domain = "default")
365(1)
Escaping and Translating at the Same Time
365(1)
Creating and Loading Translation Files
366(3)
Our File Structure for Localization
366(1)
Generating a pot File
367(2)
Creating a po File
369(1)
Creating a mo File
369(1)
GlotPress
369(2)
Using GlotPress for Your WordPress.org Plugins and Themes
369(1)
Creating Your Own GlotPress Server
370(1)
14 WordPress Optimization and Scaling
371(44)
Terms
371(2)
Origin Versus Edge
373(1)
Testing
373(13)
What to Test
374(2)
Chrome Debug Bar
376(2)
The WordPress Site Health Tool
378(1)
Apache Bench
379(6)
Siege
385(1)
W3 Total Cache
386(5)
Page Cache Settings
388(1)
Minify
389(1)
Database Caching
390(1)
Object Cache
390(1)
CDNs
390(1)
GZIP Compression
391(1)
Hosting
391(14)
WordPress-Specific Hosts
391(1)
Rolling Your Own Server
392(13)
Selective Caching
405(4)
The Transient API
406(3)
Multisite Transients
409(1)
Using JavaScript to Increase Performance
409(2)
Custom Tables
411(2)
Bypassing WordPress
413(2)
15 Ecommerce
415(26)
Choosing a Plugin
415(7)
WooCommerce
416(2)
Paid Memberships Pro
418(1)
Easy Digital Downloads
419(3)
Payment Gateways
422(1)
Merchant Accounts
422(2)
Setting Up SaaS with Paid Memberships Pro
424(1)
The SaaS Model
424(17)
Step 0 Establishing How You Want to Charge for Your App
424(1)
Step 1 Installing and Activating Paid Memberships Pro
425(1)
Step 2 Setting Up the Level
426(2)
Step 3 Setting Up Pages
428(1)
Step 4 Choosing Payment Settings
429(1)
Step 5 Choosing Email Settings
430(1)
Step 6 Choosing Advanced Settings
431(1)
Step 7 Locking Down Pages
432(3)
Step 8 Customizing Paid Memberships Pro
435(6)
16 Mobile Apps Powered by WordPress
441(26)
Mobile App Use Cases
441(1)
Native and Hybrid Mobile Apps
442(1)
What Is a Native Mobile App?
442(1)
What Is a Hybrid Mobile App?
443(1)
Why Hybrid over Native?
443(1)
Cordova
444(5)
Ionic Framework
449(1)
App Wrapper
450(1)
AppPresser
451(16)
17 PHP Libraries, Web Service Integrations, and Platform Migrations
467(26)
PHP Libraries
467(16)
Image Generation and Manipulation
468(2)
PDF Generation
470(5)
Geolocation and Geotargeting
475(2)
File Compression and Archiving
477(4)
Developer Tools
481(2)
External APIs and Web Services
483(4)
Elasticsearch
484(1)
ElasticPress by 1 Oup
484(1)
Google Vision
484(1)
Google Maps
484(1)
Google Translate
485(1)
Twilio
486(1)
Other Popular APIs
486(1)
Migrations
487(6)
Host Migrations
488(1)
Platform Migrations
489(2)
Create a Data Mapping Guide
491(2)
18 The Future
493(6)
Where We've Been
493(1)
The REST API
494(2)
WordPress Plugins Will Focus More on APIs
494(1)
Headless WordPress
494(1)
GraphQL
495(1)
Gutenberg
496(1)
The Administrator Interface Will Move to React/Gutenberg
496(1)
Gutenberg Will Power a Frontend Editing Experience for WordPress
496(1)
Block Templates Will Replace Themes
496(1)
Blocks Will Replace Plugins
497(1)
WordPress Market Share Will Increase and Decrease
497(1)
WordPress Will Become a More Popular Platform for Mobile Development
498(1)
WordPress Will Continue to Be Useful for Developing Apps of All Kinds
498(1)
Index 499
Brian Messenlehner comes from a background of building custom web applications for the US Marine Corps, and he is the co-founder of WebDevStudios.com, a WordPress-only development shop. Brian and the team at WDS have built several non-traditional websites and mobile applications using WordPress as a framework. Find him on Twitter: @bmessJason Coleman has been pushing WordPress to its limits for years and has helped launch several startups using WordPress as an application framework. Jason now leads development for Paid Memberships Pro, a membership-focused ecommerce plugin that powers many software as a service companies. Find Jason on Twitter: @jason_colemanScott Bolinger is the co-founder of AppPresser which allows you to build iOS and Android apps with WordPress. He loves developing with WordPress and JavaScript and learning how to grow his product businesses. Scott has presented at Macworld, New Media Expo, Loopconf, and several WordCamps. Find him on Twitter: @scottbolinger