?>
				<?php 
if ((int) $test[test][authenticated] == 1) {
    echo '<br><b>Authenticated: ' . $login . '</b>';
}
if ((int) $test[test][connections] !== 0) {
    echo '<b>' . $test[test][connections] . ' Browser connections</b><br>';
}
if (strlen($blockString)) {
    echo "Blocked: <b>{$blockString}</b><br>";
}
?>
				</p>
                <?php 
require 'optimization.inc';
dumpOptimizationReport($testPath, $run, $cached, true);
echo '<br>';
dumpOptimizationGlossary($settings);
?>
            </div>
        </div>

        <?php 
if ($settings['analytics']) {
    ?>
        <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
        </script>
        <script type="text/javascript">
        var pageTracker = _gat._getTracker(<?php 
Exemplo n.º 2
0
/**
* Send a mail notification to the user
* 
* @param mixed $mailto
* @param mixed $id
* @param mixed $testPath
*/
function notify($mailto, $from, $id, $testPath, $host)
{
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: {$from}\r\n";
    $headers .= "Reply-To: {$from}";
    $url;
    if (is_file("{$testPath}/url.txt")) {
        $url = htmlspecialchars(file_get_contents("{$testPath}/url.txt"));
    }
    $shorturl = substr($url, 0, 40);
    if (strlen($url) > 40) {
        $shorturl .= '...';
    }
    $subject = "Test results for {$shorturl}";
    if (!isset($host)) {
        $host = $_SERVER['HTTP_HOST'];
    }
    // calculate the results
    require_once 'page_data.inc';
    $pageData = loadAllPageData($testPath);
    $fv = null;
    $rv = null;
    $pageStats = calculatePageStats($pageData, $fv, $rv);
    if (isset($fv)) {
        $load = number_format($fv['loadTime'] / 1000.0, 3);
        $render = number_format($fv['render'] / 1000.0, 3);
        $requests = number_format($fv['requests'], 0);
        $bytes = number_format($fv['bytesIn'] / 1024, 0);
        $result = "http://{$host}/result/{$id}";
        // capture the optimization report
        require_once '../optimization.inc';
        ob_start();
        dumpOptimizationReport($testPath, 1, 0);
        $optimization = ob_get_contents();
        ob_end_clean();
        // build the message body
        $body = "<html>\r\n            <head>\r\n                <title>{$subject}</title>\r\n                <style type=\"text/css\">\r\n                    .indented1 {padding-left: 40pt;}\r\n                    .indented2 {padding-left: 80pt;}\r\n                </style>\r\n            </head>\r\n            <body>\r\n            <p>The full test results for <a href=\"{$url}\">{$url}</a> are now <a href=\"{$result}/\">available</a>.</p>\r\n            <p>The page loaded in <b>{$load} seconds</b> with the user first seeing something on the page after <b>{$render} seconds</b>.  To download \r\n            the page required <b>{$requests} requests</b> and <b>{$bytes} KB</b>.</p>\r\n            <p>Here is what the page looked like when it loaded (click the image for a larger view):<br><a href=\"{$result}/1/screen_shot/\"><img src=\"{$result}/1_screen_thumb.jpg\"></a></p>\r\n            <h3>Here are the things on the page that could use improving:</h3>\r\n            {$optimization}\r\n            </body>\r\n        </html>";
        // send the actual mail
        mail($mailto, $subject, $body, $headers);
    }
}
            </div>

		    <br>
            <?php 
include './ads/optimization_middle.inc';
?>
		    <br>

            <h2>Details:</h2>
            <?php 
require 'optimization.inc';
require_once 'page_data.inc';
$pageData = loadPageRunData($testPath, $run, $cached, null, $test['testinfo']);
require_once 'object_detail.inc';
$secure = false;
$haveLocations = false;
$requests = getRequests($id, $testPath, $run, $cached, $secure, $haveLocations, false);
dumpOptimizationReport($pageData, $requests, $id, $run, $cached, $test);
echo '<p></p><br>';
include './ads/optimization_bottom.inc';
echo '<br>';
dumpOptimizationGlossary($settings);
?>
            
            <?php 
include 'footer.inc';
?>
        </div>
    </body>
</html>
Exemplo n.º 4
0
/**
* Send a mail notification to the user
* 
* @param mixed $mailto
* @param mixed $id
* @param mixed $testPath
*/
function notify($mailto, $from, $id, $testPath, $host)
{
    global $test;
    // calculate the results
    require_once 'page_data.inc';
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: {$from}\r\n";
    $headers .= "Reply-To: {$from}";
    $pageData = loadAllPageData($testPath);
    $url = trim($pageData[1][0]['URL']);
    $shorturl = substr($url, 0, 40);
    if (strlen($url) > 40) {
        $shorturl .= '...';
    }
    $subject = "Test results for {$shorturl}";
    $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || isset($_SERVER['HTTP_SSL']) && $_SERVER['HTTP_SSL'] == 'On' ? 'https' : 'http';
    if (!isset($host)) {
        $host = $_SERVER['HTTP_HOST'];
    }
    $fv = GetMedianRun($pageData, 0);
    if (isset($fv) && $fv) {
        $load = number_format($pageData[$fv][0]['loadTime'] / 1000.0, 3);
        $render = number_format($pageData[$fv][0]['render'] / 1000.0, 3);
        $numRequests = number_format($pageData[$fv][0]['requests'], 0);
        $bytes = number_format($pageData[$fv][0]['bytesIn'] / 1024, 0);
        $result = "{$protocol}://{$host}/result/{$id}";
        // capture the optimization report
        require_once 'optimization.inc';
        require_once 'object_detail.inc';
        $secure = false;
        $haveLocations = false;
        $requests = getRequests($id, $testPath, 1, 0, $secure, $haveLocations, false);
        ob_start();
        dumpOptimizationReport($pageData[$fv][0], $requests, $id, 1, 0, $test);
        $optimization = ob_get_contents();
        ob_end_clean();
        // build the message body
        $body = "<html>\r\n            <head>\r\n                <title>{$subject}</title>\r\n                <style type=\"text/css\">\r\n                    .indented1 {padding-left: 40pt;}\r\n                    .indented2 {padding-left: 80pt;}\r\n                </style>\r\n            </head>\r\n            <body>\r\n            <p>The full test results for <a href=\"{$url}\">{$url}</a> are now <a href=\"{$result}/\">available</a>.</p>\r\n            <p>The page loaded in <b>{$load} seconds</b> with the user first seeing something on the page after <b>{$render} seconds</b>.  To download \r\n            the page required <b>{$numRequests} requests</b> and <b>{$bytes} KB</b>.</p>\r\n            <p>Here is what the page looked like when it loaded (click the image for a larger view):<br><a href=\"{$result}/{$fv}/screen_shot/\"><img src=\"{$result}/{$fv}_screen_thumb.jpg\"></a></p>\r\n            <h3>Here are the things on the page that could use improving:</h3>\r\n            {$optimization}\r\n            </body>\r\n        </html>";
        // send the actual mail
        mail($mailto, $subject, $body, $headers);
    }
}