Support » Plugin: F12-Profiler » tweaks

  • ResolvedPlugin Contributor alx359

    (@alx359)


    Terrific plugin! After P3 doesn’t work anymore with PHP7+, F12 Profiler seems finally filling the gap.

    A few suggestions:

    a) Make the resource hogs go to the top of the list:

    \plugins\f12-profiler\f12-profiler.php ~line 60 add the following line:

    $data = \f12_profiler\includes\TimeTracker::get();
    arsort($data); //<-- add

    b) When the list of plugins is too large and goes beyond the screen bottom, need to make that list scrollable. It can be achieved with the following adjustment in styles.css of the child theme:

    #wp-admin-bar-f12_profiler_1-default
    { height: 200px; overflow: auto }

    Hope you’d consider adding similar to those tweaks for the next version.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor alx359

    (@alx359)

    There’s also a mismatch of what version is minimum required to run this plugin:

    \plugins\f12-profiler\Readme.txt line 7:

    Requires PHP: 7.2

    \plugins\f12-profiler\f12-profiler.php line 21:

    define( ‘F12_PROFILER_MINIMUM_PHP_VERSION’, ‘7.0’ );

    The plugin currently can’t be activated when PHP version < 7.2. Have tested with PHP 7.1.16 and it seems to work fine, so the Readme.txt file needs to be updated accordingly, as its header appears to be parsed by WP (5.2) during activation of the plugin.

    Plugin Contributor alx359

    (@alx359)

    Think resource colors in F12 are a bit off. A brighter (red) color should mean more time/resource hog. Would suggest tweaking those colors similarly as in Query Monitor, and as backgrounds for better contrast with some admin skins, i.e.:

    \plugins\f12-profiler\f12-profiler.php line 71:

    if ( $value > 0.1 ) {
    	$value = '<span style="flex:1 1 30%; color:#fff; background:#ff5500;">' . $value . 's</span>'; //instead of: cc0000,Seconds
    } else if ( $value > 0.05 ) {
    	$value = '<span style="flex:1 1 30%; color:#fff; background:#cc0000;">' . $value . 's</span>'; //instead of: ff5500,Seconds
    } else {
    	$value = '<span style="flex:1 1 30%; color:#fff; background:#009933;">' . $value . 's</span>'; //instead of: 00cc00,Seconds
    }
    

    Also please consider XXs instead of XX Seconds everywhere, as the shorthand saves valuable screen space, especially important in an already crowded admin header. Line 93:
    'title' => F12_PROFILER_NAME . ': ' . number_format( $sum, 4 ) . 's' //instead of: 'Seconds'

    Here’s an example of how all the tweaks above look like: screenshot

    Plugin Author forge12

    (@forge12)

    Dear @alx359,

    thank you for your feedback. All of your feedback has been integrated within the new version 1.2 except the color of the times/tracking. Therefor if you update the plugin ensure you change the color of the tracking.

    We also added a tracking for the js/css resources. The color for this fields are defined within the meassure.js file.

    If you have any further suggestions do not hesitate to send them to us.

    Best regards
    Marc

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.