Maximizing Performance and Speeding Up WordPress

Post on 27-Jan-2015

106 views 1 download

Tags:

description

Syed Balkhi shows how to speed up your slow WordPress. Talk delivered May 21st at WordCamp Raleigh.

transcript

So let’s speed it up

I’m Syed Balkhi

Founder of WPBeginner, Uzzz Productions, Awesome Motive Inc.,

and more to come.

Why Performance Matters

• Decreases Bounce Rate

• Increase Time Spent on the Page

• Often increases pageviews

• SEO Benefits

• Increases Indexing Rate

Our #1 Problem

• Hosting Providers

• Memory Usage Limits on Shared Hosts

• Potential of Account Termination if you exceed limits.

• Most importantly site crashes during peak times (such as hitting front page of Digg or other social media networks) thus hurting your brand’s reputation.

Solution(s)??

• Getting a better and more reliable webhost

• Install Caching Methods

• Content Delivery Networks (CDN)

• Minify

• Database Maintenance

• Limiting HTTP Queries

• Proper 3rd Party Integrations

I recommend MaxCDN

They were kind enough to give a 25% coupon code: wpbeginner

Best Caching Plugin is:

W3 Total Cache

Decrease Page Size

•Use Excerpts instead of Full Posts.

•Show a maximum of 10 posts per page.

•User smaller images (optimize them) - use Smush.it

Database Maintenance

Limiting HTTP requests

Plugins are Great, But...

•They can increase your site’s load time when they add custom stylesheet(s) and JavaScript(s).

•One or two plugin does not mater, but when you have 8 plugins, each adding a CSS and JS file, you got yourself 16 HTTP requests which can/should be limited.

Oops, the theme is broken

Yes, I know so lets FIX it.

Merging CSS Files

•Copy the plugin’s CSS file, and paste it in your theme’s style.css file.

•So in this case, we will copy “cleaner-gallery.css” file and paste it into our theme’s style.css file.

•Repeat this STEP for all plugins that are adding additional CSS files.

In a Perfect World

Proper 3rd Party Integrations

Facebook the right way

Enable XFBML Support

http://wordpress.org/extend/plugins/facebook-open-graph-meta-in-wordpress/

Asynchronous Loading

<body><div id="fb-embed"></div><script>window.fbAsyncInit = function() { FB.init({appId: 'XXXXXXXXXXXXXXX', status: true, cookie: true, xfbml: true}); };(function() {    var e = document.createElement('script'); e.async = true;    e.src = document.location.protocol +    '//connect.facebook.net/en_US/all.js';    document.getElementById('fb-embed').appendChild(e);    }());</script>

Analytics the right way

Asynchronous Loading

<body><script>var _gaq = _gaq || [];_gaq.push(    ['_setAccount', 'UA-XXXXX-X'],    ['_setDomainName', 'domain.com'],    ['_trackPageview'] );(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);})();</script>

Don’t forget the BASICS

Add scripts in the footer

Update Core & Plugins

REGULARLY

Tools to check Performance

•Yahoo YSlow

•Google Page Speed

•Pingdom Tools

Additional Resources

• http://www.wpbeginner.com/wp-tutorials/how-wordpress-plugins-affect-your-sites-load-time/

• http://codex.wordpress.org/Conditional_Tags

• http://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/

• http://www.tutorial9.net/web-tutorials/wordpress-caching-whats-the-best-caching-plugin/

• http://www.wpbeginner.com/wp-tutorials/18-useful-tricks-to-speed-up-wordpress-boost-performance/

• http://line25.com/articles/wordpress-fat-loss-diet-to-speed-up-ease-load

• http://www.hongkiat.com/blog/ultimate-guide-to-web-optimization-tips-best-practices/

• http://www.w3-edge.com/weblog/2011/02/optimize-social-media-button-performance/

I’m Syed Balkhi

Founder of WPBeginner, Uzzz Productions, Awesome Motive Inc., and more to come.

Twitter: @wpbeginner / @syedbalkhi

Facebook: http://facebook.com/wpbeginner

Email: admin@wpbeginner.com