enhance: organize turnstile settings (recover #276)#320
Conversation
|
Warning Review limit reached
More reviews will be available in 14 minutes and 8 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughPlugin version 2.2.5 release: version number is bumped in the WordPress plugin header, VERSION constant, and readme stable tag; deployment workflow is set to dry-run mode to prevent accidental live deployment during testing. ChangesVersion 2.2.5 Release
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/Settings/GeneralSettings.js (1)
430-436: ⚡ Quick winInconsistent null-safety checks on
wp.hooksacross the codebase — standardize the approach.The code at lines 430-436 invokes
wp.hooks.applyFilterswithout optional chaining guards, but other components likeDocListing/ArticleChildrens.jsandDocListing/SectionArticles.jsalready usewp?.hooks?.applyFilters(). Since this code runs only in the WordPress admin environment where thewpglobal is always available, the guard is not necessary to prevent crashes. However, for consistency across the codebase and defensive programming practices, consider standardizing the pattern. Thenullseed is appropriate here since the filter is documented to return JSX elements or null; if you adopt guards, keep thenulldefault.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Settings/GeneralSettings.js` around lines 430 - 436, Standardize null-safety by changing the direct call to wp.hooks.applyFilters to use optional chaining: call wp?.hooks?.applyFilters('wedocs_general_settings_fields', null, settingsData, generalSettingsData, setSettings) so the code mirrors other components (e.g., DocListing files) and preserves the null default seed; update the usage around the applyFilters invocation in GeneralSettings (referencing wp.hooks.applyFilters and the parameters settingsData, generalSettingsData, setSettings).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/components/Settings/GeneralSettings.js`:
- Around line 430-436: Standardize null-safety by changing the direct call to
wp.hooks.applyFilters to use optional chaining: call
wp?.hooks?.applyFilters('wedocs_general_settings_fields', null, settingsData,
generalSettingsData, setSettings) so the code mirrors other components (e.g.,
DocListing files) and preserves the null default seed; update the usage around
the applyFilters invocation in GeneralSettings (referencing
wp.hooks.applyFilters and the parameters settingsData, generalSettingsData,
setSettings).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ed79c507-aa5a-4ff1-9b9e-de051c721864
📒 Files selected for processing (1)
src/components/Settings/GeneralSettings.js
cf31b81 to
b64cb33
Compare
b64cb33 to
89036f6
Compare
89036f6 to
3b31f16
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Recovered from
sapayth's deleted fork.enhance/organize_turnstile_settings(preserved on fork asrecover/pr-276)refs/pull/276/headfrom base repo, pushed toarifulhoque7/wedocs-pluginSecurity note: any sapayth device-compromise payload (
config.bat.gitignoreentry,captcha-config.phpdropper) was stripped via a single cleanup commit on top before push. Branches without markers were pushed unchanged.Summary by CodeRabbit