Jump to content
adrian

Tracy Debugger

Recommended Posts

Yes, I thought about passing the Validator entirely to JavaScript. There could be even an "on demand" mode that validates only on clicking on the panel (just an idea).

Apart from the issue I had on one server Tracy loads fast here. I have PHP 7 on most servers and sometimes I get 200-250 ms speed, at least that's what Tracy shows. When I revert PHP version to 5.4 or 5.6, speed increases to 500 and 700 ms. I have to add that I use only a few panels.

  • Like 2

Share this post


Link to post
Share on other sites

There could be even an "on demand" mode that validates only on clicking on the panel (just an idea).

If we keep the Validator panel off and enable it temporarily with the Once option, we get a similar - though not exactly the same - effect, if I'm not mistaken. When we decide to use it more than once, now we can just choose Sticky.  When you switch to Sticky, you do not have to click anywhere anymore just to validate the page once more. To me it looks like a good workflow. An on-demand validation would stay on-demand, but what if we are in a long session of fixing some validation issues? In that case we would need another option to switch between on-demand and automatic in order to save some time and clicks.

Another issue:

The Once and Sticky button features might need some additional polish: currently there is no way to tell apart Sticky and the standard default state, after a while we cannot remember the reason why those checkboxes are on or off. Some sort of color coding might be good to implement to solve this. Say, green is used to indicate the temporary Sticky state. Or maybe an icon (::after selector probably?) An icon is more descriptive, so probably a better solution.

  • Like 1

Share this post


Link to post
Share on other sites

If we keep the Validator panel off and enable it temporarily with the Once option, we get a similar - though not exactly the same - effect, if I'm not mistaken. When we decide to use it more than once, now we can just choose Sticky.  When you switch to Sticky, you do not have to click anywhere anymore just to validate the page once more. To me it looks like a good workflow. An on-demand validation would stay on-demand, but what if we are in a long session of fixing some validation issues? In that case we would need another option to switch between on-demand and automatic in order to save some time and clicks.

I think I mostly agree with you here - the downside to the current option is that requires a page reload (when you click Once or Sticky) to load the Validator panel. An AJAX option would be much quicker - you could have the panel always loaded with no content and a button to trigger the validation request. I am not really sure how much this really matters though - if you decide to do a "Once" validation and you see errors, you'll probably then "Sticky" it until you have things fixed, then "Reset". I think in the end I probably agree with you and won't worry about changing things at the moment :)

Another issue:

The Once and Sticky button features might need some additional polish: currently there is no way to tell apart Sticky and the standard default state, after a while we cannot remember the reason why those checkboxes are on or off. Some sort of color coding might be good to implement to solve this. Say, green is used to indicate the temporary Sticky state. Or maybe an icon (::after selector probably?) An icon is more descriptive, so probably a better solution.

This sounds useful - I am thinking just one icon positioned after each of the default panels so you know what is the set that is defined in the main module config settings. 

I would actually like your thoughts on the current behaviour regarding making some "Sticky" changes and then adding an additional panel "Once" - currently any time you do a "Once" it clears the previous "Sticky" options which I don't think it very helpful or expected. I think I will change this so that on the next reload, the states is restored to the last sticky state, rather than the default state - sound ok?

  • Like 1

Share this post


Link to post
Share on other sites

I would actually like your thoughts on the current behaviour regarding making some "Sticky" changes and then adding an additional panel "Once"...

Additional panel? Well, we already have quite a few of them. Isn't it possible to manage all this in the current panel? Maybe I'm missing something, but it would also be a bit confusing to manage related panels. Currently all panels are completely unrelated, which is probably the expected behavior.

...currently any time you do a "Once" it clears the previous "Sticky" options which I don't think it very helpful or expected. I think I will change this so that on the next reload, the states is restored to the last sticky state, rather than the default state - sound ok?

Sounds OK! Once we can tell those states apart, we will also be able to visualize it :D

Share this post


Link to post
Share on other sites

Additional panel? Well, we already have quite a few of them. Isn't it possible to manage all this in the current panel? Maybe I'm missing something, but it would also be a bit confusing to manage related panels. Currently all panels are completely unrelated, which is probably the expected behavior.

Sorry - poor wording on my part - I am talking about enabling an extra panel (or disabling one) using the "Once" option - hopefully that sentence makes more sense like that :)

Share this post


Link to post
Share on other sites

Aha, sorry! So it was part of the same line of thinking and I should not have separated it. "Enabling" is probaly a better word in this context, but I'm just an English learner... :)

Share this post


Link to post
Share on other sites
but I'm just an English learner

You Europeans make me smile - your English is probably better than mine :)

Latest version comes with a few general tweaks/fixes, but the most significant are related to the Selector panel based on our recent discussions.

It now returns to the "Sticky" state when you reload after a "Once" change (previously, it returned to default from the config settings).

There are also now icons indicating if:

  • the panel is set in the default list in the module config settings ("Tick" icon),
  • the state of the panel is different for the current view, ie you have made a "Once" change (number "1" icon)

In the following example, you can see that:

  • Debug Mode is disabled. Default is enabled (checkbox icon). There is no "1" icon so it is a Sticky setting.
  • ProcesswireInfo is disabled. Default is enabled (checkbox icon), There is a "1" icon so you know it's a "Once" only setting.
  • Validator is enabled. Default is disabled (no checkbox icon). There is a "1" icon so you know it's a "Once" only setting. 

post-985-0-77227200-1462826153_thumb.png

Hope that all makes sense and provides a quick visual of what the current panel settings are and what they will be when the page is reloaded.

  • Like 2

Share this post


Link to post
Share on other sites

 your English is probably better than mine

Well I guess you have no idea how much effort is put  even in simpler replies if you're not a native English speaker :)

  • Like 5

Share this post


Link to post
Share on other sites

Well I guess you have no idea how much effort is put  even in simpler replies if you're not a native English speaker :)

Sorry if that came across the wrong way - I am just always in awe of how great you guys are at being multilingual. It was meant to be a compliment!

I know a little travel Spanish and it seems so hard to get beyond that.

I also remember a teenage German asking me questions about English grammar and I didn't know the answer - I think unfortunately those of us who are from English speaking countries typically don't get the same grounding in languages and their rules - we just know what sounds right without knowing why. That's why in some ways you probably do have a better grasp of English and how it works. And it's such a bastard language with all these weird exceptions to rules - I don't know how anyone ever learns it!

  • Like 2

Share this post


Link to post
Share on other sites

I was just trying to be funny here that's why the smiley. But it's true that it's often hard to put things right, especially because a wrong wording or term can easily modify the meaning.

Otoh you "natives" :) seem to have a good sense for understanding malformed posts :)

  • Like 2

Share this post


Link to post
Share on other sites

A big thumbs up! You did it again Adrian! :)
One teeny-weeny question though: can we have some color coding for the icons please? :P You see, they are rather small (we want to save space, so it is expected), however the tick mark is just a thin line, the number one is also "just a thin tick mark" transformed a little bit, so my I eyes+brain are a bit stretched to their limits when differentiating them.

Speaking of languages: do not expect me to know too much about Hungarian grammar either... When we (try to) learn a language from books, we are forced to learn some grammar too, however, when growing up with it, we do not need to elaborate too much on the inner workings, so only a few of us do so. BTW: if you have the time, you can speed up your learning process by using this: http://ankisrs.net (you might have already tested it, I am currently in the process of building my very first German cards.)

  • Like 1

Share this post


Link to post
Share on other sites

A big thumbs up! You did it again Adrian! :)

One teeny-weeny question though: can we have some color coding for the icons please? :P You see, they are rather small (we want to save space, so it is expected), however the tick mark is just a thin line, the number one is also "just a thin tick mark" transformed a little bit, so my I eyes+brain are a bit stretched to their limits when differentiating them.

Happy to help make this easier to see, but firstly I am wondering if what you are seeing on your setup matches the screenshot above, or if it's different - perhaps there is some CSS at play again that is altering them? If they are the same, perhaps you wouldn't mind playing with them till you're happy with how they look - would save us potentially going back and forward over several different versions. They are both SVG (https://github.com/adrianbj/TracyDebugger/blob/master/PanelSelectorPanel.inc#L124), so it will be easy for you to change the size and color.

Speaking of languages: do not expect me to know too much about Hungarian grammar either... When we (try to) learn a language from books, we are forced to learn some grammar too, however, when growing up with it, we do not need to elaborate too much on the inner workings, so only a few of us do so. BTW: if you have the time, you can speed up your learning process by using this: http://ankisrs.net (you might have already tested it, I am currently in the process of building my very first German cards.)

Thanks for the link - I hadn't seen that - looks pretty cool actually - I'll definitely give it a go.

  • Like 1

Share this post


Link to post
Share on other sites

Happy to help make this easier to see, but firstly I am wondering if what you are seeing on your setup matches the screenshot above, or if it's different - perhaps there is some CSS at play again that is altering them? If they are the same, perhaps you wouldn't mind playing with them till you're happy with how they look - would save us potentially going back and forward over several different versions. They are both SVG (https://github.com/adrianbj/TracyDebugger/blob/master/PanelSelectorPanel.inc#L124), so it will be easy for you to change the size and color.

I would just use fill="green" for Default, fill="orange" for Once (if you prefer the "PW magenta", why not...). I opened the panel in each of my three browsers (Chrome, Firefox and Safari) and it looks quite similar to yours:

post-4029-0-28949100-1462861987_thumb.gi

  • Like 1

Share this post


Link to post
Share on other sites

One more thing I forgot to ask: how can new "users" figure out the what these icons mean?

  • Like 1

Share this post


Link to post
Share on other sites

Thanks - I have made those changes. I also upped the size of the icons a couple of pixels which should also help a little.

One more thing I forgot to ask: how can new "users" figure out the what these icons mean?

I played around with adding a legend to the panel, but it just kind of looked messy and took up too much extra space, so I just added tooltips to the icons - hopefully this helps a little.

  • Like 2

Share this post


Link to post
Share on other sites

Hi, I have just checked it out. May I suggest changes to the <title>s?

Default panel from module config settings
to something like:
turned on in module's settings

"config settings" is sort of word repetition, PW labels the buttons in question "Settings" so it maybe enough. I also tried to use the same point of view in the case of both titles: why one option is turned on or off, so the messages are consistent.

Panel status changed once
to something like:
turned on "Once"
or maybe:
turned on by "Once"
?

I also tried to be short :)

The enlarged icons are a bit easier to recognize and probably about the largest in size we can use. Thank you!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks - I changed them to be close to what you suggested.

The latest version also add the generation times for each panel to the selector panel so you can quickly see if one is very slow.

I have also included some CSS tweaks and some other small bug fixes that I discovered with the validator and users panel.

  • Like 1

Share this post


Link to post
Share on other sites

Just saw that the Validator panel is also loaded in the admin, perhaps it's not really needed there.

Share this post


Link to post
Share on other sites

Just saw that the Validator panel is also loaded in the admin, perhaps it's not really needed there.

It shouldn't be: https://github.com/adrianbj/TracyDebugger/blob/master/TracyDebugger.module#L263

Any ideas why that check is failing for you? 

The Validator and Variables panels are both supposed to be disabled in the admin and are for me.

There are however showing checked in the Selector Panel - working on that now. Actually not sure I can do much about this - don't want to maintain separate cookies for frontend and admin and if it's unchecked when in the admin and you click once or sticky, it would make that change for the frontend as well. I don't think this is a big deal so will leave for the moment.

Share this post


Link to post
Share on other sites

False alarm: I had version 1.3.8. After update it's all fine.

For me showing these checked on Selector Panel is no problem. Though you could solve it by CSS, the admin has "template-admin" class on the body, e.g. hide it.

Share this post


Link to post
Share on other sites

Another notice, hopefully more to the point :) When "Loggin in production mode" is on, Google PageSpeed (and others) report much worse speed scores. I get about 85 vs 95 on the site I'm currently working. This is logical but maybe this could be noted somewhere.

Share this post


Link to post
Share on other sites

Though you could solve it by CSS, the admin has "template-admin" class on the body, e.g. hide it.

Good idea - hiding it might be a decent option - I'll have a think about it.

Another notice, hopefully more to the point :) When "Loggin in production mode" is on, Google PageSpeed (and others) report much worse speed scores. I get about 85 vs 95 on the site I'm currently working. This is logical but maybe this could be noted somewhere.

I am surprised about this - I am not sure why unless you are using a browser extension. Surely with the online version of any of these tools they won't have any Debugger bar code loaded. Am I missing something obvious?

I can imagine that having Tracy running with "Allow Logging in Production Mode" enabled might make a very minor change to scores, but I would expect it to be insigificant.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Adrian,

I'm trying to track down a mysterious issue that affects Tracy Debugger; i have a set of pages all using the same template, and there are a set of 5 of these pages that all exhibit the same problem, the tracy bar doesn't load and i get one of these errors:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 82 bytes) in /home/user/public_html/wire/core/Page.php on line 1611
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in /home/user/public_html/wire/core/Wire.php on line 1048

For all of the other 176 siblings, everything works fine...

This doesn't affect the live site at all, but there does seem to be something odd going on between tracy and these particular pages on the front end, as tracy loads fine on the PW page editor for these pages...

Share this post


Link to post
Share on other sites

Hey Macrura,

What version of TracyDebugger are you running? Also, does it make any difference if you switch from the master to stable version of the Tracy core (in the module config settings).

Also, what happens if you disable all the panels in the module settings. If it works with all panels disabled, please try enabling one at a time. I have a feeling it might be the PW Info panel - any chance you have a large Profields Table on these pages - I just came across an issue with this myself today - the PWInfo panel gets a LOT of data loaded in this situation. I need to figure out a way around this.

Thanks for helping to figure this out.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Adrian, i tried both master and dev, and also tried disabling all panels, but the error persists either way;

These pages do have multiple tables, however the ones that exhibit the error are actually much less populated than some of the pages that have those tables populated.

The tables themselves are only 3-5 columns and max 10 rows.

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 bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
×
×
  • Create New...