{"id":99593,"date":"2019-03-09T16:18:23","date_gmt":"2019-03-09T16:18:23","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/debug-toolkit\/"},"modified":"2019-03-11T15:34:07","modified_gmt":"2019-03-11T15:34:07","slug":"debug-toolkit","status":"publish","type":"plugin","link":"https:\/\/bal.wordpress.org\/plugins\/debug-toolkit\/","author":14410613,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.1","stable_tag":"1.0.1","tested":"5.1.22","requires":"4.9","requires_php":"5.6","requires_plugins":"","header_name":"Debug Toolkit","header_author":"hellofromTonya","header_description":"Code debug made easier and more enjoyable.  A suite of tools to help you debug your code.","assets_banners_color":"737679","last_updated":"2019-03-11 15:34:07","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/KnowTheCode.io","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/debug-toolkit","header_author_uri":"https:\/\/KnowTheCode.io","rating":5,"author_block_rating":0,"active_installs":20,"downloads":8829,"num_ratings":13,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"Version 1.0.0":"<p>First release<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":13},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"2047222","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"2047222","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"2047222","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"2047222","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-4.png":{"filename":"screenshot-4.png","revision":"2048407","resolution":"4","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"2048407","resolution":"1","location":"plugin"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"2048407","resolution":"3","location":"plugin"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"2048407","resolution":"2","location":"plugin"}},"screenshots":{"1":"The better PHP error interface from Whoops.","2":"The results of running <code>vdump()<\/code> and <code>vdump_and_die()<\/code>.","3":"The results of running <code>dump()<\/code> and <code>dump_and_die()<\/code>.","4":"The results of running <code>trace()<\/code>."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[23032,94,22216,23054,23055],"plugin_category":[59],"plugin_contributors":[82172],"plugin_business_model":[],"class_list":["post-99593","plugin","type-plugin","status-publish","hentry","plugin_tags-backtrace","plugin_tags-debug","plugin_tags-debugger","plugin_tags-print_r","plugin_tags-var_dump","plugin_category-utilities-and-tools","plugin_contributors-hellofromtonya","plugin_committers-hellofromtonya"],"banners":{"banner":"https:\/\/ps.w.org\/debug-toolkit\/assets\/banner-772x250.png?rev=2047222","banner_2x":"https:\/\/ps.w.org\/debug-toolkit\/assets\/banner-1544x500.png?rev=2047222","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/debug-toolkit\/assets\/icon-128x128.png?rev=2047222","icon_2x":"https:\/\/ps.w.org\/debug-toolkit\/assets\/icon-256x256.png?rev=2047222","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/debug-toolkit\/trunk\/screenshot-1.png?rev=2048407","caption":"The better PHP error interface from Whoops."},{"src":"https:\/\/ps.w.org\/debug-toolkit\/trunk\/screenshot-2.png?rev=2048407","caption":"The results of running <code>vdump()<\/code> and <code>vdump_and_die()<\/code>."},{"src":"https:\/\/ps.w.org\/debug-toolkit\/trunk\/screenshot-3.png?rev=2048407","caption":"The results of running <code>dump()<\/code> and <code>dump_and_die()<\/code>."},{"src":"https:\/\/ps.w.org\/debug-toolkit\/trunk\/screenshot-4.png?rev=2048407","caption":"The results of running <code>trace()<\/code>."}],"raw_content":"<!--section=description-->\n<p>Debug Toolkit makes debugging your code easier and more enjoyable.  It provides you with interactive and helpful tools:<\/p>\n\n<ul>\n<li>Better PHP error interface from (<a href=\"http:\/\/filp.github.io\/whoops\/\">Whoops<\/a>)<\/li>\n<li>Better variable inspection - no need to use <code>var_dump<\/code>, <code>print_r<\/code>, or X-debug<\/li>\n<li>An interactive way to back trace the program's execution order<\/li>\n<\/ul>\n\n<h3>Better PHP Error Interface from Whoops<\/h3>\n\n<p>The built-in PHP error container is basic and not as helpful as it could be.  On top of that, it's rather ugly. Wouldn't you agree?<\/p>\n\n<p>Whoops gives you a cool interface that is helpful, interactive, and quite nice to look at.  Some features:<\/p>\n\n<ul>\n<li>Provides the error message and links to search Google, DuckDuckGo, and Stack Overflow.<\/li>\n<li>Shows the actual code where the error occurred.<\/li>\n<li>Provides an interactive call stack.  Click each and the actual code appears in the viewer panel.<\/li>\n<li>Environment and details including GET Data, POST Data, Files, Cookie, Session, Server\/Request Data, Environment Variables, and Registered Handlers.<\/li>\n<\/ul>\n\n<p>See the tools in action in this video<\/p>\n\n<p>https:\/\/vimeo.com\/322351688<\/p>\n\n<h3>Better Variable Inspection<\/h3>\n\n<p>Though X-debug is powerful, it can be difficult to set up and run.  For that reason, it's common to dump or print out the variable to browser.  But the built-in display for the PHP <code>var_dump<\/code> and <code>print_r<\/code> is basic.<\/p>\n\n<p>This plugin includes both two very popular variable dumper tools:<\/p>\n\n<ul>\n<li><a href=\"https:\/\/symfony.com\/doc\/current\/components\/var_dumper.html\">VarDumper from Symfony<\/a><\/li>\n<li><a href=\"https:\/\/kint-php.github.io\/kint\/\">Kint - a modern and powerful PHP debugging helper<\/a><\/li>\n<\/ul>\n\n<p>VarDumper provides a simple container that displays where you place it.<\/p>\n\n<p>On the other hand, Kint provides a more powerful interface that gives you more information such as printing out the expression that was passed into it, the data type, memory size, and the value.<\/p>\n\n<p>To make it even easier, the following utility functions are available for you to use in your code:<\/p>\n\n<h4>Available Functions for Inspecting Variable Values<\/h4>\n\n<p>Let's explore the functions that are available for you through this plugin.  We'll use the variable inspectors to dump <code>global $post<\/code>.<\/p>\n\n<p>Note: You can pass in any variable or function that returns a value.<\/p>\n\n<p>Dumps the given variable(s):<\/p>\n\n<pre><code>global $post;\n\n\/\/ VarDumper\nvdump( $post );\n\n\/\/ Kint\ndump( $post );\n<\/code><\/pre>\n\n<p>Dumps the given variable(s) and then exits the program's execution:<\/p>\n\n<pre><code>global $post;\n\n\/\/ VarDumper\nvdump_and_die( $post );\n\n\/\/ Kint\ndump_and_die( $post );\n<\/code><\/pre>\n\n<p>In addition, there are alias (shorthand) functions available for you if you prefer shorter function names:<\/p>\n\n<ul>\n<li><code>vd()<\/code> is an alias for <code>vdump()<\/code><\/li>\n<li><code>vdd()<\/code> and <code>vdd()<\/code> are aliases for <code>vdump_and_die()<\/code><\/li>\n<li><code>d()<\/code> is an alias for <code>dump()<\/code><\/li>\n<li><code>dd()<\/code> and <code>ddd()<\/code> are aliases for <code>dump_and_die()<\/code><\/li>\n<\/ul>\n\n<h3>Tracing Call Stack<\/h3>\n\n<p>When debugging, there are times when you need to see the order in which functions were called that lead to a certain point in the program.  PHP offers a backtrace that traces back the execution order from the point when the function is invoked.<\/p>\n\n<p>To make backtracing easier, this plugin provides you with a <code>trace()<\/code> function and combines it with the variable inspect functions.<\/p>\n\n<p>For example, if you wanted to trace the call stack to the start of the loop in your theme's <code>functions.php<\/code> file, you could use this code:<\/p>\n\n<pre><code>add_action( 'loop_start', function() {\n    trace();\n} );\n<\/code><\/pre>\n\n<h4>Available Trace Functions<\/h4>\n\n<p>Place these functions at the point where you want to trace the call stack.<\/p>\n\n<ul>\n<li><code>trace();<\/code><\/li>\n<li><code>trace_vdump();<\/code> - Combines <code>trace()<\/code> and <code>vdump()<\/code><\/li>\n<li><code>trace_dump();<\/code> - Combines <code>trace()<\/code> and <code>dump()<\/code><\/li>\n<li><code>trace_vdump_and_die();<\/code> - Combines <code>trace()<\/code> and <code>vdump_and_die()<\/code><\/li>\n<li><code>trace_dump_and_die();<\/code> - Combines <code>trace()<\/code> and <code>dump_and_die()<\/code><\/li>\n<\/ul>\n\n<p>In addition, there are alias (shorthand) functions available for you if you prefer shorter function names:<\/p>\n\n<ul>\n<li><code>tracevd();<\/code> - Combines <code>trace()<\/code> and <code>vd()<\/code><\/li>\n<li><code>traced();<\/code> - Combines <code>trace()<\/code> and <code>d()<\/code><\/li>\n<li><code>tracevdd();<\/code> - Combines <code>trace()<\/code> and <code>vdd()<\/code><\/li>\n<li><code>tracedd();<\/code> - Combines <code>trace()<\/code> and <code>dd()<\/code><\/li>\n<li><code>tracevddd();<\/code> - Combines <code>trace()<\/code> and <code>vddd()<\/code><\/li>\n<li><code>traceddd();<\/code> - Combines <code>trace()<\/code> and <code>ddd()<\/code><\/li>\n<\/ul>\n\n<h3>Admin Bar<\/h3>\n\n<p>\"DEBUG ACTIVE\" indicator displays in the WordPress admin bar to alert you when the plugin is active.<\/p>\n\n<!--section=installation-->\n<h4>From your WordPress dashboard<\/h4>\n\n<ol>\n<li>Visit 'Plugins &gt; Add New'<\/li>\n<li>Search for 'Debug Toolkit'<\/li>\n<li>Activate Debug Toolkit from your Plugins page.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How do I use this utility?<\/dt>\n<dd><p>When you are testing or debugging your code, you can use any of the functions above in place of var_dump( $var ) and print_r( $var ).  No need to wrap it in pre's either.<\/p><\/dd>\n<dt>What version of PHP do I need?<\/dt>\n<dd><p>PHP 5.6, 7.0, 7.1, 7.2, and up.<\/p><\/dd>\n<dt>Can I run this on a live site?<\/dt>\n<dd><p>I wouldn't unless you are testing.  This tool is for debug only.  Once you push the site live, deactivate and delete this plugin.<\/p><\/dd>\n<dt>What should I do when the site goes live?<\/dt>\n<dd><p>Deactivate and delete this plugin.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>Version 1.0.1<\/h4>\n\n<ul>\n<li>Removed changing the admin color palette.<\/li>\n<li>Removed changing the admin bar background color.<\/li>\n<\/ul>\n\n<h4>Version 1.0.0<\/h4>\n\n<ul>\n<li>First release<\/li>\n<\/ul>","raw_excerpt":"Code debug made easier and more enjoyable.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/99593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=99593"}],"author":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/hellofromtonya"}],"wp:attachment":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=99593"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=99593"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=99593"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=99593"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=99593"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=99593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}