wedocs-plugin
wedocs-plugin copied to clipboard
Feat/pro block settings
Summary by CodeRabbit
Release Notes
-
New Features
- Table of Contents block with collapsible sections and smooth scrolling
- Contributors block displaying post authors and contributors with customizable avatars and styling
- Advanced Contributors block with enhanced display options and responsive controls
-
Style
- Improved responsive design and RTL language support across all blocks
- Enhanced visual consistency and accessibility features
-
Chores
- Updated WordPress scripts dependency to latest version
- Optimized asset pipeline and frontend resource loading
[!CAUTION]
Review failed
Failed to post review comments
Walkthrough
This PR introduces multiple new WordPress Gutenberg blocks (Contributors, AdvanceContributors, TableOfContents, DocsGrid) with comprehensive editor interfaces, server-side rendering, responsive styling, and utility helpers. Build artifacts are updated, shared control components added, and CSS font asset paths simplified.
Changes
| Cohort / File(s) | Summary |
|---|---|
Contributors Block src/blocks/Contributors/*, assets/build/blocks/Contributors/* |
New block implementation with manual/all/main-author contributor display modes, avatar styling, date formatting, schema markup support, and extensive editor UI with typography, color, spacing controls. Includes edit, save, render, and block manifest. |
AdvanceContributors Block src/blocks/AdvanceContributors/*, assets/build/blocks/AdvanceContributors/* |
Similar to Contributors block with advanced configuration options, device-responsive controls, and dual edit component versions (edit.js and edit-old.js). Full render pipeline with dynamic CSS generation. |
TableOfContents Block src/blocks/TableOfContents/*, assets/build/blocks/TableOfContents/* |
New dynamic TOC block with heading extraction, hierarchical/numbered list support, smooth scrolling, mobile collapsibility, sticky mode, and server-side content generation. Includes client-side view.js for interactivity. |
DocsGrid Block Updates src/blocks/DocsGrid/render.php, assets/build/blocks/DocsGrid/* |
Adds function existence guards to render callbacks, enhances pagination and section rendering logic, new style files for RTL support. |
Shared Block Controls src/blocks/commonControls/*, src/blocks/components/* |
New reusable control components: AlignmentControls, BackgroundImageControls, BorderAndShadowControls, ColorsControls, DimensionsControls, DisplayControls, TypographyControls, plus lower-level controls (BackgroundControl, BorderControl, DimensionControl, ShadowControl, SpacingControl, TabSystem, TypographyControl). |
Block Helper Functions src/blocks/helpers/* |
New PHP and JavaScript utility modules for generating CSS from block attributes (typography, spacing, borders, shadows, backgrounds), CSS validation, unit conversion, and responsive breakpoint handling. Includes README documentation. |
Build Artifacts assets/build/*.asset.php, assets/build/*.js, assets/build/*.css, webpack.config.js, package.json |
Updated version hashes, dependency lists, JSX runtime migration, CSS font file path simplification (hash-based filenames → plain names), webpack config for asset/font handling, wp-scripts version bump to ^30.15.0. |
Core Plugin & CSS Updates wedocs.php, includes/Assets.php, includes/Frontend.php, assets/build/*.css |
Block registration via block.json instead of render callback, new block category, admin/frontend script localization updates (assetsUrl, isPro added), template loader filter disabled, CSS font paths updated, style-block margin rule removed. |
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60–90 minutes
Areas requiring extra attention:
- PHP render functions (Contributors, AdvanceContributors, TableOfContents, DocsGrid): Verify sanitization, escaping, and security for user-generated content and schema markup generation
- Data fetching logic: Ensure proper error handling and fallback behavior in API calls (wp.apiFetch for users, posts, revisions)
- Dynamic CSS generation: Check correctness of inline style assembly, responsive breakpoints, and per-device attribute handling across all blocks
- Block metadata & attributes: Validate block.json structures, default values, and attribute type definitions for consistency
- Helper function correctness: Review PHP and JavaScript helper functions for edge cases, unit conversions, and CSS value validation
- Webpack config changes: Verify font and image asset routing and ensure asset paths resolve correctly in production
Possibly related PRs
- weDevsOfficial/wedocs-plugin#224: Modifies
includes/Assets.phpto update admin script localization keys (weDocsAdminScriptVars). - weDevsOfficial/wedocs-plugin#203: Adds and modifies the DocsGrid block including render functions and pagination helpers.
- weDevsOfficial/wedocs-plugin#242: Updates
includes/Assets.phpwith script localization changes and style registration modifications.
Suggested labels
Needs Review
Poem
🐰 A warren of blocks we've crafted with care,
Contributors, tables of contents to share,
Docs grids align with alignment and grace,
Helpers and controls keep styling in place.
New functions hop in, responsive and bright—
The wedocs warren shines ever more bright! ✨
Pre-merge checks and finishing touches
❌ Failed checks (1 warning, 1 inconclusive)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 53.57% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
| Title Check | ❓ Inconclusive | The title "Feat/pro block settings" is vague and does not clearly convey the scope of changes in this pull request. While the PR does involve blocks and is labeled as a feature, the term "pro block settings" is too generic and non-descriptive. The actual changeset is substantially broader—it introduces multiple new Gutenberg blocks (Contributors, AdvanceContributors, TableOfContents, DocsGrid), refactors to JSX-runtime-based implementations, adds extensive helper utilities in both PHP and JavaScript, includes comprehensive styling systems, and introduces a new component library for block controls. The title fails to communicate these primary changes and instead uses vague phrasing that does not meaningfully describe the changeset. | Consider revising the title to be more specific and descriptive of the primary changes. A more appropriate title might be something like "Feat: Add new block types with helper utilities and styling system" or "Refactor: JSX-runtime blocks with Contributors, Table of Contents, and Docs Grid blocks". This would better communicate the scope and nature of the changes to reviewers scanning the commit history. |
✅ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
feat/pro-block-settings
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 and usage tips.