{"id":9353216,"date":"2017-07-26T12:24:42","date_gmt":"2017-07-26T12:24:42","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/force-development-mode\/"},"modified":"2017-07-26T12:31:54","modified_gmt":"2017-07-26T12:31:54","slug":"force-development-mode","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/force-development-mode\/","title":{"rendered":"Force development mode"},"content":{"rendered":"<p>Thanks for the plugin, I use Tracy in various projects and I&#8217;m sure it will be handy in WP too.<\/p>\n<p>I have an issue that the debugger is not initializing because I&#8217;m developing on a dev server and not on localhost. I&#8217;ve managed to force development mode using this in &#8220;\/wp-tracy\/vendor\/ktstudio\/wp-tracy\/src\/index.php&#8221;:<\/p>\n<pre><code>\nif(defined(&quot;WP_TRACY_FORCE_DEVELOPMENT_MODE&quot;) &amp;&amp; WP_TRACY_FORCE_DEVELOPMENT_MODE === true) {\n\tTracy\\Debugger::enable(Tracy\\Debugger::DEVELOPMENT);\n} else {\n\tTracy\\Debugger::enable(defined(&quot;WP_TRACY_ENABLE_MODE&quot;) ? WP_TRACY_ENABLE_MODE : null); \/\/ hooray, enabling debugging using Tracy\n}\n<\/code><\/pre>\n<p>Now in functions.php you can define a WP_TRACY_FORCE_DEVELOPMENT_MODE constant to true to get the debugger. Of course you should wrap this in a condition to enable Tracy only when you need it.<\/p>\n<pre><code>\n$user = wp_get_current_user();\nif($user-&gt;user_email === &#039;admin@admin.com&#039;) {\n\tdefine(&#039;WP_TRACY_FORCE_DEVELOPMENT_MODE&#039;, true);\n}\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-9353216","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9353216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":3,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9353216\/revisions"}],"predecessor-version":[{"id":9353248,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9353216\/revisions\/9353248"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9353216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}