Enviar pesquisa
Carregar
WordPress heartbeat API w praktyce
•
1 gostou
•
1,433 visualizações
Maciek Kuchnik
Seguir
WordUp Kraków 25.07.2014
Leia menos
Leia mais
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 22
Baixar agora
Baixar para ler offline
Recomendados
WP-Cron - WordUp Kraków Zima 2014
WP-Cron - WordUp Kraków Zima 2014
Maciek Kuchnik
1. urodziny women in technology w krakowie
1. urodziny women in technology w krakowie
Ewelina Chromińska
A gdyby wszystkich grafików świata rozdzióbały kruki, wrony?
A gdyby wszystkich grafików świata rozdzióbały kruki, wrony?
Marcin Kosedowski
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
Maciek Kuchnik
Firma na kilku WordPressach - Maciej Kuchnik
Firma na kilku WordPressach - Maciej Kuchnik
Maciek Kuchnik
Role użytkowników w WordPressie - jak dać dostęp aby nie żałować
Role użytkowników w WordPressie - jak dać dostęp aby nie żałować
Maciek Kuchnik
Taksonomie. Stosujesz - zyskujesz!
Taksonomie. Stosujesz - zyskujesz!
Tomasz Kołkiewicz
Jak nadążyć za światem front endu
Jak nadążyć za światem front endu
Tomasz Dziuda
Recomendados
WP-Cron - WordUp Kraków Zima 2014
WP-Cron - WordUp Kraków Zima 2014
Maciek Kuchnik
1. urodziny women in technology w krakowie
1. urodziny women in technology w krakowie
Ewelina Chromińska
A gdyby wszystkich grafików świata rozdzióbały kruki, wrony?
A gdyby wszystkich grafików świata rozdzióbały kruki, wrony?
Marcin Kosedowski
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
Maciek Kuchnik
Firma na kilku WordPressach - Maciej Kuchnik
Firma na kilku WordPressach - Maciej Kuchnik
Maciek Kuchnik
Role użytkowników w WordPressie - jak dać dostęp aby nie żałować
Role użytkowników w WordPressie - jak dać dostęp aby nie żałować
Maciek Kuchnik
Taksonomie. Stosujesz - zyskujesz!
Taksonomie. Stosujesz - zyskujesz!
Tomasz Kołkiewicz
Jak nadążyć za światem front endu
Jak nadążyć za światem front endu
Tomasz Dziuda
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Mais conteúdo relacionado
Destaque
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Destaque
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
WordPress heartbeat API w praktyce
1.
WP HEARTBEAT API W
PRAKTYCE Maciej Kuchnik indelso.pl
2.
HEARTBEAT API? Dwukierunkowa komunikacja
przeglądarka - serwer w „czasie rzeczywistym” ! W WordPress od wersji 3.6
3.
JAKTO DZIAŁA? XHR (XMLHttpRequest) JS
Event - heartbeat-send - heartbeat-tick - heartbeat-error - heartbeat-connection-lost - heartbeat-connection-restored - heartbeat-nonces-expired WP Filter - heartbeat_received - heartbeat_send - heartbeat_nopriv_received - heartbeat_nopriv_send WP Action - heartbeat_tick - heartbeat_nopriv_tick co X sekund
4.
HEARTBEAT JS • wp.heartbeat.enqueue() •
wp.heartbeat.dequeue() • wp.heartbeat.isQueued() • wp.heartbeat.hasFocus() • wp.heartbeat.disableSuspend() • wp.heartbeat.interval()
5.
HEARTBEAT JS EVENTS •
heartbeat-send • heartbeat-tick • heartbeat-error • heartbeat-connection-lost • heartbeat-connection-restored • heartbeat-nonces-expired
6.
HEARTBEAT PHP dla zalogowanych filtry •
heartbeat_received • heartbeat_send akcja • heartbeat_tick dla niezalogowanych filtry • heartbeat_nopriv_received • heartbeat_nopriv_send akcja • heartbeat_nopriv_tick
7.
wp.heartbeat.enqueue(id1, data, overwrite); wp.heartbeat.enqueue(id2
data, overwrite); wp.heartbeat.enqueue(id3 data, overwrite); KOLEJKA id1 ! id2 ! id3 heartbeat-send XHR
8.
XHR if ( !empty($_POST['data'])
) apply_filters( 'heartbeat_received', $response, $data, $screen_id ); apply_filters( 'heartbeat_send', $response, $screen_id ); do_action( 'heartbeat_tick', $response, $screen_id ); $response['server_time'] = time(); wp_send_json($response);
9.
jQuery(document).on( 'heartbeat-tick.id2', function(
e, data ) { //do something }); jQuery(document).on('heartbeat-error', function(e, jqXHR, textStatus, error) { console.log('ERROR'); console.log(textStatus); console.log(error); });
10.
INTERWAŁ wp.heartbeat.interval(speed, ticks); speed =
‚fast’ / 5 ; 15 ; 30 ; 60 ; 'long-polling' ticks (domyślnie 30) - tylko przy speed=5 - liczba requestów po których speed wraca do normalnej wartości apply_filters( 'heartbeat_settings', array() ) JS PHP
11.
PRZYKŁAD
12.
HEARTBEAT W WP-ADMIN
13.
HEARTBEAT W WP-ADMIN
14.
HEARTBEAT W WP-ADMIN
15.
PRZYKŁAD NA FRONCIE
16.
IMPLEMENTACJA
17.
IMPLEMENTACJA
18.
IMPLEMENTACJA
19.
IMPLEMENTACJA
20.
IMPLEMENTACJA
21.
PYTANIA?
22.
DZIĘKUJĘ! Maciej Kuchnik maciek@indelso.pl facebook.com/maciekkuchnik
Baixar agora