| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function evaluate() |
||
| 36 | { |
||
| 37 | // See if there are too many database queries |
||
| 38 | if ($this->sample->domInteractive >= self::MAX_DOM_INTERACTIVE_TIME) { |
||
| 39 | $displayDomInteractive = ($this->sample->domInteractive / 1000) . 's'; |
||
| 40 | $this->hasRecommendation = true; |
||
| 41 | $this->summary = Craft::t( |
||
| 42 | 'webperf', |
||
| 43 | 'The time before the user can interact with the page is too long', |
||
| 44 | [] |
||
| 45 | ); |
||
| 46 | $this->detail = Craft::t( |
||
| 47 | 'webperf', |
||
| 48 | 'The time to interactive was {displayDomInteractive}. Try to reduce this by reducing the amount of JavaScript that is executed on your page, and ensure that [Marketing Tags](https://nystudio107.com/blog/tags-gone-wild) are kept in check.', |
||
| 49 | [ |
||
| 50 | 'displayDomInteractive' => $displayDomInteractive, |
||
| 51 | ] |
||
| 52 | ); |
||
| 53 | $this->learnMoreUrl = 'https://developers.google.com/web/tools/lighthouse/audits/time-to-interactive'; |
||
| 54 | |||
| 55 | return; |
||
| 56 | } |
||
| 59 |