Jump to content
adrian

Tracy Debugger

Recommended Posts

1 hour ago, adrian said:

Hope you guys find these new additions useful!

Yes, definitely :) We cannot thank you enough for this module, but at least we need to try! Anyway, the even stronger support of ajax debugging came just the right time for me, as I am about to start a new project utilizing lots of ajax magic.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks @szabesz - I really appreciate everyone's positive feedback and support for this module - glad it's been useful for everyone!

Good luck with your new project.

  • Like 5

Share this post


Link to post
Share on other sites

How about adding a link to the Tracy module settings page to the Panel selector panel?

  • Like 2

Share this post


Link to post
Share on other sites
On 1/4/2017 at 5:28 AM, tpr said:

How about adding a link to the Tracy module settings page to the Panel selector panel?

@tpr - I happy to do that, but just wondering if you noticed the link to the settings from the first row of icons on the ProcessWire Info panel? Maybe you don't have that enabled by default?

Share this post


Link to post
Share on other sites

Yes, I don't have that panel enabled. I use the Panel selector and occassionally enable the panel I need (Console, Validator). It's maybe only me but the Panel Selector is the "Control Panel" of TD :) I could imagine double-clicking on the "Tracy" icon to go to the module settings page.

  • Like 1

Share this post


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

Yes, I don't have that panel enabled. I use the Panel selector and occassionally enable the panel I need (Console, Validator). It's maybe only me but the Panel Selector is the "Control Panel" of TD :) I could imagine double-clicking on the "Tracy" icon to go to the module settings page.

Ok, here's a screenshot showing the tooltip that indicates double-clicking the "Tracy" icon opens the module settings.

Screen-Shot-2017-01-05-at-12.20.47-PM.png

Currently it opens the module settings in a different tab. I am not usually a fan of this, but in this case where we are using double-click and there is no way to user initiate a new tab, I think this is best for now.

I'll commit along with the new console history/snippets stuff - hopefully shortly ;) 

  • Like 4

Share this post


Link to post
Share on other sites

The Console Panel now has a History stack and a separate Snippets stack!

Hi everyone - this has been a long time coming. It was originally suggested by @bernhard back in early November.

I want to thank @bernhard for the idea and feedback on draft versions, and @tpr who has contributed many ideas, style suggestions, and code to this functionality - sincere thanks to both of you!

Screen Shot 2017-01-05 at 10.53.52 PM.png

 

Snippets 

  • are automatically saved to the tracy config settings entry in the modules database table so that they are available on other browsers/computers
  • have a dedicated save button - they are not saved automatically when running code
  • save button only available when loaded snippet code is different from saved version so you know whether you have made changes
  • has the ability to sort alphabetically or chronologically (date modified)
  • no limit of number of snippets stored
  • snippets can be deleted - a icon appears when you mouseover a snippet in the list

History 

  • items are saved to local storage
  • automatically saved when you "run" code
  • comes with "Back" and "Forward" arrows for moving between history items
  • currently stores maximum of 25 items - let me know if you think this needs adjusting

 

Some other miscellaneous changes

  • when running code, output is now appended to the results panel (like your browser dev console)
  • you can used ALT/OPT+Enter keyboard shortcut to Clear and Run
  • the "Clear" button now clears the results panel, but leaves the code intact

 

Future ideas

  • ability to easily export/import snippets to stack
  • your ideas :)


Please let me know if you come across any bugs or weirdness with anything - it's still pretty early stages!

  • Like 6

Share this post


Link to post
Share on other sites

Quick update to the Strict Mode and AJAX calls. I just added a new config setting that allows you to turn on Strict Mode for just AJAX calls. This is helpful if you want to know for certain that an AJAX call returned a failure. Remember that Tracy intercepts Notices and Warnings and displays them in the Errors panel. As I mentioned a little while back this can result in an AJAX call being successful when Tracy is running, but failing when it's not because the notice/warning breaks the AJAX response.

This new option will be good if you're not sure you'll pay attention to the red alert in the Errors panel.

  • Like 1

Share this post


Link to post
Share on other sites

A few new tweaks to the Console Panel snippets/history functionality, thanks mostly to @tpr again - he really has played a huge role in making this look as nice as it does!

Screen Shot 2017-01-06 at 3.29.20 PM.png

  • Like 3

Share this post


Link to post
Share on other sites

Thanks! Such minor UI tweaks can add a lot to the overall feel and they were easy to add. I just took the opportunity to harvest some glory with minimal effort :)

  • Like 4

Share this post


Link to post
Share on other sites

Hi @adrian

For first time, I have a problem with this module, version 3.6.0.

 Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72

I tried de-install/re-install but without success.

 

Share this post


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

Hi @adrian

For first time, I have a problem with this module, version 3.6.0.


 Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72

I tried de-install/re-install but without success.

 

Try rolling back your PW version to 3.0.47 - https://github.com/processwire/processwire-issues/issues/151

  • Like 1

Share this post


Link to post
Share on other sites

I can confirm this error too.

7 hours ago, adrian said:

Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72

 

Share this post


Link to post
Share on other sites

@adrian The tracy debug bar takes up a lot of screen real estate, how about adding an option for collapsing the tracy debug bar by default into a "Debug" toggle link that shows fixed in the bottom right hand corner?

When a user clicks the "Debug" link, it would show the entire bar.

Currently a user has to refresh the whole page to bring back the toolbar if a user click's the "x" to close the toolbar.  With a toggle link it can appear or disappear.

Just a thought..

  • Like 1

Share this post


Link to post
Share on other sites

@gmclelland - have you tried unchecking "Show Panel Labels" ? I do that on all my sites. The only reason I have it on by default is for new users so it's easier to know what the panel icons are.

If that's still not enough, I'll have a think about the hide toggle for you. 

Share this post


Link to post
Share on other sites

@gmclelland - I decided to go ahead with adding this anyway :)

The latest version replaces the existing close (x) button with a hide arrow.

Screen Shot 2017-01-17 at 9.13.06 PM.png

This is what it looks like when hidden:

Screen Shot 2017-01-17 at 9.14.32 PM.png

In case anyone is wondering, this is quite different to the Enable/Disable button (either from the dedicated panel, or from the panel selector) because with this new option, even when hidden it is still capturing errors etc and when you unhide/show it will instantly show it's information without the need for a page reload.

There is also a new module config setting to "Hide Debug Bar By Default". That should be self-explanatory, but keep in mind that once you have clicked on the show or hide buttons, cookies take over controlling its status.

Please let me know if you have any problems.

Just an FYI - I am not a big fan of this because you won't be alerted about non-fatal warnings/notices while the debug bar is hidden, but I think it's nice to give users the option if they prefer it.

  • Like 4

Share this post


Link to post
Share on other sites

Just an idea: how about making it three-state, eg full-nolabel-min?

I also think the new setting to hide the bar is not needed, and perhaps the hide label setting is also superfluous if my suggestion gets accepted.

Share this post


Link to post
Share on other sites
44 minutes ago, tpr said:

Just an idea: how about making it three-state, eg full-nolabel-min?

I also think the new setting to hide the bar is not needed, and perhaps the hide label setting is also superfluous if my suggestion gets accepted.

Thanks for your ideas on this. I must admit though that I never have a need for the labels to be displayed (I actually think they look horribly ugly), so I am not convinced about the three-state toggle, but I am open to being convinced if enough people would like it.

I probably agree with you regarding not needing  the new setting to hide bar by default - I added it anyway, just in case it's easier with very small touch screens where it might be hard to hide in the first place - maybe not really that hard?

On another note, I just committed another update which adds nicer/simpler exception reporting for the Console panel. I was getting tired of the Tracy "Bluescreen" showing the full stack trace for a simple syntax error in the console. I wonder if at times my changes might hide useful info though, so I'll keep an eye on things and maybe add an checkbox option to turn on the full trace if checked. Please let me know how you find this new approach.

  • Like 2

Share this post


Link to post
Share on other sites

FYI - that last change regarding exception handling in the Console panel only seems to be working here on PHP 7 - on PHP 5 it reverts to the full stack trace result.

Not sure if I overlooked something or what just yet, but if anyone feels like testing a simple syntax error in different environments and let me know what happens, that would be appreciated. Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks - just tried the Hide button and I feel that it should have some extra space around, eg.

padding: 0 3px 0 5px;

Plus I think it would look nicer to have the module icon (the bug) instead of the arrow. You could play with opacity to distinguish its on/off state.

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone - Absolute newbie question (I'm discovering the module and actually I'm also discovering PHP debug stuff, so sorry if my question is rather stupid)

I've just installed the module and it loads fine on my localhost with the bottom bar. If I look at the 'Processwire Debug Mode' (which I've set ON in my config.php), I see many infos such as 'Pages loaded', 'API Variables', 'Session'... with numbers. I'm very interested since I have a page which loads 4991 pages and so takes quite a long time (and I'm desperately trying to optimize it), BUT, and here's my problem : if I click on the link to see the pages, the menu drops down (cool!) but it triggers a page load which in its turn redirects immediately to my 404 error page... and I lose the current information :(

I am spending quite a while trying to understand how to dive into this PHP debug tool (I have to admit it's for the moment way over my coder's skills), but here, I'm a little stuck on what seems to be... not much. So if anyone can give me hint on that one, I'd appreciate. Thanks !

PS : Maybe I should have opened a new question in the forum rather than following this topic ?

Share this post


Link to post
Share on other sites

@celfred, regarding the optimisation, yes, please start a new topic. I, for one, I am curious why you have to load 5000 pages!??? :).

  • Like 1

Share this post


Link to post
Share on other sites

@kongondo : I was definitely thinking of starting a new topic and ask you, guys, about my optimisation issue, but I wanted to find some clues by myself first... and believe me, I am trying to find something (hence my discovering of TracyDebugger :) ) but at the moment, I stay also curious about why I have to load 5000 pages ! (Except I am the creator of these pages, so this is rather shameful...)

So I'll start a new topic soon ! But I still think the expected behavior of my TracyDebugger shouldn't be to redirect me when I click on the 'Pages loaded' link, no?

 

Edit : WHile I'm at it, the 'Show bar in backend' option is NOT ticked and the bar displays in backend anayway :( And it triggers the 'Fatal Error Maximum function nesting level of '100' reached, aborting!'... Do you think I did something wrong? Should I try and re-install the module?

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...