chore: remove error_log() debug calls (closes #21)#45
Merged
Conversation
The three error_log() calls in fetch_from_api() ran unconditionally in production and tripped WordPress.PHP.DevelopmentFunctions. The method already returns WP_Error with the message, and callers handle it with stale-cache fallback, so behavior is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Removes unconditional error_log() debug output from the Mastodon feed fetcher to satisfy Plugin Check/PHPCS (WordPress.PHP.DevelopmentFunctions) while keeping the existing WP_Error-based failure behavior used for stale-cache fallback.
Changes:
- Removed
error_log()calls on HTTP request failure, non-200 responses, and JSON decode failure inOUTPOST_Feed_Fetcher::fetch_from_api(). - Simplified the non-200 response path by inlining the error message into the returned
WP_Error.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Phase 5. Closes #21.
Removed the three
error_log()calls inOUTPOST_Feed_Fetcher::fetch_from_api(). They ran unconditionally in production and trippedWordPress.PHP.DevelopmentFunctions. The method already returnsWP_Errorwith the message and callers fall back to stale cache, so behavior is unchanged.PHPCS exit 0, 22/22 tests pass.
Closes #21
🤖 Generated with Claude Code