WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Feature request: Blacklist pages to check in scan

[Resolved] Feature request: Blacklist pages to check in scan

  • I have a fair number of plugins that only run on on the admin page and they throw off my load times shown in the scan. It would be nice to have the option not to scan /wp-admin and any sub pages so I can get a better feel for how my plugins are affecting load times of users, instead of load times of myself.

    http://wordpress.org/extend/plugins/p3-profiler/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Kurt Payne
    Member

    @kurtpayne

    You can control this with a filter in P3 version 1.4. Something like this should work (untested):

    function my_p3_auto_scan_pages( $urls ) {
        foreach ( $urls as $k => $v ) {
            if ( false !== strpos( $v, '/wp-admin' ) {
                unset( $urls[ $k ] );
            }
        }
        return $urls;
    }
    add_filter( 'p3_automatic_scan_urls', 'my_p3_auto_scan_pages', 10, 2 );

    Thanks. Which file should that go in? The plugin has 30 files!

    Plugin Contributor Kurt Payne
    Member

    @kurtpayne

    Hi edwardra3,

    Please don’t edit P3 directly 🙂

    You can create a new plugin named p3-customizer.php with source code similar to this:
    https://gist.github.com/f87498aaf0a4dda82261

    Then upload it to wp-content/plugins and activate it like a normal plugin.

    Ah thanks.

    I’m getting an error:
    Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in blah-blah-blaj/p3-customizer.php on line 13

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Feature request: Blacklist pages to check in scan’ is closed to new replies.