Our P3 Plugin has an automatic scan mode that picks pages at random from your site to scan for performance. The pages aren’t really random, though. P3 actually picks:
- Home page
- Four random tags
- Four random categories
- Four latest posts
- Admin dashboard
- Admin posts page
- Admin plugins page
Some of the pages are shuffled to help defeat the effects of caching and get a better measurement of plugin performance. This should be a good configuration for most users, but some of our more advanced users have asked for greater control over this behavior. In version 1.4, we added a filter named p3_automatic_scan_urls to allow other plugins to customize this list.
Here’s an example plugin to get you started:
/*
Plugin Name: P3 Custom Scanner
Plugin URI: http://inside.godaddy.com/
Description: Customize the pages scanned by P3's auto scan mode
Author: GoDaddy.com
Version: 1.0
Author URI: http://www.godaddy.com/
*/
function my_p3_auto_scan_pages() {
return array(
home_url(),
home_url( '2011/01/some-post' ),
home_url( '?s=search+string+here' ),
admin_url( 'plugins.php' )
);
}
add_filter( 'p3_automatic_scan_urls', 'my_p3_auto_scan_pages' );
For an example that allows you to edit the URL list in a text area on your options page, see this plugin on gisthub.
Thanks to our users for this suggestion!