srt4rulez/timber-tracy-bar-panel

A Tracy Bar Panel with Timber info for debugging

v0.1.3 2017-03-29 01:12 UTC

This package is auto-updated.

Last update: 2024-10-28 12:11:41 UTC


README

Latest Stable Version License

Timber Tab

What info does it show?

This tracy panel shows info about the following:

  • Dumps the current Timber context into the same format as a Tracy BarDump
  • Rendered Twig File(s)
  • Version
  • Template Directories
  • Twig Cache
  • Cache
  • Auto Meta
  • Autoescape

Timber Panel

Requirements:

Getting Started

Install via composer:

composer require srt4rulez/timber-tracy-bar-panel --dev

Add composer autoload to functions.php (You are using this in a WordPress theme right?):

require __DIR__ . '/vendor/autoload.php';

Enable tracy, then add the TimberBarPanel, like so:

Tracy\Debugger::enable( Tracy\Debugger::DEVELOPMENT );
Tracy\Debugger::getBar()->addPanel( new srt4rulez\TimberBarPanel );

You could wrap tracy in a condition for WP_DEBUG and ! is_admin() (I've experienced uploads error when tracy was enabled on admin side)

if ( WP_DEBUG && ! is_admin() ) {

	Tracy\Debugger::enable( Tracy\Debugger::DEVELOPMENT );
	Tracy\Debugger::getBar()->addPanel( new \srt4rulez\TimberBarPanel );

}

Final functions.php:

require __DIR__ . '/vendor/autoload.php';

if ( WP_DEBUG && ! is_admin() ) {

	Tracy\Debugger::enable( Tracy\Debugger::DEVELOPMENT );
	Tracy\Debugger::getBar()->addPanel( new srt4rulez\TimberBarPanel );

}

Thanks

License

MIT