Repository navigation
Fix incorrect maint functions include path - #96
Merged
Merged
Conversation
The maint plugin relocated functions.php to includes/functions.php, so the old require_once(plugins/maint/functions.php) now fatals with a missing file whenever the maint plugin is enabled. Probe for the relocated includes/functions.php first and fall back to the legacy top-level path, logging an error if neither exists instead of fataling. The downstream plugin_maint_check_webseer_url() call is already guarded by function_exists(), so a missing include degrades gracefully. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fix preserves legacy compatibility and the guarded maintenance check, with no unresolved findings.
0 open findings
What changed in this PR
Fixes maintenance-plugin loading so relocated helper files no longer abort Webseer poller checks.
Changes:
- Prefer the new
includes/functions.phplocation, with legacy fallback. - Log an error when neither file exists instead of attempting a missing-file include.
| File | Description |
|---|---|
webseer_process.php |
Adds compatible maintenance-helper loading and missing-file handling. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xmacan
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
maintplugin relocatedfunctions.phpinto itsincludes/subdirectory (plugins/maint/includes/functions.php); the old top-levelplugins/maint/functions.phpno longer exists.webseer_process.phpstill does:With the maint plugin enabled, that
require_onceon a now-missing file throws a fatal error and aborts the URL check in the poller process.Fix
Probe for the relocated
includes/functions.phpfirst, fall back to the legacy top-level path for older maint installs, and log an error instead of fataling if neither is present:The downstream
plugin_maint_check_webseer_url()call is already guarded byfunction_exists(), so a missing maint include now degrades gracefully instead of crashing the poller.Notes
plugin_servcheck(PR #134). A deliberate anti-pattern to avoid isfile_exists(require_once(...)), which evaluatesrequire_onceinside thefile_exists()argument (including the file as a side effect, or fataling when it is absent).webseer_process.phpis already listed as a CLI/daemon entry point intests/bin/patch-coverage.php.php -lpasses on the changed file.