inspections['maintenance'] = new Maintenance(); } /** * @param InspectionBase $inspection */ public function registerInspection($inspection) { $this->inspections[$inspection->getName()] = $inspection; } public function runInspections() { $debug_data = [ 'message' => __('We\'re sorry, but something went wrong. Click on \'Learn more\' and follow each of the steps to quickly solve it.'), 'header' => __('The preview could not be loaded'), 'doc_url' => 'https://go.elementor.com/preview-not-loaded/', ]; foreach ($this->inspections as $inspection) { if (!$inspection->run()) { $debug_data = [ 'message' => $inspection->getMessage(), 'header' => $inspection->getHeaderMessage(), 'doc_url' => $inspection->getHelpDocUrl(), 'doc_text' => $inspection->getHelpDocText(), 'error' => true, ]; break; } } return $debug_data; } }