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

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 eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild. 
      EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Optional step value (Read more) Optional manual override of the selected value (will still adhere to the rules above) Configurable rounding of manually entered values (floor, round, ceil, disable) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant  
      Changelog
      005 (current version)
      - Fix bug where the Inputfield would not work properly within repeaters / repeater matrices
      004
      - Make rounding of manually entered values configurable (floor, round, ceil or disable)
      - Fix small JS bug when the value-display field was not displayed
      - Update README
      003
      - Code cleanup, add some ModuleInfo data & LICENSE
      - Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/)
      002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional
      001
      - Initial release
       
      Thanks!
       
       
    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...