{"id":17558,"date":"2015-09-04T16:35:51","date_gmt":"2015-09-04T16:35:51","guid":{"rendered":"http:\/\/qw\/oikcom\/?page_id=18915"},"modified":"2020-12-01T16:26:30","modified_gmt":"2020-12-01T16:26:30","slug":"an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress","status":"publish","type":"page","link":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/","title":{"rendered":"An introduction to problem determination with oik-bwtrace <span class=\"summary\">&#8211; debug trace for WordPress<\/span>"},"content":{"rendered":"Problem determination is a personal experience. It&#8217;s about discovery.\r\n\r\n<blockquote>You notice something&#8217;s wrong and use available tools to help you find out what&#8217;s going wrong.<\/blockquote>\r\n\r\nFor highly interactive debugging you can use a PHP debugger.\r\n\r\nBut there are times when you can&#8217;t, or don&#8217;t want to, use a PHP debugger.<!--more-->\r\n<span class=\"value\"><\/span>\r\n\r\nAnd there are situations where existing logging and tracing facilities don&#8217;t provide enough information in the area you&#8217;re investigating.\r\n\r\nSo you need to obtain output that shows the values of things, with some contextual information to help you identify when and where the code was invoked.\r\n\r\nYou often introduce new logic into your code that helps you report on the state of processing. \r\n\r\nSometimes your new logic alters the results returned to the browser and can appear to make things worse before you&#8217;re able to make them better. \r\n\r\nThat&#8217;s where the oik-bwtrace plugin fits in. \r\n\r\nInstead of coding a load of echo statements, print_r()s and\/or var_dump()s, along with a smattering of debug_backtrace() calls I use two fairly advanced APIs; bw_trace2() and bw_backtrace().\r\n\r\nThe output they produce is written to trace files which I can browse in a separate window or tab. \r\n\r\nIf I need more information I add some trace calls and run the output again. \r\n\r\nWhen satisfied with the results I can either remove the trace calls, comment them out or leave them in place with a trace level set to BW_TRACE_DEBUG. \r\n\r\nIn this short video I explain the <span class=\"bw_plug\"><a class=\"plugin\" href=\"https:\/\/www.oik-plugins.com\/oik-plugins\/oik-bwtrace-debug-trace-for-wordpress\/\" title=\"Link to the oik-bwtrace (oik-bwtrace: debug trace for WordPress) plugin\">oik-bwtrace<\/a><\/span> solution. \r\n\r\n\r\n<iframe loading=\"lazy\" title=\"oik-bwtrace-Sep-2015\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/QS2FjeuMMGs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\r\n\r\nI use it in my plugin development in preference to using a PHP debugger.\r\n\r\nYou may also find it useful in your own development environment, or when performing problem determination.\r\n\r\nThere are other tools available. Many of them only work on the front-end.\r\noik-bwtrace can be used to trace every transaction: AJAX, CRON, XMLRPC, etcetera.\r\n\r\n\r\n<h3>Additional notes<\/h3>\r\n<ul>\r\n<li>Well defined trace points can assist formal problem determination<\/li>\r\n<li>Too much tracing can affect performance<\/li>\r\n<li>A well written trace routine should not affect the results obtained<\/li>\r\n<li>It&#8217;s a pity, but sometimes things can still go wrong when certain levels of tracing are activated.<\/li>\r\n<\/ul>\r\n","protected":false},"excerpt":{"rendered":"<p>Problem determination is a personal experience. It&#8217;s about discovery.<\/p>\n<blockquote><p>You notice something&#8217;s wrong and use available tools to help you find out what&#8217;s going wrong.<\/p><\/blockquote>\n<p>For highly interactive debugging you can use a PHP debugger.<\/p>\n<p>But there are times when you can&#8217;t, or don&#8217;t want to, use a PHP debugger.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1148,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"content-sidebar","footnotes":""},"letters":[504],"class_list":{"0":"post-17558","1":"page","2":"type-page","3":"status-publish","5":"letters-a","6":"entry"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>An introduction to problem determination with oik-bwtrace - debug trace for WordPress - [oik] plugins.com<\/title>\n<meta name=\"description\" content=\"Video introduction to the oik-bwtrace WordPress plugin\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An introduction to problem determination with oik-bwtrace - debug trace for WordPress - [oik] plugins.com\" \/>\n<meta property=\"og:description\" content=\"Video introduction to the oik-bwtrace WordPress plugin\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"[oik] plugins.com\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-01T16:26:30+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/\",\"url\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/\",\"name\":\"An introduction to problem determination with oik-bwtrace - debug trace for WordPress - [oik] plugins.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.oik-plugins.com\/#website\"},\"datePublished\":\"2015-09-04T16:35:51+00:00\",\"dateModified\":\"2020-12-01T16:26:30+00:00\",\"description\":\"Video introduction to the oik-bwtrace WordPress plugin\",\"breadcrumb\":{\"@id\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"WordPress plugins from oik-plugins\",\"item\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FREE oik plugins\",\"item\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"oik-bwtrace &#8211; debug trace for WordPress\",\"item\":\"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"An introduction to problem determination with oik-bwtrace &#8211; debug trace for WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.oik-plugins.com\/#website\",\"url\":\"https:\/\/www.oik-plugins.com\/\",\"name\":\"[oik] plugins.com\",\"description\":\"WordPress plugins and themes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.oik-plugins.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"An introduction to problem determination with oik-bwtrace - debug trace for WordPress - [oik] plugins.com","description":"Video introduction to the oik-bwtrace WordPress plugin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"An introduction to problem determination with oik-bwtrace - debug trace for WordPress - [oik] plugins.com","og_description":"Video introduction to the oik-bwtrace WordPress plugin","og_url":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/","og_site_name":"[oik] plugins.com","article_modified_time":"2020-12-01T16:26:30+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/","url":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/","name":"An introduction to problem determination with oik-bwtrace - debug trace for WordPress - [oik] plugins.com","isPartOf":{"@id":"https:\/\/www.oik-plugins.com\/#website"},"datePublished":"2015-09-04T16:35:51+00:00","dateModified":"2020-12-01T16:26:30+00:00","description":"Video introduction to the oik-bwtrace WordPress plugin","breadcrumb":{"@id":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/an-introduction-to-problem-determination-with-oik-bwtrace-debug-trace-for-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"WordPress plugins from oik-plugins","item":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/"},{"@type":"ListItem","position":2,"name":"FREE oik plugins","item":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/"},{"@type":"ListItem","position":3,"name":"oik-bwtrace &#8211; debug trace for WordPress","item":"https:\/\/www.oik-plugins.com\/wordpress-plugins-from-oik-plugins\/free-oik-plugins\/oik-trace-plugin\/"},{"@type":"ListItem","position":4,"name":"An introduction to problem determination with oik-bwtrace &#8211; debug trace for WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.oik-plugins.com\/#website","url":"https:\/\/www.oik-plugins.com\/","name":"[oik] plugins.com","description":"WordPress plugins and themes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.oik-plugins.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/pages\/17558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/comments?post=17558"}],"version-history":[{"count":1,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/pages\/17558\/revisions"}],"predecessor-version":[{"id":40689,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/pages\/17558\/revisions\/40689"}],"up":[{"embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/pages\/1148"}],"wp:attachment":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/media?parent=17558"}],"wp:term":[{"taxonomy":"letters","embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/letters?post=17558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}