{"id":8975,"date":"2015-01-01T17:58:30","date_gmt":"2015-01-01T22:58:30","guid":{"rendered":"http:\/\/www.jbaker.info\/?p=5867"},"modified":"2015-01-01T17:58:30","modified_gmt":"2015-01-01T22:58:30","slug":"debugging-2","status":"publish","type":"post","link":"https:\/\/www.jbaker.info\/demo05\/debugging-2\/","title":{"rendered":"Debugging"},"content":{"rendered":"<p>[ezc_accordian_group]\n[ezc_accordian title=&#8217;FirePHP in WordPress&#8217;]<\/p>\n<h3>To Add FirePHP code to a site:<\/h3>\n<p>Enable the FirePHP plugin.\nIn the FirePHP console (click on the little blue bug)\nMake sure that Options > Modify User-Agent Header is <strong>Checked<\/strong>.\nHere is the link to Plugin Site:\n<a href=\"http:\/\/inchoo.net\/wordpress\/wordpress-firephp-plugin\/\">WordPress FirePHP plugin \u2022 Inchoo<\/a>\n<div class=\"xp_clear\"><\/div><hr><\/p>\n<h3>To Delete FirePHP code from a site:<\/h3>\n<p>Disable the plugin.\n<div class=\"xp_clear\"><\/div><hr><\/p>\n<h4>To show variables in the Firebug Console:<\/h4>\n<p>Regular variable:\nfb(&#39;Var: &#39; . $name);\nArray:\nfb($lines_array, &#39;Array: &#39;);<\/p>\n<div class=\"xp_clear\"><\/div><hr>\n<div class=\"xp_clear\"><\/div><hr>\n&#39;test single quotes&#39;\n&#34;test double quotes&#34;\n[\/ezc_accordian]<\/p>\n<p>[ezc_accordian title=&#8217;Debug Flowchart&#8217;]\n<img decoding=\"async\" class=\"xpfluid\" src=\"http:\/\/www.jbaker.info\/demo03\/wp-content\/uploads\/images\/debug_flowchart.jpg\" alt=\"\" \/>\n[\/ezc_accordian]\n<p>[ezc_accordian title=&#8217;PHP Use &#60;pre> tags to show actual code or variables&#8217;]\necho &#34;&#60;pre>&#34;; print_r($var); echo &#34;&#60;\/pre>&#34;;<\/p>\n<p>You can show values for an array as well by sending the array variable:\necho &#34;&#60;pre>&#34;; print_r($array); echo &#34;&#60;\/pre>&#34;;<\/p>\n<p>Or send a function as the variable and see the results:\necho &#8220;&#60;pre>&#8221;; print_r(any_function); echo &#8220;&#60;\/pre>&#8221;;<\/p>\n<p>* Use AHK ^e<\/p>\n<p>[\/ezc_accordian]\n[ezc_accordian title=&#8217;PHP Write a debug.txt file to site root directory&#8217;]\nob_start();\nvar_dump($some_variable);\n$tut = ob_get_clean();<\/p>\n<p>$fh = fopen(&#8216;debug.txt&#8217;, &#8216;w&#8217;) or die(&#8220;can&#8217;t open file&#8221;);\nfwrite($fh, $contents);\nfclose($fh);\n[\/ezc_accordian]\n[\/ezc_accordian_group]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ezc_accordian_group] [ezc_accordian title=&#8217;FirePHP in WordPress&#8217;] To Add FirePHP code to a site: Enable the FirePHP plugin. In the FirePHP console (click on the little blue bug) Make sure that Options > Modify User-Agent Header is Checked. Here is the link to Plugin Site: WordPress FirePHP plugin \u2022 Inchoo To Delete FirePHP code from a site:&#8230;  <a href=\"https:\/\/www.jbaker.info\/demo05\/debugging-2\/\" class=\"more-link\" title=\"Read Debugging\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3],"tags":[],"class_list":["post-8975","post","type-post","status-publish","format-standard","hentry","category-programming-docs","category-unvetted"],"_links":{"self":[{"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/posts\/8975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/comments?post=8975"}],"version-history":[{"count":0,"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/posts\/8975\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/media?parent=8975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/categories?post=8975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jbaker.info\/demo05\/wp-json\/wp\/v2\/tags?post=8975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}