Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Debugging and Magento

3,698 views

Published on

Strategies and tools to help effectively debug your Magento. Also, how does Magento 2 help?

Published in: Technology
  • Be the first to comment

Debugging and Magento

  1. 1. @TONEGOLF71 @SPACE48ERS #MAGETITANS DEBUGGING AND MAGENTO Tony Brown
  2. 2. @TONEGOLF71 @SPACE48ERS #MAGETITANS • Worked on Magento since 2009 • Technical Director @ Space 48 • Love learning and collaborating
  3. 3. @TONEGOLF71 @SPACE48ERS #MAGETITANS Overview • Types of debugging • Strategies • Tools • Working example • Magento 2 • Any questions / suggestions?
  4. 4. @TONEGOLF71 @SPACE48ERS #MAGETITANS Why?
  5. 5. @TONEGOLF71 @SPACE48ERS #MAGETITANS Types of Debugging • Bugs during development • Bugs that are “live” • Site down • Performance issues • Feature broken
  6. 6. @TONEGOLF71 @SPACE48ERS #MAGETITANS Strategies - General • What has changed? • Are we seeing any errors? • Eliminate as much as possible at each step • Themes • Modules • Utilise logging / monitoring • Use your tools wisely
  7. 7. @TONEGOLF71 @SPACE48ERS #MAGETITANS • Defensive coding • Include descriptive errors • Collaborate • Don’t let ego hold you back • Ideas through explanation Strategies - General
  8. 8. @TONEGOLF71 @SPACE48ERS #MAGETITANS • Defensive coding • Include descriptive errors • Collaborate • Don’t let ego hold you back • Ideas through explanation Strategies - General • Try and step back regularly
  9. 9. @TONEGOLF71 @SPACE48ERS #MAGETITANS • Defensive coding • Include descriptive errors • Collaborate • Don’t let ego hold you back • Ideas through explanation Strategies - General • Try and step back regularly
  10. 10. @TONEGOLF71 @SPACE48ERS #MAGETITANS Strategies - General • Community resources • Google - Blogs etc • Magento Stack Exchange • Twitter • Automated testing
  11. 11. @TONEGOLF71 @SPACE48ERS #MAGETITANS Tools in Magento • Template path hints • Profiler • Logging • Developer Mode (display_errors on)
  12. 12. @TONEGOLF71 @SPACE48ERS #MAGETITANS Additional Tools • PhpStorm • Magicento • Xdebug • N98 Magerun • Commerce Bug • Z-ray Toolbar
  13. 13. @TONEGOLF71 @SPACE48ERS #MAGETITANS Additional Tools • Firegento Debug • Aoe Template Hints • Aoe Profiler • New Relic • Blackfire • ECG coding standard • Automated Tests (PhpUnit, MageSpec etc)
  14. 14. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example
  15. 15. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • A store with an order export integration stops • Based on Magento cron to send orders via API
  16. 16. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • A store with an order export integration stops • Based on Magento cron to send orders via API • Has anything changed?
  17. 17. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • A store with an order export integration stops • Based on Magento cron to send orders via API • Has anything changed? • Are we receiving any errors?
  18. 18. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • A store with an order export integration stops • Based on Magento cron to send orders via API • Has anything changed? • Are we receiving any errors? • Check the cron_schedule table • Some errors present, but no new jobs scheduled
  19. 19. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example
  20. 20. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • Is the Magento cron task present in the system cron?
  21. 21. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • Is the Magento cron task present in the system cron? • Manually run the cron and monitor output
  22. 22. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example
  23. 23. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • Check the process on the server - It’s stuck!
  24. 24. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • Check the process on the server - It’s stuck! • Kill the process!!
  25. 25. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • Check the process on the server - It’s stuck! • Kill the process!! • Test!!
  26. 26. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • Check the process on the server - It’s stuck! • Kill the process!! • Test!!
  27. 27. @TONEGOLF71 @SPACE48ERS #MAGETITANS Working Example • What can we learn? • The cron checks to see if it is already running • We should monitor this going forward • Look for any errors in table or logs • If it is a heavy install could use Aoe_Scheduler
  28. 28. @TONEGOLF71 @SPACE48ERS #MAGETITANS Magento 2? • XML validation • More modern best practices • Better methods to change system behaviour in a more targeted way • Code should be more decoupled which should help reduce bugs during upgrades • New architecture makes automated testing easier
  29. 29. @TONEGOLF71 @SPACE48ERS #MAGETITANS Magento 2? • More code re-use with components through composer • Logging is now achieved with Monolog • Can log to different channels (email, Logstash) • FireBug and ChromePHP • bin/magento command line tool
  30. 30. @TONEGOLF71 @SPACE48ERS #MAGETITANS Tools for Magento 2 • Z-Ray debug toolbar • CedCommerce Debug Tool
  31. 31. @TONEGOLF71 @SPACE48ERS #MAGETITANS Tools for Magento 2 • Commerce bug
  32. 32. @TONEGOLF71 @SPACE48ERS #MAGETITANS Tools for Magento 2 • Magicento
  33. 33. @TONEGOLF71 @SPACE48ERS #MAGETITANS Tools for Magento 2 • n98 magerun 2 • working version but only has a small percentage of the commands so far
  34. 34. @TONEGOLF71 @SPACE48ERS #MAGETITANS THANKS!! Any questions or tool suggestions to share?

×