SlideShare a Scribd company logo
WordPress
          Front-End Optimizations
          Tips to Speed Up Your Blog




Saturday, October 16, 2010
What is the “Front-End”?
               HTML
               CSS
               Images
               JavaScript
               Media (Audio/Video)
               3rd Party APIs



Saturday, October 16, 2010
HTML
               Markup / Node structure
               Placement of stylesheets / scripts
               Images
               <meta> tags
               DOCTYPE
               Micro-formats



Saturday, October 16, 2010
CSS
               Typography
               Colors
               reset.css
               CSS selectors
               Background Images / CSS Sprites
               CSS3+ support
               IE6 / Browser support


Saturday, October 16, 2010
JavaScript
               Event Binding
               3rd Party APIs
               AJAX
               Form validation
               DOM traversing
               jQuery
               Cookies
               Page State / Comet / Long-polling

Saturday, October 16, 2010
Front-End Programming +
          WordPress =
          HTML + CSS + Javascript + Media +
          PHP + WordPress API




Saturday, October 16, 2010
PHP / WordPress API
               Built-in WordPress Functions
               WordPress Template Hierarchy
               WordPress Media Library
               Database Abstraction Layer
               WordPress Admin
               Site-specific PHP code written by you



Saturday, October 16, 2010
HTML

               Semantic
               DOCTYPE - specific
               Classes vs IDs
               Accessible
               Shallow node depth




Saturday, October 16, 2010
Node Depth
            <div>
               <div>
                  <div>
                     <div>
                        <div>
                           <div>...




Saturday, October 16, 2010
Better Node Depth
         <div class=”wrapper”>
            <div class=”module”>...</div>
            <div class=”module”>...</div>
            <div class=”module”>...</div>
         </div>




Saturday, October 16, 2010
Semantic
        <h1>The Title</h1>
        <p>The content, The content, The
        content, The content, The content, The
        content, The content, The content, The
        content.</p>
        <address>
        160 West End Ave
        New York, NY 10023
        </address>


Saturday, October 16, 2010
CSS

               OO approach = classes vs IDs
               2 selectors === yay!
               shorthand properties === fewer bytes
               No proprietary CSS
               Use browser hacks sparingly / <body> classes




Saturday, October 16, 2010
CSS selectors
          This works

          .module p {...}
          .override p {...}

          vs

          This doesn’t

          #module p {...}
          .override p {...}
Saturday, October 16, 2010
CSS selectors
           Overrides follow this rule:
           IDs, Classes, Elements

           #module .module p = 111
           .module .blue p = 21
           #wrapper #content span a = 202

           Classes make overrides/extending CSS
           classes a lot easier

Saturday, October 16, 2010
JavaScript

               Know what/who your scripts are!
               Inspect what your plugins are doing
               Combine them!
               use JSLint all the time!
               Remove unused functions/code




Saturday, October 16, 2010
Media

               Video = OGV + MP4, VideoJS
               Audio = MP3, JPlayer
               Images: PNG > GIF
               JPEG (Pictures)
               Web Fonts




Saturday, October 16, 2010
YSlow! - Highlights
                 Make Fewer HTTP Requests
                 Use a CDN
                 Add an Expires Header
                 Gzip Components
                 Put Stylesheets at the top
                 Put Scripts at the bottom
                 Avoid CSS Expressions
                 Make JS/CSS external
                 Reduce DNS lookups
                 Minify Javascript
                 Avoid Redirects
                 Remove Duplicate Scripts
                 Configure ETags
                 Make AJAX Cache-able

Saturday, October 16, 2010
YSlow! - low-hanging fruit
               Set Expires headers
               Add Deflate rules
               Gzip (caching plugin)
               Reduce number of DOM elements
               use Favicon
               Do not scale images/give images dimensions
               Cache AJAX requests


Saturday, October 16, 2010
Expires
          <FilesMatch “.gif|jpg|css|js”>
          ExpiresDefault “access plus 10 years”
          </FilesMatch>




Saturday, October 16, 2010
Deflate === Gzip
           AddOutputFilterByType DEFLATE text/html
           AddOutputFilterByType DEFLATE text/css
           AddOutputFilterByType DEFLATE application/x-javascript




Saturday, October 16, 2010
Google Page Speed
               Remove Unused CSS
               Avoid document.write
               Combine CSS/JS
               Use image sprites
               Minify JS/CSS/HTML
               Remove query strings from static resources
               Specify UTF-8 early
               use efficient CSS selectors


Saturday, October 16, 2010
Sources for info
               Rasmus Lerdorf session at Digg
               Douglas Crockford at Yahoo
               Anything by Steve Souders
               Google Speed / YSlow
               Smush.It
               JSLint for JS / Jigsaw Validator for CSS
               Thomas Fuchs / DOM Monster bookmarklet


Saturday, October 16, 2010

More Related Content

PDF
In depth with html5 java2days 2010
PDF
MongoTalk/Voyage
PPTX
Front end optimization
PDF
Front-End Performance Optimization in WordPress
DOC
Online shopping report-6 month project
PDF
The Tech Side of Project Argo
PDF
Introduction to HTML5
PDF
Not Only Drupal
In depth with html5 java2days 2010
MongoTalk/Voyage
Front end optimization
Front-End Performance Optimization in WordPress
Online shopping report-6 month project
The Tech Side of Project Argo
Introduction to HTML5
Not Only Drupal

Similar to WordPress Front End Optimizations (20)

PDF
Please Don't Touch the Slow Parts
PDF
Document-Oriented Databases: Couchdb Primer
PDF
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
PDF
QueryPath: It's like PHP jQuery in Drupal!
PDF
CSS Bloat!
PDF
Getting Started with Dojo Toolkit
PDF
Flex além do browser - Lightning talk qcon
PDF
Building Distributed JavaScript Widgets with jQuery
PDF
Ruby on-rails-workshop
PPTX
Edge of the Web
PDF
Open End To End Js Stack
PDF
Human APIs
PDF
D3.js capita selecta
PDF
lecture2_public
PDF
lecture2_public
PDF
Using Templates to Achieve Awesomer Architecture
PPTX
Html5 browser api_support
PPTX
Drupal Frontend Performance and Scalability
PDF
Introduction to Node.js: perspectives from a Drupal dev
PDF
Opening up the Social Web - Standards that are bridging the Islands
Please Don't Touch the Slow Parts
Document-Oriented Databases: Couchdb Primer
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
QueryPath: It's like PHP jQuery in Drupal!
CSS Bloat!
Getting Started with Dojo Toolkit
Flex além do browser - Lightning talk qcon
Building Distributed JavaScript Widgets with jQuery
Ruby on-rails-workshop
Edge of the Web
Open End To End Js Stack
Human APIs
D3.js capita selecta
lecture2_public
lecture2_public
Using Templates to Achieve Awesomer Architecture
Html5 browser api_support
Drupal Frontend Performance and Scalability
Introduction to Node.js: perspectives from a Drupal dev
Opening up the Social Web - Standards that are bridging the Islands
Ad

More from Scott Taylor (11)

PDF
The New York Times: Moving to GraphQL
PDF
Internationalizing The New York Times
PDF
A Day of REST
PDF
REST In Action: The Live Coverage Platform at the New York Times
PDF
WordPress 4.4 and Beyond
PDF
2015 WordCamp Maine Keynote
PDF
Live Coverage at The New York Times
PDF
WordPress: Getting Under the Hood
PDF
WordPress Media in a post-Koop Universe
PDF
Cloud, Cache, and Configs
PDF
eMusic: WordPress in the Enterprise
The New York Times: Moving to GraphQL
Internationalizing The New York Times
A Day of REST
REST In Action: The Live Coverage Platform at the New York Times
WordPress 4.4 and Beyond
2015 WordCamp Maine Keynote
Live Coverage at The New York Times
WordPress: Getting Under the Hood
WordPress Media in a post-Koop Universe
Cloud, Cache, and Configs
eMusic: WordPress in the Enterprise
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
KodekX | Application Modernization Development
PDF
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
Spectral efficient network and resource selection model in 5G networks
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
KodekX | Application Modernization Development
Unlocking AI with Model Context Protocol (MCP)

WordPress Front End Optimizations

  • 1. WordPress Front-End Optimizations Tips to Speed Up Your Blog Saturday, October 16, 2010
  • 2. What is the “Front-End”? HTML CSS Images JavaScript Media (Audio/Video) 3rd Party APIs Saturday, October 16, 2010
  • 3. HTML Markup / Node structure Placement of stylesheets / scripts Images <meta> tags DOCTYPE Micro-formats Saturday, October 16, 2010
  • 4. CSS Typography Colors reset.css CSS selectors Background Images / CSS Sprites CSS3+ support IE6 / Browser support Saturday, October 16, 2010
  • 5. JavaScript Event Binding 3rd Party APIs AJAX Form validation DOM traversing jQuery Cookies Page State / Comet / Long-polling Saturday, October 16, 2010
  • 6. Front-End Programming + WordPress = HTML + CSS + Javascript + Media + PHP + WordPress API Saturday, October 16, 2010
  • 7. PHP / WordPress API Built-in WordPress Functions WordPress Template Hierarchy WordPress Media Library Database Abstraction Layer WordPress Admin Site-specific PHP code written by you Saturday, October 16, 2010
  • 8. HTML Semantic DOCTYPE - specific Classes vs IDs Accessible Shallow node depth Saturday, October 16, 2010
  • 9. Node Depth <div> <div> <div> <div> <div> <div>... Saturday, October 16, 2010
  • 10. Better Node Depth <div class=”wrapper”> <div class=”module”>...</div> <div class=”module”>...</div> <div class=”module”>...</div> </div> Saturday, October 16, 2010
  • 11. Semantic <h1>The Title</h1> <p>The content, The content, The content, The content, The content, The content, The content, The content, The content.</p> <address> 160 West End Ave New York, NY 10023 </address> Saturday, October 16, 2010
  • 12. CSS OO approach = classes vs IDs 2 selectors === yay! shorthand properties === fewer bytes No proprietary CSS Use browser hacks sparingly / <body> classes Saturday, October 16, 2010
  • 13. CSS selectors This works .module p {...} .override p {...} vs This doesn’t #module p {...} .override p {...} Saturday, October 16, 2010
  • 14. CSS selectors Overrides follow this rule: IDs, Classes, Elements #module .module p = 111 .module .blue p = 21 #wrapper #content span a = 202 Classes make overrides/extending CSS classes a lot easier Saturday, October 16, 2010
  • 15. JavaScript Know what/who your scripts are! Inspect what your plugins are doing Combine them! use JSLint all the time! Remove unused functions/code Saturday, October 16, 2010
  • 16. Media Video = OGV + MP4, VideoJS Audio = MP3, JPlayer Images: PNG > GIF JPEG (Pictures) Web Fonts Saturday, October 16, 2010
  • 17. YSlow! - Highlights Make Fewer HTTP Requests Use a CDN Add an Expires Header Gzip Components Put Stylesheets at the top Put Scripts at the bottom Avoid CSS Expressions Make JS/CSS external Reduce DNS lookups Minify Javascript Avoid Redirects Remove Duplicate Scripts Configure ETags Make AJAX Cache-able Saturday, October 16, 2010
  • 18. YSlow! - low-hanging fruit Set Expires headers Add Deflate rules Gzip (caching plugin) Reduce number of DOM elements use Favicon Do not scale images/give images dimensions Cache AJAX requests Saturday, October 16, 2010
  • 19. Expires <FilesMatch “.gif|jpg|css|js”> ExpiresDefault “access plus 10 years” </FilesMatch> Saturday, October 16, 2010
  • 20. Deflate === Gzip AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/x-javascript Saturday, October 16, 2010
  • 21. Google Page Speed Remove Unused CSS Avoid document.write Combine CSS/JS Use image sprites Minify JS/CSS/HTML Remove query strings from static resources Specify UTF-8 early use efficient CSS selectors Saturday, October 16, 2010
  • 22. Sources for info Rasmus Lerdorf session at Digg Douglas Crockford at Yahoo Anything by Steve Souders Google Speed / YSlow Smush.It JSLint for JS / Jigsaw Validator for CSS Thomas Fuchs / DOM Monster bookmarklet Saturday, October 16, 2010