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
820
WordCamp Europe 2015
rmccue
1
350
WordCamp Brisbane 2015
rmccue
3
1.1k
WCNYC2014
rmccue
5
500
WCMKE2014
rmccue
5
3.4k
Introduction to Git + Using Git with WordPress
rmccue
8
1.9k
Other Decks in Programming
See All in Programming
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
350
Macとオーディオ再生 2024/11/02
yusukeito
0
150
組織に自動テストを書く文化を根付かせる戦略(2024秋版) / Building Automated Test Culture 2024 Autumn Edition
twada
PRO
10
4.5k
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.7k
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
VR HMDとしてのVision Pro+ゲーム開発について
yasei_no_otoko
0
100
CSC509 Lecture 08
javiergs
PRO
0
100
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
Progressive Web Apps für Desktop und Mobile mit Angular (Hands-on)
christianliebel
PRO
0
110
gopls を改造したら開発生産性が高まった
satorunooshie
8
240
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.5k
色々なIaCツールを実際に触って比較してみる
iriikeita
0
260
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
Become a Pro
speakerdeck
PRO
24
5k
BBQ
matthewcrist
85
9.3k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Fireside Chat
paigeccino
32
3k
Facilitating Awesome Meetings
lara
49
6k
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Writing Fast Ruby
sferik
626
61k
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