Asynchronous WordPress

Aaron Brazell
Aaron BrazellLead Editor at Wordpress Specialist
Aaron Brazell • @technosailor • www.technosailor.com
A S Y N C H R O N O U S
W O R D P R E S S
O F F L O A D I N G H O O K E D E V E N T S TO I N C R E A S E PA G E S P E E D
Aaron Brazell • @technosailor • www.technosailor.com
T H E P R O B L E M
( D R A M AT I C T H E M E M U S I C )
Aaron Brazell • @technosailor • www.technosailor.com
• Every Time WordPress loads a page, events are fired.
• Plugins typically hook events into init, admin_init,
plugins_loaded, or save_post to fire events
• Every event takes time to complete
• Many dozens of events, all waiting to finish running,
add overhead to WordPress.
Aaron Brazell • @technosailor • www.technosailor.com
P O S S I B L E P R O B L E M S C E N A R I O S
• External API Request (Facebook/Twitter? Mailkimp?)
• Saving a Post
• Requesting information about a user when a user is
created.
- S O M E O N E W H O B A D LY M A N G L E D T H E Q U O T E
“Asynchronous Events are not the heroes we
want; they are the heroes we need.”
Photo Credit: V Threepio, via Flickr, Creative Commons
T E C H C R U N C H
A S Y N C L I B R A RY
• TechCrunch had extremely
long process times,
particularly with their
CrunchBase API.
• API calls were required to
repopulate cached results.
• Eric Mann (@ericmann) and
John Bloch (@johnpbloch)
built a library to offload tasks
to asynchronous equivalents
• Runs on `shutdown` hook
Photo Credit: Charlyn Wee, via Flickr Creative Commons
Aaron Brazell • @technosailor • www.technosailor.com
O V E RV I E W O N H O W TO U S E
• Bundle the WP_Async library in any theme or plugin and
require it. It can also be installed as a standalone plugin.
• Create a subclass that extends WP_Async_Task
• Include a prepare_data() and run_action() method
(Details in the documentation)
• Include a protected $action variable that is set to the hook
name you wish to run asynchronously.
• Hook events on wp_async_{$action} (e.g.
wp_async_transition_post_status)
Aaron Brazell • @technosailor • www.technosailor.com
R E F E R E N C E S
• TechCrunch Open Sources its WordPress Async Task Library:
http://techcrunch.com/2014/07/31/wp-async-task-our-new-
open-source-library/
• Asynchronous WordPress, by 10up: http://techcrunch.com/
2014/07/31/wp-async-task-our-new-open-source-library/
• Github: https://github.com/techcrunch/wp-async-task/
• Demo Plugin: https://github.com/technosailor/wcbalt-async-wp
• This Presentation: http://www.slideshare.net/technosailor/
asynchronous-wordpress
Aaron Brazell • @technosailor • www.technosailor.com
A A R O N B R A Z E L L
• Sr. Web Engineer, 10up
• We’re Hiring Project Managers, WordPress/PHP Engineers
and Front End UX Engineers (http://is10uphiring.com/)
• Twitter: http://technosailor.com/twitter
• Email: aaron.brazell@10up.com
• Github: https://github.com/technosailor
• WP.org Profile: https://profiles.wordpress.org/technosailor
Aaron Brazell • @technosailor • www.technosailor.com
1 of 10

Recommended

Asynchronous WordPress by
Asynchronous WordPressAsynchronous WordPress
Asynchronous WordPressAaron Brazell
806 views17 slides
Building your API utility belt (Keith Casey) by
Building your API utility belt (Keith Casey)Building your API utility belt (Keith Casey)
Building your API utility belt (Keith Casey)Future Insights
1.3K views53 slides
5 W's of Hookin' by
5 W's of Hookin'5 W's of Hookin'
5 W's of Hookin'Nowell VanHoesen
439 views35 slides
Attacking open source using abandoned resources by
Attacking open source using abandoned resourcesAttacking open source using abandoned resources
Attacking open source using abandoned resourcesAdam Baldwin
141 views22 slides
Building Event-Based Systems for the Real-Time Web by
Building Event-Based Systems for the Real-Time WebBuilding Event-Based Systems for the Real-Time Web
Building Event-Based Systems for the Real-Time Webpauldix
891 views122 slides
4.Building a Data Product using apache Zeppelin - Apache Kylin Meetup @Shanghai by
4.Building a Data Product using apache Zeppelin - Apache Kylin Meetup @Shanghai4.Building a Data Product using apache Zeppelin - Apache Kylin Meetup @Shanghai
4.Building a Data Product using apache Zeppelin - Apache Kylin Meetup @ShanghaiLuke Han
4.2K views63 slides

More Related Content

Viewers also liked

Manage custom options pages in Wordpress by
Manage custom options pages in WordpressManage custom options pages in Wordpress
Manage custom options pages in WordpressSimone D'Amico
2.5K views30 slides
Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012 by
Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012
Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012Jeferson Espindola
10.5K views92 slides
Improve WordPress performance with caching and deferred execution of code by
Improve WordPress performance with caching and deferred execution of codeImprove WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of codeDanilo Ercoli
2.9K views29 slides
State of the Word 2016 by
State of the Word 2016State of the Word 2016
State of the Word 2016photomatt
269.8K views114 slides
Upfront Ventures VC Survey 2017 by
Upfront Ventures VC Survey 2017Upfront Ventures VC Survey 2017
Upfront Ventures VC Survey 2017Mark Suster
56.4K views28 slides
26 Disruptive & Technology Trends 2016 - 2018 by
26 Disruptive & Technology Trends 2016 - 201826 Disruptive & Technology Trends 2016 - 2018
26 Disruptive & Technology Trends 2016 - 2018Brian Solis
2.8M views74 slides

Viewers also liked(6)

Manage custom options pages in Wordpress by Simone D'Amico
Manage custom options pages in WordpressManage custom options pages in Wordpress
Manage custom options pages in Wordpress
Simone D'Amico2.5K views
Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012 by Jeferson Espindola
Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012
Apostila SAR 005 - Curso Básico de Busca e Salvamento - 2012
Jeferson Espindola10.5K views
Improve WordPress performance with caching and deferred execution of code by Danilo Ercoli
Improve WordPress performance with caching and deferred execution of codeImprove WordPress performance with caching and deferred execution of code
Improve WordPress performance with caching and deferred execution of code
Danilo Ercoli2.9K views
State of the Word 2016 by photomatt
State of the Word 2016State of the Word 2016
State of the Word 2016
photomatt269.8K views
Upfront Ventures VC Survey 2017 by Mark Suster
Upfront Ventures VC Survey 2017Upfront Ventures VC Survey 2017
Upfront Ventures VC Survey 2017
Mark Suster56.4K views
26 Disruptive & Technology Trends 2016 - 2018 by Brian Solis
26 Disruptive & Technology Trends 2016 - 201826 Disruptive & Technology Trends 2016 - 2018
26 Disruptive & Technology Trends 2016 - 2018
Brian Solis2.8M views

Similar to Asynchronous WordPress

TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기 by
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기Heejong Ahn
12.3K views130 slides
The Web Application Hackers Toolchain by
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchainjasonhaddix
4.5K views53 slides
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu... by
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...Daniel Bohannon
3.4K views129 slides
How a Tweet Went Viral - BIWA Summit 2017 by
How a Tweet Went Viral - BIWA Summit 2017How a Tweet Went Viral - BIWA Summit 2017
How a Tweet Went Viral - BIWA Summit 2017Rittman Analytics
2.2K views54 slides
Scraping Scripting Hacking by
Scraping Scripting HackingScraping Scripting Hacking
Scraping Scripting HackingMike Ellis
1.3K views27 slides
Your Site Has Been Hacked, Now What? by
Your Site Has Been Hacked, Now What?Your Site Has Been Hacked, Now What?
Your Site Has Been Hacked, Now What?Michele Butcher-Jones
1.9K views34 slides

Similar to Asynchronous WordPress(20)

TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기 by Heejong Ahn
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
Heejong Ahn12.3K views
The Web Application Hackers Toolchain by jasonhaddix
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
jasonhaddix4.5K views
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu... by Daniel Bohannon
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Daniel Bohannon3.4K views
How a Tweet Went Viral - BIWA Summit 2017 by Rittman Analytics
How a Tweet Went Viral - BIWA Summit 2017How a Tweet Went Viral - BIWA Summit 2017
How a Tweet Went Viral - BIWA Summit 2017
Rittman Analytics2.2K views
Scraping Scripting Hacking by Mike Ellis
Scraping Scripting HackingScraping Scripting Hacking
Scraping Scripting Hacking
Mike Ellis1.3K views
Tool it Up! - Session #1 - Xhprof by toolitup
Tool it Up! - Session #1 - XhprofTool it Up! - Session #1 - Xhprof
Tool it Up! - Session #1 - Xhprof
toolitup820 views
Connecting to the Pulse of the Planet with the Twitter Platform by Andy Piper
Connecting to the Pulse of the Planet with the Twitter PlatformConnecting to the Pulse of the Planet with the Twitter Platform
Connecting to the Pulse of the Planet with the Twitter Platform
Andy Piper11.1K views
20+ Ways to Bypass Your macOS Privacy Mechanisms by SecuRing
20+ Ways to Bypass Your macOS Privacy Mechanisms20+ Ways to Bypass Your macOS Privacy Mechanisms
20+ Ways to Bypass Your macOS Privacy Mechanisms
SecuRing651 views
You'll Never Look at Developer Support the Same Way Again by Anne Gentle
You'll Never Look at Developer Support the Same Way AgainYou'll Never Look at Developer Support the Same Way Again
You'll Never Look at Developer Support the Same Way Again
Anne Gentle1.2K views
20+ ways to bypass your mac os privacy mechanisms by Csaba Fitzl
20+ ways to bypass your mac os privacy mechanisms20+ ways to bypass your mac os privacy mechanisms
20+ ways to bypass your mac os privacy mechanisms
Csaba Fitzl2.4K views
第5回SCDN - Things that become possible with HTML5 by scdn
第5回SCDN - Things that become possible with HTML5第5回SCDN - Things that become possible with HTML5
第5回SCDN - Things that become possible with HTML5
scdn321 views
Things I've learnt from my Hacker News web app by Lim Chee Aun
Things I've learnt from my Hacker News web appThings I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web app
Lim Chee Aun5.9K views
Adversary Emulation and Cracking The Bridge – Overview EMERSON EDUARDO RODRIGUES by EMERSON EDUARDO RODRIGUES
Adversary Emulation and Cracking The Bridge – Overview EMERSON EDUARDO RODRIGUESAdversary Emulation and Cracking The Bridge – Overview EMERSON EDUARDO RODRIGUES
Adversary Emulation and Cracking The Bridge – Overview EMERSON EDUARDO RODRIGUES
Getting Started with WordPress Development by Ryan Welcher
Getting Started with WordPress DevelopmentGetting Started with WordPress Development
Getting Started with WordPress Development
Ryan Welcher761 views
Website essentials things every library website should have by Brian Pichman
Website essentials  things every library website should haveWebsite essentials  things every library website should have
Website essentials things every library website should have
Brian Pichman130 views
YQL: Select * from Internet by drgath
YQL: Select * from InternetYQL: Select * from Internet
YQL: Select * from Internet
drgath15 views

More from Aaron Brazell

Wp cli-wcbalt by
Wp cli-wcbaltWp cli-wcbalt
Wp cli-wcbaltAaron Brazell
604 views12 slides
Wp cli by
Wp cliWp cli
Wp cliAaron Brazell
691 views11 slides
American University - American Observer Class - WordPress Portfolios by
American University - American Observer Class - WordPress PortfoliosAmerican University - American Observer Class - WordPress Portfolios
American University - American Observer Class - WordPress PortfoliosAaron Brazell
887 views48 slides
WordPress Third Party Authentication by
WordPress Third Party AuthenticationWordPress Third Party Authentication
WordPress Third Party AuthenticationAaron Brazell
5K views13 slides
American University WordPress Theming Lecture by
American University WordPress Theming LectureAmerican University WordPress Theming Lecture
American University WordPress Theming LectureAaron Brazell
3.1K views17 slides
JUSTICE Act of 2009 by
JUSTICE Act of 2009JUSTICE Act of 2009
JUSTICE Act of 2009Aaron Brazell
568 views103 slides

More from Aaron Brazell(9)

American University - American Observer Class - WordPress Portfolios by Aaron Brazell
American University - American Observer Class - WordPress PortfoliosAmerican University - American Observer Class - WordPress Portfolios
American University - American Observer Class - WordPress Portfolios
Aaron Brazell887 views
WordPress Third Party Authentication by Aaron Brazell
WordPress Third Party AuthenticationWordPress Third Party Authentication
WordPress Third Party Authentication
Aaron Brazell5K views
American University WordPress Theming Lecture by Aaron Brazell
American University WordPress Theming LectureAmerican University WordPress Theming Lecture
American University WordPress Theming Lecture
Aaron Brazell3.1K views
WordCamp NY: Blogs and Making it Into the Big Leagues by Aaron Brazell
WordCamp NY: Blogs and Making it Into the Big LeaguesWordCamp NY: Blogs and Making it Into the Big Leagues
WordCamp NY: Blogs and Making it Into the Big Leagues
Aaron Brazell555 views

Recently uploaded

REPORT Data Science EXPERT LECTURE.doc by
REPORT Data Science EXPERT LECTURE.docREPORT Data Science EXPERT LECTURE.doc
REPORT Data Science EXPERT LECTURE.docParulkhatri11
7 views9 slides
MODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVA by
MODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVAMODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVA
MODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVADemian Antony D'Mello
8 views14 slides
Programmable Logic Devices : SPLD and CPLD by
Programmable Logic Devices : SPLD and CPLDProgrammable Logic Devices : SPLD and CPLD
Programmable Logic Devices : SPLD and CPLDUsha Mehta
44 views54 slides
CCNA_questions_2021.pdf by
CCNA_questions_2021.pdfCCNA_questions_2021.pdf
CCNA_questions_2021.pdfVUPHUONGTHAO9
11 views196 slides
dummy.pptx by
dummy.pptxdummy.pptx
dummy.pptxJamesLamp
7 views2 slides
IRJET-Productivity Enhancement Using Method Study.pdf by
IRJET-Productivity Enhancement Using Method Study.pdfIRJET-Productivity Enhancement Using Method Study.pdf
IRJET-Productivity Enhancement Using Method Study.pdfSahilBavdhankar
11 views4 slides

Recently uploaded(20)

REPORT Data Science EXPERT LECTURE.doc by Parulkhatri11
REPORT Data Science EXPERT LECTURE.docREPORT Data Science EXPERT LECTURE.doc
REPORT Data Science EXPERT LECTURE.doc
Parulkhatri117 views
MODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVA by Demian Antony D'Mello
MODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVAMODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVA
MODULE-1 CHAPTER 3- Operators - Object Oriented Programming with JAVA
Programmable Logic Devices : SPLD and CPLD by Usha Mehta
Programmable Logic Devices : SPLD and CPLDProgrammable Logic Devices : SPLD and CPLD
Programmable Logic Devices : SPLD and CPLD
Usha Mehta44 views
IRJET-Productivity Enhancement Using Method Study.pdf by SahilBavdhankar
IRJET-Productivity Enhancement Using Method Study.pdfIRJET-Productivity Enhancement Using Method Study.pdf
IRJET-Productivity Enhancement Using Method Study.pdf
SahilBavdhankar11 views
taylor-2005-classical-mechanics.pdf by ArturoArreola10
taylor-2005-classical-mechanics.pdftaylor-2005-classical-mechanics.pdf
taylor-2005-classical-mechanics.pdf
ArturoArreola1040 views
Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R... by IJCNCJournal
Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R...Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R...
Trust Metric-Based Anomaly Detection via Deep Deterministic Policy Gradient R...
IJCNCJournal5 views
Field Programmable Gate Arrays : Architecture by Usha Mehta
Field Programmable Gate Arrays : ArchitectureField Programmable Gate Arrays : Architecture
Field Programmable Gate Arrays : Architecture
Usha Mehta33 views
Solution Challenge Introduction.pptx by GDSCCEC
Solution Challenge Introduction.pptxSolution Challenge Introduction.pptx
Solution Challenge Introduction.pptx
GDSCCEC13 views
Design_Discover_Develop_Campaign.pptx by ShivanshSeth6
Design_Discover_Develop_Campaign.pptxDesign_Discover_Develop_Campaign.pptx
Design_Discover_Develop_Campaign.pptx
ShivanshSeth659 views
Unlocking Research Visibility.pdf by KhatirNaima
Unlocking Research Visibility.pdfUnlocking Research Visibility.pdf
Unlocking Research Visibility.pdf
KhatirNaima11 views
Ansari: Practical experiences with an LLM-based Islamic Assistant by M Waleed Kadous
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic Assistant
M Waleed Kadous13 views
Integrating Sustainable Development Goals (SDGs) in School Education by SheetalTank1
Integrating Sustainable Development Goals (SDGs) in School EducationIntegrating Sustainable Development Goals (SDGs) in School Education
Integrating Sustainable Development Goals (SDGs) in School Education
SheetalTank120 views
Different type of computer networks .pptx by nazmul1514788
Different  type of computer networks .pptxDifferent  type of computer networks .pptx
Different type of computer networks .pptx
nazmul151478820 views

Asynchronous WordPress

  • 1. Aaron Brazell • @technosailor • www.technosailor.com A S Y N C H R O N O U S W O R D P R E S S O F F L O A D I N G H O O K E D E V E N T S TO I N C R E A S E PA G E S P E E D
  • 2. Aaron Brazell • @technosailor • www.technosailor.com T H E P R O B L E M ( D R A M AT I C T H E M E M U S I C )
  • 3. Aaron Brazell • @technosailor • www.technosailor.com • Every Time WordPress loads a page, events are fired. • Plugins typically hook events into init, admin_init, plugins_loaded, or save_post to fire events • Every event takes time to complete • Many dozens of events, all waiting to finish running, add overhead to WordPress.
  • 4. Aaron Brazell • @technosailor • www.technosailor.com P O S S I B L E P R O B L E M S C E N A R I O S • External API Request (Facebook/Twitter? Mailkimp?) • Saving a Post • Requesting information about a user when a user is created.
  • 5. - S O M E O N E W H O B A D LY M A N G L E D T H E Q U O T E “Asynchronous Events are not the heroes we want; they are the heroes we need.” Photo Credit: V Threepio, via Flickr, Creative Commons
  • 6. T E C H C R U N C H A S Y N C L I B R A RY • TechCrunch had extremely long process times, particularly with their CrunchBase API. • API calls were required to repopulate cached results. • Eric Mann (@ericmann) and John Bloch (@johnpbloch) built a library to offload tasks to asynchronous equivalents • Runs on `shutdown` hook Photo Credit: Charlyn Wee, via Flickr Creative Commons
  • 7. Aaron Brazell • @technosailor • www.technosailor.com O V E RV I E W O N H O W TO U S E • Bundle the WP_Async library in any theme or plugin and require it. It can also be installed as a standalone plugin. • Create a subclass that extends WP_Async_Task • Include a prepare_data() and run_action() method (Details in the documentation) • Include a protected $action variable that is set to the hook name you wish to run asynchronously. • Hook events on wp_async_{$action} (e.g. wp_async_transition_post_status)
  • 8. Aaron Brazell • @technosailor • www.technosailor.com R E F E R E N C E S • TechCrunch Open Sources its WordPress Async Task Library: http://techcrunch.com/2014/07/31/wp-async-task-our-new- open-source-library/ • Asynchronous WordPress, by 10up: http://techcrunch.com/ 2014/07/31/wp-async-task-our-new-open-source-library/ • Github: https://github.com/techcrunch/wp-async-task/ • Demo Plugin: https://github.com/technosailor/wcbalt-async-wp • This Presentation: http://www.slideshare.net/technosailor/ asynchronous-wordpress
  • 9. Aaron Brazell • @technosailor • www.technosailor.com A A R O N B R A Z E L L • Sr. Web Engineer, 10up • We’re Hiring Project Managers, WordPress/PHP Engineers and Front End UX Engineers (http://is10uphiring.com/) • Twitter: http://technosailor.com/twitter • Email: aaron.brazell@10up.com • Github: https://github.com/technosailor • WP.org Profile: https://profiles.wordpress.org/technosailor
  • 10. Aaron Brazell • @technosailor • www.technosailor.com