Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Next Generation WordPress
Search
Ryan McCue
February 07, 2017
Programming
4
440
Next Generation WordPress
Explore what we need to push into the next generation of the WordPress project.
Ryan McCue
February 07, 2017
Tweet
Share
More Decks by Ryan McCue
See All by Ryan McCue
A Day of REST 2016
rmccue
5
810
WordCamp Europe 2015
rmccue
1
330
WordCamp Brisbane 2015
rmccue
3
1.1k
WCNYC2014
rmccue
5
480
WCMKE2014
rmccue
5
3.3k
Introduction to Git + Using Git with WordPress
rmccue
8
1.9k
Other Decks in Programming
See All in Programming
私のEbitengineの第一歩
qt_luigi
0
450
Using Livebook to build and deploy internal tools @ ElixirConf 2024
hugobarauna
0
250
Go Code Generation at newmo / 2024-08-27 #newmo_layerx_go
genkey6
0
560
Jakarta EE meets AI
ivargrimstad
0
380
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
990
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
マイグレーションコード自作して File-Based Routing に自動移行!! ~250 ページの歴史的経緯を添えて~
cut0
1
260
Some more adventure of Happy Eyeballs
coe401_
2
190
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
430
What is Parser
yui_knk
9
4.1k
GraphQLの魅力を引き出すAndroidクライアント実装
morux2
3
650
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
1.1k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
135
6.5k
Designing with Data
zakiwarfel
98
5k
A Tale of Four Properties
chriscoyier
155
22k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
25
3.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
263
13k
GraphQLとの向き合い方2022年版
quramy
43
13k
Designing Experiences People Love
moore
138
23k
No one is an island. Learnings from fostering a developers community.
thoeni
18
2.9k
KATA
mclloyd
27
13k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Code Reviewing Like a Champion
maltzj
517
39k
Web Components: a chance to create the future
zenorocha
308
42k
Transcript
Next Generation WordPress Ryan McCue Director of Engineering at Human
Made
Next Generation Previous Current
None
2003 1.x
2003 1.x 2005 2.x
2003 1.x 2005 2.x 2010 3.x
2003 1.x 2005 2.x 2010 3.x 2014 4.x
Blogging CMS Platform 2003 1.x 2005 2.x 2010 3.x 2014
4.x
4.7 + 4.8
4.x
Platform?
Platform = Next Generation
1. Philosophy 2. Process 3. Projects Next Generation
Philosophy
Backwards compatibility Design for the majority Decisions, not options
The user comes first
The user comes first
User Experience
Developer User Experience
DUX
Developers Are Users Too Philosophy:
WordPress Sucks Spoiler:
None
None
Why?
WordPress End-users
WordPress End-users Developers
“What got us here, won’t get us there” — Matt
Mullenweg, State of the Word 2016
All About Me
Process
How WordPress Works
Incremental development = Organic growth
“A rolling codebase gathers technical debt” — Ancient Australian proverb
Posts ➡ Pages ➡ CPTs
for end users for developers
Grand Design ≠ better
~ 2 years pass ~
Design For Developers Process:
Rebuilding the Plane While Flying It
WordPress WordPress
Blog CMS Platform WordPress Architecture
Platform Blog CMS Next Generation
1. Write wrappers 2. Test both old and new 3.
Flip the wrapper
Retains Backwards Compatibility Write, Test, Flip
Projects
Set a Standard Projects:
wp_insert_post
wp_insert_post (Why?)
1. Write wp_insert_post WP_Post::create $wpdb->insert( "INSERT INTO $wpdb->posts" ) wp_set_post_categories()
wp_set_post_tags() wp_slash()
2. Test wp_insert_post WP_Post::create $wpdb->insert( "INSERT INTO $wpdb->posts" ) exercise
left to reader wp_set_post_categories() wp_set_post_tags() wp_slash()
3. Flip WP_Post::create $wpdb->insert( "INSERT INTO $wpdb->posts" ) wp_set_post_categories() wp_set_post_tags()
wp_slash() wp_insert_post
3. Flip WP_Post::create $wpdb->insert( "INSERT INTO $wpdb->posts" ) wp_set_post_categories() wp_set_post_tags()
wp_slash() wp_insert_post
WP_Post::create
WP_Post::create WP_Page Woo_Product WP_Revision Jetpack_Comic
Rewrites
<?php add_rewrite_rule( 'archives/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]' );
Routers $app = new \Slim\App; $app->get('/hello/{name}', function (Request $request, Response
$response) { Slim Framework Route::get('user/{id}', function ($id) { Laravel Symfony class BlogController extends Controller { /** * @Route("/blog", name="blog_list") */ public function listAction() {
'index.php?rest_route=/$matches[1]' ); add_action( 'init', function () { global $wp; $wp->add_query_var(
'rest_route' ); }); add_action( 'parse_request', function () { global $wp; if ( empty( $wp->query_vars['rest_route'] ) ) { return; } // Finally, do something. }); add_rewrite_rule( '^wp-json/(.*)?',
function () { // Much easier. } ); add_rewrite_rule( '^wp-json/(.*)?',
'index.php?year=$matches[1]&monthnum=$matches[2]' ); add_rewrite_rule( 'archives/date/([0-9]{4})/([0-9]{1,2})/?$',
function ( $matches ) { global $wp_query; $args = [
'year' => $matches[1], 'monthnum' => $matches[2], ]; $wp_query = new WP_Query( $matches ); } ); add_rewrite_rule( 'archives/date/([0-9]{4})/([0-9]{1,2})/?$',
add_rewrite_rule( 'login/?$', function () { get_header(); wp_login_form(); get_footer(); } );
1. Write wrappers 2. Test both old and new 3.
Flip the wrapper
Bonus: No More Flushing
Autoloading
Drupal ✓ Joomla ✓ MediaWiki ✓ Magento ✓ WordPress ✗
Autoloading?
Autoloading is a trade-off
15 MB 15,000,000 bytes
Autoloading Load Everything
Composer?
Plugin Dependencies
<?php /** * Plugin Name: Amazing Plugin * Requires: other-plugin,
rest-api */ add_plugin_dependencies( __FILE__, [ 'other-plugin', 'rest-api' ] );
Conflicts? Plugin Dependencies
Already a Problem Plugin Dependencies
Even bigger?
Split WordPress
None
None
None
None
What is WordPress?
Do Not Break WordPress
Next Generation
1. Philosophy 2. Process 3. Projects Next Generation
Developers Are Users Too Philosophy:
Design For Developers Process:
Set the Standard Projects:
Thanks. rmccue.io speakerdeck.com/rmccue core.trac.wordpress.org/ticket/31245 Frank the DUX Duck from Twemoji
State of the Word photo: Brian Richards for Post Status hmn.md