Jump to content
adrian

Tracy Debugger

Recommended Posts

I have latest PW+Tracy installed and when I go to edit a page in the admin I randomly get these notifications

Quote

 404 occurred: /wire/modules/Inputfield/InputfieldFile/InputfieldFile.css.map
 404 occurred: /wire/modules/LanguageSupport/LanguageTabs.css.map

I looked in those folders and there are no map files, not sure why PW is trying to find them or why they would be missing.

This seems occur when I use the "inspector" in the browser to look at elements.

Share this post


Link to post
Share on other sites
On 3/19/2018 at 9:20 PM, Robin S said:

I'm seeing an issue in the Console panel where the indentation (tabs) of saved snippets gets lost when the page is reloaded.

Thanks @Robin S - I am seeing it too - the solution however I am not seeing :) I'll try to take another look tomorrow.

 

14 hours ago, neosin said:

I looked in those folders and there are no map files, not sure why PW is trying to find them or why they would be missing.

Hi @neosin - this is not related to Tracy. Have a read: 

 

  • Like 1

Share this post


Link to post
Share on other sites
On 3/19/2018 at 9:20 PM, Robin S said:

I'm seeing an issue in the Console panel where the indentation (tabs) of saved snippets gets lost when the page is reloaded.

Hey Robin - sorry for the delay on this, but it should now be fixed - please let me know if it works for you.

Share this post


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

Hey Robin - sorry for the delay on this, but it should now be fixed - please let me know if it works for you.

Thanks. Did you push the changes to GitHub? It's still showing 4.9.31 which is the version I was seeing the issue with.

  • Like 1

Share this post


Link to post
Share on other sites
31 minutes ago, Robin S said:

Thanks. Did you push the changes to GitHub? It's still showing 4.9.31 which is the version I was seeing the issue with.

Oops - sorry, I committed the tag and release for 4.9.32 but not the actual code :)

Try again now!

  • Like 1

Share this post


Link to post
Share on other sites

hey @adrian

I'm working on my DataTables module (that might get renamed to RockGrid btw because I'm experimenting with another grid software :) ) and have 30k sample data pages (basic-page with only title field). When I open such a page in the admin, the page load takes very long (around 10s). I looked at the network tab and saw that the request for initial page load (?id=1017) loads 5.7MB of data.

Cookie: pagelist_open=JSON%5B%221-0%22%2C%221016-0%22%2C%221017-0%22%2C%227-0%22%5D;
wire=...;
wire_challenge=...;
tracyCodeError=ERROR%3A+Maximum+execution+time+of+120+seconds+exceeded+on+line%3A+454+in+D%3A%5Claragon%5Cwww%5Caggrid1%5Cwire%5Ccore%5CWireDatabasePDO.php

When i switch off tracy the page load is instant.

The code for the debug bar is huge:

5abe34353a933_2018-03-3014_56_46-view-source_www.aggrid1.to_admin_page_edit__id1017.thumb.png.d78afa1bf702eb5736d06d114ce4a018.png

Any ideas which feature of the panel is causing this behaviour?

Thanks in advance, no hurry at all with this one :) 

  • Like 1

Share this post


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

Any ideas which feature of the panel is causing this behaviour?

My guess is that it's the Field List & Values section of the Request Info panel. Can you try disabling just that section and let me know?

 

Share this post


Link to post
Share on other sites
Spoiler

 

 

4 hours ago, bernhard said:

The code for the debug bar is huge:

5abe34353a933_2018-03-3014_56_46-view-source_www.aggrid1.to_admin_page_edit__id1017.thumb.png.d78afa1bf702eb5736d06d114ce4a018.png

 

 

Hello Neo, are you in the Matrix already? :D

  • Like 1

Share this post


Link to post
Share on other sites
42 minutes ago, adrian said:

My guess is that it's the Field List & Values section of the Request Info panel. Can you try disabling just that section and let me know?

good guess ;)

5abe551804b24_2018-03-3017_17_17-EditPage_5abe0ddaa8d6daggrid1_to.png.3c13c58e1b64ae3c7deb0718ebe66357.png5abe551908bbb_2018-03-3017_16_50-EditPage_5abe0ddaa8d6daggrid1_to.png.456ea78e60d9bc8e5ae95dac71894c36.png

Debug Mode is also very slow, but only if Request Info is ON. If Request Info is OFF the Debug Mode is 10ms (first screenshot)

  • Like 1

Share this post


Link to post
Share on other sites

Can you post a screenshot of the contents of the Field List & Value section?

Or maybe you can send me a test version of the module so I can take a look?

Share this post


Link to post
Share on other sites

I don't see any suspicious information in the panel. Only the HTML code of the debug bar is totally bloated. I think the simplest is to test it on your own. I'm running a fresh dev installation with blank profile and tracy v4.9.33

I've just created a page "data" under /home and added 30k pages with the tracy console:

for($i=0; $i<30000; $i++) {
    $p = new Page();
    $p->template = 'basic-page';
    $p->parent = $pages->get('/data');
    $p->title = uniqid();
    $p->save();
}

Then when I open one of those pages in edit mode the tracy bar takes 10s to load..

  • Like 1

Share this post


Link to post
Share on other sites

@bernhard - could you please let me know how it goes when you disable the "Pages Loaded" section in the Debug Mode panel. This seems to be the main issue at my end.

image.png.75374c3ad0b69e9495cddbb7f5a9a603.png

Share this post


Link to post
Share on other sites

As a followup @bernhard - I notice that when editing a child with thousands of siblings, all the siblings get loaded, but this doesn't seem to be a Tracy issue - take a look at the PW core Debug Mode panel. I wonder if that's a bug?

image.png.982b0230793ffede41ed596ccdea602c.png

  • Like 1

Share this post


Link to post
Share on other sites

Hm, I have "pages loaded: 23"

$config->debug = true/false does not make any difference. Only difference is when I hit the "Disable Tracy" Button in the Debug Bar it instantly becomes fast as usual. I can send you a site profile, maybe that helps :)

 

  • Like 1

Share this post


Link to post
Share on other sites

Hey @bernhard - sorry for the delay on this - had family in town.

Please try the latest version - it prevents all siblings from being loaded by the prev/next links in the Request Info panel (which was a bug I hadn't noticed). This should actually make a huge different to anyone using Tracy on a page with a lot of siblings - can't believe I didn't come across this till now - thanks for bringing it to my attention.

One caveat - if you are running AOS with the "Add links to edit previous and next pages" feature enabled you might still have problems, although it shouldn't affect page load speed. I have made a note here: 

 

  • Like 2

Share this post


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

Please try the latest version - it prevents all siblings from being loaded by the prev/next links in the Request Info panel (which was a bug I hadn't noticed). This should actually make a huge different to anyone using Tracy on a page with a lot of siblings - can't believe I didn't come across this till now - thanks for bringing it to my attention.

Thanks @adrian, that solves the issue and my pw admin is lightning fast again :) I've experienced slower loading with tracy several times, but I was not able to identify when it occured. Maybe this was the reason, I'll keep an eye.

BTW: Where do I find the prev/next links?

  • Like 1

Share this post


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

Thanks @adrian, that solves the issue and my pw admin is lightning fast again :) I've experienced slower loading with tracy several times, but I was not able to identify when it occured. Maybe this was the reason, I'll keep an eye.

 

Glad to hear!

3 hours ago, bernhard said:

BTW: Where do I find the prev/next links?

In the Request Info Panel. The name is a View link and the ID is an Edit link.

image.png.c6efe82a531d35fdc19f83611005eddc.png

Share this post


Link to post
Share on other sites

Thx adrian! Didn't use the request info panel so far, but I'll start using it :)

  • Like 1

Share this post


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

Thx adrian! Didn't use the request info panel so far, but I'll start using it :)

Don't forget to also take a look at it when editing a field, template, or module - shows all the settings for those in addition to the normal sections. Can be very handy for certain dev needs.

  • Like 2

Share this post


Link to post
Share on other sites

@bernhard - could you please check the latest version for me - I left out "include=all" for the prev/next links in the last commit. Everything still seems fast here, but would appreciate it if you could confirm it's ok at your end too please?

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone - looking for some feedback. The Tracy core has just introduced an option to dump objects using the __debugInfo() magic method which PW also supports.

It changes this:

image.png.ba3041ba468af6e569ded6068673daec.png

 

to:

image.png.bfb0aa40445b6cd37b4bb37ac1a068e6.png

 

What I am wondering is whether to make using __debugInfo() the default or not. And also wondering how often you guys might want to switch between one vs the other - in other words, will it be ok as a config setting, or do you think it's something that should be easier to change on-the-fly?

Thanks for any input.

  • Like 1

Share this post


Link to post
Share on other sites

Would you mind adding some additional information to your question? What is the difference between the two? What would be the pros/cons?

I use dumping a lot but I use only very basic features I guess. Most of the information in the first screencap does not seem to be very helpful to me (at least most of the time, or at least not yet). The second looks cleaner to me, but what I do not like is that "template" is a string and not a ProcessWire\Template as shown in the first pic (though that's a tiny detail and i guess dumping $page->template would show the correct classname?).

[2min later] To me, the second looks cleaner and more helpful. 

  • Like 2

Share this post


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

What I am wondering is whether to make using __debugInfo() the default or not.

You'll know more about this than me, but my understanding is that what is available in a dump from __debugInfo() depends on what the developer of the class makes available in the method. So if that method in a class was quite limited in what it made available (either intentionally or not intentionally) then the Tracy user potentially misses out on a lot of relevant information.

To give a silly example, if I do this in a class...

public function __debugInfo() {
    return ['Nothing to see here.'];
}

...then dumping an instance of it will be useless.

It looks like most of the __debugInfo() work is done in the dedicated WireDebugInfo class. If you think that Ryan has covered everything that anyone could ever need here then I guess shorter/tidier is better. But if you have doubts I'd rather get all the data as per the status quo than be wondering about what might have been overlooked.

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      A community member raised a question and I thought a new sanitizer method for the purpose would be useful, hence...
      Sanitizer Transliterate
      Adds a transliterate method to $sanitizer that performs character replacements as defined in the module config. The default character replacements are based on the defaults from InputfieldPageName, but with uppercase characters included too.
      Usage
      Install the Sanitizer Transliterate module.
      Customise the character replacements in the module config as needed.
      Use the sanitizer on strings like so:
      $transliterated_string = $sanitizer->transliterate($string);
       
      https://github.com/Toutouwai/SanitizerTransliterate
      https://modules.processwire.com/modules/sanitizer-transliterate/
       
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version to 2.10, add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By thomasaull
      I created a little helper module to trigger a CI pipeline when your website has been changed. It's quite simple and works like this: As soon as you save a page the module sets a Boolean via a pages save after hook. Once a day via LazyCron the module checks if the Boolean is set and sends a POST Request to a configurable Webhook URL.
      Some ideas to extend this:
      make request type configurable (GET, POST) make the module trigger at a specified time (probably only possible with a server cronjob) trigger manually Anything else? If there's interest, I might put in some more functionality. Let me know what you're interested in. Until then, maybe it is useful for a couple of people 🙂
      Github Repo: https://github.com/thomasaull/CiTrigger
    • By Robin S
      I created this module a while ago and never got around to publicising it, but it has been outed in the latest PW Weekly so here goes the support thread...
      Unique Image Variations
      Ensures that all ImageSizer options and focus settings affect image variation filenames.

      Background
      When using methods that produce image variations such as Pageimage::size(), ProcessWire includes some of the ImageSizer settings (height, width, cropping location, etc) in the variation filename. This is useful so that if you change these settings in your size() call a new variation is generated and you see this variation on the front-end.
      However, ProcessWire does not include several of the other ImageSizer settings in the variation filename:
      upscaling cropping, when set to false or a blank string interlace sharpening quality hidpi quality focus (whether any saved focus area for an image should affect cropping) focus data (the top/left/zoom data for the focus area) This means that if you change any of these settings, either in $config->imageSizerOptions or in an $options array passed to a method like size(), and you already have variations at the requested size/crop, then ProcessWire will not create new variations and will continue to serve the old variations. In other words you won't see the effect of your changed ImageSizer options on the front-end until you delete the old variations.
      Features
      The Unique Image Variations module ensures that any changes to ImageSizer options and any changes to the focus area made in Page Edit are reflected in the variation filename, so new variations will always be generated and displayed on the front-end.
      Installation
      Install the Unique Image Variations module.
      In the module config, set the ImageSizer options that you want to include in image variation filenames.
      Warnings
      Installing the module (and keeping one or more of the options selected in the module config) will cause all existing image variations to be regenerated the next time they are requested. If you have an existing website with a large number of images you may not want the performance impact of that. The module is perhaps best suited to new sites where image variations have not yet been generated.
      Similarly, if you change the module config settings on an existing site then all image variations will be regenerated the next time they are requested.
      If you think you might want to change an ImageSizer option in the future (I'm thinking here primarily of options such as interlace that are typically set in $config->imageSizerOptions) and would not want that change to cause existing image variations to be regenerated then best to not include that option in the module config after you first install the module.
       
      https://github.com/Toutouwai/UniqueImageVariations
      https://modules.processwire.com/modules/unique-image-variations/
    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      ProcessWire-Module: http://modules.processwire.com/modules/page-access-releasetime/
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
×
×
  • Create New...