You are here

public function SiteAuditCheckExtensionsCount::getAction in Site Audit 8.2

Same name and namespace in other branches
  1. 7 Check/Extensions/Count.php \SiteAuditCheckExtensionsCount::getAction()

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

Overrides SiteAuditCheckAbstract::getAction

File

Check/Extensions/Count.php, line 57
Contains \SiteAudit\Check\Extensions\Count.

Class

SiteAuditCheckExtensionsCount
Class SiteAuditCheckExtensionsCount.

Code

public function getAction() {
  if ($this->score != SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS) {
    $ret_val = dt('Consider the following options:') . PHP_EOL;
    $options = array();
    $options[] = dt('Disable unneeded or unnecessary extensions.');
    $options[] = dt('Consolidate functionality if possible, or custom develop a solution specific to your needs.');
    $options[] = dt('Avoid using modules that serve only one small purpose that is not mission critical.');
    if (drush_get_option('html')) {
      $ret_val .= '<ul>';
      foreach ($options as $option) {
        $ret_val .= '<li>' . $option . '</li>';
      }
      $ret_val .= '</ul>';
    }
    else {
      foreach ($options as $option) {
        if (!drush_get_option('json')) {
          $ret_val .= str_repeat(' ', 6);
        }
        $ret_val .= '- ' . $option . PHP_EOL;
      }
      if (!drush_get_option('json')) {
        $ret_val .= str_repeat(' ', 6);
      }
    }
    $ret_val .= dt('A lightweight site is a fast and happy site!');
    return $ret_val;
  }
}