enhance: organize turnstile settings (recover #276)#320
Conversation
WalkthroughGeneralSettings component adds documentation and extensibility for the ChangesGeneral Settings Hook Extensibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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 |
Resolved conflicts via EOL-aware 3-way merge + per-file decisions: - wedocs.php require_once area: kept both block-styles + DocsGrid registrations. - tailwind.config.js (310): kept PR's CommonJS form (develop's import-tangled form is currently syntactically invalid). - Translations (.pot), build artefacts, .nvmrc: taken from develop. - Files where develop's implementation supersedes PR's intent: taken from develop (canonical).
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
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
Documentation
New Features