Skip to content

feature: selectable docs URL structure (recover #310)#315

Open
arifulhoque7 wants to merge 327 commits into
weDevsOfficial:developfrom
arifulhoque7:recover/pr-310
Open

feature: selectable docs URL structure (recover #310)#315
arifulhoque7 wants to merge 327 commits into
weDevsOfficial:developfrom
arifulhoque7:recover/pr-310

Conversation

@arifulhoque7
Copy link
Copy Markdown
Contributor

@arifulhoque7 arifulhoque7 commented May 20, 2026

Recovered from sapayth's deleted fork.

  • Original closed PR: feature: selectable docs URL structure #310
  • Head branch: feature/selectable_docs_url_structure (preserved on fork as recover/pr-310)
  • Recovery method: fetched refs/pull/310/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

  • New Features

    • Added Docs URL Structure settings with configurable URL patterns and before/after preview examples
    • Enhanced breadcrumb navigation with improved ancestor chain handling and title formatting
  • Chores

    • Internal UI component improvements and tooling updates

Review Change Stack

MdAsifHossainNadim and others added 30 commits November 6, 2023 16:58
weDevsOfficial#184)

* revert: move-wedocs-collapse-expand-settings-from-general-to-layout-panel

* enhance: implement-collapse-expande-prompts-settings-on-layout-prompts-page
…fficial#183)

* enhance: added-documentation-creation-delete-permission-for-permitted-users

* enhance: make-actions-for-collective-status-update

* enhance: add doc creation capabilities for all users & make creation reactive

* enhance: add-parent-documentation-creation-permission-for-all-users
* enhance: handle-draft-docs-permission-&-settings

* enhance: implement-switch-to-draft-action
…#178)

* enhance: add-edit-role-add-default-for-global-settings

* insert: add-editor-role-insertion-build-file
…eDevsOfficial#175)

* fix: documentation-archive-page-section-article-title-truncted-issue

* fix: merge-conflicts
* feat: implement-single-doc-page-searching-ui

* enhance: build-search-data-listing-&-ui

* enhance: check-single-doc-page-&-organized-codebase

* fix: search-clean-icon-size

* enhance: doc-search-popup-make-compatible-with-pro-version

* enhance: update-list-icon

* fix: search-box-ui-inconsistencies

* fix: alignment-&-search-form-css-fixes
)

* enhance: organized-plugin-assets

* fix: media-overloading-issue

* fix: remove-multiple-localized-scripts-&-fix-dynamic-url-redirection-issue

* fix: spacing-issue-on-assets-enqueue
* fix: single-doc-page-search-filter-ui-stuff

* enhance: update-search-popup-ui-&-make-scalable-with-pro

* enhance: update-search-color-panels-js-implementation

* fix: remove-redunded-codes
…fficial#186)

* fix: single-doc-page-search-filter-ui-stuff

* fix: n0-releasing-content-inconsistencies

* fix: n0-releasing-explore-&-doc-search-inconsistencies

* fix: single-doc-page-search-filter-ui-stuff

* fix: single-doc-page-search-filter-ui-stuff

* fix: translation-stuff

* fix: translation-stuff-&-update-readme-changelog-version-stuff
…icial#187)

* enhance: handle-ui-loading-inconsistencies-stuff

* enhance: optimize-docs-fetching-request-&-separate-parent-section-listing-page-request

* enhance: remove-set-loadings-from-resolvers

* enhance: update-plugin-screenshot-&-upgrader-plugin-version
)

* fix: revamp-docs-delete-api-&-fix-deletion-permission-error

* fix: migrated-docs-reactivity-issue

* revert: remove-redunded-codes
…l#188)

* enhance: add-article-children-list-in-docs-listing-page

* enhance: add-draggable-option-for-article-children

* enhance: add-wedocs-content-extraction-function-&-update-children-getter-function

* release: add-releasing-logs-for-version-2-1-2
iftakharul-islam and others added 25 commits February 18, 2026 17:48
* Add use_wedocs_legacy_template helper

Introduce use_wedocs_legacy_template() to determine whether the legacy template should be used. The function checks an explicit general.use_legacy_template setting, falls back to the installed wedocs version and wp_is_block_theme() and auto-updates wedocs_settings to 'on' for installs older than 2.1.19 on non-block themes (and 'off' for block themes). Also includes minor whitespace/formatting cleanup in nearby code.

* Add legacy template setting and loader check

Add a "Use Legacy Template" toggle to General Settings (new Switcher field with tooltip) so admins can enable/disable the legacy PHP template for single doc pages. Update Frontend::template_loader to short-circuit and return the original template when the legacy template is not enabled (use_wedocs_legacy_template() returns false), allowing the new builder template to be used.
* Sidebar responsive screen query

* Pre-render block header/footer for block themes

For block themes, pre-renders block header and footer (using output buffering) before wp_head() so the Interactivity API import map and script modules are discovered and registered, then echoes the captured HTML inside the body. Also normalizes spacing/formatting throughout the template, adjusts placement of wp_body_open and wrapper markup, and preserves existing behavior for non-block themes.

* Fix CodeRabbit review issues: merge duplicate media query and add output escaping (weDevsOfficial#299)

* Initial plan

* Fix CodeRabbit review issues: merge duplicate media query and add output escaping

Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>

* Build CSS from LESS with responsive fixes

Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>

* Delete assets/build/editor.asset.php

* Delete assets/build/editor.js

* Delete assets/build/frontend.asset.php

* Delete assets/build/frontend.css

* Delete assets/build/index.asset.php

* Delete assets/build/index.js

* Delete assets/build/store.asset.php

* Delete assets/build/store.js

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>

* update build

* Rebuild assets: use react-jsx-runtime

Replace 'react' with 'react-jsx-runtime' in editor.asset.php and rebuild bundled assets. Updated generated files (assets/build/editor.asset.php, editor.js, index-rtl.css, index.asset.php, index.js, store.asset.php, store.js) to reflect the dependency change and new build/version hashes.

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* feat: Integrate search form with modal functionality

- Convert doc-search-form.php from form submission to modal-based search
- Remove Button Style and Button Size controls from PrintButton block
- Fix JavaScript null reference errors in frontend.js
- Enable search modal functionality on all pages (not just single docs)
- Add defensive programming to prevent querySelector errors
- Maintain original design while enabling quick search functionality
- Fix CSS positioning to keep search icon on right side

Changes:
- templates/doc-search-form.php: Added modal integration with CSS fixes
- assets/js/frontend.js: Fixed null reference errors and enabled modal on all pages
- includes/Frontend.php: Set isSingleDoc to true for universal modal access
- PrintButton block: Removed buttonStyle and buttonSize attributes and controls

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Preserve AI integration flag when saving settings

When updating wedocs_settings, preserve the existing integrate_ai value if the incoming payload omits or clears it. The code reads the current option and copies integrate_ai into the filtered settings when present, preventing accidental clearing of the AI connection state during general settings updates.

* Preserve integrate_ai on settings save

Use array_key_exists when merging integrate_ai from existing wedocs_settings into the new payload. The previous !empty check could drop explicit falsy values (e.g. false or 0); the new condition preserves the existing integrate_ai value when the key exists in the stored settings but is absent from the incoming settings_data_filtered.
Update plugin/package version to 2.2.0 across package.json, package-lock.json, wedocs.php and readme.txt (Stable tag and VERSION constant). Add v2.2.0 changelog entries covering new features (search modal, responsive sidebar, legacy theme option, shortcode pagination) and bug/security fixes. Regenerate package-lock.json to reflect dependency metadata changes.
Add the missing closing curly brace and </style> tag to templates/doc-search-form.php to properly terminate the inline CSS block. This prevents broken markup/CSS leakage and fixes the search form layout.
* Fix: tailwind something-[xyz] not working

* Update postcss.config.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Add AI image analysis support with vision models

Introduces image upload, deletion, and analysis endpoints to the API for AI Doc Writer, including backend image processing, validation, and cleanup. Updates AI provider configs to include vision capability metadata for models, adds UI and settings support for enabling image analysis, and integrates image payload handling in the AI Doc Writer modal and service. Also implements scheduled cleanup of temporary images and ensures compatibility with Pro features and extensibility via hooks and filters.

* Add AI image analysis pro feature preview

Introduces the AiImageAnalysisPreview component to display a pro feature preview for AI image analysis in the settings. The preview is shown when the pro version is not loaded, informing users about the feature and its impact on API token usage.

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve AI image upload/analysis and security

Refactor AI image handling to use WP attachments, strengthen validation and security, and add configurable max upload size.

- Validate and sanitize the images request param (accepts IDs or objects), with detailed validation callbacks.
- upload_temp_image now stores uploads in the WP media library (media_handle_upload), uses finfo/wp_check_filetype_and_ext/getimagesize to validate MIME and content, enforces image dimension limits, and marks attachments as temporary via post meta.
- Remove legacy temp-file endpoint/flow and temp-dir cleanup code; scheduled cleanup functions were removed in favor of using attachment metadata.
- Add pro-feature checks for image analysis and permission checks to ensure user can access attachments.
- Replace filename-based helpers with attachment-based helpers: get_image_base64() and get_image_media_type() now operate on attachment IDs and re-validate file contents.
- Sanitize AI-generated HTML output with wp_kses and whitelist allowed tags/attributes.
- Settings: add image_analysis.max_size (KB) sanitization and limits (100KB–5120KB) in SettingsApi; add UI in AiSettings.js to configure max_size with frontend bounds and display.

These changes eliminate ad-hoc temp file handling, improve security against malformed or malicious uploads, and make maximum upload size configurable.

* Harden uploads and sanitize AI settings

Improve file upload security by normalizing MIME types, using finfo to detect real MIME, and cross-validating against an allowlist; update error messaging and always prefix uploaded filenames with a unique ID to avoid conflicts. Add temperature to AI request payload. Replace direct ai settings localization with wedocs_get_ai_settings_for_frontend(), which strips sensitive fields (API keys/secrets) and exposes a has_api_key flag per provider. Also remove registration of the deactivation hook for AI cleanup cron.

* feat: add pro preview for screenshots section in AI Doc Writer modal

Adds a locked pro preview of the image upload (Screenshots) section
inside the AI Doc Writer block editor modal for free users.

- Add AiDocWriterImageUploadPreview component with a disabled drop zone,
  PRO badge, and hover tooltip matching the backend UpgradeTooltip design
  (features list, green checkmarks, indigo upgrade button) using inline
  styles to work correctly in the block editor context where Tailwind
  is not loaded
- Add src/editor/ProPreviews.js as a generic entry point for all block
  editor pro preview filters, replacing the feature-specific
  AiDocWriterProPreview.js
- Register the preview via the wedocs_ai_doc_writer_modal_fields filter
  (priority 5); bypassed automatically when Pro plugin is active via
  wedocs_pro_loaded filter check
- Import ProPreviews from the editor bundle entry point (src/editor/index.js)

* Add dynamic AI model listing & cleanup job

Add a REST endpoint to fetch provider model lists (/ai/models/{provider}) and implement provider-specific fetchers (OpenAI, Anthropic, Google). Results are normalized, cached in a transient for one hour, and fall back to the static config when no API key is present or the remote call fails. Add helpers to normalize static models and pattern-based vision detection plus use cached dynamic lists when available. Improve MIME detection by using the finfo class, harden attachment metadata reads, and tweak AI settings sanitization. Update provider model IDs/names in static configs. Frontend: fetch live model lists from the new endpoint, show loading state, add a refresh button and spinner, and wire apiFetch. Schedule a daily WP-Cron to remove temporary AI image attachments on activation and clear the hook on deactivation; implement the cleanup routine. Misc: avoid repeated option reads when preparing frontend AI settings.

* Remove AI temp image cleanup and scheduling

Remove the wedocs_cleanup_ai_temp_images handler and its cron scheduling. The cleanup function and its add_action were deleted from includes/API/API.php, and related scheduling logic (activation scheduling, deactivation hook and deactivate method) were removed from wedocs.php. This stops the plugin from scheduling or running the daily WP-Cron job that deleted temporary AI-generated attachments.

* Remove temporary metadata on attachments

Stop setting _wedocs_ai_temp and _wedocs_ai_temp_created post meta when creating attachments in the API. These lines previously marked attachments as temporary for cleanup; removing them prevents attachments from being incorrectly flagged as temporary and defers cleanup handling to other logic.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* block rendering in the editor

* colors in preview

* cleanup

* set default padding

* proper link

* add drop shadow support

* preview and block icon added

* initial setup

* quick search input field stylings

* initial frontend modal rendering

* feat: Add Print Button block

* initial search response

* frontend search better UX

* frontend UX improvement

* fix: change color UI default block

* fix: frontend design

* search modal styling

* Modal Docs Source implementation

* section, article checking for predefined docs

* added show icon option

* cs fixes

* alignment option added

* block editor settings added

* fix : coderabbit issues

* feat: doc navigation block

* Added Helpful feedback

* color and hover color fixes for multi-level links

* support for menu_order = 0

* Add contributor

* fix: unused design

* enhance: image in quick search result

* Showing multiple authors

* WIP

* enhance: drop shadow on doc nav block

* custom shadow option added

* better UX

* WIP

* initial sidebar block settings

* section box styling

* update block settings

* enhance Sections Order By

* enhance: Sections Order By name

* enhance: article order by

* Configured wedocs new package system

* frontend rendering with styles

* cleanup

* TOC block added

* TOC generation issue fix.

* fix: conflict with existing quick search

* Latest Build Added

* WIP

* Old meta value connected

* wp/script version 30

* remove build folder

* align DocsGrid, QuickSearch blocks

* initial template

* template wip

* tweaks, error handlings

* fixed undefined error

* Fixed: deprecated errors

* fixed allignment

* WIP

* Add Helpful Feedback block for articles

Introduces a new 'Helpful Feedback' block with customizable voting buttons, styling options, and server-side rendering for docs articles. Updates Contributors block to restrict rendering to docs post type and registers the new block in the main index.

* Update color controls to use 'wedocs' text domain

Replaced all instances of the 'block-responsive' text domain with 'wedocs' in ColorsControls.js for consistency with the plugin's localization. Also fixed a variable reference in ListItems.js to use attributes.containerBackgroundColor directly.

* remove old lock file

* use wp-script v30 to render blocks

* Prevent direct access

* Added Social Share Block

* Add AI Summary and Doc Actions blocks, enhance styling

Introduces a new AI-Powered Summary block with collapsible functionality, custom icons, and extensive style controls. Adds a new Doc Actions block (initial files). Refactors Contributors block to use shared style panels and improves InspectorControls organization. Updates block.json files for better support of color, spacing, and typography options. Adds a common controls utility for Inspector panels.

* Added Font Switcher Block

* Update view.js

* Fix AI summary bLock

* Fix FontSizeSwitcher Block

* add build files

* align .gitignore with develop

* remove nested `weDocs`

* Bump dependencies & update lockfile

Update package.json to bump @wordpress/scripts and regenerate package-lock.json. The lockfile was updated after installing new versions (including @wordpress/scripts ^30.25.0), adds copy-webpack-plugin, and includes many dependency version upgrades (notably multiple @babel/* packages) and accompanying metadata fixes. Regenerated lockfile to lock the upgraded dependency tree.

* Update wedocs category

* update Sidebar docs render on single docs

* docs grid pagination added

* sidebar doc render updated to single

* Sidebar: scope fetched docs to current post tree

When editing a docs post, fetch the current post from selectors and determine its topmost ancestor via a new findRootParent helper (walks parents using wp.apiFetch). Use that root ID to filter REST API results to only the docs within the current section tree before building the hierarchical sections. Also add currentPost.id to the effect dependencies so the data refreshes when switching posts.

* Removed helpful block top note block name

* Updated single block tempalte

* Update HelpfulModal AJAX payload and render output

Add localized AJAX data to the server-rendered HelpfulModal (needMoreHelpAjax with ajaxUrl and nonce) and guard it with WEDOCS_NEED_MORE_HELP_AJAX_LOCALIZED to avoid duplicate output. Update the frontend view to use the backend's expected AJAX action and payload keys: action changed to wedocs_contact_feedback, subject default set to "Need More Help", send doc_id instead of page_url, and use _ajax_nonce. Also includes small PHP whitespace/indentation cleanups.

* Update controls

* Removed build

* WIP

* Reset DB templates missing required blocks

Add a required_blocks list and maybe_reset_db_template() to detect and delete DB-stored wp_template posts that are missing required wedocs blocks so the plugin's file-based template takes precedence. The check runs once per plugin version (stored in an option). Also add get_db_template() helper and reuse the template file contents when registering block templates. Minor docblock update: QuickSearch AJAX @SInCE changed to 2.2.0.

* DocsGrid: tidy render, settings and styles

Remove text color control from block.json and simplify experimental default controls. Improve render.php by normalizing whitespace/formatting, fixing current page detection for front-page pagination, wrapping output with get_block_wrapper_attributes, adding paginate_links 'type' => 'list', and cleaning up markup/indentation (SVG attributes, anchor/style spacing, section/article HTML). Use CSS gap variable in style.scss (var(--wp--style--block-gap, 1.5rem)) for theme-consistent spacing.

* Add per-element typography controls

Introduce per-element typography support for the DocsGrid block. Adds a reusable TypographyGroup component using native FSE/Gutenberg controls (FontSizePicker, FontFamily, LineHeight, FontAppearance) that reads theme font sizes/families via useSettings, and wire up Title, Button and Pagination typography panels in the block inspector. Adds corresponding attributes to block.json (fontSize, fontWeight, fontFamily, lineHeight for title/button/pagination), applies those attributes in edit.js for the editor preview, and outputs CSS vars / inline styles in render.php for the frontend. Update style.scss to consume the new pagination CSS variables. Overall enables theme-aware, per-element typography configuration.

* Add advanced typography controls to DocsGrid

Replace the old typography PanelBody/VStack with the native ToolsPanel/ToolsPanelItem pattern and add additional typography controls (letter-spacing, text-decoration, text-transform) to the DocsGrid block. Introduces a keys map and helper setters/resetters in StyleControls.js, wires new attributes in block.json, updates edit.js to apply the new attributes to inline styles, updates render.php to emit corresponding CSS variables, and uses those variables in style.scss for pagination. These changes make the block's typography UI match the FSE editor pattern and enable more granular styling for title, button, and pagination elements.

* Add system font fallback to Typography control

Introduce a SYSTEM_FONTS constant and prefer theme-provided typography.fontFamilies; when none are registered, fall back to a curated list of system/web-safe fonts so the FontFamily control remains usable. Rename the second useSettings return to themeFontFamilies for clarity and default the FontFamily panel to shown (isShownByDefault). Add explanatory comments.

* Add inline layout option to HelpfulFeedback

Introduce a new boolean attribute inlineLayout (default false) to the HelpfulFeedback block to allow displaying the question and buttons in a single row. Editor: add a ToggleControl to edit.js that sets inlineLayout and update the block wrapper class to include "inline-layout" when enabled. Server: read inlineLayout in render.php and add the inline-layout CSS class to the output. Styles: add SCSS rules to style.scss to arrange title and buttons inline with alignment handling and responsive tweaks. This provides a compact inline presentation option while keeping existing layouts intact.

* Add truncate and collapse options to Breadcrumb

Introduce truncation and collapsing behavior for the Breadcrumb block. Added new block attributes (truncateTitle, maxTitleLength, collapseBreadcrumbs, maxVisibleItems) with defaults in block.json, new Range/Toggles in the Inspector to control them, and UI state in edit.js to preview truncation and collapsed middle items (including an expandable collapsed indicator). Server render (render.php) now respects these attributes: it collapses long breadcrumb trails into an ellipsis item and truncates long titles server-side via helper functions, and includes accessibility/title attributes for links and collapsed indicators.

* HelpfulModal: add layout & button trigger

Introduce layout and trigger button options for the HelpfulModal block. Adds new attributes (layout, triggerStyle, triggerButtonBgColor, triggerButtonTextColor, triggerButtonBorderRadius, triggerButtonPadding) and Inspector controls (layout and trigger ToggleGroup, color palettes, border radius, padding) in the editor for configuring stacked vs row layout and link vs button triggers. Editor preview logic now adapts styles and markup for row/staked modes and button styling. Server-side render.php updated to respect the new attributes (builds inline styles, outputs icon circle/SVG for row layout, and conditionally outputs button classes/styles). Added SCSS for .layout-row and .trigger-button interactions. These changes enable consistent editor preview and front-end rendering for the new layout and trigger styling options.

* fixed: Print button block

* Support text-only Social Share buttons

Introduce a new "text-only" variant for SocialShare buttons. edit.js: add conditional class, adjust inline styles for transparent background and color, and hide icons in the editor when buttonStyle is 'text-only'. render.php: output the new class and inline style for front-end links to render transparent background and use platform color for text when text-only. style.scss: add .wedocs-social-btn-text-only rules to remove background/border/shadow and tweak padding and hover. wedocs.php: comment out the AdvanceContributors block directory to disable its build inclusion.

* Group style controls and refactor date formatter

Reorganize the LastUpdated block inspector UI by closing the main InspectorControls earlier and introducing a separate InspectorControls group="styles" for color and typography settings; remove the padding and margin SpacingPanel entries. In render.php, add a function_exists guard around wedocs_format_last_updated_date to avoid redeclaration and refactor the switch into a PHP 8 match expression for more concise date-format handling (including the 'relative' human_time_diff case).

* DocActions: default text color & text-button

Change default textColor to #1e1e1e and prevent text-style buttons from rendering borders/shadows. Inline styles in edit/save now only include border properties when buttonStyle !== 'text', and .style-text rules were strengthened with !important for border, background, and box-shadow to ensure text buttons remain visually plain.

* Reorganize InspectorControls and contributors

Reorganize block inspector UI and improve contributors/block rendering.

- Move style-related panels into InspectorControls group="styles" for AISummary and SocialShare to better separate style controls.
- AdvanceContributors: remove the deprecated 'rounded' avatar option from block.json and simplify avatar radius handling in the editor (circle vs square). Add new editor controls: avatar link behavior (with custom URL), contributor gap, enableSchema toggle, and additional CSS classes; remove duplicated Advanced panel.
- AdvanceContributors render: make border parsing more robust (support unified border object, per-side format, and legacy keys), support both array and string borderRadius formats, and simplify avatar shape output.
- Contributors render: use get_block_wrapper_attributes to build wrapper with classes and inline styles for improved block support integration.

These changes improve editor UX, add configurable contributor options, and make front-end style parsing more resilient to different control formats.

* Group InspectorControls for style panels

Refactor block inspector markup to separate style controls into a dedicated InspectorControls group. Close the primary InspectorControls earlier and add InspectorControls group="styles" wrappers around ColorSettingsPanel / style-related ToolsPanel in DocActions, FontSizeSwitcher, HelpfulModal, PrintButton, and ReadingProgress so style settings are grouped separately from advanced/display panels. This organizes the editor UI and prevents nested/incorrect InspectorControls blocks.

---------

Co-authored-by: arifulhoque7 <hoquea57@gmail.com>
Co-authored-by: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com>
Update Contributors block config to use an 8px default for avatarBorderRadius instead of 50%. This changes avatars from fully circular to slightly rounded rectangles to better match the current design language and spacing.
Update Contributors block to set avatarBorderRadius when avatarShape changes. The onChange handler now applies defaults ({ circle: '50%', rounded: '8px', square: '0' }) so selecting a shape also updates the border radius to maintain consistent avatar appearance.
Replace the legacy avatarShape attribute with a direct avatarBorderRadius value in both the block editor and server render. The editor now stores explicit radius values (50%, 8px, 0) via the SelectControl and applies avatarBorderRadius to avatar styles; redundant shape-to-radius mapping and avatarShape handling were removed. The PHP render now reads avatarBorderRadius (defaulting to 50%) when building avatar styles. Also removed radius callbacks/props from the border control usage to avoid duplicate state.
…ors-avatar-rounded-border-radius

Change default avatar border radius to 8px
* Bump version to 2.2.1 and update changelog

* Bump package version to 2.2.1

Update version from 2.2.0 to 2.2.1 in package.json and package-lock.json to publish a patch release.

* Changelog: simplify v2.2.1 entries

Remove the AI image analysis (Pro) addition and shorten/reword two fix entries in the v2.2.1 changelog to eliminate extra details and streamline the release notes.

* Build: compile and add updated block assets

Regenerate and add compiled block assets for multiple blocks. Adds new built files (CSS, JS, asset manifests, fonts, images) under assets/build for blocks such as AISummary, Breadcrumb, Contributors, DocActions, DocNavigation, DocsGrid, FontSizeSwitcher, HelpfulFeedback/Modal, LastUpdated, PrintButton, QuickSearch, ReadingProgress, Search, Sidebar, SocialShare, TableOfContents and helper utilities. Updates block.asset.php dependencies (adds react, wp-api-fetch, wp-core-data, wp-data), updates frontend/editor/store/print assets and icons, removes/renames some RTL files, and includes new block styles. Also includes source updates across src/blocks, tweaks to includes (Ajax.php, Assets.php, Frontend.php), webpack.config.js, languages/wedocs.pot and main plugin file (wedocs.php). Intended to ship the latest built output and corresponding source changes.

* Update HelpfulFeedback & HelpfulModal blocks and build

Update source and compiled assets for HelpfulFeedback and HelpfulModal blocks (block.json, edit.js, render.php, styles), refresh Contributors render, and bump built asset version. Also update helpful-feedback.js, includes/Ajax.php and language POT to reflect changes. Compiled files in assets/build were regenerated to include these updates.

* Refactor feedback UI to use full-width messages

Replace the previous thank-you DOM insertion with a new showFullMessage helper that hides existing controls and displays a centered, full-width message (styled red for already-voted). Adjust handleVoteSuccess to mark the container as voted before showing the message and use showFullMessage for both thank-you and already-voted cases. Simplify showError to directly append a styled error block. Also update the POT file timestamp.

* Add font-size to helpful feedback message

Add inline font-size: 14px to the .wedocs-feedback-full-message element in assets/js/helpful-feedback.js to ensure the feedback text remains readable and consistent across themes. This is a presentational change only and does not alter functional behavior.

* Validate post ID is numeric in capability

Add an is_numeric() check for $_GET['post'] before converting with absint() and calling get_post_type(). This prevents non-numeric values from being passed through the capability gate, avoiding potential warnings or unexpected behavior and ensuring the early return still happens for missing, non-numeric, or non-"docs" posts.

* Use block_categories_all filter; remove duplicate

Replace add_action with add_filter for the 'block_categories_all' hook so the class method correctly registers the block category. Remove the standalone anonymous filter that previously added the 'wedocs' category to avoid duplicate registrations and redundant code.

* Expand padding and margin into individual props

Update Contributors block Edit component to set padding and margin using individual CSS properties (paddingTop, paddingRight, paddingBottom, paddingLeft and marginTop, marginRight, marginBottom, marginLeft) instead of a single shorthand string. This makes each side's value apply reliably (including undefined/null or numeric attribute values) and improves robustness when attributes are objects rather than preformatted strings. No other behavior changes in this file.

* Use post_author and dedupe contributors

Fix Contributors block rendering: use the post_author field for main_author mode and add existence checks for get_userdata. Aggregate contributor IDs from the wedocs_contributors meta, include the post author and revision authors, skip empty IDs, and avoid duplicates so only valid, unique user objects are added to the contributors list.

* Use ColorPalette for color controls

Replace usage of PanelColorSettings with individual ColorPalette components and add import. Reorganize color UI: rename 'Style Settings' panel to 'Color Settings', split text/background and hover color pickers into separate PanelBody sections, add explicit labels for each color picker, and switch the border color picker to ColorPalette. Also move the Inspector component invocation outside of InspectorControls and apply minor whitespace cleanup.

* Remove height: 100% from HelpfulModal styles

Delete the hard-coded `height: 100%` rule from the HelpfulModal SCSS so the modal can size itself based on content and the existing flex layout. This avoids forcing full-height behavior that can cause layout and overflow issues.

* Add block examples, AISummary borders, hover color

Add example presets for multiple blocks to improve editor previews and defaults. Enhance AISummary with borderStyle, borderWidth and borderColor attributes, render/save support and a BorderPanel in the editor. Add hoverTextColor support to DocActions (data attribute, editor control and runtime hover behavior that restores original text color). Breadcrumb block: add font-size handling in editor and render, and wrap output with get_block_wrapper_attributes. Remove the HelpfulFeedback editor preview note and related styles, and remove the HelpfulModal editor pseudo-element. Update localization POT metadata and add a few new UI strings.

* DocNavigation: support WP text color & style fixes

Expose text color support in block.json and tidy up editor preview and server render styles. In edit.js merge the block className, remove the click/selectBlock handler from the preview, and set navigation item default textDecoration to none. In render.php prefer the WP color preset (var(--wp--preset--color--*)) when present, apply !important to navigation and arrow colors, move the navigation style onto the anchor (removing redundant span color) and simplify the hover selector so hover color applies correctly. These changes ensure the block respects WordPress color presets and produces more consistent styling between editor preview and front-end.

* update discount

* updated FSE template

* template updated

* update latest template

* Remove theme attribute from template parts

Remove the hardcoded "theme":"twentytwentyfive" attribute from the header and footer template-part blocks in templates/block-templates/single-docs.html to make the template parts theme-agnostic and improve portability. No other content changes were made.

* Remove column border styles in single-docs

Remove border-related attributes and classes from the left, center, and right column blocks in templates/block-templates/single-docs.html. The change deletes the `has-border-color has-base-border-color` classes and `border-width` styles on the column wrappers so they no longer render 1px borders, simplifying the layout and avoiding redundant borders. Internal block borders (e.g. quick-search, table-of-contents) are left intact.

* Update changelog entry for v2.2.1

Update v2.2.1 changelog: change release date to 30 Mar 2026 and reword the Added item from "article page template" to "single page doc template" for the Full Site Editor (ref weDevsOfficial#295). Also remove the Contributors block avatar shape fix entry (weDevsOfficial#305).

---------

Co-authored-by: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com>
Refresh the translation template: update POT-Creation-Date and refresh source references/line numbers across the file. Add references for the new AISummary block, remove a few obsolete msgids (e.g. weDocs Blocks, Preview mode - voting disabled in editor, Style Settings), and sync msgctxt locations to match recent code changes.
Strips config.bat .gitignore entry and captcha-config.php dropper introduced from a compromised dev machine. See recovery report.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Too many files!

This PR contains 258 files, which is 108 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98a517c7-fd8c-4853-a00a-5f012395c1bf

📥 Commits

Reviewing files that changed from the base of the PR and between 54032cf and e0e605f.

⛔ Files ignored due to path filters (42)
  • .wordpress-org/banner-1544x500.png is excluded by !**/*.png
  • .wordpress-org/banner-772x250.png is excluded by !**/*.png
  • .wordpress-org/icon-128x128.png is excluded by !**/*.png
  • .wordpress-org/icon-256x256.png is excluded by !**/*.png
  • .wordpress-org/screenshot-1.png is excluded by !**/*.png
  • .wordpress-org/screenshot-10.png is excluded by !**/*.png
  • .wordpress-org/screenshot-2.png is excluded by !**/*.png
  • .wordpress-org/screenshot-3.png is excluded by !**/*.png
  • .wordpress-org/screenshot-4.png is excluded by !**/*.png
  • .wordpress-org/screenshot-5.png is excluded by !**/*.png
  • .wordpress-org/screenshot-6.png is excluded by !**/*.png
  • .wordpress-org/screenshot-7.png is excluded by !**/*.png
  • .wordpress-org/screenshot-8.png is excluded by !**/*.png
  • .wordpress-org/screenshot-9.png is excluded by !**/*.png
  • assets/build/fonts/wedocs.svg is excluded by !**/*.svg
  • assets/build/fonts/wedocs.ttf is excluded by !**/*.ttf
  • assets/build/fonts/wedocs.woff is excluded by !**/*.woff
  • assets/build/images/avatar_1.png is excluded by !**/*.png
  • assets/build/images/avatar_2.png is excluded by !**/*.png
  • assets/build/images/pro-badge.png is excluded by !**/*.png
  • assets/build/images/slider-1.jpg is excluded by !**/*.jpg
  • assets/build/images/slider-2.jpg is excluded by !**/*.jpg
  • assets/build/images/slider-3.jpg is excluded by !**/*.jpg
  • assets/build/images/slider-4.jpg is excluded by !**/*.jpg
  • assets/build/images/wedocs.svg is excluded by !**/*.svg
  • assets/fonts/wedocs.eot is excluded by !**/*.eot
  • assets/fonts/wedocs.svg is excluded by !**/*.svg
  • assets/fonts/wedocs.ttf is excluded by !**/*.ttf
  • assets/fonts/wedocs.woff is excluded by !**/*.woff
  • assets/img/demo-avatar/avatar_1.png is excluded by !**/*.png
  • assets/img/demo-avatar/avatar_2.png is excluded by !**/*.png
  • assets/img/pro-badge.png is excluded by !**/*.png
  • assets/img/wedocs-icon-128x128.png is excluded by !**/*.png
  • assets/img/wedocs-logo.svg is excluded by !**/*.svg
  • assets/js/sweetalert.min.js is excluded by !**/*.min.js
  • assets/js/vue.min.js is excluded by !**/*.min.js
  • composer.lock is excluded by !**/*.lock
  • package-lock.json is excluded by !**/package-lock.json
  • src/assets/img/avatar-four.jpg is excluded by !**/*.jpg
  • src/assets/img/avatar-one.jpg is excluded by !**/*.jpg
  • src/assets/img/avatar-three.jpg is excluded by !**/*.jpg
  • src/assets/img/avatar-two.jpg is excluded by !**/*.jpg
📒 Files selected for processing (258)
  • .bablerc.js
  • .distignore
  • .editorconfig
  • .eslintrc
  • .github/workflows/main.yml
  • .gitignore
  • .nvmrc
  • .php_cs
  • .phpcs.xml.dist
  • .prettierrc
  • .svnignore
  • .travis.yml
  • .wordpress-org/blueprints/blueprint.json
  • FILTERS.md
  • Gruntfile.js
  • LICENSE
  • appsero.json
  • assets/build/block-rtl.css
  • assets/build/block.asset.php
  • assets/build/block.css
  • assets/build/block.js
  • assets/build/blocks/AISummary/block.json
  • assets/build/blocks/AISummary/index-rtl.css
  • assets/build/blocks/AISummary/index.asset.php
  • assets/build/blocks/AISummary/index.css
  • assets/build/blocks/AISummary/index.js
  • assets/build/blocks/AISummary/style-index-rtl.css
  • assets/build/blocks/AISummary/style-index.css
  • assets/build/blocks/AISummary/view.asset.php
  • assets/build/blocks/AISummary/view.js
  • assets/build/blocks/AdvanceContributors/block.json
  • assets/build/blocks/AdvanceContributors/index.asset.php
  • assets/build/blocks/AdvanceContributors/index.js
  • assets/build/blocks/AdvanceContributors/render.php
  • assets/build/blocks/AdvanceContributors/style-index-rtl.css
  • assets/build/blocks/AdvanceContributors/style-index.css
  • assets/build/blocks/Breadcrumb/block.json
  • assets/build/blocks/Breadcrumb/index.asset.php
  • assets/build/blocks/Breadcrumb/index.js
  • assets/build/blocks/Breadcrumb/render.php
  • assets/build/blocks/Breadcrumb/style-index-rtl.css
  • assets/build/blocks/Breadcrumb/style-index.css
  • assets/build/blocks/Contributors/block.json
  • assets/build/blocks/Contributors/index.asset.php
  • assets/build/blocks/Contributors/index.js
  • assets/build/blocks/Contributors/render.php
  • assets/build/blocks/Contributors/style-index-rtl.css
  • assets/build/blocks/Contributors/style-index.css
  • assets/build/blocks/DocActions/block.json
  • assets/build/blocks/DocActions/index-rtl.css
  • assets/build/blocks/DocActions/index.asset.php
  • assets/build/blocks/DocActions/index.css
  • assets/build/blocks/DocActions/index.js
  • assets/build/blocks/DocActions/style-index-rtl.css
  • assets/build/blocks/DocActions/style-index.css
  • assets/build/blocks/DocActions/view.asset.php
  • assets/build/blocks/DocActions/view.js
  • assets/build/blocks/DocNavigation/block.json
  • assets/build/blocks/DocNavigation/index.asset.php
  • assets/build/blocks/DocNavigation/index.js
  • assets/build/blocks/DocNavigation/render.php
  • assets/build/blocks/DocNavigation/style-index-rtl.css
  • assets/build/blocks/DocNavigation/style-index.css
  • assets/build/blocks/DocsGrid/block.json
  • assets/build/blocks/DocsGrid/index.asset.php
  • assets/build/blocks/DocsGrid/index.js
  • assets/build/blocks/DocsGrid/render.php
  • assets/build/blocks/DocsGrid/style-index-rtl.css
  • assets/build/blocks/DocsGrid/style-index.css
  • assets/build/blocks/FontSizeSwitcher/block.json
  • assets/build/blocks/FontSizeSwitcher/index-rtl.css
  • assets/build/blocks/FontSizeSwitcher/index.asset.php
  • assets/build/blocks/FontSizeSwitcher/index.css
  • assets/build/blocks/FontSizeSwitcher/index.js
  • assets/build/blocks/FontSizeSwitcher/style-index-rtl.css
  • assets/build/blocks/FontSizeSwitcher/style-index.css
  • assets/build/blocks/FontSizeSwitcher/view.asset.php
  • assets/build/blocks/FontSizeSwitcher/view.js
  • assets/build/blocks/HelpfulFeedback/block.json
  • assets/build/blocks/HelpfulFeedback/index.asset.php
  • assets/build/blocks/HelpfulFeedback/index.js
  • assets/build/blocks/HelpfulFeedback/render.php
  • assets/build/blocks/HelpfulFeedback/style-index-rtl.css
  • assets/build/blocks/HelpfulFeedback/style-index.css
  • assets/build/blocks/HelpfulModal/block.json
  • assets/build/blocks/HelpfulModal/index-rtl.css
  • assets/build/blocks/HelpfulModal/index.asset.php
  • assets/build/blocks/HelpfulModal/index.css
  • assets/build/blocks/HelpfulModal/index.js
  • assets/build/blocks/HelpfulModal/render.php
  • assets/build/blocks/HelpfulModal/style-index-rtl.css
  • assets/build/blocks/HelpfulModal/style-index.css
  • assets/build/blocks/HelpfulModal/view.asset.php
  • assets/build/blocks/HelpfulModal/view.js
  • assets/build/blocks/LastUpdated/block.json
  • assets/build/blocks/LastUpdated/index-rtl.css
  • assets/build/blocks/LastUpdated/index.asset.php
  • assets/build/blocks/LastUpdated/index.css
  • assets/build/blocks/LastUpdated/index.js
  • assets/build/blocks/LastUpdated/render.php
  • assets/build/blocks/LastUpdated/style-index-rtl.css
  • assets/build/blocks/LastUpdated/style-index.css
  • assets/build/blocks/PrintButton/block.json
  • assets/build/blocks/PrintButton/index.asset.php
  • assets/build/blocks/PrintButton/index.js
  • assets/build/blocks/PrintButton/render.php
  • assets/build/blocks/PrintButton/style-index-rtl.css
  • assets/build/blocks/PrintButton/style-index.css
  • assets/build/blocks/QuickSearch/block.json
  • assets/build/blocks/QuickSearch/index.asset.php
  • assets/build/blocks/QuickSearch/index.js
  • assets/build/blocks/QuickSearch/render.php
  • assets/build/blocks/QuickSearch/style-index-rtl.css
  • assets/build/blocks/QuickSearch/style-index.css
  • assets/build/blocks/QuickSearch/templates/empty-state.php
  • assets/build/blocks/QuickSearch/templates/search-item.php
  • assets/build/blocks/QuickSearch/templates/search-results.php
  • assets/build/blocks/ReadingProgress/block.json
  • assets/build/blocks/ReadingProgress/index-rtl.css
  • assets/build/blocks/ReadingProgress/index.asset.php
  • assets/build/blocks/ReadingProgress/index.css
  • assets/build/blocks/ReadingProgress/index.js
  • assets/build/blocks/ReadingProgress/style-index-rtl.css
  • assets/build/blocks/ReadingProgress/style-index.css
  • assets/build/blocks/ReadingProgress/view.asset.php
  • assets/build/blocks/ReadingProgress/view.js
  • assets/build/blocks/Search/block.json
  • assets/build/blocks/Search/index.asset.php
  • assets/build/blocks/Search/index.js
  • assets/build/blocks/Search/style-index-rtl.css
  • assets/build/blocks/Search/style-index.css
  • assets/build/blocks/Sidebar/block.json
  • assets/build/blocks/Sidebar/index.asset.php
  • assets/build/blocks/Sidebar/index.js
  • assets/build/blocks/Sidebar/render.php
  • assets/build/blocks/Sidebar/style-index-rtl.css
  • assets/build/blocks/Sidebar/style-index.css
  • assets/build/blocks/Sidebar/view.asset.php
  • assets/build/blocks/Sidebar/view.js
  • assets/build/blocks/SocialShare/block.json
  • assets/build/blocks/SocialShare/index.asset.php
  • assets/build/blocks/SocialShare/index.js
  • assets/build/blocks/SocialShare/render.php
  • assets/build/blocks/SocialShare/style-index-rtl.css
  • assets/build/blocks/SocialShare/style-index.css
  • assets/build/blocks/TableOfContents/block.json
  • assets/build/blocks/TableOfContents/index-rtl.css
  • assets/build/blocks/TableOfContents/index.asset.php
  • assets/build/blocks/TableOfContents/index.css
  • assets/build/blocks/TableOfContents/index.js
  • assets/build/blocks/TableOfContents/render.php
  • assets/build/blocks/TableOfContents/style-index-rtl.css
  • assets/build/blocks/TableOfContents/style-index.css
  • assets/build/blocks/TableOfContents/view.asset.php
  • assets/build/blocks/TableOfContents/view.js
  • assets/build/blocks/helpers/README.md
  • assets/build/blocks/helpers/block-helpers.js
  • assets/build/blocks/helpers/block-styles.php
  • assets/build/blocks/helpers/index.js
  • assets/build/editor.asset.php
  • assets/build/editor.js
  • assets/build/frontend-rtl.css
  • assets/build/frontend.asset.php
  • assets/build/frontend.css
  • assets/build/frontend.js
  • assets/build/icons.asset.php
  • assets/build/icons.js
  • assets/build/index-rtl.css
  • assets/build/index.asset.php
  • assets/build/index.css
  • assets/build/index.js
  • assets/build/print-rtl.css
  • assets/build/print.asset.php
  • assets/build/print.css
  • assets/build/print.js
  • assets/build/store.asset.php
  • assets/build/store.js
  • assets/css/admin.css
  • assets/css/elementor-widgets.css
  • assets/css/frontend.css
  • assets/css/sweetalert.css
  • assets/fonts/fonts.json
  • assets/js/admin-script.js
  • assets/js/elementor-widgets.js
  • assets/js/frontend.js
  • assets/js/helpful-feedback.js
  • assets/js/vue.js
  • assets/less/admin.less
  • assets/less/fonts.less
  • assets/less/frontend.less
  • assets/less/print.less
  • assets/less/responsive.less
  • bin/install-wp-tests.sh
  • bin/version-replace.js
  • bin/zip.js
  • composer.json
  • includes/API.php
  • includes/API/API.php
  • includes/API/SettingsApi.php
  • includes/API/UpgraderApi.php
  • includes/Admin.php
  • includes/Admin/Admin.php
  • includes/Admin/Docs_List_Table.php
  • includes/Admin/Menu.php
  • includes/Admin/Migrate.php
  • includes/Admin/Promotion.php
  • includes/Ajax.php
  • includes/Appsero/Client.php
  • includes/Appsero/Insights.php
  • includes/Appsero/License.php
  • includes/Assets.php
  • includes/Capability.php
  • includes/Elementor.php
  • includes/Elementor/Widgets/DocsGrid.php
  • includes/Elementor/Widgets/Search.php
  • includes/Frontend.php
  • includes/Installer.php
  • includes/Post_Types.php
  • includes/Shortcode.php
  • includes/Templates/AbstractPageTemplate.php
  • includes/Templates/AbstractTemplate.php
  • includes/Templates/SingleDocTemplate.php
  • includes/Templates/TemplateManager.php
  • includes/Theme/Astra.php
  • includes/Theme/Twenty_Fifteen.php
  • includes/Theme/Twenty_Seventeen.php
  • includes/Theme_Support.php
  • includes/Upgrader/Abstracts/UpgradeHandler.php
  • includes/Upgrader/Upgrader.php
  • includes/Upgrader/Upgrades/Upgrades.php
  • includes/Upgrader/Upgrades/V_2_0_2.php
  • includes/Upgrader/Upgrades/V_2_1_17.php
  • includes/Walker.php
  • includes/Widget.php
  • includes/admin/class-admin.php
  • includes/admin/class-settings.php
  • includes/admin/template-vue.php
  • includes/class-ajax.php
  • includes/class-settings-api.php
  • includes/class-shortcode.php
  • includes/class-theme-support.php
  • includes/class-walker-docs.php
  • includes/functions.php
  • includes/theme-support/twentyfifteen.php
  • includes/theme-support/twentyseventeen.php
  • languages/wedocs-es_ES.mo
  • languages/wedocs-es_ES.po
  • languages/wedocs-fa_IR.mo
  • languages/wedocs-fa_IR.po
  • languages/wedocs-fr_FR.mo
  • languages/wedocs-fr_FR.po
  • languages/wedocs.pot
  • package.json
  • phpunit.xml.dist
  • postcss.config.js
  • readme.md
  • readme.txt
  • src/assets/css/index.css

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR refactors breadcrumb construction by extracting trail-building logic into a reusable helper function, introduces shared React dropdown components for settings and admin panels, adds URL structure configuration UI with Pro feature gates, and updates supporting infrastructure for frontend access to site URL and Tailwind configuration.

Changes

Breadcrumb Trail Refactoring & URL Structure Settings UI

Layer / File(s) Summary
Breadcrumb trail helper function
includes/functions.php
New wedocs_get_doc_breadcrumb_trail() function builds ordered breadcrumb arrays by walking ancestor chains, optionally prepending docs-home, and applying filters. Existing wedocs_breadcrumbs() is refactored to render crumbs by type with proper delimiter handling.
Breadcrumb block rendering
src/blocks/Breadcrumb/render.php
Breadcrumb block's get_breadcrumb_items() now iterates over wedocs_get_doc_breadcrumb_trail() output instead of manually assembling docs home and ancestor crumbs.
Reusable select components
src/components/ListboxSelect.js, src/components/ProPreviews/common/PreviewDropdown.js
New ListboxSelect provides a configurable Headless UI Listbox wrapper with disabled/empty states and localized placeholders. New PreviewDropdown provides a read-only dropdown for Pro preview panels with locked option gates and upgrade popups.
SelectBox refactoring
src/components/SelectBox.js
SelectBox delegates dropdown rendering to ListboxSelect, removing inline Headless UI logic and icon dependencies.
URL structure admin settings UI
src/components/Settings/GeneralSettings.js
New settings block displays URL structure options via PreviewDropdown, generates example URLs using siteUrl context, includes Pro badge gate, and wraps rendering with wedocs_general_settings_docs_url_structure_field filter.
Script localization and configuration updates
includes/Assets.php, tailwind.config.js, wedocs.php
Assets.php adds siteUrl to weDocsAdminVars for frontend access. Tailwind config syntax updated from ES modules to CommonJS require() destructuring. Plugin bootstrap loads block-styles helper.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Needs Review

Suggested reviewers

  • iftakharul-islam

Poem

🐰 A breadcrumb trail now walks in pride,
With ancestors all organized side by side,
Settings dropdowns shared with care,
URL structures blooming everywhere,
Components refactored, clean and tight—
This PR's bundled up just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main feature being restored: a selectable docs URL structure, with reference to the original issue (#310) being recovered.
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.

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.

Actionable comments posted: 4

🤖 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.

Inline comments:
In `@includes/functions.php`:
- Around line 206-208: The current breadcrumb rendering injects $crumb['title']
unescaped in the branch that checks if ( 'current' === $crumb['type'] ), so
replace the raw title insertion with an escaped version using esc_html() when
concatenating with $args['before'] and $args['after']; update the concatenation
in that branch to call esc_html($crumb['title']) to prevent XSS while keeping
the existing $args wrappers.
- Around line 159-163: The breadcrumb trail builder currently truncates ancestor
titles at data-build time by calling wedocs_apply_short_content inside the
foreach that builds $trail; remove that truncation so the helper stores raw
titles (use $ancestor->post_title) and let the block/widget apply truncateTitle
or custom max lengths later — update the foreach that constructs the
'doc_ancestor' entries to stop calling wedocs_apply_short_content and store the
unmodified title instead.
- Around line 205-217: The loop assumes 'current' is last so skips adding a
delimiter after it, which breaks when wedocs_doc_breadcrumb_trail reorders
crumbs; modify the foreach over $trail to detect whether the current $crumb is
the last element (e.g. track index with a counter or use end($trail) comparison)
and always append the appropriate delimiter after rendering any non-final crumb
— including when $crumb['type'] === 'current' — using the same ancestor spacing
rule (use 'doc_ancestor' === $crumb['type'] ? ' ' . $args['delimiter'] . ' ' :
$args['delimiter']), while keeping the existing use of
wedocs_get_breadcrumb_item for non-current items and preserving
args['before']/args['after'] around the current title.

In `@readme.txt`:
- Around line 57-58: The Markdown link for "Full Gutenberg Support" is broken
because the URL is split across a newline before the closing `)`, so update the
README to place the entire link on a single line by removing the line break
between the URL and the closing parenthesis in the line containing "Full
Gutenberg Support" (the markdown line shown with the URL
https://wedocs.co/docs/wedocs/full-site-editing/).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9b5fcf0-b948-4848-ba6f-4d7a8b733689

📥 Commits

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

📒 Files selected for processing (11)
  • .gitignore
  • includes/Assets.php
  • includes/functions.php
  • readme.txt
  • src/blocks/Breadcrumb/render.php
  • src/components/ListboxSelect.js
  • src/components/ProPreviews/common/PreviewDropdown.js
  • src/components/SelectBox.js
  • src/components/Settings/GeneralSettings.js
  • tailwind.config.js
  • wedocs.php

Comment thread includes/functions.php
Comment on lines +159 to +163
foreach ( $ancestors as $ancestor ) {
$trail[] = [
'type' => 'doc_ancestor',
'title' => wedocs_apply_short_content( $ancestor->post_title, 25 ),
'url' => get_permalink( $ancestor->ID ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Keep breadcrumb trail data unformatted in the shared helper.

Line 162 hard-truncates ancestor titles at data-build time. That overrides block settings like truncateTitle=false and custom max lengths.

Suggested fix
-                'title' => wedocs_apply_short_content( $ancestor->post_title, 25 ),
+                'title' => $ancestor->post_title,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
foreach ( $ancestors as $ancestor ) {
$trail[] = [
'type' => 'doc_ancestor',
'title' => wedocs_apply_short_content( $ancestor->post_title, 25 ),
'url' => get_permalink( $ancestor->ID ),
foreach ( $ancestors as $ancestor ) {
$trail[] = [
'type' => 'doc_ancestor',
'title' => $ancestor->post_title,
'url' => get_permalink( $ancestor->ID ),
🤖 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 `@includes/functions.php` around lines 159 - 163, The breadcrumb trail builder
currently truncates ancestor titles at data-build time by calling
wedocs_apply_short_content inside the foreach that builds $trail; remove that
truncation so the helper stores raw titles (use $ancestor->post_title) and let
the block/widget apply truncateTitle or custom max lengths later — update the
foreach that constructs the 'doc_ancestor' entries to stop calling
wedocs_apply_short_content and store the unmodified title instead.

Comment thread includes/functions.php
Comment on lines +205 to 217
foreach ( $trail as $crumb ) {
if ( 'current' === $crumb['type'] ) {
$html .= ' ' . $args['before'] . $crumb['title'] . $args['after'];
continue;
}

$breadcrumbs = array_reverse( $breadcrumbs );
++$breadcrumb_position;
$html .= wedocs_get_breadcrumb_item( $crumb['title'], $crumb['url'], $breadcrumb_position );

for ( $i = 0; $i < count( $breadcrumbs ); ++$i ) {
$html .= $breadcrumbs[$i];
$html .= ' ' . $args['delimiter'] . ' ';
}
// Preserve the existing whitespace quirk for ancestor delimiters (not the hub).
$delimiter = 'doc_ancestor' === $crumb['type'] ? ' ' . $args['delimiter'] . ' ' : $args['delimiter'];
$html .= $delimiter;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Delimiter placement breaks when crumbs are reordered by filter.

The loop currently assumes current is last. If wedocs_doc_breadcrumb_trail reorders items (as documented), separators can disappear between current and following crumbs.

Suggested fix
-        foreach ( $trail as $crumb ) {
+        foreach ( $trail as $index => $crumb ) {
+            if ( $index > 0 ) {
+                $prev      = $trail[ $index - 1 ];
+                $delimiter = 'doc_ancestor' === $prev['type'] ? ' ' . $args['delimiter'] . ' ' : $args['delimiter'];
+                $html     .= $delimiter;
+            }
+
             if ( 'current' === $crumb['type'] ) {
                 $html .= ' ' . $args['before'] . $crumb['title'] . $args['after'];
                 continue;
             }

             ++$breadcrumb_position;
             $html .= wedocs_get_breadcrumb_item( $crumb['title'], $crumb['url'], $breadcrumb_position );
-
-            // Preserve the existing whitespace quirk for ancestor delimiters (not the hub).
-            $delimiter = 'doc_ancestor' === $crumb['type'] ? ' ' . $args['delimiter'] . ' ' : $args['delimiter'];
-            $html .= $delimiter;
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
foreach ( $trail as $crumb ) {
if ( 'current' === $crumb['type'] ) {
$html .= ' ' . $args['before'] . $crumb['title'] . $args['after'];
continue;
}
$breadcrumbs = array_reverse( $breadcrumbs );
++$breadcrumb_position;
$html .= wedocs_get_breadcrumb_item( $crumb['title'], $crumb['url'], $breadcrumb_position );
for ( $i = 0; $i < count( $breadcrumbs ); ++$i ) {
$html .= $breadcrumbs[$i];
$html .= ' ' . $args['delimiter'] . ' ';
}
// Preserve the existing whitespace quirk for ancestor delimiters (not the hub).
$delimiter = 'doc_ancestor' === $crumb['type'] ? ' ' . $args['delimiter'] . ' ' : $args['delimiter'];
$html .= $delimiter;
}
foreach ( $trail as $index => $crumb ) {
if ( $index > 0 ) {
$prev = $trail[ $index - 1 ];
$delimiter = 'doc_ancestor' === $prev['type'] ? ' ' . $args['delimiter'] . ' ' : $args['delimiter'];
$html .= $delimiter;
}
if ( 'current' === $crumb['type'] ) {
$html .= ' ' . $args['before'] . $crumb['title'] . $args['after'];
continue;
}
+$breadcrumb_position;
$html .= wedocs_get_breadcrumb_item( $crumb['title'], $crumb['url'], $breadcrumb_position );
}
🤖 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 `@includes/functions.php` around lines 205 - 217, The loop assumes 'current' is
last so skips adding a delimiter after it, which breaks when
wedocs_doc_breadcrumb_trail reorders crumbs; modify the foreach over $trail to
detect whether the current $crumb is the last element (e.g. track index with a
counter or use end($trail) comparison) and always append the appropriate
delimiter after rendering any non-final crumb — including when $crumb['type']
=== 'current' — using the same ancestor spacing rule (use 'doc_ancestor' ===
$crumb['type'] ? ' ' . $args['delimiter'] . ' ' : $args['delimiter']), while
keeping the existing use of wedocs_get_breadcrumb_item for non-current items and
preserving args['before']/args['after'] around the current title.

Comment thread includes/functions.php
Comment on lines +206 to +208
if ( 'current' === $crumb['type'] ) {
$html .= ' ' . $args['before'] . $crumb['title'] . $args['after'];
continue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Escape current crumb title before rendering.

Line 207 injects the current title directly into HTML. Use esc_html() to prevent XSS via crafted post titles.

Suggested fix
-                $html .= ' ' . $args['before'] . $crumb['title'] . $args['after'];
+                $html .= ' ' . $args['before'] . esc_html( $crumb['title'] ) . $args['after'];
🤖 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 `@includes/functions.php` around lines 206 - 208, The current breadcrumb
rendering injects $crumb['title'] unescaped in the branch that checks if (
'current' === $crumb['type'] ), so replace the raw title insertion with an
escaped version using esc_html() when concatenating with $args['before'] and
$args['after']; update the concatenation in that branch to call
esc_html($crumb['title']) to prevent XSS while keeping the existing $args
wrappers.

Comment thread readme.txt
Comment on lines +57 to +58
– **[Full Gutenberg Support](https://wedocs.co/docs/wedocs/full-site-editing/
)**: Design and customize your documentation using Gutenberg blocks with complete flexibility.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix malformed Markdown link formatting.

At Line 57-58, the URL is split by a newline before ), which can break rendering in some readme parsers. Keep the full link on one line.

Suggested fix
-- **[Full Gutenberg Support](https://wedocs.co/docs/wedocs/full-site-editing/
-)**: Design and customize your documentation using Gutenberg blocks with complete flexibility.
+- **[Full Gutenberg Support](https://wedocs.co/docs/wedocs/full-site-editing/)**: Design and customize your documentation using Gutenberg blocks with complete flexibility.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**[Full Gutenberg Support](https://wedocs.co/docs/wedocs/full-site-editing/
)**: Design and customize your documentation using Gutenberg blocks with complete flexibility.
- **[Full Gutenberg Support](https://wedocs.co/docs/wedocs/full-site-editing/)**: Design and customize your documentation using Gutenberg blocks with complete flexibility.
🤖 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 `@readme.txt` around lines 57 - 58, The Markdown link for "Full Gutenberg
Support" is broken because the URL is split across a newline before the closing
`)`, so update the README to place the entire link on a single line by removing
the line break between the URL and the closing parenthesis in the line
containing "Full Gutenberg Support" (the markdown line shown with the URL
https://wedocs.co/docs/wedocs/full-site-editing/).

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).
The branch flipped this file from CRLF to LF without an intentional
line-ending change, producing ~40 lines of churn around the real edit.
Re-saving with CRLF matches upstream so the PR diff shows only the
meaningful changes.

No behavior change. core.autocrlf set to false locally.
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.

10 participants