'page')); if ($page !== ABJ404_PP) { return; } $notice = get_transient('abj404_plugin_db_notice'); if (!is_array($notice)) { return; } $type = isset($notice['type']) ? $notice['type'] : ''; // Collation issues are developer-level; don't show them to the user. if ($type === 'collation') { return; } $noticeMessage = isset($notice['message']) && is_string($notice['message']) ? $notice['message'] : ''; if ($noticeMessage === '') { return; } $guidance = isset($notice['guidance']) && is_string($notice['guidance']) ? $notice['guidance'] : ''; // Same native notice shape either way; only the left border colour // differs. A condition the plugin degrades past (stale summary columns) // must not wear the red an unusable plugin wears. Payloads written // before this key existed carry no severity and stay errors. $severity = isset($notice['severity']) && $notice['severity'] === ABJ_404_Solution_DatabaseNoticeStateHolder::SEVERITY_WARNING ? 'notice-warning' : 'notice-error'; echo '

404 Solution: ' . esc_html($noticeMessage) . '

'; if ($guidance !== '') { echo '

' . esc_html($guidance) . '

'; } if (!empty($notice['error_string'])) { $errorString = is_string($notice['error_string']) ? $notice['error_string'] : ''; echo '
' . esc_html(__('Show database error details', '404-solution')) . ''; echo '
' . esc_html($errorString) . '
'; } echo '
'; } } if (!function_exists('abj404_show_runtime_integrity_notice')) { /** @return void */ function abj404_show_runtime_integrity_notice() { if (!is_admin() || !abj404_current_user_is_plugin_admin()) { return; } $page = ABJ_404_Solution_RequestInputNormalizer::readText($_GET, array('name' => 'page')); if ($page !== ABJ404_PP) { return; } $missing = get_transient('abj404_runtime_missing_files'); if (!is_array($missing) || count($missing) === 0) { return; } echo '

404 Solution: '; echo esc_html(__('Some required plugin files are missing. Please reinstall the plugin package.', '404-solution')); $missingBasenames = array(); foreach ($missing as $missingPath) { if (is_string($missingPath)) { $missingBasenames[] = basename($missingPath); } } echo '

' . esc_html(implode(', ', $missingBasenames)) . '

'; } }