$30 off During Our Annual Pro Sale. View Details »

Ivelina Dimova - The Magic of Advanced Debugging

Ivelina Dimova - The Magic of Advanced Debugging

As lead of the Ongoing Client Support at CrowdFavorite I’ve worked with lots of legacy code on different projects. This session covers some of the lessons we’ve learned in the process and tips how to deal with the most common issues faster and more effective. It also shows how the legacy code can be actually fun.

WordPress Greek Community

December 09, 2017
Tweet

More Decks by WordPress Greek Community

Other Decks in Technology

Transcript

  1. The Magic of
    Advanced Debugging

    View Slide

  2. View Slide

  3. Work Days

    View Slide

  4. View Slide

  5. Once upon a time

    View Slide

  6. View Slide

  7. View Slide

  8. Where to start

    View Slide

  9. Don’t ever debug on
    production

    View Slide

  10. Set debug constants

    View Slide

  11. View Slide

  12. View Slide

  13. Fatal error: Cannot use object of type stdClass as array in
    /Users/ivdimova/Sites/project.dev/wordpress/wp-content/plugin
    s/custom-social-feed/includes/init.php on line 645, referer:
    http://project.dev/

    View Slide

  14. Invalid argument supplied for foreach() in
    /Users/ivdimova/Sites/project.dev/wp-includes/plugin.php on
    line 523

    View Slide

  15. Plugin conflicts?!

    View Slide

  16. Grep all the things
    grep all the things

    View Slide

  17. var_dump();
    error_log();
    error_log( print_r( $object, 1 ) );

    View Slide

  18. Query Monitor

    View Slide

  19. View Slide

  20. Xdebug

    View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. Permissions, permissions

    View Slide

  27. Version Control

    View Slide

  28. git log

    View Slide

  29. git blame

    View Slide

  30. View Slide

  31. Identify filters and hooks

    View Slide

  32. add_action( 'plugins_loaded', 'prefix_remove_action', 10 );
    function prefix_remove_action() {
    $invoice = new WC_Gateway_Sprout_Invoices();
    $result = remove_action( 'woocommerce_thankyou_sprout_invoices', array(
    $invoice, 'thankyou_page' ), 20 );
    }

    View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. Leave legacy for others

    View Slide

  37. View Slide

  38. Contact:
    [email protected]
    @iv_wp
    https://www.linkedin.com/in/ivdimova

    View Slide