Plugin Directory

Changeset 1472289


Ignore:
Timestamp:
08/11/2016 12:26:14 PM (10 years ago)
Author:
hlavacm
Message:
  • Initialization is now in scope of WP init action
  • Added WP_TRACY_ENABLE_MODE and wp_tracy_panels_filter
  • Update for Tracy 2.4.2
Location:
wp-tracy/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • wp-tracy/trunk/composer.lock

    r1455113 r1472289  
    1010        {
    1111            "name": "ktstudio/wp-tracy",
    12             "version": "v1.0.4",
     12            "version": "v1.0.5",
    1313            "source": {
    1414                "type": "git",
    1515                "url": "https://github.com/ktstudio/WP-Tracy.git",
    16                 "reference": "b58da6e8a1d1c08a858e04ab6c5daeb339266461"
     16                "reference": "09c9c438a893628e103532b3e80a1cdbbf9323d8"
    1717            },
    1818            "dist": {
    1919                "type": "zip",
    20                 "url": "https://api.github.com/repos/ktstudio/WP-Tracy/zipball/b58da6e8a1d1c08a858e04ab6c5daeb339266461",
    21                 "reference": "b58da6e8a1d1c08a858e04ab6c5daeb339266461",
     20                "url": "https://api.github.com/repos/ktstudio/WP-Tracy/zipball/09c9c438a893628e103532b3e80a1cdbbf9323d8",
     21                "reference": "09c9c438a893628e103532b3e80a1cdbbf9323d8",
    2222                "shasum": ""
    2323            },
     
    5454                "wordpress"
    5555            ],
    56             "time": "2016-07-15 07:32:51"
     56            "time": "2016-08-11 12:10:21"
    5757        },
    5858        {
    5959            "name": "tracy/tracy",
    60             "version": "v2.4.1",
     60            "version": "v2.4.2",
    6161            "source": {
    6262                "type": "git",
    6363                "url": "https://github.com/nette/tracy.git",
    64                 "reference": "89cd0c8cfd7e246a39a504f860cf2fbb5a5095f1"
     64                "reference": "6b67ebb3a4ab663f7230f769627b6d1e138b1423"
    6565            },
    6666            "dist": {
    6767                "type": "zip",
    68                 "url": "https://api.github.com/repos/nette/tracy/zipball/89cd0c8cfd7e246a39a504f860cf2fbb5a5095f1",
    69                 "reference": "89cd0c8cfd7e246a39a504f860cf2fbb5a5095f1",
     68                "url": "https://api.github.com/repos/nette/tracy/zipball/6b67ebb3a4ab663f7230f769627b6d1e138b1423",
     69                "reference": "6b67ebb3a4ab663f7230f769627b6d1e138b1423",
    7070                "shasum": ""
    7171            },
    7272            "require": {
     73                "ext-json": "*",
     74                "ext-session": "*",
    7375                "php": ">=5.4.4"
    7476            },
     
    114116                "nette"
    115117            ],
    116             "time": "2016-06-30 19:57:01"
     118            "time": "2016-07-31 16:43:38"
    117119        }
    118120    ],
  • wp-tracy/trunk/index.php

    r1455113 r1472289  
    55  Plugin URI: https://github.com/ktstudio/wp-tracy/
    66  Description: (Nette) Tracy connector for WordPress
    7   Version: 1.0.4
     7  Version: 1.0.5
    88  Author: KTStudio.cz
    99  Author URI: http://www.ktstudio.cz/
  • wp-tracy/trunk/readme.txt

    r1455113 r1472289  
    33Donate link: http://www.ktstudio.cz/
    44Tags: tracy, debugger
    5 Version: 1.0.4
     5Version: 1.0.5
    66Requires at least: 4.0
    77Tested up to: 4.5
     
    5858== Changelog ==
    5959
     60= 1.0.5 =
     61
     62* Initialization is now in scope of WP init action
     63* Added WP_TRACY_ENABLE_MODE and wp_tracy_panels_filter
     64* Update for Tracy 2.4.2
     65
    6066= 1.0.4 =
    6167
  • wp-tracy/trunk/vendor/composer/installed.json

    r1455113 r1472289  
    22    {
    33        "name": "tracy/tracy",
    4         "version": "v2.4.1",
    5         "version_normalized": "2.4.1.0",
     4        "version": "v2.4.2",
     5        "version_normalized": "2.4.2.0",
    66        "source": {
    77            "type": "git",
    88            "url": "https://github.com/nette/tracy.git",
    9             "reference": "89cd0c8cfd7e246a39a504f860cf2fbb5a5095f1"
     9            "reference": "6b67ebb3a4ab663f7230f769627b6d1e138b1423"
    1010        },
    1111        "dist": {
    1212            "type": "zip",
    13             "url": "https://api.github.com/repos/nette/tracy/zipball/89cd0c8cfd7e246a39a504f860cf2fbb5a5095f1",
    14             "reference": "89cd0c8cfd7e246a39a504f860cf2fbb5a5095f1",
     13            "url": "https://api.github.com/repos/nette/tracy/zipball/6b67ebb3a4ab663f7230f769627b6d1e138b1423",
     14            "reference": "6b67ebb3a4ab663f7230f769627b6d1e138b1423",
    1515            "shasum": ""
    1616        },
    1717        "require": {
     18            "ext-json": "*",
     19            "ext-session": "*",
    1820            "php": ">=5.4.4"
    1921        },
     
    2224            "nette/tester": "~2.0"
    2325        },
    24         "time": "2016-06-30 19:57:01",
     26        "time": "2016-07-31 16:43:38",
    2527        "type": "library",
    2628        "extra": {
     
    6466    {
    6567        "name": "ktstudio/wp-tracy",
    66         "version": "v1.0.4",
    67         "version_normalized": "1.0.4.0",
     68        "version": "v1.0.5",
     69        "version_normalized": "1.0.5.0",
    6870        "source": {
    6971            "type": "git",
    7072            "url": "https://github.com/ktstudio/WP-Tracy.git",
    71             "reference": "b58da6e8a1d1c08a858e04ab6c5daeb339266461"
     73            "reference": "09c9c438a893628e103532b3e80a1cdbbf9323d8"
    7274        },
    7375        "dist": {
    7476            "type": "zip",
    75             "url": "https://api.github.com/repos/ktstudio/WP-Tracy/zipball/b58da6e8a1d1c08a858e04ab6c5daeb339266461",
    76             "reference": "b58da6e8a1d1c08a858e04ab6c5daeb339266461",
     77            "url": "https://api.github.com/repos/ktstudio/WP-Tracy/zipball/09c9c438a893628e103532b3e80a1cdbbf9323d8",
     78            "reference": "09c9c438a893628e103532b3e80a1cdbbf9323d8",
    7779            "shasum": ""
    7880        },
     
    8183            "tracy/tracy": "~2.4"
    8284        },
    83         "time": "2016-07-15 07:32:51",
     85        "time": "2016-08-11 12:10:21",
    8486        "type": "library",
    8587        "installation-source": "dist",
  • wp-tracy/trunk/vendor/ktstudio/wp-tracy/README.md

    r1272139 r1472289  
    88
    991. Use command on your path: composer require ktstudio/wp-tracy
    10 3. Profit!
    11 4. You can optionally define PHP boolean constant WP_TRACY_CHECK_USER_LOGGED_IN...
     102. Profit!
     113. You can optionally define PHP (boolean) constant WP_TRACY_CHECK_USER_LOGGED_IN to check only logged users...
     124. You can optionally define PHP constant WP_TRACY_ENABLE_MODE to set Tracy\Debugger::enable($mode)...
     135. You can optionally use wp_tracy_panels_filter to modify default panels array (full class names)
    1214
    1315![WP Tracy](https://ktstudio.github.io/images/wp-tracy.png "Tracy bar auto-display after plugin activation")
  • wp-tracy/trunk/vendor/ktstudio/wp-tracy/src/index.php

    r1353979 r1472289  
    11<?php
    22
    3 if (defined("DOING_AJAX") && DOING_AJAX) {
    4     return; // for IE compatibility WordPress media upload
     3add_action("init", "wp_tracy_init_action", 1);
     4
     5function wp_tracy_init_action() {
     6    if (defined("DOING_AJAX") && DOING_AJAX) {
     7        return; // for IE compatibility WordPress media upload
     8    }
     9
     10    if (defined("WP_TRACY_CHECK_USER_LOGGED_IN") && WP_TRACY_CHECK_USER_LOGGED_IN && is_user_logged_in()) {
     11        return; // cancel for anonymous users
     12    }
     13
     14    Tracy\Debugger::enable(defined("WP_TRACY_ENABLE_MODE") ? WP_TRACY_ENABLE_MODE : null); // hooray, enabling debugging using Tracy
     15    // panels in the correct order
     16    $defaultPanels = array(
     17        "WpTracy\\WpPanel",
     18        "WpTracy\\WpUserPanel",
     19        "WpTracy\\WpPostPanel",
     20        "WpTracy\\WpQueryPanel",
     21        "WpTracy\\WpQueriedObjectPanel",
     22        "WpTracy\\WpDbPanel",
     23        "WpTracy\\WpRewritePanel",
     24    );
     25    $panels = apply_filters("wp_tracy_panels_filter", $defaultPanels);
     26
     27    // panels registration
     28    foreach ($panels as $className) {
     29        Tracy\Debugger::getBar()->addPanel(new $className);
     30    }
    531}
    6 
    7 if (defined("WP_TRACY_CHECK_USER_LOGGED_IN") && WP_TRACY_CHECK_USER_LOGGED_IN && is_user_logged_in()) {
    8     return; // cancel for anonymous users
    9 }
    10 
    11 Tracy\Debugger::enable(); // hooray, enabling debugging using Tracy
    12 
    13 // panels in the correct order
    14 $panels = array(
    15     "WpTracy\\WpPanel",
    16     "WpTracy\\WpUserPanel",
    17     "WpTracy\\WpPostPanel",
    18     "WpTracy\\WpQueryPanel",
    19     "WpTracy\\WpQueriedObjectPanel",
    20     "WpTracy\\WpDbPanel",
    21     "WpTracy\\WpRewritePanel",
    22 );
    23 
    24 // panels registration
    25 foreach ($panels as $className) {
    26     Tracy\Debugger::getBar()->addPanel(new $className);
    27 }
  • wp-tracy/trunk/vendor/tracy/tracy/composer.json

    r1455113 r1472289  
    1616    ],
    1717    "require": {
    18         "php": ">=5.4.4"
     18        "php": ">=5.4.4",
     19        "ext-session": "*",
     20        "ext-json": "*"
    1921    },
    2022    "require-dev": {
  • wp-tracy/trunk/vendor/tracy/tracy/src/Tracy/Bar.php

    r1455113 r1472289  
    109109                for ($i = 0; $i < $max && $lpath[$i] === $script[$i]; $i++);
    110110                $path = $i ? substr($path, 0, strrpos($path, '/', $i - strlen($path) - 1) + 1) : '/';
     111                $cookiePath = session_get_cookie_params()['path'];
     112                if (substr($cookiePath, 0, strlen($path)) === $path) {
     113                    $path = rtrim($cookiePath, '/') . '/';
     114                }
    111115            }
    112116            require __DIR__ . '/assets/Bar/loader.phtml';
  • wp-tracy/trunk/vendor/tracy/tracy/src/Tracy/BlueScreen.php

    r1455113 r1472289  
    9494    private function renderTemplate($exception, $template)
    9595    {
    96         $panels = $this->panels;
    9796        $info = array_filter($this->info);
    9897        $source = Helpers::getSource();
     
    119118
    120119    /**
     120     * @return \stdClass[]
     121     */
     122    private function renderPanels($ex)
     123    {
     124        $obLevel = ob_get_level();
     125        $res = [];
     126        foreach ($this->panels as $callback) {
     127            try {
     128                $panel = call_user_func($callback, $ex);
     129                if (empty($panel['tab']) || empty($panel['panel'])) {
     130                    continue;
     131                }
     132                $res[] = (object) $panel;
     133                continue;
     134            } catch (\Throwable $e) {
     135            } catch (\Exception $e) {
     136            }
     137            while (ob_get_level() > $obLevel) { // restore ob-level if broken
     138                ob_end_clean();
     139            }
     140            is_callable($callback, TRUE, $name);
     141            $res[] = (object) [
     142                'tab' => "Error in panel $name",
     143                'panel' => nl2br(Helpers::escapeHtml($e)),
     144            ];
     145        }
     146        return $res;
     147    }
     148
     149
     150    /**
    121151     * Returns syntax highlighted source code.
    122152     * @param  string
  • wp-tracy/trunk/vendor/tracy/tracy/src/Tracy/Debugger.php

    r1455113 r1472289  
    1717class Debugger
    1818{
    19     const VERSION = '2.4.1';
     19    const VERSION = '2.4.2';
    2020
    2121    /** server modes for Debugger::enable() */
     
    189189            'Tracy\FireLogger', 'Tracy\Helpers', 'Tracy\Logger']);
    190190
    191         if (!self::$productionMode && self::getBar()->dispatchAssets()) {
     191        if (self::$productionMode) {
     192
     193        } elseif (headers_sent($file, $line) || ob_get_length()) {
     194            throw new \LogicException(
     195                __METHOD__ . '() called after some output has been sent. '
     196                . ($file ? "Output started at $file:$line." : 'Try Tracy\OutputDebugger to find where output started.')
     197            );
     198
     199        } elseif (self::getBar()->dispatchAssets()) {
    192200            exit;
     201
    193202        } elseif (session_status() === PHP_SESSION_ACTIVE) {
    194203            self::dispatch();
     
    204213        if (self::$productionMode) {
    205214            return;
     215
     216        } elseif (headers_sent($file, $line) || ob_get_length()) {
     217            throw new \LogicException(
     218                __METHOD__ . '() called after some output has been sent. '
     219                . ($file ? "Output started at $file:$line." : 'Try Tracy\OutputDebugger to find where output started.')
     220            );
    206221
    207222        } elseif (session_status() !== PHP_SESSION_ACTIVE) {
  • wp-tracy/trunk/vendor/tracy/tracy/src/Tracy/Dumper.php

    r1455113 r1472289  
    422422            $s = strtr($s, $table);
    423423
    424         } elseif ($shortened = ($maxLength && strlen(utf8_decode($s)) > $maxLength)) {
     424        } elseif ($maxLength && $s !== '') {
    425425            if (function_exists('iconv_substr')) {
    426                 $s = iconv_substr($s, 0, $maxLength, 'UTF-8');
     426                $s = iconv_substr($tmp = $s, 0, $maxLength, 'UTF-8');
     427                $shortened = $s !== $tmp;
    427428            } else {
    428429                $i = $len = 0;
     
    430431                    if (($s[$i] < "\x80" || $s[$i] >= "\xC0") && (++$len > $maxLength)) {
    431432                        $s = substr($s, 0, $i);
     433                        $shortened = TRUE;
    432434                        break;
    433435                    }
  • wp-tracy/trunk/vendor/tracy/tracy/src/Tracy/assets/Bar/bar.js

    r1455113 r1472289  
    316316    Debug.init = function(content, dumps) {
    317317        if (!document.documentElement.dataset) {
    318             console.log('Warning: Tracy requires IE 11+');
    319             return;
     318            throw new Error('Tracy requires IE 11+');
    320319        }
    321320
     
    392391        XMLHttpRequest.prototype.open = function() {
    393392            oldOpen.apply(this, arguments);
    394             if (window.TracyAutoRefresh !== false && arguments[1].indexOf('//') < 0 || arguments[1].indexOf(location.origin + '/') === 0) {
     393            if (window.TracyAutoRefresh !== false && arguments[1].indexOf('//') <= 0 || arguments[1].indexOf(location.origin + '/') === 0) {
    395394                this.setRequestHeader('X-Tracy-Ajax', header);
    396395            }
  • wp-tracy/trunk/vendor/tracy/tracy/src/Tracy/assets/BlueScreen/content.phtml

    r1455113 r1472289  
    88 *
    99 * @param  array $exception
    10  * @param  array $panels
    1110 * @param  array $info
    1211 * @param  string $title
     
    5958
    6059
    61             <?php foreach ($panels as $panel): ?>
    62             <?php $panel = call_user_func($panel, $ex); if (empty($panel['tab']) || empty($panel['panel'])) continue; ?>
    63             <?php if (!empty($panel['bottom'])) { continue; } ?>
     60            <?php foreach ($this->renderPanels($ex) as $panel): ?>
    6461            <div class="panel">
    65                 <h2><a data-tracy-ref="^+" class="tracy-toggle"><?= Helpers::escapeHtml($panel['tab']) ?></a></h2>
     62                <h2><a data-tracy-ref="^+" class="tracy-toggle"><?= Helpers::escapeHtml($panel->tab) ?></a></h2>
    6663
    6764                <div class="inner">
    68                 <?= $panel['panel'] ?>
     65                <?= $panel->panel ?>
    6966            </div></div>
    7067            <?php endforeach ?>
     
    195192
    196193        <?php $bottomPanels = [] ?>
    197         <?php foreach ($panels as $panel): ?>
    198         <?php $panel = call_user_func($panel, NULL); if (empty($panel['tab']) || empty($panel['panel'])) continue; ?>
    199         <?php if (!empty($panel['bottom'])) { $bottomPanels[] = $panel; continue; } ?>
    200         <div class="panel">
    201             <h2><a data-tracy-ref="^+" class="tracy-toggle tracy-collapsed"><?= Helpers::escapeHtml($panel['tab']) ?></a></h2>
     194        <?php foreach ($this->renderPanels(NULL) as $panel): ?>
     195        <?php if (!empty($panel->bottom)) { $bottomPanels[] = $panel; continue; } ?>
     196        <div class="panel">
     197            <h2><a data-tracy-ref="^+" class="tracy-toggle tracy-collapsed"><?= Helpers::escapeHtml($panel->tab) ?></a></h2>
    202198
    203199            <div class="tracy-collapsed inner">
    204             <?= $panel['panel'] ?>
     200            <?= $panel->panel ?>
    205201        </div></div>
    206202        <?php endforeach ?>
     
    321317        <?php foreach ($bottomPanels as $panel): ?>
    322318        <div class="panel">
    323             <h2><a data-tracy-ref="^+" class="tracy-toggle"><?= Helpers::escapeHtml($panel['tab']) ?></a></h2>
     319            <h2><a data-tracy-ref="^+" class="tracy-toggle"><?= Helpers::escapeHtml($panel->tab) ?></a></h2>
    324320
    325321            <div class="inner">
    326             <?= $panel['panel'] ?>
     322            <?= $panel->panel ?>
    327323        </div></div>
    328324        <?php endforeach ?>
Note: See TracChangeset for help on using the changeset viewer.