Jump to content
adrian

Tracy Debugger

Recommended Posts

No more issue on Windows.

what I need is the username of the ID returned by the "fileowner" function

check my last comment/edit.

thanks for the update sir.

Share this post


Link to post
Share on other sites

Hi Adrian, thanks for releasing version 0.80 

I installed version 0.80; error message is gone and immediately the Tracy Toolbar showed up.

post-1069-0-63421100-1456500790_thumb.jp

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone,

The latest version fixes the error on Windows, although I have had to remove the "Owner" details if that function isn't available. Thanks for the suggestion Kongondo, but I think it is more complicated than using "getenv". That allows you to get the current running user - what I need is the username of the ID returned by the "fileowner" function. It also seems that perhaps "fileowner" doesn't even work as expected on Windows: " - http://www.w3schools.com/php/func_filesystem_fileowner.asp

I don't have a Windows dev environment to test, so if there is someone out there who wants to test this and submit a working PR, I'll happily include it.

Please let me know if anyone has any problems with the latest version.

I'm on windows + IIS. "Apache is running as user: nt authority\iusr" is correct (I would change Apache with Web server). About permissions: I tested with /site/config.php. The owner of the file is iusr user and has read only access. No one else has access so I don't know what to say about "0666 Readable by more than just the owner." Exists, Readable and Writeable columns seems to be correct.

Share this post


Link to post
Share on other sites

Thanks for the feedback @matjazp,

I am definitely still tweaking this stuff, but I do think that statement is correct because 0666 means that all users can read and write . If you read Ryan's recommendations for config.php (https://processwire.com/docs/security/file-permissions/#securing-your-site-config.php-file) he states that it should only be readable by the apache user, and no others. Ideally it should actually be 0400 or 0440 so that it isn't even writeable by apache, but that may not always be convenient.

I will add that I am not sure I expect to ever has these status/notes comments perfect, but I would like them to be a useful flag for obvious problems. I definitely want as much feedback on this as possible, so thanks. 

Share this post


Link to post
Share on other sites

Well, now I tested with install.php. I made the owner of the file iusr and iusr is the only one with read permissions, no one else. 

Install File /install.php ✓ ✓   0666 Failure Should be deleted for security.

Yes, install.php should be deleted for security, file exist, is readable, not writeable, but 0666? 

Share this post


Link to post
Share on other sites

Well, now I tested with install.php. I made the owner of the file iusr and iusr is the only one with read permissions, no one else. 

Install File /install.php ✓ ✓   0666 Failure Should be deleted for security.

Yes, install.php should be deleted for security, file exist, is readable, not writeable, but 0666? 

Sorry, are you saying that it is reporting that install.php is set to 666, but that is not actually the case? What permissions is listed when you:

ls -al install.php

Share this post


Link to post
Share on other sites

There is no ls command on windows. There is icacls that shows:

C:\inetpub\wwwroot>icacls install.php
install.php: Access denied.
Successfully processed 0 files; Failed processing 1 files

Access is denied because I (my login account) don't have access to the file. The only user with access to the file is the user under which web server is running. On linux that would be 400 and file is owned by user apache. 

If I change the ownership to my account and run icacls again:

C:\inetpub\wwwroot>icacls install.php
install.php NT AUTHORITY\IUSR:(RX)

Successfully processed 1 files; Failed processing 0 files

It shows that iusr user has read+execute access.

I wouldn't bother too much with windows permissions, they are more complicated than on linux, and maybe wouldn't even show permission, status and notes columns? Many php functions don't give reliable results on windows (I think that chmod does nothing on windows, but haven't tested...). There are also differences with rename/move operations etc. 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the feedback @matjazp - sorry, I spaced on "ls" not being available. I forgot that permissions are not the same on Windows - it's been a while for me :)

As you say, maybe I shouldn't bother showing them. I also wonder how much it really matters - presumably 99% of Windows use cases are dev environments - is anyone actually hosting a live site on a Windows server these days? Anyone else with any Windows input on this?

New version just posted has a new "Output Mode" indicator/panel - as a reminder of what Tracy mode you are in. If you are in DETECT mode, it will report the actual mode that Tracy determined is appropriate based on your IP Address.

I also added a phpinfo() output to a new section on the Diagnostics panel - maybe this is too much? I don't really want to make the config settings anymore complicated - ie I don't really want to add the ability to determine what sections are included in a multi-section panel, but I would like everyone's feedback on this. Should the phpinfo section be removed, or maybe should it be its own panel - maybe one that you typically leave disabled, but enable if you need to take a quick look? Any thoughts?

Share this post


Link to post
Share on other sites

As you say, maybe I shouldn't bother showing them. I also wonder how much it really matters - presumably 99% of Windows use cases are dev environments - is anyone actually hosting a live site on a Windows server these days? Anyone else with any Windows input on this?

As I said, I would not show permission, status and notes columns since they show wrong info on windows. Exist/readable/writeable columns are ok. I can't test what statuses are displayed on linux box, but flaging read/orange/green is also not trivial. If you want to be able to upgrade PW version using ProcessWireUpgrade Module, /wire has to be writeable and if that user wanted to do then it should be marked green (or orange), not red (I don't make /wire writeable in production). If you want to upgrade site modules, than /site/modules has to be writeable etc. I would limit phpinfo() just for admins. 

I'm hosting 3 live sites on Windows server for more than a year, 2 more to come. No problems so far.

  • Like 2

Share this post


Link to post
Share on other sites

presumably 99% of Windows use cases are dev environments / the phpinfo section any thoughts?

Yes I'm only developing on windows and host on linux. I like the new phpinfo section, it's not in the way and it saves me

oploading my own php scripts.

  • Like 2

Share this post


Link to post
Share on other sites

@adrian: I have a running PW 3 now, and played a little with Tracy. Really, really useful. Thank's for that, (also to @tpr!)

Regarding the configuration and features: Personally, I would like to only have those features visible / enabled, I currently need. phpinfo is definetly not one of them. I think when I use 1000 times the debugger, I would need 2 times the phpinfo. :)

What's about a single and simple ASM in the configscreen, that lets the user enable / disable features?

I have done it that way with ALIF, I don't think it is to much confusing or overwhelming. It would need one ASM in the configscreen and one additional line in your render method: https://github.com/horst-n/AdminLinksInFrontend/blob/master/AdminLinksInFrontend.module#L1437

Anyway, with or without configurable features, it's a very useful module, especially for remote debugging (on live servers) !! ^-^:)

  • Like 2

Share this post


Link to post
Share on other sites

As I said, I would not show permission, status and notes columns since they show wrong info on windows. Exist/readable/writeable columns are ok. I can't test what statuses are displayed on linux box, but flaging read/orange/green is also not trivial. If you want to be able to upgrade PW version using ProcessWireUpgrade Module, /wire has to be writeable and if that user wanted to do then it should be marked green (or orange), not red (I don't make /wire writeable in production). If you want to upgrade site modules, than /site/modules has to be writeable etc. I would limit phpinfo() just for admins. 

I'm hosting 3 live sites on Windows server for more than a year, 2 more to come. No problems so far.

Thanks - I'll revisit these shortly. As you say, even on Linux it is still not trivial getting the status flagging correct, but I guess I will need to disable on Windows and tweak regarding /wire - I forgot about it needing to be writable when using the upgrade module.

 

@adrian: I have a running PW 3 now, and played a little with Tracy. Really, really useful. Thank's for that, (also to @tpr!)

Regarding the configuration and features: Personally, I would like to only have those features visible / enabled, I currently need. phpinfo is definetly not one of them. I think when I use 1000 times the debugger, I would need 2 times the phpinfo. :)

What's about a single and simple ASM in the configscreen, that lets the user enable / disable features?

I have done it that way with ALIF, I don't think it is to much confusing or overwhelming. It would need one ASM in the configscreen and one additional line in your render method: https://github.com/horst-n/AdminLinksInFrontend/blob/master/AdminLinksInFrontend.module#L1437

Anyway, with or without configurable features, it's a very useful module, especially for remote debugging (on live servers) !! ^-^:)

Thanks for the feedback horst - really appreciated.

I have split PHPInfo into its own panel so it can be easily disabled in the config settings. BTW I do already have an ASM field handling the display of each panel - I just didn't want to get into the various sections in each panel. I am not actually convinced about the ASM choice over a simple checkbox. It's nice having the ability to order panels, but it's harder to quickly see which ones aren't selected. As users upgrade they won't necessarily know there are new panels.

The latest version also includes some CSS tweaks to the panels - I think they are a little friendlier now.

I am contemplating adding more panels:

  1. Available upgrades: core and site modules
  2. Data from Google Analytics - like realtime visitors and other timely stuff
  3. MySQL info - number of current connections and other available info
  4. Custom links panel - lets you define links and link text - maybe direct link to analytics for the site, or whatever really.
  5. Custom panel - you can output anything you want here - it would have full access to wire(). This would be kinda like a permanent barDump() panel with the output defined from the config settings. Or it could be a set of instructions, or a direct link to edit a specific page in the admin, or whatever.

Some of these are probably overkill - just brainstorming! Any thoughts on these, or do you have ideas for others?

I am also considering having separate permissions for each panel so that if you allow non-superusers access, you could hide all the debugging/error reporting stuff and just display some of these custom panels to site editors.

Does anyone think this would be useful, or should all authorized users be able to see everything?

Share this post


Link to post
Share on other sites

  

BTW I do already have an ASM field handling the display of each panel - I just didn't want to get into the various sections in each panel. I am not actually convinced about the ASM choice over a simple checkbox. It's nice having the ability to order panels, but it's harder to quickly see which ones aren't selected.

I ask that you please somehow keep the ability to order the panels.

  • Like 2

Share this post


Link to post
Share on other sites

No problem - I can stick with the ASM option - I just wasn't sure whether anyone was using the ordering option - now I know you are, it's only a small inconvenience to allow that ability.

  • Like 1

Share this post


Link to post
Share on other sites

Hey Adrian. This is looking more awesome by the day. I have to agree with the boys though...It can feel a little overwhelming viewing the configurations' GUI. I agree that something simpler would work better. I would go with ASM as well, or some collapsed fieldsets to hide stuff if possible.

As for contemplating adding these two panels:

  1. Available upgrades: core and site modules
  2. Data from Google Analytics - like realtime visitors and other timely stuff

...IMHO, I think these two are overkill. One, they are a 'digression' from the 'debugger' ball park, which is the core aim of this module. Secondly, we already have other modules that take care of those needs....to some extent. My suggestion is to only stick to tools/features that aid in debugging. Thanks!

  • Like 6

Share this post


Link to post
Share on other sites
It can feel a little overwhelming viewing the configurations' GUI. I agree that something simpler would work better. I would go with ASM as well, or some collapsed fieldsets to hide stuff if possible.

Sorry, I think I might be on a different wavelength to you guys - I already have the ASM for selecting and sorting the panels to be displayed. What other settings do you think would benefit from an ASM options? I honestly don't see it being a useful interface (compared with checkboxes) unless you need to have them sortable, or if there are a LOT of options - such that there are just too many checkboxes. But I am definitely keen to hear which ones you think would be better as ASM.

I can definitely see that some collapsed fieldsets could be helpful to organize the settings into related sections - I'll have a think about this and figure out which settings belong together.

...IMHO, I think these two are overkill. One, they are a 'digression' from the 'debugger' ball park, which is the core aim of this module. Secondly, we already have other modules that take care of those needs....to some extent. My suggestion is to only stick to tools/features that aid in debugging.

I do have a habit of getting carried away with too many settings/options - thanks for reigning me in  :)

Thanks again for the feedback - we all work and debug differently so it's great to hear what you guys want for this - don't be shy!

Share this post


Link to post
Share on other sites

Maybe creating a 1/4 and 3/4 columns in the admin, where the first would hold the asm select of the submodules, and the other their settings would make the page structure more logical.

I'm not sure the asm select can do showIf things, that would be the best. I guess this would satisfy those who needing a cleaner UI. Personally I'm fine with the current one though, it's an admin page after all.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your thoughts @tpr - I am going to take a look at the settings in the next couple of days and clean them up a little.

In the meantime, the latest version has some enhancements to the PW Info Panel. In particular, the "Fields List" section has been extended to be "Fields List & Values".

It now additionally shows:

  • some key Settings (at the moment just the maxFiles value, but might add some other key ones at some point)
  • the type of value that is returned: object, string, integer, etc
  • the value of the field - which is really nice for easily seeing what properties are available - see the phone_number in the screenshot for a useful example.

post-985-0-71538900-1456646916_thumb.png

  • Like 2

Share this post


Link to post
Share on other sites

+1 for checkboxes and easily discoverable options. I find that settings pages like this are not visited too often and I tend to forget what I should look for when I need to change settings. When I have only one loooong page I can at least use the browser's find feature to quickly look for what I am possibly after :)

I also like that the settings page is full of comments that are not hidden, because this way I am reminded to read them. (I often forget to read tooltips and similar UI help solutions since they are initially hidden, conceptually.)

All in all, I agree with tpr that it is an "admin page after all" and most importantly a page that is (should be) used by developers only.

  • Like 1

Share this post


Link to post
Share on other sites
+1 for checkboxes and easily discoverable options.

Yeah I agree - maybe I need to implement something like this (http://jsfiddle.net/PtskU/) as a new Inputfieldtype in PW. ASM's just don't always cut it.

Share this post


Link to post
Share on other sites

Sorry, I think I might be on a different wavelength to you guys - I already have the ASM for selecting and sorting the panels to be displayed. .

My bad. Would you believe I totally missed that! 

The 'problem/challenge' with ASM select (to organise the other settings in the backend GUI) is you won't be able to add notes, instructions, etc next to each option (not without a hook), so I see your point @adrian about it not being a better option compared to checkboxes.

I agree that this is an admin page so, @adrian, don't spend more time than you should on it :-). Having said that, a small confession (not a criticism in any way!!!), I get 'bothered' by grid/columns, that don't balance  :P ...In a single table/grid, I like all 'rows' to have the same number of columns if possible. In this case, I would have used collapsible fieldsets, with similar features grouped together under one fieldset, each single featere in its own row. Don't mind me, it's just me being weird. .   I spent too much time getting bothered by Menu Builder and Matrix settings not 'balancing'  ;)  :) 

  • Like 1

Share this post


Link to post
Share on other sites

I think I found a typo that causes a server error 500 on the host, at least that is how it looks when reading the error message.

This is what I did:

a) I moved a dev site with tracy debugger enabled from my laptop to my host

b) Online the site would not open: We're sorry! The server encountered an internal error and was unable to complete

    your request. Please try again later. error 500

c) Then I disabled tracy debugger in the dev site on my laptop and moved again to my host

d) Now the site opened online

e) Online I went into the backend and enabled tracy debugger

f) Then this error came up and I have no longer backend access nor the site opens:

Parse Error: syntax error, unexpected '[' (line 42 of /home/www/mysite.com/site/modules/TracyDebugger/PerformancePanel/Register.php)

Edit: I looked at line 42 and to me everything looks normal there.

Share this post


Link to post
Share on other sites

Is the server running php 5.4? This does suspiciously look like a 5.3 install, which doesn't support short array notation with [].

  • Like 3

Share this post


Link to post
Share on other sites

Is the server running php 5.4? This does suspiciously look like a 5.3 install, which doesn't support short array notation with [].

@LostKobrakai

You were right, the host had php 5.3 configured, but changing it to php 5.4 did not make the problem go straight away.

Maybe still some cache somewhere. I had to empty out config.php in the site folder, reload the pages, and put config.php

back. Maybe there is a better way for doing this but works for me. After that everything worked.

So in the end it was the old php 5.3 on the host like you said.

  • Like 1

Share this post


Link to post
Share on other sites

Sorry about that - I already adjusted one short array syntax issue with the Performance panel plugin. I'll take care of that one too - update coming shortly.

  • Like 1

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