Getting ready for PHP7.2

Getting ready for PHP7.2

At the State of the Word, it was announced that one of the upcoming focuses of the WordPress project is raising the minimum version requirement of PHP.

WordPress core is already PHP7.2 compatible but are your plugins and themes?

In this talk, Jenny will be looking at the steps needed to check if plugins and themes are compatible, and the lessons learned from doing the steps.

Are you PHPrepared?

B92fd0f4dfb7ed14c1441e4f4cf56542?s=128

Jenny Wong

March 08, 2019
Tweet

Transcript

  1. Getting Ready For PHP 7.2 Jenny Wong | @miss_jwo

  2. Getting Ready For PHP 7.2 Jenny Wong | @miss_jwo

  3. Getting Ready For PHP 7.3 Jenny Wong | @miss_jwo

  4. PHP The primary programming language that WordPress is built on.

    @miss_jwo #WCNordic
  5. Current supported versions of PHP are : 7.1, 7.2 &

    7.3 @miss_jwo #WCNordic
  6. Supported Versions http://php.net/supported-versions.php @miss_jwo #WCNordic

  7. Supported Versions http://php.net/supported-versions.php @miss_jwo #WCNordic

  8. Supported Versions http://php.net/supported-versions.php @miss_jwo #WCNordic

  9. What PHP versions are people running WordPress on? @miss_jwo #WCNordic

  10. What PHP versions are people running WordPress on? https://wordpress.org/about/stats/ PHP

    Version @miss_jwo #WCNordic
  11. What PHP versions are people running WordPress on? https://wordpress.org/about/stats/ @miss_jwo

    #WCNordic
  12. What PHP versions are people running WordPress on? https://wordpress.org/about/stats/ 5.2

    5.6 7.0 5.5 5.4 5.3 @miss_jwo #WCNordic
  13. Do you have a zombie PHP on your site? @miss_jwo

    #WCNordic
  14. https://wordpress.org/plugins/health-check @miss_jwo #WCNordic

  15. WordPress works on all the latest versions of PHP @miss_jwo

    #WCNordic
  16. What about custom code? Plugins & Themes? & @miss_jwo #WCNordic

  17. • Checks for spelling mistakes • Does not check that

    the sentences make sense Static Analysers @miss_jwo #WCNordic
  18. Scenario #1 • I’m not a developer/ coder but I

    want to check
 • Is there going to be too much to do? @miss_jwo #WCNordic
  19. Click & Check! @miss_jwo #WCNordic

  20. WP Engine Wrapper Plugin https://wordpress.org/plugins/php-compatibility-checker @miss_jwo #WCNordic

  21. WP Engine Wrapper Plugin @miss_jwo #WCNordic

  22. WP Engine Wrapper Plugin

  23. Working on a project and want to check as you

    work Scenario #2 @miss_jwo #WCNordic
  24. Composer & PHP CompatibilityWP & WordPress Coding Standards Tools for

    your workflow: (Will also install PHP Coding Standards) @miss_jwo #WCNordic
  25. Where in the workflow? • Locally • Before commits are

    accepted into a repo • Before code is push to production @miss_jwo #WCNordic
  26. Composer & PHP Compatibility @miss_jwo #WCNordic

  27. Composer & PHP Compatibility Number of files checked Warning found

    Skipped file Error found @miss_jwo #WCNordic
  28. Composer & PHP Compatibility

  29. Composer & PHP Compatibility

  30. WordPress Coding Standards Will tell you about deprecated functions in

    WordPress @miss_jwo #WCNordic
  31. Migration Time @miss_jwo #WCNordic

  32. PHP.net manual @miss_jwo #WCNordic

  33. Mirgate

  34. • Start at your current PHP version • Use a

    static analyser • Check the migration guide for current PHP Version • Repeat till at desired PHP version. @miss_jwo #WCNordic
  35. Mirgate

  36. Caveats @miss_jwo #WCNordic

  37. Some function outputs have changed @miss_jwo #WCNordic

  38. Runtime errors will not be detected by a static analyser

    @miss_jwo #WCNordic
  39. Upsides @miss_jwo #WCNordic

  40. Better Performance @miss_jwo #WCNordic

  41. Uses less computing resources @miss_jwo #WCNordic

  42. Fixed PHP bugs @miss_jwo #WCNordic

  43. PHP security support @miss_jwo #WCNordic

  44. Lots of new functions and features for developers to use!

    @miss_jwo #WCNordic
  45. If you care about keeping your WordPress up to date,

    you should care about keeping your stack up to date too. @miss_jwo #WCNordic
  46. Developers & hosting companies are your friends @miss_jwo #WCNordic

  47. Plugin Author? @miss_jwo #WCNordic

  48. Set a minimum PHP version requirement in plugin readme file

    https://make.wordpress.org/plugins/2017/08/29/minimum-php-version-requirement/ @miss_jwo #WCNordic
  49. ← Minimum requirement Plugin readme.txt @miss_jwo #WCNordic

  50. @miss_jwo #WCNordic

  51. Resources @miss_jwo #WCNordic

  52. • WordCamp London 2015: Lorna Jane Mitchell: Get Ready for

    PHP 5.4+ (video) • Lorna Jane Mitchell: Get Ready for PHP 5.4+ Slides • Your hosting providers documentation • php.net/manual • https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/#how- to-use • Cloudways How to Upgrade From PHP 5.X to PHP 7 (Cheat Sheet) • Auth0: Migrating a PHP5 app to PHP7 by Prosper Otemuyiwa (PDF) • How to Set up Modern PHP Coding Standards for WordPress | Thorsten Frommen @miss_jwo #WCNordic
  53. Suurkiitokset! jenny@humanmade.com @miss_jwo