Repository navigation
fix: answer blocked and demo-mode site frontends with 403, not 500 - #2021
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Set locked-site denial response codes inc/managers/class-site-manager.php |
The keep-until-live demo denial and generic locked-site denial now pass HTTP 403 to wp_die(). |
Priority:
Estimated code review effort: 1 (Trivial) | ~4 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 72519
-
Blocked site frontends return the intended 403 response instead of 500.
Pre-merge checks: 
5
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
Summary
Site_Manager::lock_site()callswp_die()without a response code for locked (inactive membership) and keep-until-live demo sites, so WordPress answers HTTP 500. These are deliberate access blocks, not server errors; the 500s trigger 5xx monitoring and tell crawlers the site is broken.Both calls now pass
['response' => 403]. Message, redirects and the reactivation filter are unchanged.Evidence
Production (tgc.church host): a blocked site returned
500with "This site is not available at the moment"; it was the largest single 5xx source in the rolling 24h error audit.Verification
php -l inc/managers/class-site-manager.phpSummary by CodeRabbit