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 Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.56
      Composer: rockett/jumplinks
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! :)
    • By BitPoet
      As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now:
      InputfieldSlideToggle
      Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary.
      Status
      Still very alpha, use with caution!
      Features / Field Settings
      Size
      You can render the toggles in four different sizes: small, medium, large and extra large.
      Off Color
      Currently, "unchecked" toggles can be displayed either in grey (default) or red.
      On Color
      "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red.
      Screenshots

      Some examples with checkbox label


      View all Size and Color Combinations
      Small toggles Medium toggles Big toggles Extra big toggles  









    • By Orkun
      Hi Guys
      I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer.
      So I duplicated the module and placed it under /site/modules/.
      I have added 3 new Settings to the InputfieldDatetime Module.
      1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING

       
      2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING

       
      3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY

       
      The Problem
      Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right.
      What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select.
      But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again.
      The time select doesn't get change when you select a date 1 time and don't close the picker.
      Here is the whole extended InputfieldDatetime Module.
      The Files that I have changed:
      InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version  
      Thats the Part of the JS that is not working correctly:
      if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is?
      InputfieldDatetime.zip
       
      Kind Regards
      Orkun
    • By teppo
      This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened.
      At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide
      https://modules.processwire.com/modules/process-changelog/
      https://github.com/teppokoivula/ProcessChangelog
      How does it work?
      Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table.
      How do you use it?
      When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while.
      For detailed installation instructions etc. see README.md.
       


    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




×
×
  • Create New...