Force development mode
-
Thanks for the plugin, I use Tracy in various projects and I’m sure it will be handy in WP too.
I have an issue that the debugger is not initializing because I’m developing on a dev server and not on localhost. I’ve managed to force development mode using this in “/wp-tracy/vendor/ktstudio/wp-tracy/src/index.php”:
if(defined("WP_TRACY_FORCE_DEVELOPMENT_MODE") && WP_TRACY_FORCE_DEVELOPMENT_MODE === true) { Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT); } else { Tracy\Debugger::enable(defined("WP_TRACY_ENABLE_MODE") ? WP_TRACY_ENABLE_MODE : null); // hooray, enabling debugging using Tracy }
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.
$user = wp_get_current_user(); if($user->user_email === '[email protected]') { define('WP_TRACY_FORCE_DEVELOPMENT_MODE', true); }
- The topic ‘Force development mode’ is closed to new replies.