39

Maximizing Performance and Speeding Up WordPress

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Maximizing Performance and Speeding Up WordPress
Page 2: Maximizing Performance and Speeding Up WordPress

So let’s speed it up

Page 3: Maximizing Performance and Speeding Up WordPress

I’m Syed Balkhi

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

and more to come.

Page 4: Maximizing Performance and Speeding Up WordPress

Why Performance Matters

• Decreases Bounce Rate

• Increase Time Spent on the Page

• Often increases pageviews

• SEO Benefits

• Increases Indexing Rate

Page 5: Maximizing Performance and Speeding Up WordPress

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.

Page 6: Maximizing Performance and Speeding Up WordPress

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

Page 7: Maximizing Performance and Speeding Up WordPress
Page 8: Maximizing Performance and Speeding Up WordPress
Page 9: Maximizing Performance and Speeding Up WordPress
Page 10: Maximizing Performance and Speeding Up WordPress
Page 11: Maximizing Performance and Speeding Up WordPress
Page 12: Maximizing Performance and Speeding Up WordPress

I recommend MaxCDN

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

Page 13: Maximizing Performance and Speeding Up WordPress
Page 14: Maximizing Performance and Speeding Up WordPress

Best Caching Plugin is:

W3 Total Cache

Page 15: Maximizing Performance and Speeding Up WordPress

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

Page 16: Maximizing Performance and Speeding Up WordPress

Database Maintenance

Page 17: Maximizing Performance and Speeding Up WordPress
Page 18: Maximizing Performance and Speeding Up WordPress
Page 19: Maximizing Performance and Speeding Up WordPress

Limiting HTTP requests

Page 20: Maximizing Performance and Speeding Up WordPress

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.

Page 21: Maximizing Performance and Speeding Up WordPress
Page 22: Maximizing Performance and Speeding Up WordPress

Oops, the theme is broken

Page 23: Maximizing Performance and Speeding Up WordPress

Yes, I know so lets FIX it.

Page 24: Maximizing Performance and Speeding Up WordPress

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.

Page 25: Maximizing Performance and Speeding Up WordPress

In a Perfect World

Page 26: Maximizing Performance and Speeding Up WordPress
Page 27: Maximizing Performance and Speeding Up WordPress
Page 28: Maximizing Performance and Speeding Up WordPress

Proper 3rd Party Integrations

Page 29: Maximizing Performance and Speeding Up WordPress

Facebook the right way

Page 30: Maximizing Performance and Speeding Up WordPress

Enable XFBML Support

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

Page 31: Maximizing Performance and Speeding Up 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>

Page 32: Maximizing Performance and Speeding Up WordPress

Analytics the right way

Page 33: Maximizing Performance and Speeding Up WordPress

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>

Page 34: Maximizing Performance and Speeding Up WordPress

Don’t forget the BASICS

Page 35: Maximizing Performance and Speeding Up WordPress

Add scripts in the footer

Page 36: Maximizing Performance and Speeding Up WordPress

Update Core & Plugins

REGULARLY

Page 37: Maximizing Performance and Speeding Up WordPress

Tools to check Performance

•Yahoo YSlow

•Google Page Speed

•Pingdom Tools

Page 38: Maximizing Performance and Speeding Up WordPress

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/

Page 39: Maximizing Performance and Speeding Up WordPress

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: [email protected]