ted
(Ted Johansson)
06.Сентябрь.2024 08:56:51
9
Скорее всего, это происходит потому, что существует трекер проверки проблемы, но логика самой проверки больше не существует. Наиболее вероятная причина такого сценария — установка плагина с проверкой проблемы, а затем его удаление. В этом случае трекер остаётся, но логика проверки отсутствует.
У меня есть исправление для этого здесь:
main ← dev/clear-trackers-for-uninstalled-checks
merged 02:11AM - 18 Sep 24 UTC
### What is this change?
When running checks, we look to the existing problem… check trackers and try to grab their `ProblemCheck` classes.
In some cases this is no longer in the problem check repository, e.g. when the check was part of a plugin that has been uninstalled.
In the case where the check was scheduled, this would lead to an error in one of the jobs.
### How does this fix it?
This fix has two parts:
1. If a problem check tracker can't find it's `ProblemCheck` class, it destroys itself and any admin notices associated with it. It then returns `nil`.
2. The job that selects which checks to run now accounts for the fact that the `ProblemCheck` class could be `nil`, and filters it out of the run.
Bonus:
- Scheduled checks now honour the `enabled = false` configuration, same as realtime checks.
2 лайка