Jump to content
adrian

Tracy Debugger

Recommended Posts

Posted (edited)
On 3/25/2019 at 3:21 PM, adrian said:

Or you can force development mode for superusers. 

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

Will do, noted and yes could be Devilbox is doing that, thx for your help.

Edited by happywire
typo
  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, tthom_pw said:

 

Btw, if I delete all problematic files, with the next update, aren't those going back?

If I leave things as is, then yes. But if server scanners are going to regularly flag this file, then I'll move the Terminal to its own separate module so it's not part of Tracy.

Share this post


Link to post
Share on other sites

@tthom_pw - any word back from your host? I think I'll probably have to take the approach of separating out Terminal, but just wanted to know if you had any updates first.

Share this post


Link to post
Share on other sites

@adrian sorry for the late answer, kids had ice hockey championship, dance show, I had a lot of work, etc... you know how it's going..

That hosting provider set an exception for shell.php, so, there it's OK, the site has saved.

But, today sent me an another hosting provider an email: your site was hacked! And they put shell.php into quarantine. At least, they didn't turn off the site completely. 😄

So, +1 vote from me for separating Terminal function. Thanks!

 

Share this post


Link to post
Share on other sites

@tthom_pw - thanks for the updates. Looks like this is going to be an ongoing problem, so I have separated it out into its own module: http://modules.processwire.com/modules/process-terminal/

It can be run standalone, or via the Terminal panel in Tracy.

Hopefully this will help to make it available if you run your own server / VPS, but not cause problems for those Tracy users on shared hosting.

  • Like 5

Share this post


Link to post
Share on other sites

validator.nu (utilized by Tracy) seems to have been down for more than 16 hours or so. Most "is it down or just me" websites also report that it is down, a few report it is not down.
Does anyone have more info on this? I could not google any news regarding this issue.

  • Like 1

Share this post


Link to post
Share on other sites
On 4/29/2019 at 2:48 PM, szabesz said:

validator.nu

Is it just me who is upset by not being able to validate "real-time"? Anyway, in Tracy's source code I read:

"what about switching to: https://checker.html5.org ?"
So I just manually changed it to $this->validatorUrl = 'https://checker.html5.org/';
Seems to work.

@adrian Any chance of adding options to the Settings so that we can provide a working ULR without changing the source code? I am thinking of a text inputbox, so that any working service can be provided, just in case.

As far as I can see, currently we have three options: https://validator.github.io/validator/ of which html5.validator.nu/validator.nu does not work at the moment.

  • Like 1

Share this post


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

@adrian Any chance of adding options to the Settings so that we can provide a working ULR without changing the source code? I am thinking of a text inputbox, so that any working service can be provided, just in case.

Sounds like an easy and valuable PR 😉

  • Like 1

Share this post


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

Sounds like an easy and valuable PR 😉

I would probably need to spend 2 or 3 days on it. I guess it is not comparable to the time-frame Adrian needs to do it.

  • Like 1

Share this post


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

I would probably need to spend 2 or 3 days on it. I guess it is not comparable to the time-frame Adrian needs to do it.

For sure Adrian will be faster than anybody else, but just see how he does those things with eg the vscode file editor links setting and do the same. This will never take you 2-3 days, I'm sure. And I guess you'll learn something new (otherwise you would not think that such a modification would take so long).

But I don't mean that as an offense. I just think that everybody of us (me included) should try to contribute as much as possible and not just request things 🙂 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks @szabesz and @bernhard - I decided to just switch the service to https://checker.html5.org/ - I don't think an option to specify any service will be very useful because I parse the returned response before displaying it in the panel, so the service must return the expected html. 

Anyway, hopefully this will keep us going for a while - let me know if you notice any problems with this option.

  • Like 1

Share this post


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

I don't think an option to specify any service will be very useful because I parse the returned response before displaying it in the panel, so the service must return the expected html.

I see.

Thanks for updating the module!

Share this post


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

I parse the returned response before displaying it in the panel

BTW, I was not suggesting doing it in the panel, but in the module's settings. Isn't that possible either? Am I misunderstanding something?

Share this post


Link to post
Share on other sites
6 hours ago, szabesz said:

BTW, I was not suggesting doing it in the panel, but in the module's settings. Isn't that possible either? Am I misunderstanding something?

With the way the panel sends the HTML and parses the returned result, it needs to use a https://validator.github.io/validator/ based service. There are a few, but you can't use all validators that are online, because they aren't all based on nu validator.

Share this post


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

you can't use all validators that are online, because they aren't all based on nu validator.

What I meant was that we could be allowed to pick one of those listed here: https://validator.github.io/validator/ and not any other out there.

Share this post


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

What I meant was that we could be allowed to pick one of those listed here: https://validator.github.io/validator/ and not any other out there.

Yeah, but html5.validator.nu is down and validator.w3.org/nu doesn't work with the panel for some reason, so there is really only the checker.html5.org option anyways 🙂

  • Like 1

Share this post


Link to post
Share on other sites

Nice enhancement to the file filtering in the File Editor panel thanks to @tpr that lets you arrow key up and down through results and Enter to open.

GnAkgnRo4U.thumb.gif.a6074e05d2a69b87978e1ef0069b17b5.gif

 

  • Like 3

Share this post


Link to post
Share on other sites

Hey @adrian! Sorry if this has been discussed/answered already – tried to browse a bit but there's just so much information here. Anyway, as I've been trying to integrate Tracy into my regular process, I've ran into a bit of a dilemma regarding the "output mode" setting.

The thing is that I'm used to displaying errors on screen when ProcessWire's debug mode is enabled, but Tracy seems to override that. The solution to this would apparently be the "output mode" setting, but since in my case the development often happens on a publicly viewable (development) domain, the "DETECT" setting doesn't work for me (as it assumes that my site is in PRODUCTION mode), and I already have programmatic rules in place for enabling $config->debug depending on the state of the site / environment. I would've assumed the debug mode to force Tracy to dev mode as well, but it seems that it doesn't.

I guess I'm mainly asking if this would make sense, or if there's a reason to keep Tracy's output mode and $config->debug separate? 🙂

Share this post


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

Hey @adrian! Sorry if this has been discussed/answered already – tried to browse a bit but there's just so much information here. Anyway, as I've been trying to integrate Tracy into my regular process, I've ran into a bit of a dilemma regarding the "output mode" setting.

The thing is that I'm used to displaying errors on screen when ProcessWire's debug mode is enabled, but Tracy seems to override that. The solution to this would apparently be the "output mode" setting, but since in my case the development often happens on a publicly viewable (development) domain, the "DETECT" setting doesn't work for me (as it assumes that my site is in PRODUCTION mode), and I already have programmatic rules in place for enabling $config->debug depending on the state of the site / environment. I would've assumed the debug mode to force Tracy to dev mode as well, but it seems that it doesn't.

I guess I'm mainly asking if this would make sense, or if there's a reason to keep Tracy's output mode and $config->debug separate? 🙂

Maybe not the direct answer to your question, but You can easilly enable/disable Tracy in config dependant on your $config->debug setting.

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Ivan Gretsky said:

Maybe not the direct answer to your question, but You can easilly enable/disable Tracy in config dependant on your $config->debug setting.

Thanks Ivan! 🙂

So it would seem that I can at least solve this by setting that $config->tracyDisabled based on my own rules (or just use the same rules by stating that "$config->tracyDisabled = !$config->debug"), and then setting the output mode to DEVELOPMENT (or alternatively forcing development mode for superusers, since that's what I'm usually logged in while developing anyway).

Still would seem more "streamlined" if Tracy utilised ProcessWire's built-in debug mode flag, but again there may be a good reason why a more nuanced setup is required.

... although, now that I'm reading the docs more carefully, I'm also wondering if I should just stick with DEVELOPMENT mode all the time. I'm not entirely sure (yet) what's the harm in that, considering that only superusers and users with the tracy-debugger permission should see anything out of ordinary anyway – right? Or is this setting going to do/affect something else? Basically it seems that this setting is useful in case, say, a client is going through the site as a superuser and you don't want them to see the Tracy bar 🤔

--

Another thing I've been wondering – and this is completely unrelated to the questions above – is whether Tracy provides support for breakpoints, as in points of code where execution should stop and display current "state" in some manner?

I'm aware of the bd() function, but couldn't find anything pointing to this direction specifically. There is the bp() function, but apparently it's a different concept entirely – more like a timer than a breakpoint, really. Coming from Xdebug I'm used to relying on breakpoints while debugging features that I want to walk through step-by-step, stop before they are fully executed, etc. If the answer is "no", that's fine – I can always just use Xdebug on the side 🙂

Edit: should've kept digging further. Found this from the blog entry introducing Tracy Debugger:

Quote

While Tracy doesn't provide breakpoints/step through code functionality the way Xdebug does, it does provide a wide variety other features that I think make it a valuable tool, whether you use it in conjunction with Xdebug, or on its own.

I guess that answers my question above, and the suggested solution is indeed a combination of Tracy + Xdebug 😅

Edited by teppo
  • Like 1

Share this post


Link to post
Share on other sites

Hey @teppo - you raise some interesting points regarding Tracy's output mode. Honestly I think when I initially set that logic up I wasn't certain of the approach that would make the most sense so what we currently have may not be perfect, but here are my thoughts on the current state of things.

In Production mode Tracy logs and emails (if set up) errors, but doesn't display the debug bar or errors on the screen. Unless you are a superuser or other authorized user, all sites will be in Production mode regardless of this setting. If you are a superuser and the output mode is set to Production or Detect (and the site is on a live server) and the "force" option is not checked, then Tracy will be in Production mode - I guess my thinking around this is that some superusers may not want Tracy to be in Development even for themselves when a site is live, but that on the dev version of their site with all the same settings, they would like it to be Development mode.

The reason it's not all tied to PW's debug mode is that if debug mode is on and for some reason Tracy doesn't capture the errors (unlikely/impossible I suppose), guest users may see PW/PHP error messages (not good!), so I like to have Tracy's Development mode tools (debug bar / bluescreen error stacks, etc) available for superusers even when debug mode is off on a live site.

I hope that explains a little of my thinking, but if you are struggling with the way things are set up and would like to see changes, I am definitely willing to consider your suggestions - I haven't revisited this logic in many years!

Re: breakpoints - sounds like you figured that all out in the end, but regarding the bp() method that is used by the Performance panel - that comes from the wording used in that Panel (https://github.com/Zarganwar/PerformancePanel/blob/master/src/Panel.php) which is clearly not a good use of the term and is confusing.

If you're interested, you may like to look through the other 3rd party panels available for the Tracy core: https://componette.com/search/tracy - in particular there are a couple of XDebug related panels that you might find helpful - they don't seem to be actively developed anymore, but perhaps you could investigate and we could implement one into TracyDebugger if helpful.

In general, I'd definitely appreciate any thoughts you have on Tracy and its functionality.

Cheers!

  • Like 3

Share this post


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

The reason it's not all tied to PW's debug mode is that if debug mode is on and for some reason Tracy doesn't capture the errors (unlikely/impossible I suppose), guest users may see PW/PHP error messages (not good!), so I like to have Tracy's Development mode tools (debug bar / bluescreen error stacks, etc) available for superusers even when debug mode is off on a live site.

I hope that explains a little of my thinking, but if you are struggling with the way things are set up and would like to see changes, I am definitely willing to consider your suggestions - I haven't revisited this logic in many years!

Thanks for the reply, @adrian. Your logic makes perfect sense to me!

I didn't think this through: I'm not used to debugging anything on production, so it didn't even occur to me that this way one can actually use Tracy on a real production / live site. I'll have to agree that enabling debug mode on production is a bad idea – partly because something may indeed slip through to the front end, and partly because some modules etc. may in fact behave differently (such as output some sort of debug log on screen) when the debug mode is enabled 🙂

I can definitely live with this, it's really not an issue. Mainly it was just a bit confusing while getting started with the module.

41 minutes ago, adrian said:

If you're interested, you may like to look through the other 3rd party panels available for the Tracy core: https://componette.com/search/tracy - in particular there are a couple of XDebug related panels that you might find helpful - they don't seem to be actively developed anymore, but perhaps you could investigate and we could implement one into TracyDebugger if helpful.

In general, I'd definitely appreciate any thoughts you have on Tracy and its functionality.

Awesome – definitely will check those out!

I've only been using Tracy "seriously" as of this morning, but I must say that I'm quite enjoying it already. It's a massive tool and so far I've only used a tiny fraction of its features, but I can see a lot of value in it 🙂

  • Like 1

Share this post


Link to post
Share on other sites

Just added a small feature that fixes a big pain point for me.

When editing a page, there is a new button in the AdminTools panel to change the "collapsed" status of all fields to fully open and editable.

image.png.5499dc7348ed10e620347ff1063d93b7.png

This is great for those fields that you don't want available regularly (especially for non-superusers), but occasionally need to view or edit.

Fields will remain like this until you click this alternate button, or the site cookies are cleared.

image.png.a748cefb87ae6a89e09c36278f9ab811.png

Hope you find it useful!

  • Like 3

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 gebeer
      I am happy to present my new fieldtype FieldtypeImageFromPage. It is made up of 2 modules:
      Fieldtype Image Reference From Another Page is a Fieldtype that stores a reference to a single image from another page. The image can be selected with the associated Inputfield.
      Inputfield Select Image From Page is an Inputfield to select a single image from images on a predefined page and it's children.
      And there also is a helper module that takes care of cleanup tasks.
      This module evolved out of a discussion about my other Module FieldtypeImagePicker.  It caters for use cases where a set of images is being reused multiple times across a site. With this fieldtype these images can be administered through a chosen page. All images uploaded to that page will be available in the inputfield.
      When to use ?
      Let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site.
      Suited for images that are used on multiple pages throughout the site (e.g. icons).
      Other than the native ProcessWire images field, the images here are not stored per page. Only references to images on another page are stored. This has several advantages:
      one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Features
      Images can be manipulated like native ProcessWire images (resizing, cropping etc.) Image names are fully searchable through the API Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message to help you edit those pages and remove references there before you can finally delete the image. How to install and setup
      Download and install this module like any other modules in ProcessWire Create a page in the page tree that will hold your images. This page's template must have an images field Upload some images to the page you created in step 2 Create a new field. As type choose 'Image Reference From Another Page'. Save the field. In 'Details' Tab of the field choose the page you created in step 2 Click Save button Choose the images field name for the field that holds your images (on page template from step 2) Click Save button again Choose whether you want to include child pages of page from step 2 to supply images Add the field to any template You are now ready to use the field View of the inputfield on the page edit screen:

      View of the field settings

      The module can be installed from this github repo. Some more info in the README there, too.
      In my tests it was fairly stable. After receiving your valued feedback, I will eventually add it to the modules directory.
      My ideas for further improvement:
      - add ajax loading of thumbnails
      Happy to hear your feedback!
       
    • By gebeer
      Although the PW backend is really intuitive, ever so often my clients need some assistance. Be it they are not so tech savvy or they are not working in the backend often.
      For those cases it is nice to make some help videos available to editors. This is what this module does.
      ProcessHelpVideos Module
      A Process module to display help videos for the ProcessWire CMS. It can be used to make help videos (screencasts) available to content editors.
      This module adds a 'Help Videos" section to the ProcessWire backend. The help videos are accessible through an automatically created page in the Admin page tree. You can add your help videos as pages in the page tree. The module adds a hidden page to the page tree that acts as parent page for the help video pages. All necessary fields and templates will be installed automatically. If there are already a CKEditor field and/or a file field for mp4 files installed in the system, the module will use those. Otherwise it will create the necessary fields. Also the necessary templates for the parent help videos page and it's children are created on module install. The module installs a permission process-helpvideos. Every user role that should have access to the help video section, needs this permission. I use the help video approach on quite a few production sites. It is stable so far and well received by site owners/editors. Up until now I installed required fields, templates and pages manually and then added the module. Now I added all this logic to the install method of the module and it should be ready to share.
      The module and further description on how to use it is available on github: https://github.com/gebeer/ProcessHelpVideos
      If you like to give it a try, I am happy to receive your comments/suggestions here.
    • By Robin S
      A module created in response to the topic here:
      Page List Select Multiple Quickly
      Modifies PageListSelectMultiple to allow you to select multiple pages without the tree closing every time you select a page.
      The screencast says it all:

       
      https://github.com/Toutouwai/PageListSelectMultipleQuickly
      https://modules.processwire.com/modules/page-list-select-multiple-quickly/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImagePicker. It provides a configurable input field for choosing any type of image from a predefined folder.
      The need for it came up because a client had a custom SVG icon set and I wanted the editors to be able to choose an icon in the page editor.
      It can also be used to offer a choice of images that are used site-wide without having to upload them to individual pages.
      There are no image manipulation methods like with the native PW image field.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImagePicker
      Kudos to @Martijn Geerts. I used his module FieldTypeSelectFile as a base to build upon.
      Here's how the input field looks like in the page editor:

      Hope it can be of use to someone.
      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Eventually this will go in the module directory soon, too.
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://github.com/BernhardBaumrock/RockPDF
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
×
×
  • Create New...