Jump to content
adrian

Tracy Debugger

Recommended Posts

10 minutes ago, Macrura said:

Hopefully i set this up right – i created a new permission called tracy-debugger-superuser, then i created a new role called 'developer' and then added that permission to that role; so now only people with the developer role should be able to see the tracy debug bar (?)

I haven't set up that tracy-debugger-superuser yet - that was just an idea at this stage. What I am asking you is whether that approach would be best, or whether it would be better to go with a permission that could be added to certain superusers that limits the panels on their Debug bars.

I think the second option would give more flexibility - what do you think?

Share this post


Link to post
Share on other sites

right - ok thanks, sure - yes, a per-superuser permission is best, to limit the panels, or none at all (sorry for being dense, doing like 10 things at once here..)

  • Like 1

Share this post


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

right - ok thanks, sure - yes, a per-superuser permission is best, to limit the panels, or none at all (sorry for being dense, doing like 10 things at once here..)

 

Ok, check out the latest version. Any panels that are checked here won't be available to superusers (and other users with tracy permission) if they have the "tracy-restricted-panels" permission. Let me know if that works for your needs.

Screen Shot 2016-09-13 at 2.48.50 PM.png

  • Like 2

Share this post


Link to post
Share on other sites

that is really cool - hopefully others find it useful also; i was able to create a 'restricted' role with that permission, and add it to selected superadmins on the project, and now they have a much smaller, restricted set of tracy items – working great! thanks as always!:rolleyes:

  • Like 2

Share this post


Link to post
Share on other sites
3 minutes ago, Macrura said:

that is really cool - hopefully others find it useful also; i was able to create a 'restricted' role with that permission, and add it to selected superadmins on the project, and now they have a much smaller, restricted set of tracy items – working great! thanks as always!:rolleyes:

Sweet - glad you are finding it useful.

I am kinda keen on knowing what panels you use and what panels you restricted them to. 

I have actually been thinking about setting up a poll so I can find out what panels you guys are all using - would be helpful so I know which ones to focus on improving. I don't think this new version of the forums has the poll option though.

  • Like 1

Share this post


Link to post
Share on other sites

@adrian At the moment I do not have the time to test these new "tracy-restricted-panels" permission features, however, may I point out this "strange sounding" title?

Restricted User Disbled Panels (vs e.g. Disbled Restricted-user Panels ?)

English is far from being my mother tongue, nevertheless, if I understand it correctly, then we restrict users to a certain set of panels, and this set of panels can be configured via enabling/disabling them. So it is not the panels that are restricted but the users themselves, because they have restricted access. Or am I mistaken? Sorry for being picky on this one, but I just do not comprehend this title as it sounds ambiguous to me and my proposal is not the best either but I just coud not could up with a better one :)

  • Like 1

Share this post


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

@adrian At the moment I do not have the time to test these new "tracy-restricted-panels" permission features, however, may I point out this "strange sounding" title?

Restricted User Disbled Panels (vs e.g. Disbled Restricted-user Panels ?)

English is far from being my mother tongue, nevertheless, if I understand it correctly, then we restrict users to a certain set of panels, and this set of panels can be configured via enabling/disabling them. So it is not the panels that are restricted but the users themselves, because they have restricted access. Or am I mistaken? Sorry for being picky on this one, but I just do not comprehend this title as it sounds ambiguous to me and my proposal is not the best either but I just coud not could up with a better one :)

How about:

Disabled Panels for Restricted Users or Panels Disabled for Restricted Users

  • Like 1

Share this post


Link to post
Share on other sites

Hello adrian,

I have discovered a problem with the HTML-validator:

Screenshot_20.jpg

I always get this message if I try to validate a page. I use the latest PW(3.0.33) and the latest TracyDebugger. I have added this panel permantently and my pages are always reachable. Can you confirm this behaviour?

Best regards

Share this post


Link to post
Share on other sites
28 minutes ago, Juergen said:

I use the latest PW(3.0.33) and the latest TracyDebugger.

Me too, but it works for me as it did before. Maybe something on your end?

Share this post


Link to post
Share on other sites

I dont know! If I click the link directly I can open the validator page. Could there be a maximum of queries responsible for this behaviour.

It also shows me the Tracy toolbar divs as error if I click the link manually.

Screenshot_21.jpg

Share this post


Link to post
Share on other sites

Hi @Juergen - I think what you have come across is a POST size limit on the validator.nu site. You can confirm this by entering:

bd(static::$pageHtml,'pageHTML', array('maxLength' => 1000000));

as the last line of this function: https://github.com/adrianbj/TracyDebugger/blob/master/TracyDebugger.module#L784

You may need the Dumps Recorder - I didn't check if the standard dumps panel retains this dump.

If you then copy and paste this into: https://validator.nu/ using the "Text Field" option. You'll likely get a "bad gateway" error. If so, then that is the issue, although I am not sure what to do about it at the moment - I don't know whether they recently changed that limit (I have asked here: https://github.com/validator/validator/issues/371) - I am also seeing it here depending on the size of DOM of my page - horst's ALIF module puts it over the limit for me.

As for the tracy-debug divs being shown when clicking the link, that is confusing and a little concerning as it looks like the validator is getting access to the Tracy debug bar, which is shouldn't have. Any chance you could let me know the URL of the site (PM if you want) so I can take a look at that?

 

  • Like 2

Share this post


Link to post
Share on other sites

Hello adrian,

thanks for your response. I am sure that it should be the limit. For testing the site with guest access I have adust my settings to show the toolbar also for non logged in users (especially for testing some features which are also reachable without being logged in). In this case you will reach the limit quite fast. I will turn this back and I will see how it behave. It is not a real problem.

As for the tracy-debub divs I can say that they were not validated in the panel. This behaviour is only by clicking the link directly.

I will test it for a while without showing the toolbar on frontend for non logged in users and post the result here afterwards.

Share this post


Link to post
Share on other sites

Hi @Juergen - please try the latest commit - I switched it from using validator.nu to validator.w3.org/nu/ and it seems to be fine now. They both use the same checker so hopefully everything will be fine. I have a feeling that this might be a bit of a moving target though, so if anyone ever comes across issues with it, let me know and I'll try to get it working again.

  • Like 2

Share this post


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

I have a feeling that this might be a bit of a moving target though

As long as we hit the target we are quite happy with it, I think :D

Oh, and thanks a million as always!

  • Like 1

Share this post


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

Hi adrian,

it works now as expected!!!! :)  Thanks!!

Awesome!

It also seems like the w3.org version that we're now using is significantly faster - I was typically getting 750 to 1000ms times on the validator.nu service - now it's around 500ms.

  • Like 1

Share this post


Link to post
Share on other sites

can anybody tell me what is wrong with this code?

$i = 1;
while ($i <= 10) {
    echo $i++;
}

it works inside a template file, but inside the console it leads to endless 100% cpu

  • Like 2

Share this post


Link to post
Share on other sites

Not sure yet, but note that it works fine in the Template Editor - just use the Test button / CTRL+Enter. 

Let me see if I can see out why the console is misbehaving with that. The console is ajax driven, whereas the template editor/tester isn't.

Share this post


Link to post
Share on other sites

I found it - the "++" is being lost, so it's processing:

echo $i  ;

hence the continuous loop!

 

Must be some encoding issue. I was url encoding, but I stopped doing that to fix another issue. I will revisit and see what I can do to fix.

Thanks for reporting.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, bit of a rushed fix, but hopefully I haven't broken anything else regarding console encoding.

Please let me know how you go with the latest version.

Share this post


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

works! thank you. i hope it does not affect any other parts of tracy :)

The changes I made will only affect the console - it's just a matter of whether the encoding change breaks anything else. I checked the pageNameUTF8 sanitizer (because it was the issue that you had with that which resulted in the change that deleted "+" signs) and that still works great, so hopefully we are good :)

  • Like 2

Share this post


Link to post
Share on other sites

It has always been good practice to note any 3rd party modules that you are using when posting an issue/bug report for the PW core, but after seeing @ryan's recent note about issues: https://github.com/processwire/processwire/issues/8 - "Indicate any 3rd party modules that are installed.", I thought it might be helpful to make it easy to get a formatted list of installed modules that you can simply copy/paste into your issue report.

The latest version of Tracy includes an update to the ProcessWire Info panel that provides a new "Versions List" section that lists all modules and their version numbers in a textarea to make it easy to copy/paste. It also shows the PW, PHP, and MySQL versions.

Screen Shot 2016-09-22 at 11.01.07 AM.png

For those of you updating from an existing version of Tracy, you'll need to check this new panel section in the module config settings:

Screen Shot 2016-09-22 at 11.04.24 AM.png

  • Like 6

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      A community member raised a question and I thought a new sanitizer method for the purpose would be useful, hence...
      Sanitizer Transliterate
      Adds a transliterate method to $sanitizer that performs character replacements as defined in the module config. The default character replacements are based on the defaults from InputfieldPageName, but with uppercase characters included too.
      Usage
      Install the Sanitizer Transliterate module.
      Customise the character replacements in the module config as needed.
      Use the sanitizer on strings like so:
      $transliterated_string = $sanitizer->transliterate($string);
       
      https://github.com/Toutouwai/SanitizerTransliterate
      https://modules.processwire.com/modules/sanitizer-transliterate/
       
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version to 2.10, add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By thomasaull
      I created a little helper module to trigger a CI pipeline when your website has been changed. It's quite simple and works like this: As soon as you save a page the module sets a Boolean via a pages save after hook. Once a day via LazyCron the module checks if the Boolean is set and sends a POST Request to a configurable Webhook URL.
      Some ideas to extend this:
      make request type configurable (GET, POST) make the module trigger at a specified time (probably only possible with a server cronjob) trigger manually Anything else? If there's interest, I might put in some more functionality. Let me know what you're interested in. Until then, maybe it is useful for a couple of people 🙂
      Github Repo: https://github.com/thomasaull/CiTrigger
    • By Robin S
      I created this module a while ago and never got around to publicising it, but it has been outed in the latest PW Weekly so here goes the support thread...
      Unique Image Variations
      Ensures that all ImageSizer options and focus settings affect image variation filenames.

      Background
      When using methods that produce image variations such as Pageimage::size(), ProcessWire includes some of the ImageSizer settings (height, width, cropping location, etc) in the variation filename. This is useful so that if you change these settings in your size() call a new variation is generated and you see this variation on the front-end.
      However, ProcessWire does not include several of the other ImageSizer settings in the variation filename:
      upscaling cropping, when set to false or a blank string interlace sharpening quality hidpi quality focus (whether any saved focus area for an image should affect cropping) focus data (the top/left/zoom data for the focus area) This means that if you change any of these settings, either in $config->imageSizerOptions or in an $options array passed to a method like size(), and you already have variations at the requested size/crop, then ProcessWire will not create new variations and will continue to serve the old variations. In other words you won't see the effect of your changed ImageSizer options on the front-end until you delete the old variations.
      Features
      The Unique Image Variations module ensures that any changes to ImageSizer options and any changes to the focus area made in Page Edit are reflected in the variation filename, so new variations will always be generated and displayed on the front-end.
      Installation
      Install the Unique Image Variations module.
      In the module config, set the ImageSizer options that you want to include in image variation filenames.
      Warnings
      Installing the module (and keeping one or more of the options selected in the module config) will cause all existing image variations to be regenerated the next time they are requested. If you have an existing website with a large number of images you may not want the performance impact of that. The module is perhaps best suited to new sites where image variations have not yet been generated.
      Similarly, if you change the module config settings on an existing site then all image variations will be regenerated the next time they are requested.
      If you think you might want to change an ImageSizer option in the future (I'm thinking here primarily of options such as interlace that are typically set in $config->imageSizerOptions) and would not want that change to cause existing image variations to be regenerated then best to not include that option in the module config after you first install the module.
       
      https://github.com/Toutouwai/UniqueImageVariations
      https://modules.processwire.com/modules/unique-image-variations/
    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      ProcessWire-Module: http://modules.processwire.com/modules/page-access-releasetime/
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
×
×
  • Create New...