The OAuth callback URL was returning 404 errors due to WordPress not recognizing
the custom /oauth/callback route. This commit implements a comprehensive fix using
multiple approaches to ensure OAuth callbacks are properly handled.
Changes:
- Add parse_request hook to directly intercept OAuth callback URLs
- Implement regex pattern matching for /oauth/callback requests
- Add fallback query var registration methods
- Include comprehensive error logging for debugging
- Maintain backward compatibility with existing rewrite rules
The parse_request implementation successfully bypasses WordPress's standard
rewrite rule processing, ensuring OAuth callbacks are caught and processed
before a 404 can occur. Verified working with successful token exchange.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>