| @@ -45,27 +45,13 @@ | ||
| 45 | 45 | * @param StatisticsScope|null $scope |
| 46 | 46 | * @return array [ 'no_enrollment' => int, 'no_content' => int, 'pending_review' => int, 'quiz_low_pass' => int ] |
| 47 | 47 | */ |
| 48 | 48 | public function get_checks( ?StatisticsScope $scope = null ): array { |
| 49 | - $sig = $scope ? $scope->signature() : array( 0, 0 ); | |
| 50 | - // The low-pass quiz check depends on these filters, so vary the key on them — | |
| 51 | - // otherwise a threshold change stays masked until the TTL expires. | |
| 52 | - $quiz_config = array( | |
| 53 | - (float) apply_filters( 'learn-press/statistics/quiz-pass-alert', 50 ), | |
| 54 | - (int) apply_filters( 'learn-press/statistics/quiz-pass-alert-min-attempts', 5 ), | |
| 55 | - ); | |
| 56 | - | |
| 57 | - return StatisticsCache::remember( | |
| 58 | - 'health_checks', | |
| 59 | - array( $sig, $quiz_config ), | |
| 60 | - function () use ( $scope ) { | |
| 61 | - return array( | |
| 62 | - 'no_enrollment' => $this->count_courses_without_enrollment( $scope ), | |
| 63 | - 'no_content' => $this->count_courses_without_content( $scope ), | |
| 64 | - 'pending_review' => $this->count_pending_courses( $scope ), | |
| 65 | - 'quiz_low_pass' => $this->count_low_pass_quizzes( $scope ), | |
| 66 | - ); | |
| 67 | - } | |
| 49 | + return array( | |
| 50 | + 'no_enrollment' => $this->count_courses_without_enrollment( $scope ), | |
| 51 | + 'no_content' => $this->count_courses_without_content( $scope ), | |
| 52 | + 'pending_review' => $this->count_pending_courses( $scope ), | |
| 53 | + 'quiz_low_pass' => $this->count_low_pass_quizzes( $scope ), | |
| 68 | 54 | ); |
| 69 | 55 | } |
| 70 | 56 | |
| 71 | 57 | /** |