Skip to content

enhance: organize turnstile settings (recover #276)#320

Open
arifulhoque7 wants to merge 4 commits into
weDevsOfficial:developfrom
arifulhoque7:recover/pr-276
Open

enhance: organize turnstile settings (recover #276)#320
arifulhoque7 wants to merge 4 commits into
weDevsOfficial:developfrom
arifulhoque7:recover/pr-276

Conversation

@arifulhoque7
Copy link
Copy Markdown
Contributor

@arifulhoque7 arifulhoque7 commented May 20, 2026

Recovered from sapayth's deleted fork.

  • Original closed PR: enhance: organize turnstile settings #276
  • Head branch: enhance/organize_turnstile_settings (preserved on fork as recover/pr-276)
  • Recovery method: fetched refs/pull/276/head from base repo, pushed to arifulhoque7/wedocs-plugin

Security note: any sapayth device-compromise payload (config.bat .gitignore entry, captcha-config.php dropper) was stripped via a single cleanup commit on top before push. Branches without markers were pushed unchanged.

Summary by CodeRabbit

Documentation

  • Enhanced General Settings panel documentation with expanded descriptions and comments.

New Features

  • General Settings panel now supports extensibility, allowing additional settings fields to be injected through WordPress hooks.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Walkthrough

GeneralSettings component adds documentation and extensibility for the wedocs_general_settings_fields WordPress filter hook. JSDoc describes the component and filter contract. Implementation invokes the hook to allow external code to inject additional settings fields into the General Settings panel.

Changes

General Settings Hook Extensibility

Layer / File(s) Summary
Hook-driven settings extensibility
src/components/Settings/GeneralSettings.js
JSDoc header documents the General Settings component and the wedocs_general_settings_fields filter contract. Implementation adds a hook invocation that passes settingsData, generalSettingsData, and setSettings to allow external filters to inject custom fields. Inline comment labels the legacy template section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A filter hook hops into view,
Where settings dance in WordPress brew,
External code may now inject,
Extensions brought with hook respect,
The legacy stays, but now can grow—
A pluggable path for friends to know!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The pull request title mentions 'organize turnstile settings' and references PR #276 recovery, but the actual changes only add JSDoc documentation and a WordPress filter hook to GeneralSettings.js with no turnstile-related modifications. Update the title to accurately reflect the changes made, such as 'feat: add WordPress filter hook to GeneralSettings for extensible settings fields' or clarify the scope of turnstile settings organization in this PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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).
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/Settings/GeneralSettings.js (1)

430-436: ⚡ Quick win

Inconsistent null-safety checks on wp.hooks across the codebase — standardize the approach.

The code at lines 430-436 invokes wp.hooks.applyFilters without optional chaining guards, but other components like DocListing/ArticleChildrens.js and DocListing/SectionArticles.js already use wp?.hooks?.applyFilters(). Since this code runs only in the WordPress admin environment where the wp global 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. The null seed is appropriate here since the filter is documented to return JSX elements or null; if you adopt guards, keep the null default.

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9110f3d and cf31b81.

📒 Files selected for processing (1)
  • src/components/Settings/GeneralSettings.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants