Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making WordPress faster and greener - David Hilditch [ΕΝ]

Making WordPress faster and greener - David Hilditch [ΕΝ]

Slow WordPress websites tend to be that way because of a few pitfalls that cause your server to do far more work than needed to generate your pages.

You can easily spend more money on servers, but that’s not only bad for your pocket it’s also bad for the planet!

Learn how to easily avoid these pitfalls and get anything between 2 and 10 times more speed from your existing hardware.

WordPress Greek Community

April 09, 2022
Tweet

More Decks by WordPress Greek Community

Other Decks in Technology

Transcript

  1. How much energy does WordPress use? How to calculate? •

    Percentage of websites using WordPress? • Percentage of traffic hitting WordPress websites? • Average price of hosting paid by WordPress websites?
  2. WordPress hosting figures • WordPress boasts about 35% of all

    websites • 455 million WordPress websites • Total hosting worth $77.5 billion per month • $4 per site per month average for wordpress hosting • WordPress about $2 billion per month worldwide ◦ So about 2.6% of website traffic hits WordPress websites • Websites use about 5% of electricity worldwide
  3. Types of inefficiencies in the WordPress ecosystem Running code when

    not required Excessive options size and misuse of autoload Table Scans & WP_Query abuse Cache busting
  4. Running code when not required • Contact Forms 7 •

    Popup Builder • Mailjet • Mailchimp • Most plugins!
  5. Excessive options size and misuse of autoload • MBs of

    data loaded on every page • MBs of data updated on every page
  6. Table Scans & WP_Query abuse • Table or index scans

    cause all your data to be read • WP_Query with LIMIT 1 often used to check for existence of data ◦ But they forget to remove the ‘orderby’ clause!
  7. Cache busting • Page caching is great • But not

    if you can’t use it • Commonly your uncached users are your most valuable ones ◦ And they get a slow experience! • If a WordPress plugin generates user-specific HTML, the solution is commonly to avoid page caching for those cases ◦ That’s not good enough!
  8. What can developers do to improve performance? • Avoid table

    scans - test plugins at scale • Avoid loading all data and processing it with PHP • Avoid massive objects in wp_options • Remove the sort order from WP_Query when not needed • Learn how to use the object cache to store fragments from page to page • Avoid cache busting - use Ajax for user-specific content • Don’t run your code on pages where your code is not needed! • Help me build an open source scalability test rig for WordPress
  9. What can you do today to improve performance? • Learn

    how to use Query Monitor ◦ Long running queries ◦ Hundreds or thousands of queries ◦ Queries that retrieve thousands of rows ◦ Excessive RAM usage • Run Asset Cleanup Pro ◦ Disable unused plugins per page • Use an object cache ◦ Prefer plugins which make good use of the object cache
  10. How to get in touch Twitter: @davehilditch Facebook: davehilditch Github:

    dhilditch Website: www.wpintense.com Discord Server: Link on my website