Jump to content
adrian

Tracy Debugger

Recommended Posts

In my case, it doesn't help. I was playing with this when I was developing ProcessFileEdit but haven't found a proper solution. Then support for UTF8 for windows was added I think in 7.0 or 7.1 and then I stopped bothering.

Share this post


Link to post
Share on other sites
7 hours ago, adrian said:

@szabesz - I haven't seen any of these issues. Is it browser specific, or any chance the scrollbar issue could be related to this: https://processwire.com/talk/topic/13389-adminonsteroids/?do=findComment&comment=179123 or something else in AOS?

I disabled AOS and it did not make any difference, the tracyHidden class gets applied to <body> when I click the arrow icon to minify the debug bur. Regarding scrollbar issue, it happens in both Firefox and Safari too. Chrome and Firefox are the latest. The tiny svg icon issue is a bit browser specific, as it does not happen in Firefox, but does happen in both Safari and Chrome.

The hidden class issue emerged when I updated Tracy yesterday. I cannot see any connection to AOS, but I could not spend time on debugging.

Share this post


Link to post
Share on other sites
12 minutes ago, szabesz said:

The hidden class issue emerged when I updated Tracy yesterday. I cannot see any connection to AOS, but I could not spend time on debugging.

I have just remembered that yesterday – beside updating Tracy – I also enabled the "Hide debugbar by default" in an attempt to workaround the scrollbar issue, so that the debugbar on the right does not get in the way by default. I have just gone to the settings and turned off "Hide debugbar by default" and it partially solved the problem. With this setting, if I click the arrow to minimze the debugbar, tracyHidden class still gets applied to <body> but upon page reload it does not, so at least it is not "sticky" and I can see the admin.

Edited by szabesz
typos

Share this post


Link to post
Share on other sites

Thanks for the extra details @szabesz - unfortunately I still can't reproduce. Could you please try deleting your browser LocalStorage - maybe that is affecting the position under the scrollbar. Could you also send me your Tracy settings. You can use my ModuleSettingsImportExport module to make that easy.

Regarding the SVG icon issue - does this occur both backend and frontend? Just wondering if maybe there is some frontend css (or custom backend css for that matter) that might be interfering.

Share this post


Link to post
Share on other sites

@tpr and @matjazp - I just converted one of my ProcessWire log files to Windows 1252 and I still had no problems with the panel - it was successfully json encoded and saved to the wireCache. I'm not sure how to proceed from here - any thoughts?

Share this post


Link to post
Share on other sites
4 hours ago, adrian said:

I'm not sure how to proceed from here - any thoughts?

Leave it. Let the user fix it. While I was able to make it work in a terminal, conversion is unreliable.

Screenshot 2019-03-25 06.34.17_cr.jpg

Screenshot 2019-03-25 06.19.08_cr.jpg

  • Like 1

Share this post


Link to post
Share on other sites
17 hours ago, adrian said:

Thanks for the extra details @szabesz - unfortunately I still can't reproduce. Could you please try deleting your browser LocalStorage - maybe that is affecting the position under the scrollbar. Could you also send me your Tracy settings. You can use my ModuleSettingsImportExport module to make that easy.

Regarding the SVG icon issue - does this occur both backend and frontend? Just wondering if maybe there is some frontend css (or custom backend css for that matter) that might be interfering.

Cleaning all local data storage features of the browser nor incognito mode did not make a difference either, all issues remain. I have no browser extensions installed, btw.

I tested the scrollbar and the tiny icon issues on a clean and "latest" PW (last week's 3.0.127) and they are still there in Chrome, so these do not seem to be site specific. I can send you the whole site zipped up if you need it.

See them in action:

tracy-n-hide-icon-fix.gif.2b4a9ad9c3840cbea62b66978bb460ae.gif

tracy-n-scrollbar.gif.b858a6851d0399c21a3a557310979014.gif

The scrollbar issue is kinda random. In the screen-grab it happens right after reload but not afterwards, but during my daily work I could not notice any pattern, most of the time the scrollbar gets in the way.

However, the tracyHidden issue is indeed site specific so it does not happen on the clean install. I will need to spend more time on debugging this one.

Oh, and the Tracy setting generated by your module:  (from both clean and problematic sites)

Thanks in advance

 

  • Like 1

Share this post


Link to post
Share on other sites

Heads up. If you run ProcessWire with TracyDebugger inside Devilbox you need to make sure you have Output Mode set to DEVELOPMENT, otherwise you will not see the Debug Bar.

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, happywire said:

Heads up. If you run ProcessWire with TracyDebugger inside Devilbox you need to make sure you have Output Mode set to DEVELOPMENT, otherwise you will not see the Debug Bar.

Or you can force development mode for superusers. 

I guess Devilbox is preventing DETECT mode from determining whether you're on localhost or not.

  • Like 1

Share this post


Link to post
Share on other sites

@szabesz - thanks for those files - the svg size and hiding of body problems are coming from the server type indicator feature - specifically the "Custom - control with CSS" option. I'll try to fix shortly. Not sure about the bar being under the scrollbar - I still don't see that, but at least the other problems are figured out 🙂

  • Like 1

Share this post


Link to post
Share on other sites

Hey @szabesz - turns out the svg icon issue was actually related to not having the fixed debug bar position option checked. I decided to remove this an optional, because the draggable version had other problems as well. I think this might also fix your issue with the scrollbar being on top of the debug bar as well.

The hiding of the body when hiding the debug bar was related to the custom server type indicator. I have fixed this, although this means that now the indicator won't be hidden when the bar is hidden, but hopefully that is ok.

One observation about your Tracy settings - you didn't have the db() and bdb() shortcuts checked - you may want those.

Also, I have deleted your settings attachment in your previous post because it includes your email address 🙂

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, adrian said:

I have fixed this, although this means that now the indicator won't be hidden when the bar is hidden, but hopefully that is ok.

Thank you! I myself actually like the idea that the custom indicator is always visible.

2 hours ago, adrian said:

you didn't have the db() and bdb() shortcuts checked - you may want those

Thanks for reminding me. Strange but I've never had the need of them, bd() and d() have just been enough. Maybe it is because I tend to prefer very targeted checks.

Edited by szabesz
typos
  • Like 1

Share this post


Link to post
Share on other sites
Just now, szabesz said:

I myself actually like the idea that the custom indicator is always visible.

Don't forget to check out the newish Favicon badge option if you haven't already - I find it very useful.

  • Thanks 1

Share this post


Link to post
Share on other sites

I'm getting such errors increasingly with Tracy:
Filename doesn't exist: /home/foocom/www/dev.mysite/site/assets/cache/TracyDebugger/offer-index-dev.php on line: 135 in /home/foocom/www/dev.mysite/wire/core/TemplateFile.php

I then have to manually copy over my dev tpl to the Tracy cache folder. Is this a bug?

Share this post


Link to post
Share on other sites

@dragan - are you using the "User Dev Templates" feature, or the User Bar's "Page Versions" feature?

Share this post


Link to post
Share on other sites

I have defined an alternative tpl in the tpl settings, and I then use the Template Path panel in Tracy, where it says: 

Quote

Temporarily use a template file with a suffix. eg. project-dev.php.  
Select an alternate from the list. Create the file in your templates directory first

(the three orange cubes icon)

Share this post


Link to post
Share on other sites

I can't seem to reproduce any issues here with the Template Path panel. I actually don't understand why it's looking for a file at the root of /site/assets/cache/TracyDebugger/ - I don't think it should be.

I have a feeling you might have a combination of Tracy features / settings that is resulting in this, but not sure what. Would you mind PM'ing me your settings in JSON format. Maybe also an export of your template settings as well.

Share this post


Link to post
Share on other sites

tracy-cache-twice.PNG.a7e7e5116724763901dce56882886bd5.PNG

^ does this look normal to you? I see the same dev-template twice o_O

 

37 minutes ago, adrian said:

Would you mind PM'ing me your settings in JSON format. Maybe also an export of your template settings as well.

Sure, but I have no idea how to find / generate JSON settings. Is that done from within Tracy?  Or Tracy's module config @ module/edit?name=TracyDebugger&collapse_info=1 ?

Template settings: I assume the JSON export from backend/setup/template/export/ ?

Edited by dragan
added screenshot

Share this post


Link to post
Share on other sites
1 hour ago, dragan said:

^ does this look normal to you? I see the same dev-template twice o_O

The version under the Tracy cache is the backed up copy created when you use the File Editor panel. That is expected.

That is partly why the File Editor now has a default setting to exclude /site/assets

My concern is why the error you are seeing is looking for files under: /site/assets/cache/TracyDebugger/offer-index-dev.php rather than /site/assets/cache/TracyDebugger/site/templates/offer-index-dev.php

Share this post


Link to post
Share on other sites

Hi adrian,

First of all, thanks for the module, great job. 🙂

A few days ago, my hosting provider sent me an email:

Quote

'/home/zzz/public_html/site/modules/TracyDebugger/panels/Terminal/shell.php' # Known exploit = [Fingerprint Match]

Could you please give me some advice, what should I do?

They will disable the whole site if I won't solve this problem.. But the module is so useful, I don't want to remove.

Thanks,
Tamas

Share this post


Link to post
Share on other sites

Hi @tthom_pw - that file is not necessary for most of Tracy's functionality so you could certainly just delete it, but I would like to understand why they are actually concerned about it. As I mentioned to @bernhard above, it's impossible to run that shell.php file outside the PW admin and without superuser permissions. It is blocked by PW's htaccess rules.

Also, unless I am missing something, it's no more dangerous than Ryan's HannaCode module in terms of what it can run - Hanna lets you shell_exec() which is what this file uses to run system commands.

That said, if it's going to be a red flag for some hosting providers, I can move the file out of Tracy and make it a separate module that if installed will integrate with Tracy.

Could you please follow up with your host and explain how it is protected from direct access etc and see what they say?

Share this post


Link to post
Share on other sites

@tthom_pwThis report is most likely coming from ConfigServer eXploit Scanner (cxs). You can ask your hosting provider if he is willing to exclude this file from scanning. I'm not familiar with how scanner work but most likely it's searching for strings exec, shell, shell_exec etc. 

  • Like 1

Share this post


Link to post
Share on other sites

Hi guys,

thanks for all.

@matjazp : yes, CXS..

Unfortunately, it's an automatic virus scan and I don't hope, they will be flexible. From hosting provider side, it's a risk, there is a code match and won't check what are in those files, it's more easier to say, we don't care, solve this. 🙂

And, actually, they are hosting thousands of websites and I think, it's not expected to verify every single virus alert and debug files.

For example AutoSmush exe binaries. How knows, what are those doing? 🙂

Yes, I can tell them, those files aren't accessible from outside, but, they can tell, hey, it's OK, but perhaps somebody transport data from inside to outside.
So, it could be a neverending story.. 

Btw, if I delete all problematic files, with the next update, aren't those going back?
Of course, I will write an email.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-07-03 -- SnipWire 0.8.7 (beta) released! Fixes some small bugs and adds an indicator for TEST mode 2020-04-06 -- SnipWire 0.8.6 (beta) released! Adds support for Snipcart subscriptions and also fixes some problems 2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  

       
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By Sten
      Hello
      Till now I hacked something with the twig template but it works no more with new PW versions so I look forward to create a module. I am working on a site in multiple languages : French, English, Italian, German, Spanish, Portuguese, Hebrew, Russian. The new posts are entered in any language with a field for language. Till now, I got twig files to get the translations with constants defined for each part of the pages.
      So I'd like to create a module to include theses files added according to the url /fr/en/...
      Have you some observations to do before I begin about the direction to take ?
      Thank you
    • By ukyo
      Mystique Module for ProcessWire CMS/CMF
      Github repo : https://github.com/trk/Mystique
      Mystique module allow you to create dynamic fields and store dynamic fields data on database by using a config file.
      Requirements
      ProcessWire 3.0 or newer PHP 7.0 or newer FieldtypeMystique InputfieldMystique Installation
      Install the module from the modules directory:
      Via Composer:
      composer require trk/mystique Via git clone:
      cd your-processwire-project-folder/ cd site/modules/ git clone https://github.com/trk/Mystique.git Module in live reaction with your Mystique config file
      This mean if you remove a field from your config file, field will be removed from edit screen. As you see on youtube video.
      Using Mystique with your module or use different configs path, autoload need to be true for modules
      Default configs path is site/templates/configs/, and your config file name need to start with Mystique. and need to end with .php extension.
      Adding custom path not supporting anymore !
      // Add your custom path inside your module class`init` function, didn't tested outside public function init() { $path = __DIR__ . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR; Mystique::add($path); } Mystique module will search site/modules/**/configs/Mystique.*.php and site/templates/Mystique.*.php paths for Mystique config files.
      All config files need to return a PHP ARRAY like examples.
      Usage almost same with ProcessWire Inputfield Api, only difference is set and showIf usage like on example.
      <?php namespace ProcessWire; /** * Resource : testing-mystique */ return [ 'title' => __('Testing Mystique'), 'fields' => [ 'text_field' => [ 'label' => __('You can use short named types'), 'description' => __('In file showIf working like example'), 'notes' => __('Also you can use $input->set() method'), 'type' => 'text', 'showIf' => [ 'another_text' => "=''" ], 'set' => [ 'showCount' => InputfieldText::showCountChars, 'maxlength' => 255 ], 'attr' => [ 'attr-foo' => 'bar', 'attr-bar' => 'foo' ] ], 'another_text' => [ 'label' => __('Another text field (default type is text)') ] ] ]; Example:
      site/templates/configs/Mystique.seo-fields.php <?php namespace ProcessWire; /** * Resource : seo-fields */ return [ 'title' => __('Seo fields'), 'fields' => [ 'window_title' => [ 'label' => __('Window title'), 'type' => Mystique::TEXT, // or InputfieldText 'useLanguages' => true, 'attr' => [ 'placeholder' => __('Enter a window title') ] ], 'navigation_title' => [ 'label' => __('Navigation title'), 'type' => Mystique::TEXT, // or InputfieldText 'useLanguages' => true, 'showIf' => [ 'window_title' => "!=''" ], 'attr' => [ 'placeholder' => __('Enter a navigation title') ] ], 'description' => [ 'label' => __('Description for search engines'), 'type' => Mystique::TEXTAREA, 'useLanguages' => true ], 'page_tpye' => [ 'label' => __('Type'), 'type' => Mystique::SELECT, 'options' => [ 'basic' => __('Basic page'), 'gallery' => __('Gallery'), 'blog' => __('Blog') ] ], 'show_on_nav' => [ 'label' => __('Display this page on navigation'), 'type' => Mystique::CHECKBOX ] ] ]; Searching data on Mystique field is limited. Because, Mystique saving data to database in json format. When you make search for Mystique field, operator not important. Operator will be changed with %= operator.
      Search example
      $navigationPages = pages()->find('my_mystique_field.show_on_nav=1'); $navigationPages = pages()->find('my_mystique_field.page_tpye=gallery');
    • By Robin S
      This is a module I made as an experiment a while ago and never got around to releasing publicly. At the time it was prompted by discussions around using Repeater fields for "page builder" purposes, where the depth feature could possibly be used for elements that would be nested inside other elements. I thought it would be useful to enforce some depth rules and translate the depth data into a multi-dimensional array structure.
      I'm not using this module anywhere myself but maybe it's useful to somebody.
      Repeater Depth Helper
      This module does two things relating to Repeater fields that have the "Item depth" option enabled:
      It enforces some depth rules for Repeater fields on save. Those rules are:
      The first item must have a depth of zero. Each item depth must not be more than one greater than previous item depth. It provides a RepeaterPageArray::getDepthStructure helper method that returns a nested depth structure for a Repeater field value.
      Helper method
      The module adds a RepeaterPageArray::getDepthStructure method that returns a multi-dimensional array where the key is the page ID and the value is an array of nested "child" items, or null if there are no nested children.
      Example

      The module doesn't make any assumptions about how you might want to use the depth structure array, but here is a way you might use it to output a nested unordered list.
      // Output a nested unordered list from a depth structure array function outputNestedList($depth_structure, $repeater_items) { $out = "<ul>"; foreach($depth_structure as $page_id => $nested_children) { $out .= "<li>" . $repeater_items->get("id=$page_id")->title; // Go recursive if there are nested children if(is_array($nested_children)) $out .= outputNestedList($nested_children, $repeater_items); $out .= "</li>"; } $out .= "</ul>"; return $out; } $repeater_items = $page->my_repeater; $depth_structure = $repeater_items->getDepthStructure(); echo outputNestedList($depth_structure, $repeater_items);
       
      https://github.com/Toutouwai/RepeaterDepthHelper
      https://modules.processwire.com/modules/repeater-depth-helper/
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
×
×
  • Create New...