WPIntell

Source evidence

Enable Admin only viewing

WP Page Load Stats · support · 2014-09-05T15:42:00+00:00

complaintsentiment
mediumseverity
0.92relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 35 rows with source links

17.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
nickweb unresolved
Line 108, add the following : if ( current_user_can( 'manage_options' ) ) { /* A user with admin privileges */' BEFORE the closing PHP tag. At the NEXT opening PHP tag add the following } . For ease of use, I have done the following: if ( current_user_can( 'manage_options' ) ) { /* A user with admin privileges */ ?> <div id="wp_pls"> <ul> <li><?php printf( __( '%s queries in %s seconds.', 'wp_pls' ), $query_count, $timer_stop ); ?></li> <li><?php printf( __( 'Average load time of %s (%s runs).', 'wp_pls' ), $average_load_time, sizeof( $load_times ) ); ?></li> <li><?php printf( __( '%s out of %s MB (%s) memory used.', 'wp_pls' ), $memory_usage, $memory_limit, round( ( $memory_usage / $memory_limit ), 2 ) * 100 . '%' ); ?></li> <li><?php printf( __( 'Peak memory usage %s MB.', 'wp_pls' ), $memory_peak_usage ); ?></li> </ul> <div class="actions"> <a href="void(0);">×</a> <a>">-</a> </div> </div> <?php } //Nick Edit - The above checks if user is an admin. If they are, shows the stats, if not, it won't. https://wordpress.org/plugins/wp-page-load-stats/ exactly what i was looking for thx Great mod, nickweb! Would anyone know how to also add support to NOT display load stats on wp-admin pages? Thanks! Forget it. This was easy enough. Just update the following row: From: if ( current_user_can( 'manage_options' ) ) { To: if ( current_user_can( 'manage_options' ) && ! is_admin() ) {

Comments

3 shown
adamt19 2014-09-23T17:36:00+00:00

exactly what i was looking for thx

killerdog 2015-01-01T12:00:00+00:00

Great mod, nickweb! Would anyone know how to also add support to NOT display load stats on wp-admin pages? Thanks!

killerdog 2015-01-01T12:32:00+00:00

Forget it. This was easy enough. Just update the following row: From: if ( current_user_can( 'manage_options' ) ) { To: if ( current_user_can( 'manage_options' ) && ! is_admin() ) {