SlideShare a Scribd company logo
Lucy Tomas • @_lucymtc • #WCAlicante2017
W O R D P R E S S
M E J O R E S P R Á C T I C A S
C O - O R G A N I Z A D O R A W O R D P R E S S V A L E N C I A
Y W O R D P R E S S D E N I A
A U T O R A P L U G I N S E N R E P O S I T O R I O W O R D P R E S S . O R G
L U C Y T O M A S , W E B E N G I N E E R @ 1 0 U P
W O R D P R E S S E N G I N E E R I N G B E S T P R A C T I C E S
Í N D I C E
Sobre 10up
Rendimiento
Seguridad
Librerías y frameworks
Patrones de diseño,
documentación y estilo
Algunas buenas prácticas en
JavaScript
Lucy Tomas • @_lucymtc • #WCAlicante2017
S O B R E 1 0 U P
USA Canada Europe India
Lucy Tomas • @_lucymtc • #WCAlicante2017
S O B R E 1 0 U P
https://10up.github.io/Engineering-Best-Practices
Lucy Tomas • @_lucymtc • #WCAlicante2017
S O B R E 1 0 U P
Lucy Tomas • @_lucymtc • #WCAlicante2017
R E N D I M I E N T O
Lucy Tomas • @_lucymtc • #WCAlicante2017
WP_Object_Cache y Transients API
R E N D I M I E N T O
R E N D I M I E N T O C A C H E Y T R A N S I E N T S
R E N D I M I E N T O C A C H E Y T R A N S I E N T S
Lucy Tomas • @_lucymtc • #WCAlicante2017
wp_cache_set() / wp_cache_get()
R E N D I M I E N T O C A C H E Y T R A N S I E N T S
Lucy Tomas • @_lucymtc • #WCAlicante2017
R E N D I M I E N T O C A C H E Y T R A N S I E N T S
Lucy Tomas • @_lucymtc • #WCAlicante2017
R E N D I M I E N T O
admin-ajax.php
C A C H E Y T R A N S I E N T S
Lucy Tomas • @_lucymtc • #WCAlicante2017
WP_Query vs. get_posts() vs. query_posts()
R E N D I M I E N T O
hook pre_get_posts
W P _ Q U E R Y
Lucy Tomas • @_lucymtc • #WCAlicante2017
Argumentos de WP_Query que optimizan la consulta
R E N D I M I E N T O
'no_found_rows' => true ( evita SQL_CALC_FOUND_ROWS )
'update_post_term_cache' => false
'update_post_meta_cache' => false
'fields' => 'ids'
Evitar
'posts_per_page' => -1
'post__not_in'
W P _ Q U E R Y
Lucy Tomas • @_lucymtc • #WCAlicante2017
R E N D I M I E N T O
wp_options autoload
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D
Lucy Tomas • @_lucymtc • #WCAlicante2017
V A L I D A R , S A N E A R , E S C A P A R
S E G U R I D A D
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D
V A L I D A R , S A N E A R
V A L I D A R , S A N E A R , E S C A P A R
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D
sanitize_* wp_kses_*
sanitize_text_field(), sanitize_key(), sanitize_email(), sanitize_title(), wp_kses,…….
V A L I D A R , S A N E A R , E S C A P A R
Lucy Tomas • @_lucymtc • #WCAlicante2017
V A L I D A R , E S C A P A R
S E G U R I D A D
- Atributos: esc_attr()
- Enlaces: esc_url()
- Traducciones: esc_html_e(), esc_html__() en lugar de _e() y __()
V A L I D A R , S A N E A R , E S C A P A R
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D
L A T E E S C A P I N G
E V I T A R
V A L I D A R , S A N E A R , E S C A P A R
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D
P R E V E N I R I N Y E C C I O N E S S Q L
C O N W P D B P R E P A R E
V A L I D A R , S A N E A R , E S C A P A R
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D
N O N C E S
check_admin_referer, wp_verify_nonce, wp_nonce_field, wp_create_nonce,…….
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D N O N C E S
Lucy Tomas • @_lucymtc • #WCAlicante2017
S E G U R I D A D N O N C E S
Lucy Tomas • @_lucymtc • #WCAlicante2017
L I B R E R Í A S
Y F R A M E W O R K S
E N W O R D P R E S S
9 9 % D E L O Q U E
S E
N E C E S I T A M O S
L I B R E R Í A S / F R A M E W O R K S
Y mucho más…
Lucy Tomas • @_lucymtc • #WCAlicante2017
P A T R O N E S D E D I S E Ñ O
D E S I G N P A T T E R N S
Lucy Tomas • @_lucymtc • #WCAlicante2017
E S T I L O Y
D O C U M E N T A C I Ó N
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T
U S O D E J Q U E R Y M O D E R A D O
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T J Q U E R Y
V S
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T J Q U E R Y
V S
Lucy Tomas • @_lucymtc • #WCAlicante2017
E V I T A R H A C E R L A M I S M A
S E L E C C I Ó N M Á S D E U N A
V E Z
J A V A S C R I P T
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T
V S
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T
C L O S U R E S
E V I T A C O N T A M I N A R E L O B J E T O W I N D O W
L I M I T A N D O E L A L C A N C E D E V A R I A B L E S Y
F U N C I O N E S
Lucy Tomas • @_lucymtc • #WCAlicante2017
V S
J A V A S C R I P T C L O S U R E S
Lucy Tomas • @_lucymtc • #WCAlicante2017
J A V A S C R I P T C L O S U R E S
Lucy Tomas • @_lucymtc • #WCAlicante2017
G R A C I A S

More Related Content

What's hot

Master’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistantsMaster’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistants
Daniel Harvey
 
TCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting Tools
TCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting ToolsTCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting Tools
TCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting Tools
Roland Frasier
 
Projek akhir asas pengangkutan data a168611
Projek akhir asas pengangkutan data a168611Projek akhir asas pengangkutan data a168611
Projek akhir asas pengangkutan data a168611
NAZIFAH FITRIYAH
 
Mapan projek akhir
Mapan projek akhirMapan projek akhir
Mapan projek akhir
MUHAMMADIZZAT62
 
How to properly meet dogs
How to properly meet dogsHow to properly meet dogs
How to properly meet dogs
Sunny Luthra
 
(Got to) give the people what they want - Amazon Search Summit June 2017
(Got to) give the people what they want - Amazon Search Summit June 2017(Got to) give the people what they want - Amazon Search Summit June 2017
(Got to) give the people what they want - Amazon Search Summit June 2017
Charlie Williams
 
Digital Nomad: The New Normal
Digital Nomad: The New NormalDigital Nomad: The New Normal
Digital Nomad: The New Normal
Natasha Murashev
 
Root cause of all behavioral issues in dogs
Root cause of all behavioral issues in dogsRoot cause of all behavioral issues in dogs
Root cause of all behavioral issues in dogs
Sunny Luthra
 
TCS: Copy Tools From Traffic & Conversion Summit 2017
TCS: Copy Tools From Traffic & Conversion Summit 2017TCS: Copy Tools From Traffic & Conversion Summit 2017
TCS: Copy Tools From Traffic & Conversion Summit 2017
Roland Frasier
 
WP Durham - The Word-Camp Scenario Survival Guide
WP Durham - The Word-Camp Scenario Survival GuideWP Durham - The Word-Camp Scenario Survival Guide
WP Durham - The Word-Camp Scenario Survival Guide
Shanta Nathwani
 
TCS: Video Marketing Tools + Image Tools
TCS: Video Marketing Tools + Image ToolsTCS: Video Marketing Tools + Image Tools
TCS: Video Marketing Tools + Image Tools
Roland Frasier
 
Shopping for keywords - topic research for ecommerce (for The SEO Social, May...
Shopping for keywords - topic research for ecommerce (for The SEO Social, May...Shopping for keywords - topic research for ecommerce (for The SEO Social, May...
Shopping for keywords - topic research for ecommerce (for The SEO Social, May...
Charlie Williams
 
Becoming a Better Developer #WCA2
Becoming a Better Developer #WCA2Becoming a Better Developer #WCA2
Becoming a Better Developer #WCA2
Brian Richards
 
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
Roland Frasier
 
Spiraling Upward! Avast 2017 presentation
Spiraling Upward! Avast 2017 presentationSpiraling Upward! Avast 2017 presentation
Spiraling Upward! Avast 2017 presentation
Wendy Wallbridge
 
Film240 Flipbook
Film240 FlipbookFilm240 Flipbook
Film240 Flipbook
Holly Macdonald
 
Digital trend 2015
Digital trend 2015Digital trend 2015
Digital trend 2015
Roman Hasan
 
Wild Scotland
Wild ScotlandWild Scotland
Wild Scotland
Ross Mackenzie
 
Socialmediastenden
SocialmediastendenSocialmediastenden
Socialmediastenden
Sascha Funk
 
Programming != Writing Code
Programming != Writing CodeProgramming != Writing Code
Programming != Writing Code
Gustavo Cunha
 

What's hot (20)

Master’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistantsMaster’s voice: the rise of voice assistants
Master’s voice: the rise of voice assistants
 
TCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting Tools
TCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting ToolsTCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting Tools
TCS: Analytics Tool, Influencer Marketing Analytics Tools + Retargeting Tools
 
Projek akhir asas pengangkutan data a168611
Projek akhir asas pengangkutan data a168611Projek akhir asas pengangkutan data a168611
Projek akhir asas pengangkutan data a168611
 
Mapan projek akhir
Mapan projek akhirMapan projek akhir
Mapan projek akhir
 
How to properly meet dogs
How to properly meet dogsHow to properly meet dogs
How to properly meet dogs
 
(Got to) give the people what they want - Amazon Search Summit June 2017
(Got to) give the people what they want - Amazon Search Summit June 2017(Got to) give the people what they want - Amazon Search Summit June 2017
(Got to) give the people what they want - Amazon Search Summit June 2017
 
Digital Nomad: The New Normal
Digital Nomad: The New NormalDigital Nomad: The New Normal
Digital Nomad: The New Normal
 
Root cause of all behavioral issues in dogs
Root cause of all behavioral issues in dogsRoot cause of all behavioral issues in dogs
Root cause of all behavioral issues in dogs
 
TCS: Copy Tools From Traffic & Conversion Summit 2017
TCS: Copy Tools From Traffic & Conversion Summit 2017TCS: Copy Tools From Traffic & Conversion Summit 2017
TCS: Copy Tools From Traffic & Conversion Summit 2017
 
WP Durham - The Word-Camp Scenario Survival Guide
WP Durham - The Word-Camp Scenario Survival GuideWP Durham - The Word-Camp Scenario Survival Guide
WP Durham - The Word-Camp Scenario Survival Guide
 
TCS: Video Marketing Tools + Image Tools
TCS: Video Marketing Tools + Image ToolsTCS: Video Marketing Tools + Image Tools
TCS: Video Marketing Tools + Image Tools
 
Shopping for keywords - topic research for ecommerce (for The SEO Social, May...
Shopping for keywords - topic research for ecommerce (for The SEO Social, May...Shopping for keywords - topic research for ecommerce (for The SEO Social, May...
Shopping for keywords - topic research for ecommerce (for The SEO Social, May...
 
Becoming a Better Developer #WCA2
Becoming a Better Developer #WCA2Becoming a Better Developer #WCA2
Becoming a Better Developer #WCA2
 
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1TCS: Competitive Intelligence Tools - Tools Presentation Part 1
TCS: Competitive Intelligence Tools - Tools Presentation Part 1
 
Spiraling Upward! Avast 2017 presentation
Spiraling Upward! Avast 2017 presentationSpiraling Upward! Avast 2017 presentation
Spiraling Upward! Avast 2017 presentation
 
Film240 Flipbook
Film240 FlipbookFilm240 Flipbook
Film240 Flipbook
 
Digital trend 2015
Digital trend 2015Digital trend 2015
Digital trend 2015
 
Wild Scotland
Wild ScotlandWild Scotland
Wild Scotland
 
Socialmediastenden
SocialmediastendenSocialmediastenden
Socialmediastenden
 
Programming != Writing Code
Programming != Writing CodeProgramming != Writing Code
Programming != Writing Code
 

Viewers also liked

WordCamp Alicante 2017 - De HTML a WordPress
WordCamp Alicante 2017 - De HTML a WordPressWordCamp Alicante 2017 - De HTML a WordPress
WordCamp Alicante 2017 - De HTML a WordPress
Darío BF
 
Retos WordPress 2017 - Fernando Tellado
Retos WordPress 2017 - Fernando TelladoRetos WordPress 2017 - Fernando Tellado
Retos WordPress 2017 - Fernando Tellado
Fernando Tellado
 
10 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 2017
10 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 201710 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 2017
10 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 2017
Juan Seguí Moreno
 
Optimiza tu WordPress para móviles en media hora con AMP
Optimiza tu WordPress para móviles en media hora con AMPOptimiza tu WordPress para móviles en media hora con AMP
Optimiza tu WordPress para móviles en media hora con AMP
Fernando Serer
 
Cómo crear una escuela de formación en Wordpress
Cómo crear una escuela de formación en WordpressCómo crear una escuela de formación en Wordpress
Cómo crear una escuela de formación en Wordpress
Miguel Florido
 
WP-CLI: La navaja suiza de WordPress que te hará un superhéroe
WP-CLI: La navaja suiza de WordPress que te hará un superhéroeWP-CLI: La navaja suiza de WordPress que te hará un superhéroe
WP-CLI: La navaja suiza de WordPress que te hará un superhéroe
Sergio Nieto
 
Ngss poster
Ngss posterNgss poster
Ngss poster
VictoriaLes
 
Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015
Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015
Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015
Fernando Serer
 
The weather in japan
The weather in japanThe weather in japan
The weather in japan
ernesto_correa
 
Cómo hacer Seo mobile en 2017
Cómo hacer Seo mobile en 2017Cómo hacer Seo mobile en 2017
Cómo hacer Seo mobile en 2017
Jordiob.com
 
Silicon Valley, más que un lugar una forma de hacer las cosas
Silicon Valley, más que un lugar una forma de hacer las cosasSilicon Valley, más que un lugar una forma de hacer las cosas
Silicon Valley, más que un lugar una forma de hacer las cosas
Juan Seguí Moreno
 
Power Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPressPower Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPress
Raymund Mitchell
 
WordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sitesWordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sites
Michael McCallister
 
Object Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin DevelopmentObject Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin Development
mtoppa
 
The Capitalist in the Co-Op: The Art & Science of the Premium WordPress Business
The Capitalist in the Co-Op: The Art & Science of the Premium WordPress BusinessThe Capitalist in the Co-Op: The Art & Science of the Premium WordPress Business
The Capitalist in the Co-Op: The Art & Science of the Premium WordPress Business
Shane Pearlman
 
Breaking up (your code) is hard to do
Breaking up (your code) is hard to doBreaking up (your code) is hard to do
Breaking up (your code) is hard to do
Dan Beil
 
WordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open SourceWordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open Source
jclermont
 
Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4
Konstantin Obenland
 
What's the plan for your master brand?
What's the plan for your master brand?What's the plan for your master brand?
What's the plan for your master brand?
Fly Solo Media Agency
 
Congrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp PhillyCongrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp Philly
Trailer Trash Design
 

Viewers also liked (20)

WordCamp Alicante 2017 - De HTML a WordPress
WordCamp Alicante 2017 - De HTML a WordPressWordCamp Alicante 2017 - De HTML a WordPress
WordCamp Alicante 2017 - De HTML a WordPress
 
Retos WordPress 2017 - Fernando Tellado
Retos WordPress 2017 - Fernando TelladoRetos WordPress 2017 - Fernando Tellado
Retos WordPress 2017 - Fernando Tellado
 
10 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 2017
10 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 201710 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 2017
10 consejos para mejorar la WPO en WordPress - Ponencia Wordcamp Alicante 2017
 
Optimiza tu WordPress para móviles en media hora con AMP
Optimiza tu WordPress para móviles en media hora con AMPOptimiza tu WordPress para móviles en media hora con AMP
Optimiza tu WordPress para móviles en media hora con AMP
 
Cómo crear una escuela de formación en Wordpress
Cómo crear una escuela de formación en WordpressCómo crear una escuela de formación en Wordpress
Cómo crear una escuela de formación en Wordpress
 
WP-CLI: La navaja suiza de WordPress que te hará un superhéroe
WP-CLI: La navaja suiza de WordPress que te hará un superhéroeWP-CLI: La navaja suiza de WordPress que te hará un superhéroe
WP-CLI: La navaja suiza de WordPress que te hará un superhéroe
 
Ngss poster
Ngss posterNgss poster
Ngss poster
 
Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015
Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015
Optimización WPO WordPress - Meetup WP Valencia - 26/09/2015
 
The weather in japan
The weather in japanThe weather in japan
The weather in japan
 
Cómo hacer Seo mobile en 2017
Cómo hacer Seo mobile en 2017Cómo hacer Seo mobile en 2017
Cómo hacer Seo mobile en 2017
 
Silicon Valley, más que un lugar una forma de hacer las cosas
Silicon Valley, más que un lugar una forma de hacer las cosasSilicon Valley, más que un lugar una forma de hacer las cosas
Silicon Valley, más que un lugar una forma de hacer las cosas
 
Power Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPressPower Up Your Non-Profit Website With WordPress
Power Up Your Non-Profit Website With WordPress
 
WordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sitesWordCamp Milwaukee 2012: Learning from the WordPress sites
WordCamp Milwaukee 2012: Learning from the WordPress sites
 
Object Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin DevelopmentObject Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin Development
 
The Capitalist in the Co-Op: The Art & Science of the Premium WordPress Business
The Capitalist in the Co-Op: The Art & Science of the Premium WordPress BusinessThe Capitalist in the Co-Op: The Art & Science of the Premium WordPress Business
The Capitalist in the Co-Op: The Art & Science of the Premium WordPress Business
 
Breaking up (your code) is hard to do
Breaking up (your code) is hard to doBreaking up (your code) is hard to do
Breaking up (your code) is hard to do
 
WordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open SourceWordCamp Milwaukee 2012 - Contributing to Open Source
WordCamp Milwaukee 2012 - Contributing to Open Source
 
Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4
 
What's the plan for your master brand?
What's the plan for your master brand?What's the plan for your master brand?
What's the plan for your master brand?
 
Congrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp PhillyCongrats. You're having a WordPress Site. WordCamp Philly
Congrats. You're having a WordPress Site. WordCamp Philly
 

Similar to 10up WordPress Engineering Best Practices

Challenging Your Assumptions
Challenging Your AssumptionsChallenging Your Assumptions
Challenging Your Assumptions
Kristina Fox
 
Challenging Your Assumptions
Challenging Your AssumptionsChallenging Your Assumptions
Challenging Your Assumptions
Kristina Fox
 
he Art of Measuring Content Marketing Success - Content Marketing World
he Art of Measuring Content Marketing Success -  Content Marketing World he Art of Measuring Content Marketing Success -  Content Marketing World
he Art of Measuring Content Marketing Success - Content Marketing World
Ashley Segura
 
Using Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and HowUsing Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and How
Adam W. Warner
 
Pubcon 2018: Data Driven Content Marketing Audit Runthrough
Pubcon 2018: Data Driven Content Marketing Audit Runthrough Pubcon 2018: Data Driven Content Marketing Audit Runthrough
Pubcon 2018: Data Driven Content Marketing Audit Runthrough
Ashley Segura
 
You Created a Plugin. Now What?
You Created a Plugin. Now What?You Created a Plugin. Now What?
You Created a Plugin. Now What?
Adam W. Warner
 
Introduction to Information Technology 2
Introduction to Information Technology 2Introduction to Information Technology 2
Introduction to Information Technology 2
dmeekis
 
GPBookletFINAL
GPBookletFINALGPBookletFINAL
GPBookletFINAL
Ansley Ponder
 
Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
David Simons
 
You Created a Plugin. Now What? WordCamp Sacramento
You Created a Plugin. Now What? WordCamp SacramentoYou Created a Plugin. Now What? WordCamp Sacramento
You Created a Plugin. Now What? WordCamp Sacramento
Adam W. Warner
 
I Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPR
I Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPRI Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPR
I Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPR
Asenath Horton
 
You Created a Plugin. Now What? WordCamp Orange County
You Created a Plugin. Now What? WordCamp Orange CountyYou Created a Plugin. Now What? WordCamp Orange County
You Created a Plugin. Now What? WordCamp Orange County
Adam W. Warner
 
Thinking (and Working) Like a Network
Thinking (and Working) Like a NetworkThinking (and Working) Like a Network
Thinking (and Working) Like a Network
Jonas Altman
 
Be Prepared - Internet Safety
Be Prepared - Internet SafetyBe Prepared - Internet Safety
Be Prepared - Internet Safety
Mike Mackintosh
 
Move Fast And Document Things
Move Fast And Document ThingsMove Fast And Document Things
Move Fast And Document Things
Ruthie BenDor
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
Ronald Ashri
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
Ronald Ashri
 
It's the age of digital reputations, how's yours?
It's the age of digital reputations, how's yours?It's the age of digital reputations, how's yours?
It's the age of digital reputations, how's yours?
The Digital Conversationalist
 
SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...
SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...
SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...
Distilled
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQL
David Simons
 

Similar to 10up WordPress Engineering Best Practices (20)

Challenging Your Assumptions
Challenging Your AssumptionsChallenging Your Assumptions
Challenging Your Assumptions
 
Challenging Your Assumptions
Challenging Your AssumptionsChallenging Your Assumptions
Challenging Your Assumptions
 
he Art of Measuring Content Marketing Success - Content Marketing World
he Art of Measuring Content Marketing Success -  Content Marketing World he Art of Measuring Content Marketing Success -  Content Marketing World
he Art of Measuring Content Marketing Success - Content Marketing World
 
Using Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and HowUsing Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and How
 
Pubcon 2018: Data Driven Content Marketing Audit Runthrough
Pubcon 2018: Data Driven Content Marketing Audit Runthrough Pubcon 2018: Data Driven Content Marketing Audit Runthrough
Pubcon 2018: Data Driven Content Marketing Audit Runthrough
 
You Created a Plugin. Now What?
You Created a Plugin. Now What?You Created a Plugin. Now What?
You Created a Plugin. Now What?
 
Introduction to Information Technology 2
Introduction to Information Technology 2Introduction to Information Technology 2
Introduction to Information Technology 2
 
GPBookletFINAL
GPBookletFINALGPBookletFINAL
GPBookletFINAL
 
Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
 
You Created a Plugin. Now What? WordCamp Sacramento
You Created a Plugin. Now What? WordCamp SacramentoYou Created a Plugin. Now What? WordCamp Sacramento
You Created a Plugin. Now What? WordCamp Sacramento
 
I Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPR
I Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPRI Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPR
I Factor: Ignite your Inner Badass- become Irresistible #CityLaunchPR
 
You Created a Plugin. Now What? WordCamp Orange County
You Created a Plugin. Now What? WordCamp Orange CountyYou Created a Plugin. Now What? WordCamp Orange County
You Created a Plugin. Now What? WordCamp Orange County
 
Thinking (and Working) Like a Network
Thinking (and Working) Like a NetworkThinking (and Working) Like a Network
Thinking (and Working) Like a Network
 
Be Prepared - Internet Safety
Be Prepared - Internet SafetyBe Prepared - Internet Safety
Be Prepared - Internet Safety
 
Move Fast And Document Things
Move Fast And Document ThingsMove Fast And Document Things
Move Fast And Document Things
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
It's the age of digital reputations, how's yours?
It's the age of digital reputations, how's yours?It's the age of digital reputations, how's yours?
It's the age of digital reputations, how's yours?
 
SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...
SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...
SearchLove London | Kelvin Newman, 'What the Flash Crash and Black Boxes can ...
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQL
 

Recently uploaded

Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Dutch Power
 
Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...
Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...
Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...
SkillCertProExams
 
Carrer goals.pptx and their importance in real life
Carrer goals.pptx  and their importance in real lifeCarrer goals.pptx  and their importance in real life
Carrer goals.pptx and their importance in real life
artemacademy2
 
Collapsing Narratives: Exploring Non-Linearity • a micro report by Rosie Wells
Collapsing Narratives: Exploring Non-Linearity • a micro report by Rosie WellsCollapsing Narratives: Exploring Non-Linearity • a micro report by Rosie Wells
Collapsing Narratives: Exploring Non-Linearity • a micro report by Rosie Wells
Rosie Wells
 
Gregory Harris - Cycle 2 - Civics Presentation
Gregory Harris - Cycle 2 - Civics PresentationGregory Harris - Cycle 2 - Civics Presentation
Gregory Harris - Cycle 2 - Civics Presentation
gharris9
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
XP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to LeadershipXP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to Leadership
samililja
 
Updated diagnosis. Cause and treatment of hypothyroidism
Updated diagnosis. Cause and treatment of hypothyroidismUpdated diagnosis. Cause and treatment of hypothyroidism
Updated diagnosis. Cause and treatment of hypothyroidism
Faculty of Medicine And Health Sciences
 
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
OECD Directorate for Financial and Enterprise Affairs
 
Mẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPoint
Mẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPointMẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPoint
Mẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPoint
1990 Media
 
2024-05-30_meetup_devops_aix-marseille.pdf
2024-05-30_meetup_devops_aix-marseille.pdf2024-05-30_meetup_devops_aix-marseille.pdf
2024-05-30_meetup_devops_aix-marseille.pdf
Frederic Leger
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Dutch Power
 
Gregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptxGregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptx
gharris9
 
ASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdfASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdf
ToshihiroIto4
 
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
OECD Directorate for Financial and Enterprise Affairs
 
Burning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdfBurning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdf
kkirkland2
 
Tom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issueTom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issue
amekonnen
 
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij
 

Recently uploaded (19)

Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
 
Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...
Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...
Mastering the Concepts Tested in the Databricks Certified Data Engineer Assoc...
 
Carrer goals.pptx and their importance in real life
Carrer goals.pptx  and their importance in real lifeCarrer goals.pptx  and their importance in real life
Carrer goals.pptx and their importance in real life
 
Collapsing Narratives: Exploring Non-Linearity • a micro report by Rosie Wells
Collapsing Narratives: Exploring Non-Linearity • a micro report by Rosie WellsCollapsing Narratives: Exploring Non-Linearity • a micro report by Rosie Wells
Collapsing Narratives: Exploring Non-Linearity • a micro report by Rosie Wells
 
Gregory Harris - Cycle 2 - Civics Presentation
Gregory Harris - Cycle 2 - Civics PresentationGregory Harris - Cycle 2 - Civics Presentation
Gregory Harris - Cycle 2 - Civics Presentation
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
XP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to LeadershipXP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to Leadership
 
Updated diagnosis. Cause and treatment of hypothyroidism
Updated diagnosis. Cause and treatment of hypothyroidismUpdated diagnosis. Cause and treatment of hypothyroidism
Updated diagnosis. Cause and treatment of hypothyroidism
 
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
 
Mẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPoint
Mẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPointMẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPoint
Mẫu PPT kế hoạch làm việc sáng tạo cho nửa cuối năm PowerPoint
 
2024-05-30_meetup_devops_aix-marseille.pdf
2024-05-30_meetup_devops_aix-marseille.pdf2024-05-30_meetup_devops_aix-marseille.pdf
2024-05-30_meetup_devops_aix-marseille.pdf
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
 
Gregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptxGregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptx
 
ASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdfASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdf
 
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
 
Burning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdfBurning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdf
 
Tom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issueTom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issue
 
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
 

10up WordPress Engineering Best Practices

  • 1. Lucy Tomas • @_lucymtc • #WCAlicante2017 W O R D P R E S S M E J O R E S P R Á C T I C A S C O - O R G A N I Z A D O R A W O R D P R E S S V A L E N C I A Y W O R D P R E S S D E N I A A U T O R A P L U G I N S E N R E P O S I T O R I O W O R D P R E S S . O R G L U C Y T O M A S , W E B E N G I N E E R @ 1 0 U P W O R D P R E S S E N G I N E E R I N G B E S T P R A C T I C E S
  • 2. Í N D I C E Sobre 10up Rendimiento Seguridad Librerías y frameworks Patrones de diseño, documentación y estilo Algunas buenas prácticas en JavaScript
  • 3. Lucy Tomas • @_lucymtc • #WCAlicante2017 S O B R E 1 0 U P USA Canada Europe India
  • 4. Lucy Tomas • @_lucymtc • #WCAlicante2017 S O B R E 1 0 U P https://10up.github.io/Engineering-Best-Practices
  • 5. Lucy Tomas • @_lucymtc • #WCAlicante2017 S O B R E 1 0 U P
  • 6. Lucy Tomas • @_lucymtc • #WCAlicante2017 R E N D I M I E N T O
  • 7. Lucy Tomas • @_lucymtc • #WCAlicante2017 WP_Object_Cache y Transients API R E N D I M I E N T O
  • 8. R E N D I M I E N T O C A C H E Y T R A N S I E N T S
  • 9. R E N D I M I E N T O C A C H E Y T R A N S I E N T S
  • 10. Lucy Tomas • @_lucymtc • #WCAlicante2017 wp_cache_set() / wp_cache_get() R E N D I M I E N T O C A C H E Y T R A N S I E N T S
  • 11. Lucy Tomas • @_lucymtc • #WCAlicante2017 R E N D I M I E N T O C A C H E Y T R A N S I E N T S
  • 12. Lucy Tomas • @_lucymtc • #WCAlicante2017 R E N D I M I E N T O admin-ajax.php C A C H E Y T R A N S I E N T S
  • 13. Lucy Tomas • @_lucymtc • #WCAlicante2017 WP_Query vs. get_posts() vs. query_posts() R E N D I M I E N T O hook pre_get_posts W P _ Q U E R Y
  • 14. Lucy Tomas • @_lucymtc • #WCAlicante2017 Argumentos de WP_Query que optimizan la consulta R E N D I M I E N T O 'no_found_rows' => true ( evita SQL_CALC_FOUND_ROWS ) 'update_post_term_cache' => false 'update_post_meta_cache' => false 'fields' => 'ids' Evitar 'posts_per_page' => -1 'post__not_in' W P _ Q U E R Y
  • 15. Lucy Tomas • @_lucymtc • #WCAlicante2017 R E N D I M I E N T O wp_options autoload
  • 16. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D
  • 17. Lucy Tomas • @_lucymtc • #WCAlicante2017 V A L I D A R , S A N E A R , E S C A P A R S E G U R I D A D
  • 18. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D V A L I D A R , S A N E A R V A L I D A R , S A N E A R , E S C A P A R
  • 19. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D sanitize_* wp_kses_* sanitize_text_field(), sanitize_key(), sanitize_email(), sanitize_title(), wp_kses,……. V A L I D A R , S A N E A R , E S C A P A R
  • 20. Lucy Tomas • @_lucymtc • #WCAlicante2017 V A L I D A R , E S C A P A R S E G U R I D A D - Atributos: esc_attr() - Enlaces: esc_url() - Traducciones: esc_html_e(), esc_html__() en lugar de _e() y __() V A L I D A R , S A N E A R , E S C A P A R
  • 21. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D L A T E E S C A P I N G E V I T A R V A L I D A R , S A N E A R , E S C A P A R
  • 22. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D P R E V E N I R I N Y E C C I O N E S S Q L C O N W P D B P R E P A R E V A L I D A R , S A N E A R , E S C A P A R
  • 23. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D N O N C E S check_admin_referer, wp_verify_nonce, wp_nonce_field, wp_create_nonce,…….
  • 24. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D N O N C E S
  • 25. Lucy Tomas • @_lucymtc • #WCAlicante2017 S E G U R I D A D N O N C E S
  • 26. Lucy Tomas • @_lucymtc • #WCAlicante2017 L I B R E R Í A S Y F R A M E W O R K S
  • 27. E N W O R D P R E S S 9 9 % D E L O Q U E S E N E C E S I T A M O S L I B R E R Í A S / F R A M E W O R K S Y mucho más…
  • 28. Lucy Tomas • @_lucymtc • #WCAlicante2017 P A T R O N E S D E D I S E Ñ O D E S I G N P A T T E R N S
  • 29. Lucy Tomas • @_lucymtc • #WCAlicante2017 E S T I L O Y D O C U M E N T A C I Ó N
  • 30. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T
  • 31. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T U S O D E J Q U E R Y M O D E R A D O
  • 32. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T J Q U E R Y V S
  • 33. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T J Q U E R Y V S
  • 34. Lucy Tomas • @_lucymtc • #WCAlicante2017 E V I T A R H A C E R L A M I S M A S E L E C C I Ó N M Á S D E U N A V E Z J A V A S C R I P T
  • 35. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T V S
  • 36. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T C L O S U R E S E V I T A C O N T A M I N A R E L O B J E T O W I N D O W L I M I T A N D O E L A L C A N C E D E V A R I A B L E S Y F U N C I O N E S
  • 37. Lucy Tomas • @_lucymtc • #WCAlicante2017 V S J A V A S C R I P T C L O S U R E S
  • 38. Lucy Tomas • @_lucymtc • #WCAlicante2017 J A V A S C R I P T C L O S U R E S
  • 39. Lucy Tomas • @_lucymtc • #WCAlicante2017 G R A C I A S

Editor's Notes

  1. Estas 2 funciones en el core de WP por si solas no hacen nada. Al instalar un plugin para cache, será el plugin que defina lo que hacen estas funciones. Si desarrollas un plugin y usas estas funciones estarás haciendo un favor al usuario que tiene configurado un sistema para el cache.
  2. Ejemplo común. En este caso siembre habrá un usuario que se encuentre con este valor de cache vacío, es ese usuario que genera la query y guarda el cache. Para 1 usuario la query es lenta. Hay estrategias más complejas, se puede generar el cache de manera asincrónica en el background. Nunca asumir que estos objetos estarán en memoria, pueden ser borrados en cualquier momento. nunca usar transients como manera de almacenar datos que necesita la aplicación. el tiempo de expiración garantiza un tiempo máximo de su existencia. Sabremos que después de ese tiempo nunca existirá. En ningún momento se garantiza un tiempo mínimo. puedo poner fecha expiración dentro de 1 año y a los 5 minutos ese transient borrarse por alguna razón. Ejemplo error común! un plugin premium que guarda las licencias de los usuarios con fecha de expiración en un transient. transients son excelentes para almacenar datos de API’s de terceros, RSS feeds, etc. siempre será mas rápido hacer las peticiones a nuestra base de datos que a servicios externos.
  3. WP no hace uso del cache en el admin Rewrite rules API. registrar un endpoint con rewrite add_rewrite_rule() add_action( 'template_redirect', 'do_api' ); do_api() { if(…){wp_send_json( $response );} }
  4. - usar siempre por lo general WP_query, hace cosas detrás del escenario que otros métodos no hacen. get_posts: 'suppress_filters' => true - query_posts tiene un uso distinto a get_posts o wp_query. No esta recomendado usar en themes o plugins. Reemplazará la query principal, incluso ejecutándola mas de una vez. usar pre_get_posts para modificar la query principal.
  5. 'no_found_rows' => true : Si no se usa paginación evita que WordPress ejecute SQL_CALC_FOUND_ROWS en la query. update_post_term_cache: Si no se va a hacer uso de los términos de los posts. update_post_meta_cache: Si no se va a hacer uso del meta de los posts. Siempre poner límite que no sea -1. Si nuestra web tiene 100,000 posts acabará rompiendo. post__not_in : SQL ejecuta NOT IN, lento. Más rápido filtrar los ID’s dentro del loop en PHP.
  6. Esto es algo que se puede olvidar fácilmente. Por defecto estas funciones guardan la opción con autoload ‘yes’/true. Esto significa que esa opción se carga de manera automática en cada carga de página. Si la opción sólo se necesita en una página en concreto -> especificar autoload = false. NO se puede modificar el valor autoload de una opción existente, hay que borrar la opción y guardarla de nuevo.
  7. Validar: asegurarnos de que lo recibido es lo que esperamos Sanear = limpiar
  8. Validar datos para asegurarnos que lo que recibimos es lo que esperamos. Sanear datos para limpiar y asegurar que cumplen con ciertos estándares y criterios.
  9. - Hacer uso de wp_kses de forma moderada. Es una función cara en cuanto a rendimiento se refiere debido al gran número de expresiones regulares que tiene que recorrer.
  10. En 10up seguimos la filosofía de Late Escaping. Nos aseguramos que no puede pasar nada nunca entre el momento en que guardamos el valor en una variable y el momento en el que se imprime en pantalla. Lo mismo para escribir en la base de datos, siembre sanear en el último momento.
  11. $wpdb->prepare() = sprintf() llama a mysqli_real_escape_string en cada argumento. sprintf devuelve un string formateado. mysqli_real_escape_string escapa caracteres especiales en un string. Escapa ‘ y “ : previene Inyecciones SQL
  12. Con lo que incluye WordPress tenemos el 99% de lo que necesitamos, desde manejo de base de datos, enviar emails, etc. Y esto tanto en PHP como en JavaScript. Así que en 10up tratamos de no usar librerías y frameworks que WordPress no incluye, aunque sí que se usan algunas frameworks y librerías que son de código abierto como PHPUnit. Para JavaScript por ejemplo usamos jQuery, Underscore, Backbone. Backbone es un framework para construir aplicaciones JavaScript más complejas y es muy usado en WordPress, especialmente en la librería de imágenes (o biblioteca de medios).
  13. - Aseguran mantenibilidad de un proyecto. - Estandarizar prácticas de desarrollo permiten a nuevos desarrolladores entrar en el proyecto de manera más sencilla. Definiendo un nivel de dificultad bajo a la hora de saltar a un proyecto. En 10up desarrolladores entran y salen de proyectos constantemente. Sería un fracaso si tu código solo lo entiendes tu o unos cuantos, llevaría demasiado tiempo para un nuevo desarrollador nuevo el ajustarse al proyecto.
  14. En 10up revisamos cada línea de código antes de incluirla en un proyecto, tanto si es nuestro como plugins de terceros. En estas revisiones, a parte de seguridad, rendimiento y arquitectura del código, se tiene muy en cuenta la documentación y el estilo. La regla de oro es que cualquier manager de proyecto debe poder entender lo que hace tu código. Aunque trabajes sólo, tu futuro YO lo agradecerá.
  15. jQuery nos ayuda a realizar procesos más complejos como pueden ser peticiones en ajax, animaciones. Pero en otras cosas más sencillas puede ser un excesivo.
  16. En JS tenemos que cuidar al igual que en PHP los posibles conflictos con nombres de funciones y variables. Closure. Actúan como una clase en PHP, nos permite disponer de funciones y variables privadas a las que se pueden acceder solo si las exponemos.