Jump to content
adrian

Tracy Debugger

Recommended Posts

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

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      TrelloWire
      This is a module that allows you to automatically create Trello cards for ProcessWire pages and update them when the pages are updated. This allows you to setup connected workflows. Card properties and change handling behaviour can be customized through the extensive module configuration. Every action the module performs is hookable, so you can modify when and how cards are created as much as you need to. The module also contains an API-component that makes it easy to make requests to the Trello API and build your own connected ProcessWire-Trello workflows.
      Features
      All the things the module can do for you without any custom code: Create a new card on Trello whenever a page is added or published (you can select applicable templates). Configure the target board, target list, name and description for new cards. Add default labels and checklists to the card. Update the card whenever the page is updated (optional). When the status of the card changes (published / unpublished, hidden / unhidden, trashed / restored or deleted), move the card to a different list or archive or delete it (configurable). You can extend this through hooks in many ways: Modifiy when and how cards are created. Modify the card properties (Target board & list, title, description, et c.) before they are sent to Trello. Create your own workflows by utilizing an API helper class with many convenient utility methods to access the Trello API directly. Feedback & Future Plans
      Let me know what you think! In particular:
      If you find any bugs report them here or on Github, I'll try to fix them. This module was born out of a use-case for a client project where we manage new form submissions through Trello. I'm not sure how many use-cases there are for this module. If you do use it, tell me about it! The Trello API is pretty extensive, I'll try to add some more helper methods to the TrelloWireApi class (let me know if you need anything in particular). I'll think about how the module can support different workflows that include Twig – talk to me if you have a use-case! Next steps could be a dashboard to manage pages that are connected to a Trello card, or a new section in the settings tab to manage the Trello connection. But it depends on whether there is any interest in this 🙂 Links
      Repository on Github Complete module documentation (getting started, configuration & API documentation) [Module directory pending approval] Module configuration

    • By MoritzLost
      Process Cache Control
      This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Plans for improvements
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots


    • By Macrura
      PrevNextTabs Module
      Github: https://github.com/outflux3/PrevNextTabs
      Processwire helper modules for adding page navigation within the editor.
      Overview
      This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)
      Usage
      This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.
      Warnings
      If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.
      For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.
      http://modules.processwire.com/modules/prev-next-tabs/
    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

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