You are here

public function SiteAuditCheckFrontEndWebPageTest::getResultPass in Site Audit 8.2

Implements \SiteAudit\Check\Abstract\getResultPass().

Overrides SiteAuditCheckAbstract::getResultPass

2 calls to SiteAuditCheckFrontEndWebPageTest::getResultPass()
SiteAuditCheckFrontEndWebPageTest::getResultFail in Check/FrontEnd/WebPageTest.php
Implements \SiteAudit\Check\Abstract\getResultFail().
SiteAuditCheckFrontEndWebPageTest::getResultWarn in Check/FrontEnd/WebPageTest.php
Implements \SiteAudit\Check\Abstract\getResultWarn().

File

Check/FrontEnd/WebPageTest.php, line 66
Contains \SiteAudit\Check\FrontEnd\WebPageTest.

Class

SiteAuditCheckFrontEndWebPageTest
Class SiteAuditCheckFrontEndWebPageTest.

Code

public function getResultPass() {
  $ret_val = '';
  if (drush_get_option('html')) {
    $ret_val .= '<p><b>Full Report:</b> ' . $this->registry['webpagetest']['data']->data->summary . '</p>';
    $ret_val .= '<p><b>Location:</b> ' . $this->registry['webpagetest']['data']->data->location . '</p>';
    $ret_val .= '<p><b>Connectivity:</b> ' . $this->registry['webpagetest']['data']->data->connectivity . '</p>';
    $ret_val .= '<p><b>Scores:</b></p><ul>';
    $ret_val .= '<li> Use persistent connections (keep alive): ' . $this->registry['webpagetest']['scores']->{'score_keep-alive'} . '</li>';
    $ret_val .= '<li> Use gzip compression for transferring compressable responses: ' . $this->registry['webpagetest']['scores']->score_gzip . '</li>';
    $ret_val .= '<li> Leverage browser caching of static assets: ' . $this->registry['webpagetest']['scores']->score_cache . '</li>';
    $ret_val .= '<li> Use a CDN for all static assets: ' . $this->registry['webpagetest']['scores']->score_cdn . '</li>';
    $ret_val .= '<li> Compress Images: ' . ($this->registry['webpagetest']['scores']->score_compress == -1 ? 'N/A' : $this->registry['webpagetest']['scores']->score_compress) . '</li>';
    $ret_val .= '</ul>';
    $ret_val .= '<p><b>Link to Images:</b></p><ul>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['images']->waterfall . '">Waterfall</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['images']->connectionView . '">Connection View</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['images']->checklist . '">Checklist</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['images']->screenShot . '">Screenshot</a></li>';
    $ret_val .= '</ul>';
    $ret_val .= '<p><b>Link to Detailed Reports:</b></p><ul>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['pages']->details . '">Details</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['pages']->checklist . '">Checklist</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['pages']->breakdown . '">Breakdown</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['pages']->domains . '">Domains</a></li>';
    $ret_val .= '<li> <a href="' . $this->registry['webpagetest']['pages']->screenShot . '">Screenshot</a></li>';
    $ret_val .= '</ul>';
  }
  else {
    $ret_val .= 'Full Report: ' . $this->registry['webpagetest']['data']->data->summary;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(4) . 'Location: ' . $this->registry['webpagetest']['data']->data->location;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(4) . 'Connectivity: ' . $this->registry['webpagetest']['data']->data->connectivity;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(4) . 'Scores:';
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Use persistent connections (keep alive): ' . $this->registry['webpagetest']['scores']->{'score_keep-alive'};
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Use gzip compression for transferring compressable responses: ' . $this->registry['webpagetest']['scores']->score_gzip;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Leverage browser caching of static assets: ' . $this->registry['webpagetest']['scores']->score_cache;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Use a CDN for all static assets: ' . $this->registry['webpagetest']['scores']->score_cdn;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Compress Images: ' . ($this->registry['webpagetest']['scores']->score_compress == -1 ? 'N/A' : $this->registry['webpagetest']['scores']->score_compress);
    $ret_val .= PHP_EOL . $this
      ->addSpaces(4) . 'Link to Images:';
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Waterfall: ' . $this->registry['webpagetest']['images']->waterfall;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Connection View: ' . $this->registry['webpagetest']['images']->connectionView;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Checklist: ' . $this->registry['webpagetest']['images']->checklist;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Screenshot: ' . $this->registry['webpagetest']['images']->screenShot;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(4) . 'Link to Detailed Reports:';
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Details: ' . $this->registry['webpagetest']['pages']->details;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Checklist: ' . $this->registry['webpagetest']['pages']->checklist;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Breakdown: ' . $this->registry['webpagetest']['pages']->breakdown;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Domains: ' . $this->registry['webpagetest']['pages']->domains;
    $ret_val .= PHP_EOL . $this
      ->addSpaces(6) . '* Screenshot: ' . $this->registry['webpagetest']['pages']->screenShot;
  }
  return $ret_val;
}