SlideShare a Scribd company logo
Best Practices for WordPress
in Enterprise
Who Am I?
• My name is Taylor Lovett
• Director of Web Engineering at 10up
• WordPress plugin creator and core contributor
• Open source community member
@tlovett12
10up is hiring!
@tlovett12
taylor.lovett@10up.com
The world’s leading CMS
for websites.
2 4 %
66M sites

58.7% of all CMS’s
http://w3techs.com/technologies/overview/content_management/all

Recommended for you

Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress

Have you ever cried yourself to sleep unable to find the cause of a horrendous bug in your WordPress site? Cry no more, your tears will be reshaped as blinding swords as we explore uncharted territories laced with mystical creatures. Debugging is an often avoided topic due to the uncertainty of how best to accomplish it and the lack of powerful introspective tools. This talk will explore new territory and showcase tools that help you debug complex and difficult issues in your WordPress site.

web developmentwordpress
Isomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWPIsomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWP

- NodeifyWP is a framework that allows developers to build isomorphic web applications using WordPress, PHP, and Node.js. - It uses PHP to execute JavaScript (Node.js) on the server, enabling the use of modern front-end technologies like React while retaining WordPress for content management. - Setting up NodeifyWP in a theme involves requiring the framework, registering server-side and post-specific JavaScript, and rendering content through a REST API endpoint.

wordpressjavascriptisomorphic
Naked and afraid Offline Mobile
Naked and afraid Offline MobileNaked and afraid Offline Mobile
Naked and afraid Offline Mobile

The document discusses using offline storage on mobile devices by leveraging HTML, JavaScript, and technologies like Cordova, PouchDB, and CouchDB. It summarizes the evolution of HTML5 offline storage standards including Web Storage, Web SQL, and IndexedDB. It then outlines an approach to building a mobile app that works offline by storing data locally on the device using IndexedDB and syncing with a remote CouchDB database using PouchDB when an internet connection is available.

offline datamobile
What is enterprise?
W E B S I T E S R E C E I V I N G 

M I L L I O N S O F
PA G E V I E W S P E R D AY
W E B S I T E S P R O D U C I N G 

H I G H D O L L A R
R E V E N U E S
W E B S I T E S W O R K E D O N B Y 

L A R G E T E A M S

Recommended for you

Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network

This document discusses lessons learned from managing a large WordPress multisite network with over 8,500 sites and 77,000 users. Key points include how to setup and install multisite quickly, pros and cons to consider, when multisite is a good fit, and challenges of supporting a very large network at a university including infrastructure, selecting plugins and themes, ongoing security, and tools used for monitoring, debugging and version control. Managing a large multisite installation requires keeping things simple and scalable as well as thinking long term about how design decisions will impact the network over time.

wordpressmultisite
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server Communication

AJAX allows asynchronous communication between the client and server without refreshing the page. It uses techniques like XMLHttpRequest, iFrames, and remote scripting to update parts of the DOM without reloading the entire page. The same origin policy prevents scripts from one origin accessing properties from another for security. Popular browsers that support AJAX include Internet Explorer, Firefox, and WebKit which powers Safari and Chrome.

browserssame originxhr
CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013

Sample code: https://github.com/cqsupport/webinar-aem-monitoring-maintenance Webinar Recording: https://my.adobeconnect.com/p9du34yji38 Monitor and maintain your AEM optimally. Eliminate performance slowdowns To manage and deliver content swiftly, you need a steady CQ environment. You can maximize the performance using the built-in monitoring and maintenance tools.

wcmcqadobe
W E B S I T E S P R O V I D I N G 

C R I T I C A L T I M E
S E N S I T I V E D ATA
W E B S I T E S I N V O LV I N G 

M A N Y C O M P L E X
I N T E G R AT I O N S
L A R G E O R G A N I Z AT I O N S A N D H I G H
D O L L A R B U S I N E S S O B J E C T I V E S
R E Q U I R E W E B S I T E S T H AT A R E
P E R F O R M A N T , E F F I C I E N T , S E C U R E ,
M A I N TA I N A B L E , H I G H LY AVA I L A B L E ,
D ATA - C E N T I C , A N D S C A L A B L E
Best practices-wordpress-enterprise

Recommended for you

Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP

This webinar lays the foundation for your PHP app. If you have at least one year of PHP experience, this webinar explains these key building blocks for creating and maintaining enterprise-class applications, mobile services, and third-party libraries. It covers: what makes mission-critical PHP different? (including cloud-based solutions); how to maintain your PHP stack; how to ensure code security; and what to do when your system goes down?

applicationsmission-criticalsecurity
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese

As you go into the cloud, the applications you are building will often be built on service-oriented architectures that communicate through RESTful APIs. Where API design and development used to be an uncommon thing, today it has become a basic application requirement. George Reese will cover the basic considerations in designing and implementing an API for your applications. George Reese is the author of a number of technology books and a regular speaker on RESTful APIs, cloud computing, Java, and database systems. His most recent books are The REST API Design Handbook and O’Reilly’s Cloud Application Architectures. Professionally, he is the Executive Director of Cloud Computing at Dell as a result of Dell's recent acquisition of Enstratius, a company George co-founded. George has also led a number of Open Source projects, including several MUD libraries and the Imaginary Home home automation libraries for Java. He is also the primary maintainer of Dasein Cloud, a cloud abstraction API for Java. George holds a BA from Bates College in Maine and an MBA from the Kellogg School of Management at Northwestern University.

restfulapiopen source
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction

This document provides an introduction to Adobe Experience Manager (AEM), formerly known as CQ5. It discusses key aspects of AEM including its use of OSGi and JCR technologies, templates and components for authoring content, and workflows for automating processes. The document also provides an overview of installing and setting up an AEM author instance, as well as related terms.

adobe cq5adobe cq5 developeradobe aem
https://10up.github.io/Engineering-Best-Practices/
C A C H I N G
Redis as a Persistent Object Cache
• WP lets you drop in a custom object cache.
• Redis lets you store things in memory for fast
read/writes
• Redis offers built in failover features that make it
easier to scale than Memcached
https://wordpress.org/plugins/wp-redis/
Page Caching
• Page caching is the act of caching entire
rendered HTML pages.
• Pages can be stored in the object cache
avoiding database queries entirely
https://wordpress.org/plugins/batcache/

Recommended for you

[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5

This document discusses HTML5 and provides examples of new HTML5 elements and features such as audio, video, and the canvas element. It demonstrates how to add audio and video to a basic HTML5 page structure and provides code samples using the canvas element to draw shapes. It also discusses HTML5 support in different browsers and techniques for improving compatibility, such as using JavaScript to add support for new elements in older browsers.

html5
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?

Web Developers are excited to use HTML 5 features but sometimes they need to explain to their non-technical boss what it is and how it can benefit the company. This presentation provides just enough information to share the capabilities of this new technologies without overwhelming the audience with the technical details. "What is HTML5?" covers things you might have seen on other websites and wanted to add on your own website but you didn't know it was a feature of HTML 5. After viewing this slideshow you will probably give your web developer the "go ahead" to upgrade your current HTML 4 website to HTML 5. You will also understand why web developers don't like IE (Internet Explorer) and why they always want you to keep your browser updated to latest version. "I have seen the future. It's in my browser" is the slogan used by many who have joined the HTML 5 revolution.

html 5microdatahtml5
2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting

This document discusses malware prevention and removal for websites. It begins by providing background on the speaker and his hosting business. It then emphasizes that malware is the #1 threat to websites, as it can prevent visitors, drain ad spending, and hurt search engine rankings. The document provides tips for identifying malware through warnings from users, browsers, search engines, and Google Webmaster Tools. It describes common malware patterns and provides steps for thorough removal, such as searching for suspicious scripts and code. Finally, it stresses the importance of prevention through secure passwords, updating software, and having backup and restoration processes. The overall message is that malware poses severe risks and careful prevention and response strategies are needed.

pubconseowebhosting
Fragment Caching
• All output involving a database read on the front
end should be fragment cached aside from the
main WP query.
• For example, generated HTML from a feature
post carousel should be cached since it uses a
WP_Query
Remote Calls
• Remote blocking calls can be a huge
performance bottleneck
• Cache remote calls as long as possible
• Utilize non-blocking remote requests wherever
possible
Prime Cache Asynchronously
• Don’t make the user wait for a cache to be
primed.
• Re-prime after invalidation
• Cleverly prime cached data asynchronously
(cron, non-blocking AJAX, etc.)
admin-ajax.php
• Admin-ajax.php is for admin use only. It is not
cached as aggressively as the front end. Page
caching will not work.

Recommended for you

Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015

This is a revised talk from the May 2015 presentation I gave to WordCamp Hamilton. At the end of this presentation you should have some ideas on how to speed up your WordPress site from within (plugins, code / theme optimizations) to environmental changes.

Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue

Being a WordPress developer means that our main programming language is PHP. Which works for building websites but not for running tasks. In this talk I will share my experience using Node.js as a platform to build on. Explaining why I have chosen for Node.js and show you how I used Node.js to build microservices that are supporting my WordPress projects.

node.jswordcampnorrköping
Piecing Together the WordPress Puzzle
Piecing Together the WordPress PuzzlePiecing Together the WordPress Puzzle
Piecing Together the WordPress Puzzle

What you need to know to upgrade to a self-hosted WP website. An overview of WordPress website hosting options and their impact on your WordPress website. A visual map of the site setup path through Dashboard menus and settings.

wordpressmanaged wordpress hostingself-hosted wordpress site
Off the Shelf Caching Plugins
• Can be difficult to install and even more difficult
to remove.
• Created for the general public and often bloated
with features.
• Keep it simple.
D ATA B A S E R E A D S
A N D W R I T E S
Avoid Front End Writes
• Database writes are slow
• Avoid race conditions
• Page caching makes them unreliable.
• If you really need to write data on the front end,
use AJAX.
Understand WP_Query Parameters
• 'no_found_rows' => true: Tells WordPress not to pass
SQL_CALC_FOUND_ROWS to the database query.
• 'update_post_meta_cache' => false: useful when
post meta will not be utilized.
• 'update_post_term_cache' => false: useful when
taxonomy terms will not be utilized.
• 'fields' => 'ids': useful when only the post IDs are
needed (less typical). Avoids lots of extra preparation.

Recommended for you

Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9

This document discusses asynchronous JavaScript, databases, and Project 3. It introduces callbacks, promises, and async/await in JavaScript. It also covers the differences between SQL and NoSQL databases, provides examples of using SQL databases locally and online, and exercises on SQLZOO. It describes Project 3 as connecting a database to the back end of an application. Students are instructed to draw out their database structure, write queries, and demo their working Project 3 application connecting to an actual database by the due date.

AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013

Sample code: https://github.com/cqsupport/webinar-dispatchercache Webinar Recording: http://my.adobeconnect.com/p7th2gf8k43/ Optimizing dispatcher cache covering: Best practices for using the dispatcher Tips and tricks for improving performance Common pitfalls to avoid How to design your site so you get the most out of your Dispatcher

adobeadobe confidentialcq5
What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer Science

Taylor Lovett is a senior web engineer who studied computer science. Computer science involves the study of computational theory, software, and hardware. It includes topics like algorithms, data structures, graph theory, programming, databases, and computer hardware. Big-O notation is used to describe how efficiently an algorithm solves a problem based on changes to input size. It indicates the worst-case time complexity of an algorithm. Tracking post views in WordPress can cause data race issues if not implemented carefully due to the possibility of concurrent requests updating the view count.

wordpressbig oh notationdatabase performance
Understand WP Query Parameters
• ‘posts_per_page’ => ‘…’: Sets the query limit to
something other than -1
• ‘post__not_in’: Tells MySQL to run a NOT IN
query which is inherently slow. Try to avoid.
Understand WP Query Parameters
new WP_Query( array(
'no_found_rows' => true,
'fields' => 'ids',
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
'posts_per_page' => 100,
) );
Autoloading Options
• add_option() takes a 3rd parameter $autoload.
• If you don’t need an option on every request,
specify false for $autoload.
Autoloading Options
if ( ! add_option( 'option_name', 'some_value', '', 'no' ) ) {
update_option( 'option_name', 'some_value' );
}

Recommended for you

ADBMS Project Pearl
ADBMS Project PearlADBMS Project Pearl
ADBMS Project Pearl

The document describes a movie database project created by Team Pearl. The database allows users to search information about movies, directors, genres and theaters. It includes data on movie showtimes, theater locations and contact information. The database was designed with functional areas for movies, theaters, awards and ratings. Entities and attributes were defined in the logical design. The physical database design was then implemented using SQL statements to create the database structure based on the logical model.

World Renewable Energy Congress 2011 Brochure
World Renewable Energy Congress 2011 BrochureWorld Renewable Energy Congress 2011 Brochure
World Renewable Energy Congress 2011 Brochure
Microsoft office Power Point
Microsoft office Power PointMicrosoft office Power Point
Microsoft office Power Point
B R O W S E R
P E R F O R M A N C E
Use a CDN
• CDN’s enable you to serve static assets from
servers closer to your visitors while reducing
load on your web server(s).
• CDN recommendation is very unique to each
project.
Reduce the Number and Size of HTTP
Requests
• Minify JS and CSS files (we use Grunt)
• Concatenate JS and CSS files (we use Grunt)
• Optimize images
• HTTP 2?
M A I N TA I N A B I L I T Y
A N D S TA B I L I T Y

Recommended for you

Ensayo
EnsayoEnsayo
Ensayo

Este documento describe la importancia de la formulación y evaluación de proyectos. Explica que la formulación y evaluación de proyectos son herramientas para identificar programas exitosos, medir la eficacia de programas, y determinar cuándo se necesitan cambios. También ayudan a los administradores a tomar decisiones informadas sobre los recursos y conclusiones objetivas sobre el éxito de los programas.

The Effect of Topography on The Seismic Wavefield
The Effect of Topography on The Seismic WavefieldThe Effect of Topography on The Seismic Wavefield
The Effect of Topography on The Seismic Wavefield

Active tectonic settings exhibit deformation manifested by earthquakes and by strong topographic variations due to erosion and uplift. Seismic waves from these earthquakes will clearly be influenced by the topographic variations, but it is challenging to isolate the effects of topography from the effects of variations in 3D seismic wave-speed structure. Here we design a realistic numerical experiment to investigate the effects of topography on the regional seismic wavefield. We choose southern California as a target region. We perform several sets of 3D seismic wavefield simulations for 137 earthquake sources ranging from Mw 3.4 to 5.4. We test the influence of topography within a homogeneous model and a layered model, and for each model we establish the shortest resolvable period for each path between a source and station. By examining the path-specific shortest resolvable periods, we are able to make some generalizations. Topography has the strongest influence on surface waves, particularly for waveforms with travel paths that are nodal to the source radiation; in these directions, the wave amplitudes are relatively low, so any multi-pathing or scattering effects due to topography are more easily identified. The topographic effects are stronger for shorter periods and for longer paths. The influence of topography on the seismic waveforms arises from both the change in the topographic surface, but also the change in the wave-speed structure that arises from perturbing the topography for a 1D (or 3D) wave- speed model. These generalizations of the influence of topography provide a basis for further numerical investigations or for where to search within a regional set of observations for the topographic effects. Topography should be included within simulation-based seismic imaging applications, especially those at high frequencies, in order to eliminate the possibility of attributing topographically-caused waveforms to subsurface variations in structure.

full waveformspectral element methodseismic
Consumer 720-The keys to consumer engagement in a social media world
Consumer 720-The keys to consumer engagement in a social media  worldConsumer 720-The keys to consumer engagement in a social media  world
Consumer 720-The keys to consumer engagement in a social media world

This document describes a white paper about Consumer720, a solution that combines internal consumer data with external social media data to provide a more complete view of consumers. It outlines the technical framework needed, including layers for data acquisition, content management, entity resolution, rationalization/enrichment, and consumer engagement. The goal is to help companies better understand consumers, improve acquisition, retention, and profitability in today's social media world.

Maintainable Code Improves Stability
• Easily maintainable and extendible code bases
are less susceptible to bugs.
• Bugs in maintainable code are solved quicker
• New features are more easily created in
maintainable code.
• Happy engineers are more productive (often
overlooked).
Modern PHP Design Patterns
• WordPress core is backwards compatible with
PHP 5.2.4.
• Enterprise websites aren’t (usually) constrained
by incredibly outdated software
• Namespaces, traits, composer, etc.
Don’t Obsess Over MVC PHP
• MVC (model, view, and controller) is a great
pattern in many situations.
• WordPress is inherently not object oriented. We
find that forcing MVC with tools like Twig
ultimately leads to more confusing code that is
harder to maintain.
Modern JS Design Patterns
• CommonJS
• ES6-7
• Write modular code with tools like Webpack and
Browserify

Recommended for you

Anhance
AnhanceAnhance
Anhance

The document contains timestamps, place names, numbers and terms that appear to be related to a game or strategy. It also includes names of individuals and organizations, phone numbers, dates and other details that are difficult to interpret without additional context. The document seems to be notes from an in-game strategy discussion containing suggestions about troops, equipment, formations and other game elements.

Apartment Hunting Tips
Apartment Hunting TipsApartment Hunting Tips
Apartment Hunting Tips

Apartment hunting doesn't have to stress you out. Here are some tips to help you find the perfect Halifax Apartment faster. For more information on apartments, contact us: www.templetonproperties.ca

apartmentsrentingapartment living
MYREVIEWERS ASAD Project
MYREVIEWERS ASAD ProjectMYREVIEWERS ASAD Project
MYREVIEWERS ASAD Project

This document provides an overview of the My Reviewers e-learning portal. Key features of the portal include peer review functionality, community comments to provide students with feedback language and resources, and the ability to archive student work and feedback for research purposes. The portal allows instructors to assign peer reviews and revision plans. It also provides administrators with analytics and reporting tools to identify at-risk students and assess writing programs.

Feature Plugins
• Group distinct pieces of functionality into plugins
as much as possible.
• This separation simplifies deployments and
enables you to reuse functionality on other
projects.
Documentation
• Properly documented code is more quickly fixed and
iterated upon
• Make documentation a part of your code review process
• PHP Documentation Standards: 

https://make.wordpress.org/core/handbook/best-
practices/inline-documentation-standards/php/
• JS Documentation Standards:

https://make.wordpress.org/core/handbook/best-
practices/inline-documentation-standards/javascript/

Wrapping Wrappers
• WordPress has a very rich, easy to use API with
ways to create posts, send HTTP requests,
create metaboxes, etc.
• Creating wrappers around these core APIs more
often than not just results in a layer of confusing
code and another library to memorize.
Write Tests
• PHPUnit for PHP
• Core unit testing framework and WP Mock -
https://github.com/10up/wp_mock
• Mocha for JavaScript
• Tests improve quality and stability through
identification of issues. Decrease regression

Recommended for you

001 filosofia de la educacion cosmovision filosofia y educacion
001 filosofia de la educacion cosmovision filosofia y educacion001 filosofia de la educacion cosmovision filosofia y educacion
001 filosofia de la educacion cosmovision filosofia y educacion

El documento trata sobre la filosofía y la educación. Plantea preguntas sobre qué y cómo se debe enseñar, a quiénes, dónde y para qué. También cuestiona conceptos como el hombre integral, los objetivos de la enseñanza, las metodologías, las materias que se imparten y cómo afectan los paradigmas, orígenes y creencias del profesor y alumnos al proceso educativo. Finalmente, busca definir la filosofía y la educación desde una perspectiva adventista y los principios bíblicos.

Lingkungan
LingkunganLingkungan
Lingkungan

tentang menjaga lingkungan

pelestarian lingkungan
Kti endang satuni
Kti endang satuniKti endang satuni
Kti endang satuni

Study kasus ini membahas asuhan kebidanan pada ibu nifas umur 19 tahun dengan masalah putting susu lecet. Tujuannya adalah memberikan asuhan kebidanan yang tepat untuk mengatasi masalah tersebut. Study kasus ini menggunakan pendekatan deskriptif dengan teknik wawancara dan pemeriksaan fisik. Hasilnya menunjukkan bahwa ibu mampu melaksanakan asuhan yang diberikan seperti menyusui dengan benar sehingga

S E C U R I T Y
Clean Input
• Validate/sanitize data being inserted into the
database to strip anything harmful.
Clean Input
if ( ! empty( $_POST['option'] ) ) {

update_post_meta( $post_id, 'option_key', true );
} else {
delete_post_meta( $post_id, 'option_key' );
}
update_post_meta( $post_id, 'key_name',
sanitize_text_field( $_POST['description'] ) );
Secure Output
• Escape data that is printed to the screen
• Escape data as late as possible
• Check out the esc_* functions in the codex.
https://codex.wordpress.org/Validating_Sanitizing_and_Escaping_User_Data

Recommended for you

002 la visitacion del anciano y pastor
002 la visitacion del anciano y pastor002 la visitacion del anciano y pastor
002 la visitacion del anciano y pastor

El documento describe diferentes tipos de personalidades y cómo la personalidad de alguien que visita a otros debería reflejar la de Cristo. También proporciona consejos sobre cómo realizar visitas efectivas a miembros de la iglesia, incluidos los no adventistas y los nuevos conversos, enfocándose en enseñar, orar y brindar apoyo. Visitar a otros, especialmente a los más vulnerables, es un servicio importante.

The Foundation of Knowledge
The Foundation of KnowledgeThe Foundation of Knowledge
The Foundation of Knowledge

Difference between intelligence and thinking. Different types of intelligence. Thinking can be improved.

criticalthinkingintelligencecritical
Realyn_C_ Manalili_ Resume
Realyn_C_ Manalili_ ResumeRealyn_C_ Manalili_ Resume
Realyn_C_ Manalili_ Resume

Realyn C. Manalili is seeking a challenging job that utilizes her education and experience. She has over 7 years of experience in administrative and customer service roles for hospitality companies. Her experience includes positions as a retail staff member, administrative assistant, receptionist, and content writer. She has strong computer skills in Microsoft Office and other systems. Manalili graduated in 2008 with a bachelor's degree in Hotel and Restaurant Institution Management. She is looking to further enhance her skills and personal development.

Secure Output
<section>
<?php esc_html_e( get_post_meta( get_the_ID(),
'key_name', true ) ); ?>
</section>
<section class="<?php
esc_attr_e( get_post_meta( get_the_ID(), 'key_name',
true ) ); ?>">
...
</section>
innerHTML and jQuery Selectors
• Don’t insert arbitrary data into innerHTML or
jQuery selectors.
innerHTML and jQuery Selectors
document.getElementsByClassName( 'class-name' )
[0].innerText = textString;
var node = document.createElement( 'div' );
node.innerText = textString;
document.getElementsByClassName( 'class-name' )
[0].appendChild( node );
jQuery( '.class-name-' + parseInt( index ) );
Nonces
• Ensure intent of important actions (database
modifications) by associating them with a nonce
• wp_create_nonce(), wp_verify_nonce(),
wp_nonce_field()

Recommended for you

Kb2 asuhan kebidanan pada ibu hamil kunjungan awal
Kb2 asuhan kebidanan pada ibu hamil kunjungan awalKb2 asuhan kebidanan pada ibu hamil kunjungan awal
Kb2 asuhan kebidanan pada ibu hamil kunjungan awal

Kb2 asuhan kebidanan pada ibu hamil kunjungan awal

Wordpress search-elasticsearch
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearch

- The document discusses modernizing WordPress search using Elasticsearch. It introduces ElasticPress, an open source WordPress plugin that uses Elasticsearch to power search and complex queries. - ElasticPress allows searching of post content, titles, taxonomies and metadata. It supports advanced filtering, fuzzy matching, and relevancy-based results. - The document provides instructions for installing Elasticsearch, configuring ElasticPress, indexing posts, and using WP_Query to integrate Elasticsearch searches and filters. Examples of complex queries using filters, taxonomies, dates and metadata are also shown.

Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise

10up open sourced their WordPress Best Practices (PHP, JavaScript, tools, and workflows) in late 2014. As the Director of Web Engineering at 10up, I drove this project and am the lead contributor to the docs. These Best Practices allow developers to build sites that scale, perform, and are secure one sites receiving millions of page views per day. They also standardize development practices in such a way that facilitates team collaboration. This talk will highlight some important parts of the Best Practices and reveal some valuable tips about how we (10up) engineer some of the most complex and most viewed WordPress sites in the world.

enterprisewordpressphp
Nonces
<form>
<?php wp_nonce_field( 'prefix-form-action',
'nonce_field' ); ?>
...
</form>
if ( empty( $_POST['nonce_field'] ||
wp_verify_nonce( $_POST['nonce_field'], 'prefix-
form-action' ) {
return false;
}
Limit Login Attempts
• Limit max number of login attempts to prevent
password guessing.
Require Strong Passwords
• Weak passwords are one of the most common
ways attackers exploit websites.
• Require your users create strong passwords.
There are a few great plugins that do this
automatically.
T H I R D PA RT Y C O D E

Recommended for you

Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress

This document provides best practices for WordPress development including caching, database reads/writes, search, browser performance, maintainability, security, third party code, and teams. It recommends using Redis for caching, understanding WP_Query parameters, writing modular feature plugins, thorough documentation, testing, sanitizing inputs, using nonces, and conducting internal code reviews.

redisjavascriptelasticsearch
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications

This document provides best practices for WordPress applications, covering topics like caching, database reads/writes, search queries, maintainability, security, third-party code, teams, and workflows. It recommends tools and techniques to optimize performance, including using Redis for caching, Elasticsearch for complex queries, feature plugins, documentation, testing, linting, and managing dependencies with Composer.

wordpressphpmysql
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website

The document discusses common mistakes that are often found during website audits. It covers 5 categories: content architecture, display architecture, site architecture, security, and performance. Some examples of mistakes mentioned include having similar content types, not reusing fields, extra modules installed that are not useful, reinventing functionality that Drupal already provides well, outdated core/contrib modules, and complex queries without indexes. The document provides best practices for each category such as planning content architecture ahead of time, separating logic from presentation, using the right hooks for custom modules, keeping software updated, and optimizing databases before caching. It emphasizes the importance of testing, environments, and maintenance for the website lifecycle.

 
���by Acquia
drupalacquia webinardrupal webinar
Review Every Line of Code
Over 40,000 community plugins
• Plugins reviewed before submission
• Plugin revisions not reviewed
• Review guidelines not geared for
enterprise
Review Every Line of Code
Thousands of community themes
• More stringent review guidelines than
plugins
• Review guidelines not geared for enterprise
• Performance not measured
Understand Your Librarys
• jQuery, Underscores, etc. are helpful tools but
should not be used blindly. There is no substitute
for a solid understand of JavaScript.
• Encouraging engineers to understand the
libraries they are using will improve overall code
quality and decrease bugs.
T E A M S

Recommended for you

Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer

We are all flooded with information: blogs, videos, millions of open source projects. In this presentation I share my insights: what are the must-know and must-have tools, frameworks and techniques you can use today (or at least know about) in order to be up-to-date.

asp.netresponsive designangularjs
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1

First Session on Learning to Code for Startup MVP's using Ruby on Rails. This session covers the web architecture, Git/GitHub and makes a real rails app that is deployed to Heroku at the end. Thanks, Henry

startupbeginnercode
Enterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and RedundancyEnterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and Redundancy

Slides on how to build your WordPress site so that it performs like an enterprise application. Associated video: http://wordpress.tv/2014/06/25/john-giaconia-enterprise-wordpress-performance-scalability-and-redundancy/

performancewordcampwordpress
Workflows
• Keeping track of code history with version
control is critical.
• Mandate workflow at the start of project to keep
everyone on the same page.
• Use descriptive commit messages
• Gitflow: http://nvie.com/posts/a-successful-git-
branching-model/
Internal Code Reviews
• Code reviews help ensure performance,
security, maintainability, and scalability
• Engineers improve skills by reviewing and
receiving reviews.
Q U E S T I O N S ?
@ T L O V E T T 1 2
TAY L O R . L O V E T T @ 1 0 U P. C O M
TAY L O R L O V E T T. C O M

More Related Content

What's hot

Adobe AEM CQ5 - Developer Introduction
Adobe AEM CQ5 - Developer IntroductionAdobe AEM CQ5 - Developer Introduction
Adobe AEM CQ5 - Developer Introduction
Yash Mody
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First Aid
Alan Seiden
 
Hey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the ProblemHey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the Problem
ColdFusionConference
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
Rami Sayar
 
Isomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWPIsomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWP
Taylor Lovett
 
Naked and afraid Offline Mobile
Naked and afraid Offline MobileNaked and afraid Offline Mobile
Naked and afraid Offline Mobile
ColdFusionConference
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network
William Earnhardt
 
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server Communication
Mike Wilcox
 
CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013
Andrew Khoury
 
Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP
Zend by Rogue Wave Software
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
buildacloud
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
Tekno Point
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
Christopher Schmitt
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
Susan Winters
 
2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting
shendison
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
Alan Lok
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
Marko Heijnen
 
Piecing Together the WordPress Puzzle
Piecing Together the WordPress PuzzlePiecing Together the WordPress Puzzle
Piecing Together the WordPress Puzzle
Business Vitality LLC
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
Derek Jacoby
 
AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013
Andrew Khoury
 

What's hot (20)

Adobe AEM CQ5 - Developer Introduction
Adobe AEM CQ5 - Developer IntroductionAdobe AEM CQ5 - Developer Introduction
Adobe AEM CQ5 - Developer Introduction
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First Aid
 
Hey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the ProblemHey My Web App is Slow Where is the Problem
Hey My Web App is Slow Where is the Problem
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
 
Isomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWPIsomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWP
 
Naked and afraid Offline Mobile
Naked and afraid Offline MobileNaked and afraid Offline Mobile
Naked and afraid Offline Mobile
 
Managing Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large NetworkManaging Multisite: Lessons from a Large Network
Managing Multisite: Lessons from a Large Network
 
ClubAJAX Basics - Server Communication
ClubAJAX Basics - Server CommunicationClubAJAX Basics - Server Communication
ClubAJAX Basics - Server Communication
 
CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013
 
Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting2010 11 pubcon_hendison-hosting
2010 11 pubcon_hendison-hosting
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
Piecing Together the WordPress Puzzle
Piecing Together the WordPress PuzzlePiecing Together the WordPress Puzzle
Piecing Together the WordPress Puzzle
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013
 

Viewers also liked

What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer Science
Taylor Lovett
 
ADBMS Project Pearl
ADBMS Project PearlADBMS Project Pearl
ADBMS Project Pearl
Divya Tadi
 
World Renewable Energy Congress 2011 Brochure
World Renewable Energy Congress 2011 BrochureWorld Renewable Energy Congress 2011 Brochure
World Renewable Energy Congress 2011 Brochure
dranilgarg
 
Microsoft office Power Point
Microsoft office Power PointMicrosoft office Power Point
Microsoft office Power Point
Wael Elmeligy
 
Ensayo
EnsayoEnsayo
The Effect of Topography on The Seismic Wavefield
The Effect of Topography on The Seismic WavefieldThe Effect of Topography on The Seismic Wavefield
The Effect of Topography on The Seismic Wavefield
Ulrika Miller
 
Consumer 720-The keys to consumer engagement in a social media world
Consumer 720-The keys to consumer engagement in a social media  worldConsumer 720-The keys to consumer engagement in a social media  world
Consumer 720-The keys to consumer engagement in a social media world
duane lyons
 
Anhance
AnhanceAnhance
Anhance
Izhan mohd
 
Apartment Hunting Tips
Apartment Hunting TipsApartment Hunting Tips
Apartment Hunting Tips
Templeton Properties
 
MYREVIEWERS ASAD Project
MYREVIEWERS ASAD ProjectMYREVIEWERS ASAD Project
MYREVIEWERS ASAD Project
Divya Tadi
 
001 filosofia de la educacion cosmovision filosofia y educacion
001 filosofia de la educacion cosmovision filosofia y educacion001 filosofia de la educacion cosmovision filosofia y educacion
001 filosofia de la educacion cosmovision filosofia y educacion
Ismael Antonio Serrano España
 
Lingkungan
LingkunganLingkungan
Lingkungan
Nely Mus
 
Kti endang satuni
Kti endang satuniKti endang satuni
Kti endang satuni
ENDANGSATUNIKTI
 
002 la visitacion del anciano y pastor
002 la visitacion del anciano y pastor002 la visitacion del anciano y pastor
002 la visitacion del anciano y pastor
Ismael Antonio Serrano España
 
The Foundation of Knowledge
The Foundation of KnowledgeThe Foundation of Knowledge
The Foundation of Knowledge
biura3
 
Realyn_C_ Manalili_ Resume
Realyn_C_ Manalili_ ResumeRealyn_C_ Manalili_ Resume
Realyn_C_ Manalili_ Resume
Realyn Manalili
 
Kb2 asuhan kebidanan pada ibu hamil kunjungan awal
Kb2 asuhan kebidanan pada ibu hamil kunjungan awalKb2 asuhan kebidanan pada ibu hamil kunjungan awal
Kb2 asuhan kebidanan pada ibu hamil kunjungan awal
pjj_kemenkes
 
Wordpress search-elasticsearch
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearch
Taylor Lovett
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
Taylor Lovett
 

Viewers also liked (19)

What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer Science
 
ADBMS Project Pearl
ADBMS Project PearlADBMS Project Pearl
ADBMS Project Pearl
 
World Renewable Energy Congress 2011 Brochure
World Renewable Energy Congress 2011 BrochureWorld Renewable Energy Congress 2011 Brochure
World Renewable Energy Congress 2011 Brochure
 
Microsoft office Power Point
Microsoft office Power PointMicrosoft office Power Point
Microsoft office Power Point
 
Ensayo
EnsayoEnsayo
Ensayo
 
The Effect of Topography on The Seismic Wavefield
The Effect of Topography on The Seismic WavefieldThe Effect of Topography on The Seismic Wavefield
The Effect of Topography on The Seismic Wavefield
 
Consumer 720-The keys to consumer engagement in a social media world
Consumer 720-The keys to consumer engagement in a social media  worldConsumer 720-The keys to consumer engagement in a social media  world
Consumer 720-The keys to consumer engagement in a social media world
 
Anhance
AnhanceAnhance
Anhance
 
Apartment Hunting Tips
Apartment Hunting TipsApartment Hunting Tips
Apartment Hunting Tips
 
MYREVIEWERS ASAD Project
MYREVIEWERS ASAD ProjectMYREVIEWERS ASAD Project
MYREVIEWERS ASAD Project
 
001 filosofia de la educacion cosmovision filosofia y educacion
001 filosofia de la educacion cosmovision filosofia y educacion001 filosofia de la educacion cosmovision filosofia y educacion
001 filosofia de la educacion cosmovision filosofia y educacion
 
Lingkungan
LingkunganLingkungan
Lingkungan
 
Kti endang satuni
Kti endang satuniKti endang satuni
Kti endang satuni
 
002 la visitacion del anciano y pastor
002 la visitacion del anciano y pastor002 la visitacion del anciano y pastor
002 la visitacion del anciano y pastor
 
The Foundation of Knowledge
The Foundation of KnowledgeThe Foundation of Knowledge
The Foundation of Knowledge
 
Realyn_C_ Manalili_ Resume
Realyn_C_ Manalili_ ResumeRealyn_C_ Manalili_ Resume
Realyn_C_ Manalili_ Resume
 
Kb2 asuhan kebidanan pada ibu hamil kunjungan awal
Kb2 asuhan kebidanan pada ibu hamil kunjungan awalKb2 asuhan kebidanan pada ibu hamil kunjungan awal
Kb2 asuhan kebidanan pada ibu hamil kunjungan awal
 
Wordpress search-elasticsearch
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearch
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 

Similar to Best practices-wordpress-enterprise

Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
Taylor Lovett
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
Taylor Lovett
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
Acquia
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Ofer Zelig
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
Enterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and RedundancyEnterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and Redundancy
John Giaconia
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
 
Website optimization with request reduce
Website optimization with request reduceWebsite optimization with request reduce
Website optimization with request reduce
Matt Wrock
 
Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)
Klas Berlič Fras
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
ssuser35fdf2
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
Ran Bar-Zik
 
Measure and increase developer productivity with help of Severless by Kazulki...
Measure and increase developer productivity with help of Severless by Kazulki...Measure and increase developer productivity with help of Severless by Kazulki...
Measure and increase developer productivity with help of Severless by Kazulki...
Vadym Kazulkin
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Vadym Kazulkin
 
Web development tips and tricks
Web development tips and tricksWeb development tips and tricks
Web development tips and tricks
maxo_64
 
USG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 DaysUSG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 Days
Eric Sembrat
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
Cesar Martinez
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
reedmaniac
 
presentation
presentationpresentation
presentation
tutorialsruby
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
Eugene Lazutkin
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
ElifTech
 

Similar to Best practices-wordpress-enterprise (20)

Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Enterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and RedundancyEnterprise WordPress - Performance, Scalability and Redundancy
Enterprise WordPress - Performance, Scalability and Redundancy
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 
Website optimization with request reduce
Website optimization with request reduceWebsite optimization with request reduce
Website optimization with request reduce
 
Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)Basic Application Performance Optimization Techniques (Backend)
Basic Application Performance Optimization Techniques (Backend)
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
 
Measure and increase developer productivity with help of Severless by Kazulki...
Measure and increase developer productivity with help of Severless by Kazulki...Measure and increase developer productivity with help of Severless by Kazulki...
Measure and increase developer productivity with help of Severless by Kazulki...
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 
Web development tips and tricks
Web development tips and tricksWeb development tips and tricks
Web development tips and tricks
 
USG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 DaysUSG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 Days
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
 

More from Taylor Lovett

WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
Taylor Lovett
 
Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch
Taylor Lovett
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
Taylor Lovett
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
Taylor Lovett
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
Taylor Lovett
 
The JSON REST API for WordPress
The JSON REST API for WordPressThe JSON REST API for WordPress
The JSON REST API for WordPress
Taylor Lovett
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
Taylor Lovett
 

More from Taylor Lovett (7)

WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
 
Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
The JSON REST API for WordPress
The JSON REST API for WordPressThe JSON REST API for WordPress
The JSON REST API for WordPress
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 

Best practices-wordpress-enterprise

  • 1. Best Practices for WordPress in Enterprise
  • 2. Who Am I? • My name is Taylor Lovett • Director of Web Engineering at 10up • WordPress plugin creator and core contributor • Open source community member @tlovett12
  • 4. The world’s leading CMS for websites. 2 4 % 66M sites
 58.7% of all CMS’s http://w3techs.com/technologies/overview/content_management/all
  • 6. W E B S I T E S R E C E I V I N G 
 M I L L I O N S O F PA G E V I E W S P E R D AY
  • 7. W E B S I T E S P R O D U C I N G 
 H I G H D O L L A R R E V E N U E S
  • 8. W E B S I T E S W O R K E D O N B Y 
 L A R G E T E A M S
  • 9. W E B S I T E S P R O V I D I N G 
 C R I T I C A L T I M E S E N S I T I V E D ATA
  • 10. W E B S I T E S I N V O LV I N G 
 M A N Y C O M P L E X I N T E G R AT I O N S
  • 11. L A R G E O R G A N I Z AT I O N S A N D H I G H D O L L A R B U S I N E S S O B J E C T I V E S R E Q U I R E W E B S I T E S T H AT A R E P E R F O R M A N T , E F F I C I E N T , S E C U R E , M A I N TA I N A B L E , H I G H LY AVA I L A B L E , D ATA - C E N T I C , A N D S C A L A B L E
  • 14. C A C H I N G
  • 15. Redis as a Persistent Object Cache • WP lets you drop in a custom object cache. • Redis lets you store things in memory for fast read/writes • Redis offers built in failover features that make it easier to scale than Memcached https://wordpress.org/plugins/wp-redis/
  • 16. Page Caching • Page caching is the act of caching entire rendered HTML pages. • Pages can be stored in the object cache avoiding database queries entirely https://wordpress.org/plugins/batcache/
  • 17. Fragment Caching • All output involving a database read on the front end should be fragment cached aside from the main WP query. • For example, generated HTML from a feature post carousel should be cached since it uses a WP_Query
  • 18. Remote Calls • Remote blocking calls can be a huge performance bottleneck • Cache remote calls as long as possible • Utilize non-blocking remote requests wherever possible
  • 19. Prime Cache Asynchronously • Don’t make the user wait for a cache to be primed. • Re-prime after invalidation • Cleverly prime cached data asynchronously (cron, non-blocking AJAX, etc.)
  • 20. admin-ajax.php • Admin-ajax.php is for admin use only. It is not cached as aggressively as the front end. Page caching will not work.
  • 21. Off the Shelf Caching Plugins • Can be difficult to install and even more difficult to remove. • Created for the general public and often bloated with features. • Keep it simple.
  • 22. D ATA B A S E R E A D S A N D W R I T E S
  • 23. Avoid Front End Writes • Database writes are slow • Avoid race conditions • Page caching makes them unreliable. • If you really need to write data on the front end, use AJAX.
  • 24. Understand WP_Query Parameters • 'no_found_rows' => true: Tells WordPress not to pass SQL_CALC_FOUND_ROWS to the database query. • 'update_post_meta_cache' => false: useful when post meta will not be utilized. • 'update_post_term_cache' => false: useful when taxonomy terms will not be utilized. • 'fields' => 'ids': useful when only the post IDs are needed (less typical). Avoids lots of extra preparation.
  • 25. Understand WP Query Parameters • ‘posts_per_page’ => ‘…’: Sets the query limit to something other than -1 • ‘post__not_in’: Tells MySQL to run a NOT IN query which is inherently slow. Try to avoid.
  • 26. Understand WP Query Parameters new WP_Query( array( 'no_found_rows' => true, 'fields' => 'ids', 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'posts_per_page' => 100, ) );
  • 27. Autoloading Options • add_option() takes a 3rd parameter $autoload. • If you don’t need an option on every request, specify false for $autoload.
  • 28. Autoloading Options if ( ! add_option( 'option_name', 'some_value', '', 'no' ) ) { update_option( 'option_name', 'some_value' ); }
  • 29. B R O W S E R P E R F O R M A N C E
  • 30. Use a CDN • CDN’s enable you to serve static assets from servers closer to your visitors while reducing load on your web server(s). • CDN recommendation is very unique to each project.
  • 31. Reduce the Number and Size of HTTP Requests • Minify JS and CSS files (we use Grunt) • Concatenate JS and CSS files (we use Grunt) • Optimize images • HTTP 2?
  • 32. M A I N TA I N A B I L I T Y A N D S TA B I L I T Y
  • 33. Maintainable Code Improves Stability • Easily maintainable and extendible code bases are less susceptible to bugs. • Bugs in maintainable code are solved quicker • New features are more easily created in maintainable code. • Happy engineers are more productive (often overlooked).
  • 34. Modern PHP Design Patterns • WordPress core is backwards compatible with PHP 5.2.4. • Enterprise websites aren’t (usually) constrained by incredibly outdated software • Namespaces, traits, composer, etc.
  • 35. Don’t Obsess Over MVC PHP • MVC (model, view, and controller) is a great pattern in many situations. • WordPress is inherently not object oriented. We find that forcing MVC with tools like Twig ultimately leads to more confusing code that is harder to maintain.
  • 36. Modern JS Design Patterns • CommonJS • ES6-7 • Write modular code with tools like Webpack and Browserify
  • 37. Feature Plugins • Group distinct pieces of functionality into plugins as much as possible. • This separation simplifies deployments and enables you to reuse functionality on other projects.
  • 38. Documentation • Properly documented code is more quickly fixed and iterated upon • Make documentation a part of your code review process • PHP Documentation Standards: 
 https://make.wordpress.org/core/handbook/best- practices/inline-documentation-standards/php/ • JS Documentation Standards:
 https://make.wordpress.org/core/handbook/best- practices/inline-documentation-standards/javascript/

  • 39. Wrapping Wrappers • WordPress has a very rich, easy to use API with ways to create posts, send HTTP requests, create metaboxes, etc. • Creating wrappers around these core APIs more often than not just results in a layer of confusing code and another library to memorize.
  • 40. Write Tests • PHPUnit for PHP • Core unit testing framework and WP Mock - https://github.com/10up/wp_mock • Mocha for JavaScript • Tests improve quality and stability through identification of issues. Decrease regression
  • 41. S E C U R I T Y
  • 42. Clean Input • Validate/sanitize data being inserted into the database to strip anything harmful.
  • 43. Clean Input if ( ! empty( $_POST['option'] ) ) {
 update_post_meta( $post_id, 'option_key', true ); } else { delete_post_meta( $post_id, 'option_key' ); } update_post_meta( $post_id, 'key_name', sanitize_text_field( $_POST['description'] ) );
  • 44. Secure Output • Escape data that is printed to the screen • Escape data as late as possible • Check out the esc_* functions in the codex. https://codex.wordpress.org/Validating_Sanitizing_and_Escaping_User_Data
  • 45. Secure Output <section> <?php esc_html_e( get_post_meta( get_the_ID(), 'key_name', true ) ); ?> </section> <section class="<?php esc_attr_e( get_post_meta( get_the_ID(), 'key_name', true ) ); ?>"> ... </section>
  • 46. innerHTML and jQuery Selectors • Don’t insert arbitrary data into innerHTML or jQuery selectors.
  • 47. innerHTML and jQuery Selectors document.getElementsByClassName( 'class-name' ) [0].innerText = textString; var node = document.createElement( 'div' ); node.innerText = textString; document.getElementsByClassName( 'class-name' ) [0].appendChild( node ); jQuery( '.class-name-' + parseInt( index ) );
  • 48. Nonces • Ensure intent of important actions (database modifications) by associating them with a nonce • wp_create_nonce(), wp_verify_nonce(), wp_nonce_field()
  • 49. Nonces <form> <?php wp_nonce_field( 'prefix-form-action', 'nonce_field' ); ?> ... </form> if ( empty( $_POST['nonce_field'] || wp_verify_nonce( $_POST['nonce_field'], 'prefix- form-action' ) { return false; }
  • 50. Limit Login Attempts • Limit max number of login attempts to prevent password guessing.
  • 51. Require Strong Passwords • Weak passwords are one of the most common ways attackers exploit websites. • Require your users create strong passwords. There are a few great plugins that do this automatically.
  • 52. T H I R D PA RT Y C O D E
  • 53. Review Every Line of Code Over 40,000 community plugins • Plugins reviewed before submission • Plugin revisions not reviewed • Review guidelines not geared for enterprise
  • 54. Review Every Line of Code Thousands of community themes • More stringent review guidelines than plugins • Review guidelines not geared for enterprise • Performance not measured
  • 55. Understand Your Librarys • jQuery, Underscores, etc. are helpful tools but should not be used blindly. There is no substitute for a solid understand of JavaScript. • Encouraging engineers to understand the libraries they are using will improve overall code quality and decrease bugs.
  • 56. T E A M S
  • 57. Workflows • Keeping track of code history with version control is critical. • Mandate workflow at the start of project to keep everyone on the same page. • Use descriptive commit messages • Gitflow: http://nvie.com/posts/a-successful-git- branching-model/
  • 58. Internal Code Reviews • Code reviews help ensure performance, security, maintainability, and scalability • Engineers improve skills by reviewing and receiving reviews.
  • 59. Q U E S T I O N S ? @ T L O V E T T 1 2 TAY L O R . L O V E T T @ 1 0 U P. C O M TAY L O R L O V E T T. C O M