WordPress.org

Ready to get started?Download WordPress

Forums

P3 (Plugin Performance Profiler)
[resolved] Multiple scans and log results (4 posts)

  1. Stephen Harris
    Member
    Posted 2 years ago #

    Thanks for such a great plugin!

    I would like to run the scan multiple times and log the site load for each time, rather than performing the scan manually.

    This is a kind of bespoke request, so I can't expect this as a new feature, but if you could provide pointers on how this could be achieved I'd be very grateful.

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

  2. Kurt Payne
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Stephen,

    I've thought about how to do this. There really needs to be another server involved which can act as a client. Aside from where to host this, there are two challenges that need to be overcome:

    1.) Part of the plugin to be accessible outside of the WordPress admin so it can be activated / deactivated by the client for the scheduled scans, without you having to give up your admin password.

    2.) The client needs a full stack browser to scan the site so it loads all of the scripts, styles, iframes, and ajax resources. The easiest option here is phantomjs (a command line version of Safari, basically). Alternately, Selenium RC might work.

    If you want to make this work in your environment, you could start off by using phantomjs (or Selenium RC) to script logging into your site and starting a scan on a regular basis.

    I hope this helps!

  3. Stephen Harris
    Member
    Posted 2 years ago #

    Hi Kurt,
    Thanks for the quick response! I wasn't clear in my first message - I'm not attempting to perform periodic scans - but rather perform the scan 20, 50, or even 100 times (as my computer and patience allows) immediately after each other. (It's an odd request I know)

    It's on a localhost, and I'm attempting to verify/disprove the claim that putting code in functions.php rather than its own plug-in improves a site's load time. To make any reasonable judgement I need lots of samples of load times from both states. To do this, I would ideally need to automate the scans.

    It seems the above would escape the challenges above? At least - could a click of 'start scan' trigger the first scan, and then subsequent ones when it has completed? Presumably this could be done with Selenium or even jQuery (adding a custom button to trigger clicking of 'start scan' etc.)? Or is it possible/easier to do this server side?

    Many thanks

  4. Kurt Payne
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Stephen,

    You can use something like sikuli to get quick and dirty automation going. Once you have your script written, you can put it in a loop.

    Or, since this is on a localhost, you could skip P3 and go right to using xdebug. You can use KCacheGrind, WinCacheGrind, or WebGrind to look at the output.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic