adrian Posted July 26, 2016 Author Share Posted July 26, 2016 Thanks again for all that. The one that stands out is the ToDo panel - I honestly haven't tested that on a large site with many template php/css/js files, so perhaps that is expected. Maybe I need to implement some caching so that it only scans files if they have been changed since the last scan. That should help with that significantly. Actually, you should take a look at the ToDo panel config settings and exclude any js/css from external libraries - I bet that is what is slowing that down. My ToDo panel renders in 0.03s compared to your 1.27s! I was actually thinking about adding caching to the Validator panel as well although that one will be a little more complex as it will require storing the rendered HTML so it can be compared. Regarding the generally slow nature of your local dev setup - have you read this thread: I feel like it might be the reason Tracy is running so slow - would be worth a look regardless as it seems like you are experiencing slow page loads even without Tracy, although of course I don't know what resources your page is loading. 1 Link to comment Share on other sites More sharing options...
adrian Posted July 26, 2016 Author Share Posted July 26, 2016 Just added color significance to PW and Tracy Log panel icons. Red for errors, exception, critical Orange for everything else, including warnings, info, debug, and any custom names PW logs Green for none All colors are based on log entries from the last 5 seconds which should cover everything loaded/redirected etc during the last page load. The idea being that you don't want the red or orange colors to be triggered from an error that was recorded days ago, even if it's the most recent entry. Hopefully this logic makes sense and it provides a useful visual cue to let you know that something was just logged. PS - as part of this I needed a different icon for the Tracy log panel - you'll see it's now burning campfire logs - it's actually hard to find a nice small icon for logs 2 Link to comment Share on other sites More sharing options...
bernhard Posted July 26, 2016 Share Posted July 26, 2016 hi adrian, thank you for that link. i tried all that but without success. if i open LICENCE.TXT it loads really fast. don't know what the problem is, but it's getting offtopic and i have to finish my project thank you for all your help. Link to comment Share on other sites More sharing options...
tpr Posted July 27, 2016 Share Posted July 27, 2016 I think an on-demand google pagespeed and gtmetrix page analyzis could be nice panel additions. On "on-demand" I mean they should analyze only on user request (eg. click on a button). Both have APIs but PS requires an api key, maybe gtmetrix too. I know it's a bigger request, I'm just asking whether you have thought about such feature. 5 Link to comment Share on other sites More sharing options...
bernhard Posted July 27, 2016 Share Posted July 27, 2016 at least for google it would be as easy as adding a link like this echo '<a href="https://developers.google.com/speed/pagespeed/insights/?url=' . $page->httpUrl . '">Google Speedtest</a>'; 1 Link to comment Share on other sites More sharing options...
tpr Posted July 27, 2016 Share Posted July 27, 2016 Yep, I use that now in an utility (win) but unfortunately gtmetrix uses POST, so there's no such easy way to get the results. Link to comment Share on other sites More sharing options...
adrian Posted July 27, 2016 Author Share Posted July 27, 2016 On 7/27/2016 at 7:30 AM, tpr said: I think an on-demand google pagespeed and gtmetrix page analyzis could be nice panel additions. On "on-demand" I mean they should analyze only on user request (eg. click on a button). Both have APIs but PS requires an api key, maybe gtmetrix too. I know it's a bigger request, I'm just asking whether you have thought about such feature. Expand I think it's a great idea - I have added to my list. On 7/27/2016 at 10:51 AM, bernhard said: at least for google it would be as easy as adding a link like this echo '<a href="https://developers.google.com/speed/pagespeed/insights/?url=' . $page->httpUrl . '">Google Speedtest</a>'; Expand In the meantime I have added a new "Custom PHP" panel which lets you return anything you want. which results in: Not very pretty looking I know - I am sure @tpr will have some style suggestions for me This is obviously not the best solution for things like page speed because it won't work with local dev sites, so as I said, I will work on dedicated panels for those, but this still may be helpful until then, and perhaps also for other things. Some other significant recent updates that I haven't mentioned. There are now separate default panel config options for frontend vs backend The User switcher now lets you logout (while maintaining the session and access to the Tracy debug bar). Until recently, you had to switch to a different user before the logout would work properly. 5 Link to comment Share on other sites More sharing options...
adrian Posted July 28, 2016 Author Share Posted July 28, 2016 Second new panel today Introducing "Page Recorder" This panel records the ID of all pages added whenever it is enabled (so this is one you'll want off by default and just enabled via "Sticky" when you need it). This is perfect for all sorts of testing, whether you need to create a LOT of pages for performance testing or you are testing a form which is automatically creating pages. Once you are done with the testing session, simply click the "Trash Recorded Pages" button and they will all be moved to the Trash. Because pages are sent to the trash rather than completely deleted, I consider it safe to use, but I am a little worried that someone may leave it enabled when they are creating real content pages and then later trash them, then empty the trash without realizing it contains a page they want. If there is demand, I may consider adding checkboxes so you can remove certain pages from the list so they won't get trashed with all the others. Please let me know if you have any suggestions for functionality or the interface. 4 Link to comment Share on other sites More sharing options...
bernhard Posted July 28, 2016 Share Posted July 28, 2016 hi adrian, the page recorder reminded me of my hook recorder i created almost a year ago and i got very little feedback so didn't take it further (not to say it was and may still be beyond my scope ). i think it could play very well together with tracy and all the options we have now (eg only load that panel once when needed). that's only a first vague idea. the last post in the topic has some more suggestions. if you like the idea i would be happy to support you as much as i can 4 Link to comment Share on other sites More sharing options...
netcarver Posted July 28, 2016 Share Posted July 28, 2016 @bernhard Don't know how I missed your original post about that - looks great, have just added my likes to it. I think it would be a great to try merging the two. 1 Link to comment Share on other sites More sharing options...
tpr Posted July 28, 2016 Share Posted July 28, 2016 The custom php module works great for google speed test. I added a no-jquery javascript lightbox to it (modified version of squeral lightbox), called from my site js. The same could be added for gtmetrix but even using "?url=xxx" needs manual click on the "Analyize" button (the url is pre-filled though). I can share the code if someone needs. 5 Link to comment Share on other sites More sharing options...
Gazley Posted July 28, 2016 Share Posted July 28, 2016 Hi there, I've just been fighting a very basic issue on my localhost. Some code that did a simple redirect just stopped working. The redirect ignored the path and just ended up at the site root URL. Because I had changed numerous things, I almost tore the application apart trying to work out what was going wrong with this very simple command: $session->redirect($utils->stripDoubleSlashes("$rootUrl$successMessage")); One other thing I had done was installed the Tracy module. I unticked "Enable Tracy Debugger" and the $session->redirect started to work again just fine. I then hard-coded the redirect path and put it on the first line of my home.php template and turned Tracy back on again: $session->redirect('http://localhost:8888/contact/thank-you/'); I just ended up back at the root of localhost with a blank page. Any ideas what might be happening here? Thanks! Link to comment Share on other sites More sharing options...
tpr Posted July 28, 2016 Share Posted July 28, 2016 Just for the record, this works for gtmetrix (opens in new window): return '<form action="https://gtmetrix.com/analyze.html" method="post" target="_blank">' . '<input type="hidden" name="url" value="' . $page->httpUrl . '" />' . '<button type="submit">GTmetrix test</button>' . '</form>'; I managed to make it work in iframe but it's kinda hacky, I think it's better open it like this. 3 Link to comment Share on other sites More sharing options...
blynx Posted July 28, 2016 Share Posted July 28, 2016 Hej, I was playing around with Tracy Debugger and when I checked the Page/Template/Fields Object options for the Processwire-Info panel I only get a blank page rendered in the processwire backend. ... !? Using MAMP. Any ideas what is going on? cheers, Steffen Link to comment Share on other sites More sharing options...
bernhard Posted July 28, 2016 Share Posted July 28, 2016 On 7/28/2016 at 11:37 AM, tpr said: Just for the record, this works for gtmetrix (opens in new window): return '<form action="https://gtmetrix.com/analyze.html" method="post" target="_blank">' . '<input type="hidden" name="url" value="' . $page->httpUrl . '" />' . '<button type="submit">GTmetrix test</button>' . '</form>'; I managed to make it work in iframe but it's kinda hacky, I think it's better open it like this. Expand would be good to have such snippets available somewhere (github or the like). maybe a dedicated folder where we can add files and make pull requests? On 7/28/2016 at 11:50 AM, blynx said: Hej, I was playing around with Tracy Debugger and when I checked the Page/Template/Fields Object options for the Processwire-Info panel I only get a blank page rendered in the processwire backend. ... !? Using MAMP. Any ideas what is going on? cheers, Steffen Expand are you using the latest version of tracy? Link to comment Share on other sites More sharing options...
tpr Posted July 28, 2016 Share Posted July 28, 2016 On 7/28/2016 at 12:04 PM, bernhard said: would be good to have such snippets available somewhere (github or the like). maybe a dedicated folder where we can add files and make pull requests? Expand Maybe they could be in the module docs. Link to comment Share on other sites More sharing options...
blynx Posted July 28, 2016 Share Posted July 28, 2016 On 7/28/2016 at 12:04 PM, bernhard said: are you using the latest version of tracy? Expand @bernhard yep, latest version of the TracyDebugger module, just installed it. But I was using ProcessWire 2.7.2 - Was trying with ProcessWire 3.0.11 now: Same problem but it only occurs once when I log in. After a reload the backened page loads as it should. ... For a couple of times. Now can't log into PW3 either - blank screen. Will have a try on a Webserver later ... Maybe it is something about the MAMP configuration? EDIT: No errors in apache_error.log or php_error.log in Apps/MAMP/logs/... Link to comment Share on other sites More sharing options...
adrian Posted July 28, 2016 Author Share Posted July 28, 2016 On 7/28/2016 at 11:50 AM, blynx said: I was playing around with Tracy Debugger and when I checked the Page/Template/Fields Object options for the Processwire-Info panel I only get a blank page rendered in the processwire backend. ... !? Using MAMP. Any ideas what is going on? Expand Does it make a difference if you only have one of those Object options enabled - trying to figure out if it's one in particular or whether it's the size of the content when more than one is checked. Also, did you make any changes to the Maximum Nesting Depth option? If that is too high, those Objects could get very large. Link to comment Share on other sites More sharing options...
adrian Posted July 28, 2016 Author Share Posted July 28, 2016 @blynx - it just occurred to me - I think the problem may also be related to SessionHandlerDB - do you have that module installed? If so, there are two things possibly going on. The type of the data field in the sessions db table may still be text, but it needs to be mediumtext - Ryan fixed this here: https://github.com/ryancramerdesign/ProcessWire/commit/d4e8eb3dc54fbee54befa1ecc2d18b6269febc18#diff-cb9ec68dc3f620a40013310f547e904fR366 so if you upgrade your version of PW that will be fixed. Your MYSQL max_allowed_packet setting may be too small - you need to fix this one manually yourself Of course you can also just uninstall the SessionHandlerDB module as well, assuming I am correct that this is the problem Link to comment Share on other sites More sharing options...
adrian Posted July 28, 2016 Author Share Posted July 28, 2016 On 7/28/2016 at 9:00 AM, Gazley said: Hi there, I've just been fighting a very basic issue on my localhost. Some code that did a simple redirect just stopped working. The redirect ignored the path and just ended up at the site root URL. Because I had changed numerous things, I almost tore the application apart trying to work out what was going wrong with this very simple command: $session->redirect($utils->stripDoubleSlashes("$rootUrl$successMessage")); One other thing I had done was installed the Tracy module. I unticked "Enable Tracy Debugger" and the $session->redirect started to work again just fine. I then hard-coded the redirect path and put it on the first line of my home.php template and turned Tracy back on again: $session->redirect('http://localhost:8888/contact/thank-you/'); I just ended up back at the root of localhost with a blank page. Any ideas what might be happening here? Thanks! Expand Hi @Gazley, I am sorry this has been a painful debugging experience for you! I am trying to reproduce here without any luck. Are you running the Master version of the Tracy core, or the Legacy version? Does it help if you switch? Also, does the same problem occur with all custom panels removed? Use the Panel Selector Sticky option to quickly test without any panels enabled - if this helps, could you narrow it down to a specific panel for me? If none of that helps, could you send me all the code for your home.php file (and any other files that are included in it)? Link to comment Share on other sites More sharing options...
Gazley Posted July 28, 2016 Share Posted July 28, 2016 Hi @adrian, Please don't be sorry in any way! I've got Tracy 2.4.4 and PW 3.0.27. I too am running on MAMP. I've got the default panels open. I'll try shutting them down as you suggest and see what happens. Many thanks! Link to comment Share on other sites More sharing options...
adrian Posted July 28, 2016 Author Share Posted July 28, 2016 @tpr and @bernhard - thanks for your thoughts on the Custom PHP panel - the form for submitting to gtmetrix is cool. I am happy to provide a place for sharing these snippets - let's see just how many get posted here for the moment and if we get a critical mass, then I'll either add them to the blog post, or start a Github repo. Let me take a better look at your Hook Recorder - it definitely sounds interesting! 2 Link to comment Share on other sites More sharing options...
adrian Posted July 28, 2016 Author Share Posted July 28, 2016 On 7/28/2016 at 2:13 PM, Gazley said: I've got Tracy 2.4.4 Expand Please grab the latest version of Tracy before you do too much debugging. Link to comment Share on other sites More sharing options...
Gazley Posted July 28, 2016 Share Posted July 28, 2016 Wow, I thought that was the latest! Link to comment Share on other sites More sharing options...
Gazley Posted July 28, 2016 Share Posted July 28, 2016 @adrian I updated the version to latest and unset all the panels as you suggested, with no difference. I've posted my home.php code below. I am also using @wanze's TemplateEngineTwig module. <?php namespace ProcessWire; // FileCompiler=0 // Line below added to test Tracy issue $session->redirect('http://localhost:8888/contact/thank-you/'); $forms->addHookAfter('FormBuilderProcessor::saveForm', function(HookEvent $event) { $form = $event->object; if ($form->formName === 'contact') { $session = wire('session'); if ($packageValue = wire('input')->post['package']) { $formMessage = $packageValue; $session->set('form-message', $formMessage); } $rootUrl = SITE_URL; $successMessage = $form->successMessage; $utils = wire('modules')->get('Utils'); $session->redirect($utils->stripDoubleSlashes("$rootUrl$successMessage")); } }); $config->forms += ['form' => $forms->render('contact')]; foreach ($page->page_matrix as $item) { $view->set($item->output_variable, $item->render()); } Link to comment Share on other sites More sharing options...
Recommended Posts