PreprocessCss.php in Site Audit 8.2
Same filename and directory in other branches
Contains \SiteAudit\Check\Cache\PreprocessCss.
File
Check/Cache/PreprocessCss.phpView source
<?php
/**
* @file
* Contains \SiteAudit\Check\Cache\PreprocessCss.
*/
/**
* Class SiteAuditCheckCachePreprocessCss.
*/
class SiteAuditCheckCachePreprocessCss extends SiteAuditCheckAbstract {
/**
* Implements \SiteAudit\Check\Abstract\getLabel().
*/
public function getLabel() {
return dt('Aggregate and compress CSS files in Drupal');
}
/**
* Implements \SiteAudit\Check\Abstract\getDescription().
*/
public function getDescription() {
return dt('Verify that Drupal is aggregating and compressing CSS.');
}
/**
* Implements \SiteAudit\Check\Abstract\getResultFail().
*/
public function getResultFail() {
return dt('CSS aggregation and compression is not enabled!');
}
/**
* Implements \SiteAudit\Check\Abstract\getResultInfo().
*/
public function getResultInfo() {
return $this
->getResultFail();
}
/**
* Implements \SiteAudit\Check\Abstract\getResultPass().
*/
public function getResultPass() {
return dt('CSS aggregation and compression is enabled.');
}
/**
* Implements \SiteAudit\Check\Abstract\getResultWarn().
*/
public function getResultWarn() {
}
/**
* Implements \SiteAudit\Check\Abstract\getAction().
*/
public function getAction() {
if (!in_array($this->score, array(
SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS,
))) {
return dt('Go to /admin/config/development/performance and check "Aggregate and compress CSS files".');
}
}
/**
* Implements \SiteAudit\Check\Abstract\calculateScore().
*/
public function calculateScore() {
$config = \Drupal::config('system.performance')
->get('css.preprocess');
if ($config) {
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS;
}
if (site_audit_env_is_dev()) {
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}
return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL;
}
}
Classes
Name | Description |
---|---|
SiteAuditCheckCachePreprocessCss | Class SiteAuditCheckCachePreprocessCss. |