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

Way of the Future

Jason Cosper
November 07, 2015

Way of the Future

With the performance gains promised by HHVM and PHP 7, WordPress site admins are living in pretty exciting times. The PHP world at large is in a proverbial space race, and every WordPress site will (eventually) benefit. But early adopters and folks who manage their own servers shouldn’t be the only ones who get early access to these face melting bumps in speed. In this talk, I’ll be introducing you to things you can do to get your code ready for these next generation hosting environments.

Jason Cosper

November 07, 2015
Tweet

More Decks by Jason Cosper

Other Decks in Technology

Transcript

  1. I created Hipster Ipsum I organize the Bakersfield WordPress Meetup

    I maintain the Force Strong Passwords plugin
  2. The numbers were compelling WordPress 4.1.x with 20 concurrent users.

    • Requests per second • PHP 5.5: 256 • PHP 7: 627 • HHVM 3.7: 666 • Latency • PHP 5.5: 78 milliseconds • PHP 7: 32 milliseconds • HHVM 3.7: 30 milliseconds
  3. PHP adoption rates were depressing • PHP 5.3 — 41.4%

    • Released: June 30, 2009 • End of Life: August 14, 2014 • PHP 5.4 — 30.1% • Released: March 1, 2012 • End of Life: September 12, 2015 • PHP 5.5 — 9.3% • Released: June 20, 2013 • End of Life: June 20, 2016 • PHP 5.6 — 1.5% • Released: August 28, 2014 • End of Life: August 28, 2017
  4. And hosts were announcing HHVM support • WP Engine •

    DreamHost • Pagely • SiteGround • Kinsta • Etc.
  5. PHP 5.5 vs. PHP 7 • WordPress (4.3.1) • PHP

    7 was 2.6 times faster than PHP 5.5 • WordPress (4.3.1) + WooCommerce (2.4.8) • PHP 7 was 1.4 times faster than PHP 5.5 • WordPress (4.3.1) + bbPress (2.5.8) • PHP 7 was 6.6 times faster than PHP 5.5 • WordPress (4.3.1) + BuddyPress (2.3.4) • PHP 7 was 4.7 times faster than PHP 5.5
  6. However, 67.9% of all PHP sites are currently powered by

    versions that should be considered dead
  7. It does PHP 7 & HHVM And it was made

    for WordPress development
  8. HGV • Built with members of the 10up team •

    Work on your code under PHP 5.5, PHP 7 & HHVM at the same time • Provision multiple sites using YML files • Debugging & benchmarking tools • Xdebug • XHProf • Siege • query-monitor • debug-objects • debug-bar
  9. Prerequisites • Git • VirtualBox or VMware • Vagrant •

    The Vagrant Ghost plugin boogah.org/hgv-prereq ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install git brew install caskroom/cask/brew-cask brew cask install vagrant brew cask install virtualbox vagrant plugin install vagrant-ghost
  10. Install cd ~ mkdir vagrant cd vagrant git clone --recursive

    https://github.com/wpengine/hgv.git cd hgv vagrant up
  11. Get to work • Local file access • Use your

    favorite text editor! • [HGV_dir]/hgv_data/sites/[sitename]/ • [HGV_dir]/hgv_data/sites/[sitename]/wp-content/[plugins|themes]/ • SSH • vagrant ssh • phpMyAdmin • admin.hgv.test/phpmyadmin/
  12. Force your site to PHP 7 vagrant ssh sudo nano

    -w /etc/nginx/conf.d/www-[sitename].conf
  13. Force your site to PHP 7 Change this: cache.php.example.test php;

    php.example.test php; To this: cache.php.example.test php7; php.example.test php7; Save your changes!