soulseekah / wptop

Performance statistics for your PHP code in production for WordPress.
60 stars 1 forks source link

Add check so that "undefined constant" errors do not show when starting Vagrant #1

Closed grappler closed 9 years ago

grappler commented 9 years ago

I added a simple check so that I do not get errors of constants not being set when starting Vagrant.

/** Turn on real-time profiling using wptop */
if ( function_exists( 'xhprof_enable' ) ) {
    require ABSPATH . 'wp-content/plugins/wptop/enable.php';
    wptop_enable();
}

This looks really nice. I need more time to play with it.

soulseekah commented 9 years ago

Thanks. Well, I did have the bailout here https://github.com/soulseekah/wptop/blob/487eb02b92922a9d3aeae0e21399f2c5fcb15a8b/wptop/enable.php#L20 but I noticed it's being checked too late. I will move it up so that wptop_enable is safe to call without XHProf available.

Let me know if this works.

grappler commented 9 years ago

It works! Thanks.

P.s Perhaps you could add this link to the readme http://gm.zoomlab.it/2014/xhprof-varying-vagrant-vagrants/