Jump to content

Tracy Debugger


adrian

Recommended Posts

This is really useful again Adrian, thanks! However, be careful. If you show us what can be achieved, we might demand more and more and even more :P:D Just to show you what I mean, here is the WooCommerce "System Status" report (certain parts are deleted, such as the list of plugins):

Spoiler

 

WordPress Environment

Home URL:

 

https://example.com

Site URL:

 

https://example.com/live

WC Version:

 

2.6.4

Log Directory Writable:

 

 .../public_html/live/wp-content/uploads/wc-logs/

WP Version:

 

4.6.1

WP Multisite:

 

WP Memory Limit:

 

768 MB

WP Debug Mode:

 

 

WP Cron:

 

 

Language:

 

en_US

Server Environment

Server Info:

 

Apache

PHP Version:

 

5.6.26

PHP Post Max Size:

 

128 MB

PHP Time Limit:

 

120

PHP Max Input Vars:

 

3000

cURL Version:

 

7.50.3, OpenSSL/1.0.2h

SUHOSIN Installed:

 

MySQL Version:

 

5.6.28

Max Upload Size:

 

128 MB

Default Timezone is UTC:

 

 

fsockopen/cURL:

 

 

SoapClient:

 

 

DOMDocument:

 

 

GZip:

 

 

Multibyte String:

 

 

Remote Post:

 

 

Remote Get:

 

 

Database

WC Database Version:

 

2.6.4

 

woocommerce_sessions

 

 

woocommerce_api_keys

 

 

woocommerce_attribute_taxonomies

 

 

woocommerce_downloadable_product_permissions

 

 

woocommerce_order_items

 

 

woocommerce_order_itemmeta

 

 

woocommerce_tax_rates

 

 

woocommerce_tax_rate_locations

 

 

woocommerce_shipping_zones

 

 

woocommerce_shipping_zone_locations

 

 

woocommerce_shipping_zone_methods

 

 

woocommerce_payment_tokens

 

 

woocommerce_payment_tokenmeta

 

 

Settings

Force SSL:

 

 

Currency

 

USD ($)

Currency Position

 

left

Thousand Separator

 

,

Decimal Separator

 

.

Number of Decimals

 

2

WC Pages

Shop Base:

 

#555 - /shop/

Cart:

 

#558 - /cart/

Checkout:

 

#571 - /checkout/

My Account:

 

 Page not set

Taxonomies

Product Types:

 

external (external), grouped (grouped), simple (simple), variable (variable)

Theme

Name:

 

Storefront child

Version:

 

1.1

Author URL:

 

http://szabesz.hu

Child Theme:

 

 

Parent Theme Name:

 

Storefront

Parent Theme Version:

 

2.0.7 – 2.1.2 is available

Parent Theme Author URL:

 

https://woocommerce.com/

WooCommerce Support:

 

 

 

 

 

Similar to the above is the diagnostics info of another WP plugin:

 

Spoiler

 

 Server Settings

 

General

 

Operating System

Linux

Timezone

UTC   This is a WordPress setting

Server Time

2016-09-22 18:48:21

Web Server

Apache

APC Enabled

No

Root Path

.../public_html/live/

ABSPATH

.../public_html/live/

Plugins Path

.../public_html/live/wp-content/plugins

Loaded PHP INI

/usr/local/php56/lib/php.ini

Server IP

x.x.x.x

Client IP

x.x.x.x

WordPress

Version

4.6.1

Language

en-US

Charset

UTF-8

Memory Limit

512M (Max 768M)

PHP

Version

5.6.26

SAPI

cgi-fcgi

User

user

Safe Mode

Off

Memory Limit

768M

Memory In Use

76.00 MB

Max Execution Time

120

Shell Exec

Is Supported

Shell Exec Zip

Is Supported

MySQL

Version

5.6.28

Charset

utf8

Wait Timeout

60

Max Allowed Packets

33554432

msyqldump Path

/usr/bin/mysqldump

Server Disk

Free space

16.28% -- 377.38GB from 2.26TB

Note: This value is the physical servers hard-drive allocation. 

On shared hosts check your control panel for the 'TRUE' disk space quota value.

 

 

 

 

I copied over these just to give you some ideas should you find the time to improve this new feature. It would help forum support as well in some cases.

Edited by szabesz
typo
  • Like 1
Link to comment
Share on other sites

I am sure there are some good ideas in there @szabesz - I don't want to get too carried away, because a lot of that info is available from the PHPInfo panel, but I am certainly open to requests for things to add.

I did just update it with Apache version because this may be relevant when debugging htaccess issues.

  • Like 1
Link to comment
Share on other sites

4 minutes ago, adrian said:

I don't want to get too carried away

I see, sure, there is no need to copy over too much stuff from PHPInfo, maybe just the most important things to get a quick general overview. (memory/file size related stuff, and other things that we sometimes trip over)

Link to comment
Share on other sites

After activating the version panel I got the following error message:

Call to undefined function apache_get_version() in ......./web/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireInfoPanel.inc on line 408

Edit: Its still there after disabling the version list, so its maybe a problem with the latest version.

  • Like 1
Link to comment
Share on other sites

7 hours ago, Juergen said:

After activating the version panel I got the following error message:

Call to undefined function apache_get_version() in ......./web/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireInfoPanel.inc on line 408

Edit: Its still there after disabling the version list, so its maybe a problem with the latest version.

Sorry @Juergen - it looks like that function doesn't exist in all environments - Windows perhaps? The latest version checks if it exists before trying to use it. There was also a problem with the checkbox not actually disabling this panel which is also fixed now.

Can you please confirm that this fixes it for you, both checked and unchecked?

Thanks!

  • Like 1
Link to comment
Share on other sites

Pretty stoked by this morning's update :)

The Versions List now has a "Copy for Github" button, as well as a "Copy plain text" button.

Screen Shot 2016-09-24 at 7.23.00 AM.png

 

The Github button copies MarkDown code to your clipboard that results in this formatted output:

Screen Shot 2016-09-24 at 5.08.12 AM.png

Screen Shot 2016-09-24 at 5.08.53 AM.png

Screen Shot 2016-09-24 at 5.09.34 AM.png

Absolutely no excuses now for not including all your server and module info details in your Github Issue reports.

Please let me know if anyone has any problems or suggestions for improvements / things to include.

  • Like 1
Link to comment
Share on other sites

2 minutes ago, tpr said:

Nice! What did you use for copy? As I know some browsers doesn't allow interacting with the clipboard.

https://clipboardjs.com/

Screen Shot 2016-09-24 at 5.18.29 AM.png

 

Of course I could have just put the markdown code in the textarea, but I wanted to keep that simply for viewing and copy/pasting into the forum (in a spoiler), etc.

  • Like 2
Link to comment
Share on other sites

I am tempted to add a few key PHP settings in another sub-section of this list - I think it could really help with quickly identifying some issues.

What do you guys think of this list of metrics?

  • mod_rewrite
  • mod_security
  • allow_url_fopen
  • post_max_size
  • upload_max_filesize
  • max_input_time
  • max_execution_time
  • max_input_vars
  • memory_limit

Adding in @ryan and @horst to see if you guys have any other specific Apache/PHP settings that you think would be useful to include in Debug info. I think these (together with the pw/php/mysql/apache and module version details mentioned above should cover most common issues (including image uploading problems).

Btw, if you're confused what I am talking about, scan a few posts up to see this new feature in Tracy for copying a Github-friendly formatted collpased/expandable list of debug info for inclusion in Github Issue reports.

  • Like 3
Link to comment
Share on other sites

Very good initiative @adrian!

What I think could be useful is:

max_execution_time  (and if it can be increased)
max_input_nesting_level
xdebug & xdebug.max_nesting_level
function_exists('gd_info')
		$gd  = gd_info();
		$ver = isset($gd['GD Version']) ? $gd['GD Version'] : $this->_('Version-Info not available');
		$jpg = isset($gd['JPEG Support']) ? $gd['JPEG Support'] : false;
		$png = isset($gd['PNG Support']) ? $gd['PNG Support'] : false;
		$gif = isset($gd['GIF Read Support']) && isset($gd['GIF Create Support']) ? $gd['GIF Create Support'] : false;
		$freetype = isset($gd['FreeType Support']) ? $gd['FreeType Support'] : false;
function_exists('exif_read_data')
class_exists('Imagick')

In regard of mysql, I think the version is important. For more, you may have a look at DiagnoseDatabase.module or ask @netcarver & @ryan.

  • Like 2
Link to comment
Share on other sites

Thanks @horst - great ideas! I'll add all those xdebug, GD and Imagick metrics.

As for MySQL version - I am already capturing that in the Server Details section (along with PW, PHP, and Apache versions). Does that cover your needs, or are you thinking of something else?

  • Like 1
Link to comment
Share on other sites

Ah, sorry. No, there are no other needs in regard of mysql. I just mentioned this and pointed to Steve and Ryan, as I don't have much knowledge of mysql.

But throwing in another thought, that I have had some time ago, what can be useful in regard of troubleshooting image processing issues:

Selecting / defining a problematic image, and var_dump all infos of ImageInspector + the current image settings, calculated / merged like here.https://processwire.com/talk/topic/13125-get-image-quality-value-from-image-instance/

But I don't know if this could be something practicable for Tracy. (?)

Edited by horst
  • Like 1
Link to comment
Share on other sites

19 minutes ago, horst said:

max_execution_time (and if it can be increased)

Sorry I missed the bit about whether it can be increased - as far as I know, that's just a matter of checking for safe mode? Do you know if there is anything else to consider?

 

2 minutes ago, horst said:

Throwing in another thought, that I have had some time ago, what can be useful in regard of troubleshooting image processing issues:

Selecting / defining a problematic image, and var_dump all infos of ImageInspector + the current image settings, calculated / merged like here.https://processwire.com/talk/topic/13125-get-image-quality-value-from-image-instance/

This sounds interesting, but I think it sounds like a dedicated image panel, rather than info to be included in this "Version List" (outdated name now) section. Is that what you are thinking also?

Link to comment
Share on other sites

        $max_execution_time = trim(ini_get('max_execution_time'));
        $can_change = set_time_limit($max_execution_time);

I only know: simply testing if it can change. :)

That image processing feature shouldn't belong to the Version List. Just wanted to throw it in and ask, if this would be useful to integrate somehow into Tracy.

  • Like 1
Link to comment
Share on other sites

37 minutes ago, horst said:

That image processing feature shouldn't belong to the Version List. Just wanted to throw it in and ask, if this would be useful to integrate somehow into Tracy.

Yeah, let's do it - I'll look into it more later.

For now, here is what the latest info looks like when pasted into Github:

Screen Shot 2016-09-24 at 10.26.29 AM.png

Thanks again @horst and @szabesz for your feedback and suggestions.

  • Like 2
Link to comment
Share on other sites

Hmm, something in one of the recent minor revisions is messing up bootstrap styles of some buttons on a form page of mine - not sure which revision introduced it though. I'm on 3.2.8 now, but it happened with the previous version too.

Inspecting in the browser shows tracy using a style...

#tracy-debug input[type="submit"], .btn {...}

...which is stomping on bootstrap's own button style.

  • Like 2
Link to comment
Share on other sites

42 minutes ago, netcarver said:

Hmm, something in one of the recent minor revisions is messing up bootstrap styles of some buttons on a form page of mine - not sure which revision introduced it though. I'm on 3.2.8 now, but it happened with the previous version too.

Inspecting in the browser shows tracy using a style...


#tracy-debug input[type="submit"], .btn {...}

...which is stomping on bootstrap's own button style.

Sorry Steve, that was lazy on my part.

Should be all fixed now, but be sure to do a hard reload - there's a JS file update needed. I really should have added JS versioning.

PS - In case anyone was wondering, the "Copy plain text" button is great for pasting into a "Spoiler" in this forum.

  • Like 3
Link to comment
Share on other sites

Hi everyone!

The latest version makes use of the Tracy core's LIVE dump feature in several places, including the PW Info panel, the Template Resources panel, and whenever you use bd()

From my initial testing this seems to have made huge differences in the size of the DOM required by Tracy, especially if you have a heavy page where before the PW Info panel (especially if you had the objects displayed) could be huge.

It is also magic when you want to do a dump with a custom (greater than default of 3) depth, eg:

bd($page, 'Page Object', array('maxDepth' => 10));

What was 29MB is now only 3KB - that's right, I have got those MBs and KBs correct! 

Once you start expanding the object and drilling down into, the rest of the object is added to the DOM as needed - very clever indeed!

Anyway, please let me know if you find any problems with this change.

  • Like 2
Link to comment
Share on other sites

4 hours ago, adrian said:

What was 29MB is now only 3KB - that's right, I have got those MBs and KBs correct! 

Once you start expanding the object and drilling down into, the rest of the object is added to the DOM as needed - very clever indeed!

Thumbs up Adrian! Is it already Christmas?

  • Like 2
Link to comment
Share on other sites

Folks at Nette are on fire :) And adrian keeps the pace :)

Btw, what about a shorthand syntax to bd()? I always have to search the docs or my previous code to get the name of the params. Something like bd(var, title, 3000, 10) would be much simpler. In fact what I need most of the time is var, maxLength, and perhaps maxDepth. But perhaps it's just me :)

  • Like 1
Link to comment
Share on other sites

4 minutes ago, tpr said:

And adrian keeps the pace

I like to think we are ahead of their pace :) Those guys don't have a console panel, or a persistent dumps recorder, live template tester, or any of the other cool goodies that we have :)

7 minutes ago, tpr said:

Btw, what about a shorthand syntax to bd()?

I'll see what I can do - I agree it would be nicer to not have to write the array with the keys for those options.

  • Like 2
Link to comment
Share on other sites

  • adrian pinned and locked this topic
  • adrian unpinned and pinned this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...