feat: Update Node.js requirements and package.json structure#791
feat: Update Node.js requirements and package.json structure#791
Conversation
|
Caution Review failedThe pull request is closed. Warning
|
| Cohort / File(s) | Summary |
|---|---|
Version & environment files .nvmrc, .gitignore |
Adds .nvmrc specifying Node 24.11.1; updates .gitignore with playwright-report/* and vendor/bin/.phpunit.result.cache (duplicate entry present). |
Package and tooling package.json |
Adds engines (node, npm); updates dependencies and devDependencies (notably @wordpress/blocks, eslint, prettier, stylelint); adds webpack-cli; renames scripts to colon-based names (build-pot→build:pot, build-mopo→build:mopo, translate-US→build:translate-US). |
Conditional block registration utility src/utils/conditional-block-registration.js, src/utils/index.js |
New module exposing createConditionalRegistration, registerForPostTypes, registerForTemplates, and registerForPostTypesAndTemplates; re-exported from src/utils/index.js. Uses wp.data selectors, timeout + subscription retry logic and duplicate-registration guards. |
Build assets & bundles build/blocks/icons/index.asset.php, build/blocks/sticky-menu/index.asset.php, build/blocks/sticky-menu/index.js |
Updated asset version hashes; adjusted internal webpack module id in sticky-menu bundle (2842 → 560). |
Config filename and ignore sync .distignore, .eslintrc, .gitattributes, .prettierignore, .github/labeler.yml, README.md, docs/wordpress-packages.md |
Switched references from .webpack.config.cjs to webpack.config.js across documentation and tooling config; updated ESLint/Prettier/gitattributes/labeler mappings accordingly. |
Generated/test cache vendor/bin/.phpunit.result.cache |
Deleted PHPUnit result cache file contents. |
Minor formatting webpack.config.js |
Added trailing newline; no logic change. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
- Files warranting extra attention:
src/utils/conditional-block-registration.js— verify matching logic, subscription/unsubscribe correctness and edge-case timeoutspackage.json— validate dependency upgrades (eslint major bump) and renamed scripts for CI compatibility.gitignore— duplicatevendor/bin/.phpunit.result.cacheentry and change from exact to glob for playwright entry
Possibly related PRs
- Enhance tour blocks with comprehensive metadata, icons integration, and conditional registration #696 — Adds the same conditional block registration utility and exposes it for block usage (strong code-level overlap).
- 2.0 Beta 2 #451 — Introduces conditional registration logic for Gutenberg blocks (related implementation).
- Add PR templates, workflows, and labeler config #647 — Modifies
.github/labeler.ymlmappings similar to this change (config-level relation).
Suggested labels
[Type] Enhancement, area:ci, lang:javascript, lang:md, status:needs-review, meta:needs-changelog
Poem
🐰 Node set to twenty-four, I hop with glee,
A register waits to know when blocks should be,
Hashes refreshed and scripts renamed with care,
Ignores updated, caches cleared from there,
I nibble changes — tidy, small, and merry! 🥕✨
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately reflects the main changes: updating Node.js version requirements via .nvmrc and package.json engines field, plus package.json structural updates including dependency versions and script renames. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. |
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
.distignore(1 hunks).eslintrc(1 hunks).gitattributes(1 hunks).github/labeler.yml(1 hunks).prettierignore(1 hunks)README.md(1 hunks)docs/wordpress-packages.md(1 hunks)
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.
There was a problem hiding this comment.
Actionable comments posted: 12
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (6)
build/1905d950e626f7f3d788.svgis excluded by!**/*.svgbuild/47097bc0b1de7b74cdeb.svgis excluded by!**/*.svgbuild/7b35f3170485a266aa9c.svgis excluded by!**/*.svgbuild/b6ab55697168aa31a937.svgis excluded by!**/*.svgbuild/fb641d61abaeb706e423.svgis excluded by!**/*.svgpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (82)
.gitignore(1 hunks).nvmrc(1 hunks).webpack.assets.config.js(1 hunks).webpack.config.cjs(0 hunks)build/admin-rtl.css(0 hunks)build/admin-script.asset.php(1 hunks)build/admin.asset.php(1 hunks)build/admin.css(1 hunks)build/blocks/icons/index.asset.php(1 hunks)build/blocks/sticky-menu/index.asset.php(1 hunks)build/blocks/sticky-menu/index.js(1 hunks)build/custom.asset.php(1 hunks)build/general.asset.php(1 hunks)build/linked-cover.asset.php(1 hunks)build/maps.asset.php(1 hunks)build/metabox-structure.asset.php(1 hunks)build/metaboxes-rtl.css(0 hunks)build/metaboxes.asset.php(1 hunks)build/metaboxes.css(1 hunks)build/modals.asset.php(1 hunks)build/scporder.asset.php(1 hunks)build/slider-query.asset.php(1 hunks)build/slotfills.asset.php(1 hunks)build/style-rtl.css(0 hunks)build/style.asset.php(1 hunks)build/style.css(1 hunks)package.json(4 hunks)src/blocks/accommodation-related-accommodation/index.js(1 hunks)src/blocks/accommodation-related-destination/index.js(1 hunks)src/blocks/accommodation-related-tour/index.js(1 hunks)src/blocks/accommodation-type/index.js(1 hunks)src/blocks/additional-info/index.js(1 hunks)src/blocks/banking/index.js(1 hunks)src/blocks/best-time-to-visit/index.js(1 hunks)src/blocks/booking-validity/index.js(1 hunks)src/blocks/checkin-time/index.js(1 hunks)src/blocks/checkout-time/index.js(1 hunks)src/blocks/climate/index.js(1 hunks)src/blocks/cuisine/index.js(1 hunks)src/blocks/departs-from/index.js(1 hunks)src/blocks/destination-to-accommodation/index.js(1 hunks)src/blocks/destination-to-tour/index.js(1 hunks)src/blocks/dress/index.js(1 hunks)src/blocks/duration/index.js(1 hunks)src/blocks/electricity/index.js(1 hunks)src/blocks/ends-in/index.js(1 hunks)src/blocks/facilities/index.js(1 hunks)src/blocks/facts-country-wrapper/index.js(1 hunks)src/blocks/facts-regions-wrapper/index.js(1 hunks)src/blocks/google-map/index.js(1 hunks)src/blocks/group-size/index.js(1 hunks)src/blocks/health/index.js(1 hunks)src/blocks/included/index.js(1 hunks)src/blocks/itinerary/index.js(1 hunks)src/blocks/minimum-child-age/index.js(1 hunks)src/blocks/not-included/index.js(1 hunks)src/blocks/number-of-rooms/index.js(1 hunks)src/blocks/price-include-exclude/index.js(1 hunks)src/blocks/price/index.js(1 hunks)src/blocks/rating/index.js(1 hunks)src/blocks/regions/index.js(1 hunks)src/blocks/related-regions/index.js(1 hunks)src/blocks/review-related-accommodation/index.js(1 hunks)src/blocks/review-related-destination/index.js(1 hunks)src/blocks/review-related-tour/index.js(1 hunks)src/blocks/safety/index.js(1 hunks)src/blocks/single-supplement-wrapper/index.js(1 hunks)src/blocks/special-interests/index.js(1 hunks)src/blocks/spoken-languages/index.js(1 hunks)src/blocks/suggested-visitor-types/index.js(1 hunks)src/blocks/tagline/index.js(1 hunks)src/blocks/tour-related-accommodation/index.js(1 hunks)src/blocks/tour-related-destination/index.js(1 hunks)src/blocks/tour-related-tour/index.js(1 hunks)src/blocks/transport/index.js(1 hunks)src/blocks/travel-styles/index.js(1 hunks)src/blocks/units/index.js(1 hunks)src/blocks/visa/index.js(1 hunks)src/blocks/wetu-map/index.js(1 hunks)src/utils/conditional-block-registration.js(1 hunks)src/utils/index.js(1 hunks)vendor/bin/.phpunit.result.cache(1 hunks)
💤 Files with no reviewable changes (4)
- build/metaboxes-rtl.css
- build/admin-rtl.css
- .webpack.config.cjs
- build/style-rtl.css
🧰 Additional context used
📓 Path-based instructions (20)
**/*.{css,scss,less,jsx,tsx,js,ts}
📄 CodeRabbit inference engine (.github/instructions/patterns.instructions.md)
Use design tokens via
theme.json; avoid inline styles when possible
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.css
**/*.{css,scss,less,js,jsx,ts,tsx,vue}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Minimise DOM depth; prefer CSS utilities/presets over custom CSS
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.css
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Defer non-critical JavaScript; avoid synchronous blocking
Use semicolons to terminate statements in JavaScript block code
Ensure all generated code follows ESLint rules and WordPress Coding Standards before deployment
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.js
**/*.{css,scss,less,js,jsx,ts,tsx,vue,md}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Avoid large images in patterns; recommend responsive sizes and lazy loading
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.css
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
No inline CSS; use theme.json tokens only
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.css
**/*.{json,php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
Woo patterns respect constraints
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jspackage.jsonsrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{php,js,ts,jsx,tsx,vue}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Verify input is properly escaped and sanitized, security capabilities/nonce checks are in place
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{js,ts,jsx,tsx,css,scss,sass}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Avoid heavy re-renders, minimize CSS/JS payload, and implement lazy-loading where possible
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.css
**/*.{js,ts,jsx,tsx,php,py,java,go,rb}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Verify CI pipeline is passing and no TODO comments are left in code before release
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{php,js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (GEMINI.md)
Follow WordPress Coding Standards including proper namespacing, security practices (sanitization/escaping), and code organization
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jspackage.jsonsrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{js,jsx,ts,tsx,php}
📄 CodeRabbit inference engine (GEMINI.md)
Implement accessibility features following WCAG 2.2 AA standards in all block components and patterns
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
Validate generated code against WordPress standards, test thoroughly, check security implications, and review for proper sanitization/escaping
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{js,jsx,ts,tsx,php,scss,css}
📄 CodeRabbit inference engine (GEMINI.md)
Use camelCase for variable and function names, kebab-case for CSS classes, and snake_case for PHP variable names per WordPress Coding Standards
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jsbuild/slotfills.asset.phpsrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/maps.asset.phpbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jsbuild/metabox-structure.asset.phpsrc/blocks/facts-country-wrapper/index.jsbuild/blocks/sticky-menu/index.asset.phpsrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jsbuild/scporder.asset.phpsrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jsbuild/blocks/icons/index.asset.phpsrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jsbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpsrc/blocks/related-regions/index.jsbuild/slider-query.asset.phpsrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.cssbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{js,jsx,ts,tsx,scss,css}
📄 CodeRabbit inference engine (GEMINI.md)
For performance optimization, implement code splitting, lazy loading, and minimize CSS/JavaScript bundle sizes in block components
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/utils/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jsbuild/metaboxes.csssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jsbuild/blocks/sticky-menu/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jsbuild/admin.csssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/utils/conditional-block-registration.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.jsbuild/style.css
src/blocks/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use Block API v3 standards when developing blocks
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.js
{src/blocks/**/*.{js,jsx,ts,tsx},src/**/*.php,inc/**/*.php}
📄 CodeRabbit inference engine (AGENTS.md)
Apply WCAG 2.2 AA accessibility standards to all blocks and UI components
Files:
src/blocks/regions/index.jssrc/blocks/tour-related-destination/index.jssrc/blocks/rating/index.jssrc/blocks/visa/index.jssrc/blocks/climate/index.jssrc/blocks/tour-related-tour/index.jssrc/blocks/review-related-accommodation/index.jssrc/blocks/electricity/index.jssrc/blocks/special-interests/index.jssrc/blocks/booking-validity/index.jssrc/blocks/spoken-languages/index.jssrc/blocks/accommodation-related-accommodation/index.jssrc/blocks/facilities/index.jssrc/blocks/accommodation-type/index.jssrc/blocks/tagline/index.jssrc/blocks/review-related-destination/index.jssrc/blocks/transport/index.jssrc/blocks/departs-from/index.jssrc/blocks/minimum-child-age/index.jssrc/blocks/safety/index.jssrc/blocks/health/index.jssrc/blocks/group-size/index.jssrc/blocks/review-related-tour/index.jssrc/blocks/duration/index.jssrc/blocks/cuisine/index.jssrc/blocks/accommodation-related-tour/index.jssrc/blocks/ends-in/index.jssrc/blocks/destination-to-accommodation/index.jssrc/blocks/single-supplement-wrapper/index.jssrc/blocks/banking/index.jssrc/blocks/dress/index.jssrc/blocks/included/index.jssrc/blocks/google-map/index.jssrc/blocks/units/index.jssrc/blocks/destination-to-tour/index.jssrc/blocks/checkin-time/index.jssrc/blocks/facts-country-wrapper/index.jssrc/blocks/not-included/index.jssrc/blocks/wetu-map/index.jssrc/blocks/price-include-exclude/index.jssrc/blocks/accommodation-related-destination/index.jssrc/blocks/checkout-time/index.jssrc/blocks/best-time-to-visit/index.jssrc/blocks/additional-info/index.jssrc/blocks/number-of-rooms/index.jssrc/blocks/facts-regions-wrapper/index.jssrc/blocks/itinerary/index.jssrc/blocks/suggested-visitor-types/index.jssrc/blocks/related-regions/index.jssrc/blocks/price/index.jssrc/blocks/tour-related-accommodation/index.jssrc/blocks/travel-styles/index.js
**/*.{css,scss,less,jsx,tsx}
📄 CodeRabbit inference engine (.github/instructions/patterns.instructions.md)
Provide mobile-first responsive behaviour in block patterns
Files:
build/metaboxes.cssbuild/admin.cssbuild/style.css
**/*.php
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Use
wp_enqueue_block_styleandwp_register_stylewith dependencies for registering styles
**/*.php: Escape on output using functions likeesc_html,esc_attr, etc.
Sanitize on input; validate types and ranges
Check capabilities; use nonces for state-changing requests
Harden REST endpoints: permissions callbacks; minimal data exposureFollow WordPress Coding Standards (WPCS) for all WordPress code
Files:
build/slotfills.asset.phpbuild/maps.asset.phpbuild/metabox-structure.asset.phpbuild/blocks/sticky-menu/index.asset.phpbuild/scporder.asset.phpbuild/blocks/icons/index.asset.phpbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpbuild/slider-query.asset.phpbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/*.{html,htm,jsx,tsx,vue,php}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Ensure keyboard navigation paths are accessible, semantic HTML is used, alt text is provided for images, and color contrast meets accessibility standards
Files:
build/slotfills.asset.phpbuild/maps.asset.phpbuild/metabox-structure.asset.phpbuild/blocks/sticky-menu/index.asset.phpbuild/scporder.asset.phpbuild/blocks/icons/index.asset.phpbuild/linked-cover.asset.phpbuild/general.asset.phpbuild/metaboxes.asset.phpbuild/slider-query.asset.phpbuild/modals.asset.phpbuild/custom.asset.phpbuild/style.asset.phpbuild/admin.asset.phpbuild/admin-script.asset.php
**/blocks/**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
PHP render callbacks must be properly documented with descriptions of attributes and return values
Files:
build/blocks/sticky-menu/index.asset.phpbuild/blocks/icons/index.asset.php
🧬 Code graph analysis (3)
.webpack.assets.config.js (1)
includes/classes/legacy/class-maps.php (1)
assets(76-121)
build/blocks/sticky-menu/index.js (4)
build/blocks/sticky-menu/sticky-menu-editor-extension.js (4)
t(1-1)r(1-1)a(1-1)l(1-1)build/blocks/accommodation-related-accommodation/index.js (3)
e(1-1)n(1-1)s(1-1)build/blocks/cuisine/index.js (3)
r(1-1)a(1-1)s(1-1)build/blocks/transport/index.js (2)
r(1-1)i(1-1)
src/utils/conditional-block-registration.js (1)
src/js/blocks/slotfills.js (1)
postType(61-61)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
| playwright-report/* | ||
| vendor/bin/.phpunit.result.cache | ||
|
|
||
| vendor/bin/.phpunit.result.cache |
There was a problem hiding this comment.
Remove duplicate and redundant entries.
There are issues with this section:
vendor/bin/.phpunit.result.cacheis duplicated on lines 74 and 76.playwright-report/*on line 73 is redundant since/playwright-report/already exists on line 64.
Apply this diff to clean up:
test-results/*
-playwright-report/*
-vendor/bin/.phpunit.result.cache
-
vendor/bin/.phpunit.result.cacheCommittable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In .gitignore around lines 73 to 76, remove the duplicate and redundant entries:
delete the duplicated vendor/bin/.phpunit.result.cache line and remove the
playwright-report/* entry because /playwright-report/ is already present
earlier; ensure only one vendor/bin/.phpunit.result.cache remains (if needed)
and no duplicate or redundant patterns are left in that section.
.webpack.assets.config.js
Outdated
| // Get the package.json version for the asset files | ||
| const packageJson = require( './package.json' ); | ||
| const version = packageJson.version || '1.0.0'; | ||
|
|
||
| // Generate .asset.php for each JS entry point | ||
| for ( const [entryName, entrypoint] of compilation.entrypoints ) { | ||
| // Only generate asset.php for entries that produce JS files | ||
| if ( assets[ entryName + '.js' ] ) { | ||
| // Collect dependencies (this is a simplified version) | ||
| const dependencies = []; | ||
|
|
||
| // Add common WordPress dependencies based on file type | ||
| if ( entryName.includes( 'admin' ) ) { | ||
| dependencies.push( 'wp-element', 'wp-components', 'wp-i18n' ); | ||
| } | ||
| if ( entryName.includes( 'block' ) || entryName.includes( 'editor' ) ) { | ||
| dependencies.push( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' ); | ||
| } | ||
|
|
||
| // Default dependencies for all JS files | ||
| dependencies.push( 'wp-polyfill' ); |
There was a problem hiding this comment.
Fix duplicate dependencies and cache package.json read.
Several issues with the dependency generation logic:
- Duplicate dependencies: If an entry name contains both
adminandblock/editor, dependencies likewp-elementandwp-componentswill be added twice. - Package.json loaded on every compilation: Move
require('./package.json')outside the hook for better performance.
Apply this diff:
+// Cache package.json read
+const packageJson = require( './package.json' );
+
// Custom plugin to generate .asset.php files like wp-scripts
class AssetPhpPlugin {
apply( compiler ) {
compiler.hooks.compilation.tap( 'AssetPhpPlugin', ( compilation ) => {
compilation.hooks.processAssets.tap(
{
name: 'AssetPhpPlugin',
stage: compilation.constructor.PROCESS_ASSETS_STAGE_ADDITIONAL,
},
( assets ) => {
- // Get the package.json version for the asset files
- const packageJson = require( './package.json' );
const version = packageJson.version || '1.0.0';
// Generate .asset.php for each JS entry point
for ( const [entryName, entrypoint] of compilation.entrypoints ) {
// Only generate asset.php for entries that produce JS files
if ( assets[ entryName + '.js' ] ) {
- // Collect dependencies (this is a simplified version)
- const dependencies = [];
+ // Collect dependencies using Set to avoid duplicates
+ const dependencies = new Set();
// Add common WordPress dependencies based on file type
if ( entryName.includes( 'admin' ) ) {
- dependencies.push( 'wp-element', 'wp-components', 'wp-i18n' );
+ [ 'wp-element', 'wp-components', 'wp-i18n' ].forEach( d => dependencies.add( d ) );
}
if ( entryName.includes( 'block' ) || entryName.includes( 'editor' ) ) {
- dependencies.push( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' );
+ [ 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' ].forEach( d => dependencies.add( d ) );
}
// Default dependencies for all JS files
- dependencies.push( 'wp-polyfill' );
+ dependencies.add( 'wp-polyfill' );
// Generate the PHP content in WordPress format
- const assetContent = `<?php return array('dependencies' => array(${dependencies.map(dep => `'${dep}'`).join(', ')}), 'version' => '${version}');`;
+ const depsArray = Array.from( dependencies );
+ const assetContent = `<?php return array('dependencies' => array(${depsArray.map(dep => `'${dep}'`).join(', ')}), 'version' => '${version}');`;Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In .webpack.assets.config.js around lines 14 to 34, the code currently requires
./package.json inside the compilation hook and pushes duplicate dependencies
when an entry name matches multiple conditions; move the package.json require to
the module top-level (once) and read version with a fallback there, and change
dependency accumulation to dedupe before writing (e.g., use a Set or filter
duplicates) so entries that match both 'admin' and 'block'/'editor' do not
include repeated wp-element/wp-components entries.
.webpack.assets.config.js
Outdated
| module: { | ||
| rules: [ | ||
| { | ||
| test: /\.js$/, | ||
| exclude: /node_modules/, | ||
| use: { | ||
| loader: 'babel-loader', | ||
| options: { | ||
| presets: [ '@babel/preset-env' ], | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| test: /\.s?css$/, | ||
| use: [ | ||
| MiniCssExtractPlugin.loader, | ||
| 'css-loader', | ||
| 'postcss-loader', | ||
| 'sass-loader', | ||
| ], | ||
| }, | ||
| ], |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if postcss config exists
echo "=== Checking for PostCSS config ==="
find . -maxdepth 2 -type f \( -name "postcss.config.*" \)
# Check if any JS files use JSX syntax or React
echo -e "\n=== Checking for React/JSX usage in source files ==="
if [ -d "src" ]; then
rg "import.*from ['\"]react" src/ --type js 2>/dev/null | head -10 || true
rg "import.*from ['\"]@wordpress/element" src/ --type js 2>/dev/null | head -10 || true
echo -e "\n=== Checking for JSX syntax patterns ==="
rg "<[A-Z][a-zA-Z0-9]*[^>]*>" src/ --type js 2>/dev/null | head -10 || true
fi
# Also check in root and other likely locations
echo -e "\n=== Checking webpack config file ==="
ls -la .webpack.assets.config.js 2>/dev/null || echo "File not found at root"
# Check package.json for postcss dependency
echo -e "\n=== Checking for postcss in package.json ==="
if [ -f "package.json" ]; then
rg "postcss" package.json || echo "No postcss found in package.json"
fiRepository: lightspeedwp/tour-operator
Length of output: 1869
Add postcss.config.js and @babel/preset-react to fix build failures.
The current webpack configuration will fail on build:
- postcss-loader is configured but
postcss.config.jsdoes not exist, andpostcssis missing frompackage.json. This will cause PostCSS processing to fail. - JSX is used extensively in React components (e.g.,
src/blocks/sticky-menu/,src/blocks/modal-button/,src/blocks/icons/) and in@wordpress/elementhooks, but@babel/preset-reactis not in the babel-loader presets. JSX will not transpile correctly without it.
Add @babel/preset-react to the presets array, create postcss.config.js, and add postcss to package.json dependencies.
🤖 Prompt for AI Agents
In .webpack.assets.config.js around lines 78 to 99 the webpack rules use
postcss-loader but there is no postcss config or dependency and the babel-loader
presets omit JSX support; add '@babel/preset-react' to the presets array in this
file so JSX is transpiled, create a top-level postcss.config.js (exporting the
needed plugins like autoprefixer or an empty plugins array) and add 'postcss' to
package.json dependencies (and install it) so postcss-loader has the runtime;
after these changes run the build to verify loaders and presets are applied.
.webpack.assets.config.js
Outdated
| resolve: { | ||
| alias: { | ||
| '@utils': path.resolve( __dirname, 'src/js/utils' ), | ||
| }, | ||
| }, | ||
| }; No newline at end of file |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Add newline at end of file.
The resolve configuration with @utils alias is useful. However, the file is missing a trailing newline which is a common convention for text files.
resolve: {
alias: {
'@utils': path.resolve( __dirname, 'src/js/utils' ),
},
},
};
+📝 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.
| resolve: { | |
| alias: { | |
| '@utils': path.resolve( __dirname, 'src/js/utils' ), | |
| }, | |
| }, | |
| }; | |
| resolve: { | |
| alias: { | |
| '@utils': path.resolve( __dirname, 'src/js/utils' ), | |
| }, | |
| }, | |
| }; | |
🤖 Prompt for AI Agents
In .webpack.assets.config.js around lines 107 to 112 the file ends immediately
after the resolve block and is missing a trailing newline; add a single newline
character at the end of the file (ensure the file ends with a blank
line/linefeed) and save so the file terminates with a newline.
| @@ -1 +1 @@ | |||
| !function(){"use strict";var t,e={2842:function(){var t=window.wp.blocks,e=window.wp.blockEditor,o=window.wp.i18n,r=window.wp.data,i=window.wp.element,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"lsx-tour-operator/sticky-menu","version":"1.0.0","title":"Sticky Menu","category":"lsx-tour-operator","icon":"menu","description":"A sticky navigation menu that links to sections on the page","supports":{"html":false,"anchor":true,"align":["wide","full"],"color":{"background":true},"spacing":{"padding":true,"margin":true},"typography":{"fontSize":true,"textAlign":true,"lineHeight":true}},"attributes":{"position":{"type":"string","default":"top"},"menuItems":{"type":"array","default":[]}},"textdomain":"tour-operator","editorScript":["file:./index.js","file:./sticky-menu-editor-extension.js"],"style":"file:./style-index.css","viewScript":"file:./view.js"}'),a=window.ReactJSXRuntime,s=t=>{const{attributes:{customActiveBackgroundColor:r,customActiveTextColor:i,customHoverBackgroundColor:n,customHoverTextColor:s},setAttributes:l,clientId:c}=t,d=(0,e.__experimentalUseMultipleOriginColorsAndGradients)();return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(e.InspectorControls,{group:"color",children:(0,a.jsx)(e.__experimentalColorGradientSettingsDropdown,{settings:[{label:(0,o.__)("Active Background Color","tour-operator"),colorValue:r,onColorChange:t=>{l({customActiveBackgroundColor:t})}},{label:(0,o.__)("Active Text Color","tour-operator"),colorValue:i,onColorChange:t=>{l({customActiveTextColor:t})}},{label:(0,o.__)("Hover Background Color","tour-operator"),colorValue:n,onColorChange:t=>{l({customHoverBackgroundColor:t})}},{label:(0,o.__)("Hover Text Color","tour-operator"),colorValue:s,onColorChange:t=>{l({customHoverTextColor:t})}}],panelId:c,hasColorsOrGradients:!1,disableCustomColors:!1,__experimentalIsRenderedInSidebar:!0,...d})})})};(0,t.registerBlockType)(n.name,{...n,edit:function({attributes:t,setAttributes:n,clientId:l}){const{backgroundColor:c,textColor:d,menuItems:u=[],customActiveBackgroundColor:p,customActiveTextColor:m,customHoverBackgroundColor:g,customHoverTextColor:h}=t,v=(0,e.useBlockProps)({style:{"--active-bg-color":p||void 0,"--active-text-color":m||void 0,"--hover-bg-color":g||void 0,"--hover-text-color":h||void 0}}),x={paddingTop:v.style?.paddingTop,paddingRight:v.style?.paddingRight,paddingBottom:v.style?.paddingBottom,paddingLeft:v.style?.paddingLeft},b={...v.style,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0},f=(0,r.useSelect)(t=>t(e.store).getBlocks(),[]);return(0,i.useEffect)(()=>{const t=setTimeout(()=>{const t=e=>{let o=[];return e.forEach(e=>{if("core/group"===e.name&&"section"===e.attributes.tagName&&e.attributes.addToStickyMenu&&e.attributes.anchor&&""!==e.attributes.anchor.trim()){const t=e.attributes.anchor,r=e.attributes.metadata?.name||t;o.push({id:t,title:r})}e.innerBlocks&&e.innerBlocks.length>0&&(o=o.concat(t(e.innerBlocks)))}),o},e=t(f);u.map(t=>`${t.id}:${t.title}`).sort().join("|")!==e.map(t=>`${t.id}:${t.title}`).sort().join("|")&&n({menuItems:e})},100);return()=>clearTimeout(t)},[f,u,n]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s,{attributes:t,setAttributes:n,clientId:l}),(0,a.jsx)("div",{...v,style:b,children:(0,a.jsx)("nav",{className:"lsx-to-sticky-menu-nav","aria-label":(0,o.__)("Page section navigation","tour-operator"),children:u.length>0?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("ul",{className:"lsx-to-sticky-menu-list","aria-label":(0,o.__)("Page sections","tour-operator"),children:u.map(t=>(0,a.jsx)("li",{className:"lsx-to-sticky-menu-item",children:(0,a.jsx)("a",{className:"lsx-to-sticky-menu-button",href:`#${t.id}`,"aria-current":"false","aria-label":(0,o.__)("Navigate to %s section","tour-operator").replace("%s",t.title),style:x,children:t.title})},t.id))})}):(0,a.jsxs)("div",{className:"lsx-to-sticky-menu-placeholder",children:[(0,a.jsx)("p",{children:(0,o.__)('Add section groups with "Add to Sticky Menu" enabled to populate this menu.',"tour-operator")}),(0,a.jsxs)("details",{style:{fontSize:"11px",color:"#666",marginTop:"8px"},children:[(0,a.jsx)("summary",{children:(0,o.__)("How to add menu items","tour-operator")}),(0,a.jsxs)("ol",{style:{marginLeft:"16px",lineHeight:"1.4"},children:[(0,a.jsx)("li",{children:(0,o.__)('Add a Group block and set HTML element to "section"',"tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)("Set an HTML Anchor in Block Settings → Advanced","tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)("Name the block in the List View or toolbar","tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)('Enable "Add to Sticky Menu" in the block sidebar',"tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)("The menu will automatically populate with the block name and anchor","tour-operator")})]})]})]})})})]})},save:function({attributes:t}){const{backgroundColor:r,textColor:i,menuItems:n=[],customActiveBackgroundColor:s,customActiveTextColor:l,customHoverBackgroundColor:c,customHoverTextColor:d}=t,u=e.useBlockProps.save({style:{"--active-bg-color":s||void 0,"--active-text-color":l||void 0,"--hover-bg-color":c||void 0,"--hover-text-color":d||void 0}}),p={paddingTop:u.style?.paddingTop,paddingRight:u.style?.paddingRight,paddingBottom:u.style?.paddingBottom,paddingLeft:u.style?.paddingLeft},m={...u.style,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0};return(0,a.jsx)("div",{...u,style:m,children:(0,a.jsx)("nav",{className:"lsx-to-sticky-menu-nav","aria-label":(0,o.__)("Page section navigation","tour-operator"),children:n.length>0&&(0,a.jsx)("ul",{className:"lsx-to-sticky-menu-list","aria-label":(0,o.__)("Page sections","tour-operator"),children:n.map(t=>(0,a.jsx)("li",{className:"lsx-to-sticky-menu-item","data-section-id":t.id,children:(0,a.jsx)("a",{className:"lsx-to-sticky-menu-button",href:`#${t.id}`,"data-section-id":t.id,"aria-current":"false",style:p,children:t.title})},t.id))})})})}})}},o={};function r(t){var i=o[t];if(void 0!==i)return i.exports;var n=o[t]={exports:{}};return e[t](n,n.exports,r),n.exports}r.m=e,t=[],r.O=function(e,o,i,n){if(!o){var a=1/0;for(d=0;d<t.length;d++){o=t[d][0],i=t[d][1],n=t[d][2];for(var s=!0,l=0;l<o.length;l++)(!1&n||a>=n)&&Object.keys(r.O).every(function(t){return r.O[t](o[l])})?o.splice(l--,1):(s=!1,n<a&&(a=n));if(s){t.splice(d--,1);var c=i();void 0!==c&&(e=c)}}return e}n=n||0;for(var d=t.length;d>0&&t[d-1][2]>n;d--)t[d]=t[d-1];t[d]=[o,i,n]},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={5738:0,4830:0};r.O.j=function(e){return 0===t[e]};var e=function(e,o){var i,n,a=o[0],s=o[1],l=o[2],c=0;if(a.some(function(e){return 0!==t[e]})){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(l)var d=l(r)}for(e&&e(o);c<a.length;c++)n=a[c],r.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return r.O(d)},o=self.webpackChunktour_operator=self.webpackChunktour_operator||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))}();var i=r.O(void 0,[4830],function(){return r(2842)});i=r.O(i)}(); No newline at end of file | |||
| !function(){"use strict";var t,e={560:function(){var t=window.wp.blocks,e=window.wp.blockEditor,o=window.wp.i18n,r=window.wp.data,i=window.wp.element,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"lsx-tour-operator/sticky-menu","version":"1.0.0","title":"Sticky Menu","category":"lsx-tour-operator","icon":"menu","description":"A sticky navigation menu that links to sections on the page","supports":{"html":false,"anchor":true,"align":["wide","full"],"color":{"background":true},"spacing":{"padding":true,"margin":true},"typography":{"fontSize":true,"textAlign":true,"lineHeight":true}},"attributes":{"position":{"type":"string","default":"top"},"menuItems":{"type":"array","default":[]}},"textdomain":"tour-operator","editorScript":["file:./index.js","file:./sticky-menu-editor-extension.js"],"style":"file:./style-index.css","viewScript":"file:./view.js"}'),a=window.ReactJSXRuntime,s=t=>{const{attributes:{customActiveBackgroundColor:r,customActiveTextColor:i,customHoverBackgroundColor:n,customHoverTextColor:s},setAttributes:l,clientId:c}=t,d=(0,e.__experimentalUseMultipleOriginColorsAndGradients)();return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(e.InspectorControls,{group:"color",children:(0,a.jsx)(e.__experimentalColorGradientSettingsDropdown,{settings:[{label:(0,o.__)("Active Background Color","tour-operator"),colorValue:r,onColorChange:t=>{l({customActiveBackgroundColor:t})}},{label:(0,o.__)("Active Text Color","tour-operator"),colorValue:i,onColorChange:t=>{l({customActiveTextColor:t})}},{label:(0,o.__)("Hover Background Color","tour-operator"),colorValue:n,onColorChange:t=>{l({customHoverBackgroundColor:t})}},{label:(0,o.__)("Hover Text Color","tour-operator"),colorValue:s,onColorChange:t=>{l({customHoverTextColor:t})}}],panelId:c,hasColorsOrGradients:!1,disableCustomColors:!1,__experimentalIsRenderedInSidebar:!0,...d})})})};(0,t.registerBlockType)(n.name,{...n,edit:function({attributes:t,setAttributes:n,clientId:l}){const{backgroundColor:c,textColor:d,menuItems:u=[],customActiveBackgroundColor:p,customActiveTextColor:m,customHoverBackgroundColor:g,customHoverTextColor:h}=t,v=(0,e.useBlockProps)({style:{"--active-bg-color":p||void 0,"--active-text-color":m||void 0,"--hover-bg-color":g||void 0,"--hover-text-color":h||void 0}}),x={paddingTop:v.style?.paddingTop,paddingRight:v.style?.paddingRight,paddingBottom:v.style?.paddingBottom,paddingLeft:v.style?.paddingLeft},b={...v.style,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0},f=(0,r.useSelect)(t=>t(e.store).getBlocks(),[]);return(0,i.useEffect)(()=>{const t=setTimeout(()=>{const t=e=>{let o=[];return e.forEach(e=>{if("core/group"===e.name&&"section"===e.attributes.tagName&&e.attributes.addToStickyMenu&&e.attributes.anchor&&""!==e.attributes.anchor.trim()){const t=e.attributes.anchor,r=e.attributes.metadata?.name||t;o.push({id:t,title:r})}e.innerBlocks&&e.innerBlocks.length>0&&(o=o.concat(t(e.innerBlocks)))}),o},e=t(f);u.map(t=>`${t.id}:${t.title}`).sort().join("|")!==e.map(t=>`${t.id}:${t.title}`).sort().join("|")&&n({menuItems:e})},100);return()=>clearTimeout(t)},[f,u,n]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s,{attributes:t,setAttributes:n,clientId:l}),(0,a.jsx)("div",{...v,style:b,children:(0,a.jsx)("nav",{className:"lsx-to-sticky-menu-nav","aria-label":(0,o.__)("Page section navigation","tour-operator"),children:u.length>0?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("ul",{className:"lsx-to-sticky-menu-list","aria-label":(0,o.__)("Page sections","tour-operator"),children:u.map(t=>(0,a.jsx)("li",{className:"lsx-to-sticky-menu-item",children:(0,a.jsx)("a",{className:"lsx-to-sticky-menu-button",href:`#${t.id}`,"aria-current":"false","aria-label":(0,o.__)("Navigate to %s section","tour-operator").replace("%s",t.title),style:x,children:t.title})},t.id))})}):(0,a.jsxs)("div",{className:"lsx-to-sticky-menu-placeholder",children:[(0,a.jsx)("p",{children:(0,o.__)('Add section groups with "Add to Sticky Menu" enabled to populate this menu.',"tour-operator")}),(0,a.jsxs)("details",{style:{fontSize:"11px",color:"#666",marginTop:"8px"},children:[(0,a.jsx)("summary",{children:(0,o.__)("How to add menu items","tour-operator")}),(0,a.jsxs)("ol",{style:{marginLeft:"16px",lineHeight:"1.4"},children:[(0,a.jsx)("li",{children:(0,o.__)('Add a Group block and set HTML element to "section"',"tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)("Set an HTML Anchor in Block Settings → Advanced","tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)("Name the block in the List View or toolbar","tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)('Enable "Add to Sticky Menu" in the block sidebar',"tour-operator")}),(0,a.jsx)("li",{children:(0,o.__)("The menu will automatically populate with the block name and anchor","tour-operator")})]})]})]})})})]})},save:function({attributes:t}){const{backgroundColor:r,textColor:i,menuItems:n=[],customActiveBackgroundColor:s,customActiveTextColor:l,customHoverBackgroundColor:c,customHoverTextColor:d}=t,u=e.useBlockProps.save({style:{"--active-bg-color":s||void 0,"--active-text-color":l||void 0,"--hover-bg-color":c||void 0,"--hover-text-color":d||void 0}}),p={paddingTop:u.style?.paddingTop,paddingRight:u.style?.paddingRight,paddingBottom:u.style?.paddingBottom,paddingLeft:u.style?.paddingLeft},m={...u.style,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0};return(0,a.jsx)("div",{...u,style:m,children:(0,a.jsx)("nav",{className:"lsx-to-sticky-menu-nav","aria-label":(0,o.__)("Page section navigation","tour-operator"),children:n.length>0&&(0,a.jsx)("ul",{className:"lsx-to-sticky-menu-list","aria-label":(0,o.__)("Page sections","tour-operator"),children:n.map(t=>(0,a.jsx)("li",{className:"lsx-to-sticky-menu-item","data-section-id":t.id,children:(0,a.jsx)("a",{className:"lsx-to-sticky-menu-button",href:`#${t.id}`,"data-section-id":t.id,"aria-current":"false",style:p,children:t.title})},t.id))})})})}})}},o={};function r(t){var i=o[t];if(void 0!==i)return i.exports;var n=o[t]={exports:{}};return e[t](n,n.exports,r),n.exports}r.m=e,t=[],r.O=function(e,o,i,n){if(!o){var a=1/0;for(d=0;d<t.length;d++){o=t[d][0],i=t[d][1],n=t[d][2];for(var s=!0,l=0;l<o.length;l++)(!1&n||a>=n)&&Object.keys(r.O).every(function(t){return r.O[t](o[l])})?o.splice(l--,1):(s=!1,n<a&&(a=n));if(s){t.splice(d--,1);var c=i();void 0!==c&&(e=c)}}return e}n=n||0;for(var d=t.length;d>0&&t[d-1][2]>n;d--)t[d]=t[d-1];t[d]=[o,i,n]},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={5738:0,4830:0};r.O.j=function(e){return 0===t[e]};var e=function(e,o){var i,n,a=o[0],s=o[1],l=o[2],c=0;if(a.some(function(e){return 0!==t[e]})){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(l)var d=l(r)}for(e&&e(o);c<a.length;c++)n=a[c],r.o(t,n)&&t[n]&&t[n][0](),t[n]=0;return r.O(d)},o=self.webpackChunktour_operator=self.webpackChunktour_operator||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))}();var i=r.O(void 0,[4830],function(){return r(560)});i=r.O(i)}(); No newline at end of file | |||
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Sticky menu bundle looks functionally unchanged; consider reducing inline styles at the source
The bundled block code keeps a good semantic and accessible structure (nav with labelled lists and descriptive link labels), and per the PR summary this is effectively just webpack/module wiring with no behavioural changes.
Upstream, the source for this bundle uses several repeated inline style objects (e.g. font size, colour, margins for helper text and placeholders). When you next touch the source block code, consider moving those into classes backed by theme.json design tokens rather than inline styles to better align with your design system.
🤖 Prompt for AI Agents
In build/blocks/sticky-menu/index.js around line 1, the bundle contains repeated
inline style objects used for placeholder/helper text (fontSize, color, margin,
padding, etc.); update the original source block (not the generated bundle) to
replace these inline style objects with semantic class names, add corresponding
CSS rules that reference theme.json design tokens (spacing, typography, color)
and remove the inline style usage, then rebuild the block bundle so the
generated file no longer contains those inline style literals.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
package.json (1)
71-71:⚠️ Cross-platform compatibility issue withrm -Rpersists.The
rm -Rcommand in the build:mopo script is not available on Windows and will break on that platform. This issue was previously flagged and remains unresolved.Consider using a cross-platform alternative such as:
- "build:mopo": "rm -R languages/tour-operator-en_EN.mo && cp languages/tour-operator.pot languages/tour-operator-en_EN.po && wp i18n make-mo languages", + "build:mopo": "rimraf languages/tour-operator-en_EN.mo && cp languages/tour-operator.pot languages/tour-operator-en_EN.po && wp i18n make-mo languages",Add
rimrafas a devDependency and use it in place ofrm -Rto support Windows, macOS, and Linux development environments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
package.json(4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{json,php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
Woo patterns respect constraints
Files:
package.json
**/*.{php,js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (GEMINI.md)
Follow WordPress Coding Standards including proper namespacing, security practices (sanitization/escaping), and code organization
Files:
package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (3)
package.json (3)
33-35: Verify @babel/preset-react version pinning is intentional.The version of @babel/preset-react has been changed from ^7.28.5 (caret) to 7.28.5 (pinned). This locks the preset to a specific version, preventing patch and minor updates. Ensure this doesn't prevent bug fixes or security updates in future maintenance.
66-69: Verify the new modular build pipeline works end-to-end.The build system has been restructured into modular build:blocks and build:assets steps. Ensure:
- Both commands execute successfully in sequence on Node.js 24.11.0
- The .webpack.assets.config.js config correctly outputs .asset.php files as referenced in PR objectives
- Error handling is appropriate if either build step fails
- Local testing confirms
npm run buildproduces all expected outputs (blocks and assets)The PR objectives mention local testing was completed, but verify this on a clean checkout.
46-46: webpack-cli@6.0.1 is compatible with the build pipeline.The replacement of webpack-remove-empty-scripts with webpack-cli@6.0.1 is properly configured. The new .webpack.assets.config.js file correctly implements webpack hooks to generate .asset.php files, and all loaders (babel-loader@10.0.0, css-loader@7.1.2, sass-loader@16.0.6) are compatible with webpack 5.x, which is bundled with webpack-cli@6.0.1. The build:assets command will function as intended.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
build/blocks/banner-cover/block.json (1)
28-28: [Addressed by src file review]This is the compiled build output corresponding to src/blocks/banner-cover/block.json. The same post-meta key consistency and migration concerns apply; see the review comment on the source file.
package.json (1)
64-64: Address cross-platform compatibility for build:mopo script.The
rm -Rcommand is POSIX-only and will fail on Windows. Replace with a cross-platform alternative such asrimraf.Add
rimrafto devDependencies and update the script:- "build:mopo": "rm -R languages/tour-operator-en_EN.mo && cp languages/tour-operator.pot languages/tour-operator-en_EN.po && wp i18n make-mo languages", + "build:mopo": "rimraf languages/tour-operator-en_EN.mo && cp languages/tour-operator.pot languages/tour-operator-en_EN.po && wp i18n make-mo languages",Then ensure
rimrafis added to the devDependencies section.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
build/blocks/banner-cover/block.json(1 hunks)package.json(3 hunks)src/blocks/banner-cover/block.json(1 hunks)webpack.config.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (16)
**/*.{css,scss,less,jsx,tsx,js,ts}
📄 CodeRabbit inference engine (.github/instructions/patterns.instructions.md)
Use design tokens via
theme.json; avoid inline styles when possible
Files:
webpack.config.js
**/*.{css,scss,less,js,jsx,ts,tsx,vue}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Minimise DOM depth; prefer CSS utilities/presets over custom CSS
Files:
webpack.config.js
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Defer non-critical JavaScript; avoid synchronous blocking
Use semicolons to terminate statements in JavaScript block code
Ensure all generated code follows ESLint rules and WordPress Coding Standards before deployment
Files:
webpack.config.js
**/*.{css,scss,less,js,jsx,ts,tsx,vue,md}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Avoid large images in patterns; recommend responsive sizes and lazy loading
Files:
webpack.config.js
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
No inline CSS; use theme.json tokens only
Files:
webpack.config.js
**/*.{json,php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
Woo patterns respect constraints
Files:
webpack.config.jsbuild/blocks/banner-cover/block.jsonsrc/blocks/banner-cover/block.jsonpackage.json
**/*.{php,js,ts,jsx,tsx,vue}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Verify input is properly escaped and sanitized, security capabilities/nonce checks are in place
Files:
webpack.config.js
**/*.{js,ts,jsx,tsx,css,scss,sass}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Avoid heavy re-renders, minimize CSS/JS payload, and implement lazy-loading where possible
Files:
webpack.config.js
**/*.{js,ts,jsx,tsx,php,py,java,go,rb}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Verify CI pipeline is passing and no TODO comments are left in code before release
Files:
webpack.config.js
**/*.{php,js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (GEMINI.md)
Follow WordPress Coding Standards including proper namespacing, security practices (sanitization/escaping), and code organization
Files:
webpack.config.jsbuild/blocks/banner-cover/block.jsonsrc/blocks/banner-cover/block.jsonpackage.json
**/*.{js,jsx,ts,tsx,php}
📄 CodeRabbit inference engine (GEMINI.md)
Implement accessibility features following WCAG 2.2 AA standards in all block components and patterns
Files:
webpack.config.js
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
Validate generated code against WordPress standards, test thoroughly, check security implications, and review for proper sanitization/escaping
Files:
webpack.config.js
**/*.{js,jsx,ts,tsx,php,scss,css}
📄 CodeRabbit inference engine (GEMINI.md)
Use camelCase for variable and function names, kebab-case for CSS classes, and snake_case for PHP variable names per WordPress Coding Standards
Files:
webpack.config.js
**/*.{js,jsx,ts,tsx,scss,css}
📄 CodeRabbit inference engine (GEMINI.md)
For performance optimization, implement code splitting, lazy loading, and minimize CSS/JavaScript bundle sizes in block components
Files:
webpack.config.js
**/block.json
📄 CodeRabbit inference engine (CLAUDE.md)
**/block.json: Gutenberg blocks must include complete block.json with proper metadata configuration
Block JSON files should include all required metadata fields and follow WordPress block editor specifications
Files:
build/blocks/banner-cover/block.jsonsrc/blocks/banner-cover/block.json
**/*block.json
📄 CodeRabbit inference engine (GEMINI.md)
**/*block.json: Use theme.json tokens for colors, typography, spacing, and other design tokens in Gutenberg block styling
Generate Gutenberg blocks using complete working code including block.json metadata, Edit component, Save/render component, and styles
Configure block patterns and block metadata in block.json with proper selectors, keywords, categories, and rendering attributes
Files:
build/blocks/banner-cover/block.jsonsrc/blocks/banner-cover/block.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (4)
webpack.config.js (1)
5-5: Verify webpack-remove-empty-scripts is properly handled per PR objectives.The code still imports
webpack-remove-empty-scripts, but the PR objectives state this plugin is "removed" and "replaced by webpack-cli". Clarify whether:
- This dependency remains intentional and the PR description needs updating, or
- This import should be removed as part of the refactoring.
Check if
webpack-remove-empty-scriptsis still listed in package.json devDependencies and confirm whether the import on Line 5 should be retained or removed.src/blocks/banner-cover/block.json (1)
25-25: Verify post-meta key alignment and data migration strategy.The metadata binding key changed from
"banner_image"to"banner". Ensure that:
- Posts are saved with the new post-meta key
"banner"(not the old"banner_image").- A migration strategy exists for existing posts to prevent data loss or broken banner images.
package.json (2)
33-33: Verify @babel/preset-react caret notation.The PR objectives mention "removed caret from @babel/preset-react", but line 33 shows the caret is still present:
"@babel/preset-react": "^7.28.5". Confirm whether:
- This should be
"@babel/preset-react": "7.28.5"(caret removed), or- The PR description is inaccurate and the caret should remain.
21-24: Node.js 24.11.0 constraint acknowledged.The engines field specifies Node.js >=24.11.0, which is stricter than the project's dependency requirements. Per the previous review discussion, you have confirmed intent to use the latest Node.js version. This is acceptable provided:
- Your CI/build pipeline validates compatibility, and
- Migration documentation clearly instructs developers to upgrade to Node.js >=24.11.0.
Ensure migration notes in your PR description or CONTRIBUTING guide reflect this requirement.
| "prettier": "3.7.3", | ||
| "stylelint": "16.26.1", | ||
| "webpack-cli": "6.0.1", | ||
| "webpack-remove-empty-scripts": "^1.1.1" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Check webpack.config.js for webpack-remove-empty-scripts import/usage
fd -e js -e ts -e mjs | grep -E "(webpack\.config|webpack)" | head -20Repository: lightspeedwp/tour-operator
Length of output: 87
🏁 Script executed:
# Search for webpack-remove-empty-scripts usage across the codebase
rg "webpack-remove-empty-scripts" -A 3 -B 3Repository: lightspeedwp/tour-operator
Length of output: 1592
🏁 Script executed:
# Check package.json to see the exact devDependencies
cat -n package.json | sed -n '45,55p'Repository: lightspeedwp/tour-operator
Length of output: 522
Resolve webpack-remove-empty-scripts inconsistency.
The package webpack-remove-empty-scripts remains in devDependencies (line 50) and is actively imported in webpack.config.js (line 5). If PR objectives stated this package was "removed (replaced by webpack-cli)", the code does not reflect that removal. Clarify whether:
- The dependency should be removed entirely (along with the webpack.config.js import), or
- The PR description should be updated to reflect that the package remains in use.
🤖 Prompt for AI Agents
In package.json at line 50 and webpack.config.js around line 5, the
devDependency "webpack-remove-empty-scripts" is present but the PR claims it was
removed; decide which path to take and make consistent: if you intend to remove
the package, delete the "webpack-remove-empty-scripts" entry from
devDependencies in package.json and remove its import/usage from
webpack.config.js (and update any build scripts referencing it); otherwise, keep
the package in package.json and update the PR description to state that the
package remains in use (and ensure webpack.config.js import stays), so the
dependency listing and PR message match.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
src/utils/conditional-block-registration.js (2)
19-25: Share registration state across handler invocations to avoid duplicated work.Because
registeredandcheckingare declared insideconditionallyRegister, each call gets fresh flags and can schedule its own timeout/subscription. If the returned handler is ever invoked more than once, you can end up doing redundant work or accidentally re-registering.Consider hoisting the flags into the
createConditionalRegistrationclosure so all invocations of the returned handler share a single piece of state:export function createConditionalRegistration(config) { const { postTypes = [], templateSlugs = [], registerFunction, timeout = 100, } = config; + + // Track registration state per conditional registration instance, + // not per invocation of the returned handler. + let registered = false; + let checking = false; if (!registerFunction || typeof registerFunction !== 'function') { throw new Error('registerFunction is required and must be a function'); } return function conditionallyRegister() { - const { select } = wp.data; - let registered = false; - let checking = false; + const { select } = wp.data; @@ - const checkAndRegister = () => { + const checkAndRegister = () => { if (registered || checking) { return registered; }This keeps behaviour deterministic even if the handler is called multiple times in different places.
Also applies to: 31-35, 82-104
41-45: Align selector usage with defensive optional chaining on methods.At present,
getCurrentPostType/getEditedPostSlugare assumed to exist ifselect('core/editor')resolves, which can throw if those methods are missing. To make this more robust and consistent withsrc/js/blocks/slotfills.js, consider:- const shouldRegister = () => { - try { - const postType = select('core/editor')?.getCurrentPostType(); - const postSlug = select('core/editor')?.getEditedPostSlug(); + const shouldRegister = () => { + try { + const editorSelect = select('core/editor'); + const postType = editorSelect?.getCurrentPostType?.(); + const postSlug = editorSelect?.getEditedPostSlug?.();This guards both the store and the selector methods themselves, avoiding surprises if the editor API changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
src/utils/conditional-block-registration.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{css,scss,less,jsx,tsx,js,ts}
📄 CodeRabbit inference engine (.github/instructions/patterns.instructions.md)
Use design tokens via
theme.json; avoid inline styles when possible
Files:
src/utils/conditional-block-registration.js
**/*.{css,scss,less,js,jsx,ts,tsx,vue}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Minimise DOM depth; prefer CSS utilities/presets over custom CSS
Files:
src/utils/conditional-block-registration.js
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Defer non-critical JavaScript; avoid synchronous blocking
Use semicolons to terminate statements in JavaScript block code
Ensure all generated code follows ESLint rules and WordPress Coding Standards before deployment
Files:
src/utils/conditional-block-registration.js
**/*.{css,scss,less,js,jsx,ts,tsx,vue,md}
📄 CodeRabbit inference engine (.github/instructions/performance.instructions.md)
Avoid large images in patterns; recommend responsive sizes and lazy loading
Files:
src/utils/conditional-block-registration.js
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
No inline CSS; use theme.json tokens only
Files:
src/utils/conditional-block-registration.js
**/*.{json,php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/review.instructions.md)
Woo patterns respect constraints
Files:
src/utils/conditional-block-registration.js
**/*.{php,js,ts,jsx,tsx,vue}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Verify input is properly escaped and sanitized, security capabilities/nonce checks are in place
Files:
src/utils/conditional-block-registration.js
**/*.{js,ts,jsx,tsx,css,scss,sass}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Avoid heavy re-renders, minimize CSS/JS payload, and implement lazy-loading where possible
Files:
src/utils/conditional-block-registration.js
**/*.{js,ts,jsx,tsx,php,py,java,go,rb}
📄 CodeRabbit inference engine (.github/instructions/reviews.instructions.md)
Verify CI pipeline is passing and no TODO comments are left in code before release
Files:
src/utils/conditional-block-registration.js
**/*.{php,js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (GEMINI.md)
Follow WordPress Coding Standards including proper namespacing, security practices (sanitization/escaping), and code organization
Files:
src/utils/conditional-block-registration.js
**/*.{js,jsx,ts,tsx,php}
📄 CodeRabbit inference engine (GEMINI.md)
Implement accessibility features following WCAG 2.2 AA standards in all block components and patterns
Files:
src/utils/conditional-block-registration.js
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
Validate generated code against WordPress standards, test thoroughly, check security implications, and review for proper sanitization/escaping
Files:
src/utils/conditional-block-registration.js
**/*.{js,jsx,ts,tsx,php,scss,css}
📄 CodeRabbit inference engine (GEMINI.md)
Use camelCase for variable and function names, kebab-case for CSS classes, and snake_case for PHP variable names per WordPress Coding Standards
Files:
src/utils/conditional-block-registration.js
**/*.{js,jsx,ts,tsx,scss,css}
📄 CodeRabbit inference engine (GEMINI.md)
For performance optimization, implement code splitting, lazy loading, and minimize CSS/JavaScript bundle sizes in block components
Files:
src/utils/conditional-block-registration.js
🧬 Code graph analysis (1)
src/utils/conditional-block-registration.js (1)
src/js/blocks/slotfills.js (1)
postType(61-61)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (1)
src/utils/conditional-block-registration.js (1)
106-156: Conditional registration flow and cleanup look solid overall.The combination of
checkAndRegister, bounded retries,MAX_WAIT, and thecleanuphelper gives a sensible lifecycle for the subscription, and the three helper exports are thin, readable wrappers aroundcreateConditionalRegistration. Aside from the smaller refinements noted elsewhere, the overall structure and control flow look good to ship.Also applies to: 169-211
| * @param {string[]} config.postTypes - Array of post types that support the block | ||
| * @param {string[]} config.templateSlugs - Array of template slug patterns to match | ||
| * @param {Function} config.registerFunction - Function to call when conditions are met | ||
| * @param {number} [config.timeout=100] - Initial timeout before checking registration |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Update JSDoc types to reflect support for RegExp template patterns.
The implementation allows templateSlugs entries to be either string or RegExp, but the JSDoc only documents string[]. That can confuse consumers (and type-aware tooling).
Consider updating the annotations to match behaviour, for example:
- * @param {string[]} config.templateSlugs - Array of template slug patterns to match
+ * @param {(string|RegExp)[]} config.templateSlugs - Array of template slug patterns to match
@@
- * @param {string[]} templateSlugs - Array of template slug patterns
+ * @param {(string|RegExp)[]} templateSlugs - Array of template slug patterns
@@
- * @param {string[]} templateSlugs - Array of template slug patterns
+ * @param {(string|RegExp)[]} templateSlugs - Array of template slug patternsThis keeps the documentation honest and clearer for future maintainers.
Also applies to: 180-185, 197-200
🤖 Prompt for AI Agents
In src/utils/conditional-block-registration.js around lines 12-15 (also update
similar blocks at 180-185 and 197-200), the JSDoc for config.templateSlugs
currently documents string[] but the implementation accepts string or RegExp;
update the JSDoc types to reflect this (e.g. (string|RegExp)[] or
Array<string|RegExp>) and adjust any param descriptions to mention RegExp
support so type-aware tools and maintainers see the correct contract.
| // Maximum retries and wait time constants | ||
| const MAX_RETRIES = 50; | ||
| const MAX_WAIT = 30000; // 30 seconds | ||
|
|
||
| const cleanup = () => { | ||
| if (!unsubscribed) { | ||
| unsubscribed = true; | ||
| if (unsubscribe) { | ||
| unsubscribe(); | ||
| } | ||
| if (timeoutId) { | ||
| clearTimeout(timeoutId); | ||
| timeoutId = null; | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| // Set up maximum wait timeout | ||
| timeoutId = setTimeout(() => { | ||
| console.warn(`Block registration timeout after ${MAX_WAIT}ms, unsubscribing`); | ||
| cleanup(); | ||
| }, MAX_WAIT); | ||
|
|
||
| const unsubscribe = wp.data.subscribe(() => { |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Make cleanup resilient to future changes in unsubscribe timing.
cleanup closes over unsubscribe, which is declared afterwards. It’s safe today because cleanup only runs asynchronously, but this creates a subtle temporal coupling.
You can make this more robust by declaring unsubscribe before cleanup and assigning it later:
- let unsubscribed = false;
- let retryCount = 0;
- let timeoutId = null;
+ let unsubscribed = false;
+ let retryCount = 0;
+ let timeoutId = null;
+ let unsubscribe;
@@
- const cleanup = () => {
+ const cleanup = () => {
if (!unsubscribed) {
unsubscribed = true;
- if (unsubscribe) {
- unsubscribe();
- }
+ if (typeof unsubscribe === 'function') {
+ unsubscribe();
+ }
@@
- const unsubscribe = wp.data.subscribe(() => {
+ unsubscribe = wp.data.subscribe(() => {This avoids any potential temporal-dead-zone footguns if the subscription semantics change in future.
Also applies to: 145-153
🤖 Prompt for AI Agents
In src/utils/conditional-block-registration.js around lines 114 to 137 (and
likewise lines 145–153), the cleanup function closes over unsubscribe which is
declared later causing a temporal coupling; fix by declaring let unsubscribe =
null (or undefined) before defining cleanup, then assign the actual unsubscribe
function returned by wp.data.subscribe afterwards, and ensure cleanup checks
unsubscribe truthiness before calling it and sets unsubscribe = null after
calling to avoid double calls.
Update Node.js Requirements and Package Configuration
Overview
This PR updates the Node.js version requirements for the Tour Operator plugin to ensure compatibility with modern development environments and security standards.
Changes Made
Node.js Version Requirements
Package Configuration Updates
Build System Configuration
webpack.config.js)Technical Details
Node.js Compatibility
Configuration Files
package.json: Contains engines specification requiring Node >=24.11.0webpack.config.js: Uses original naming convention for build configurationTesting
Environment Testing
Build Process
Impact Assessment
Developer Experience
Compatibility
Deployment Notes
Requirements
Migration
Related Issues
This update ensures the plugin development environment uses current Node.js LTS standards while maintaining existing functionality and build processes.
Summary: Updated Node.js requirements to version 24.11.0+ while reverting package.json structure to previous version (keeping engines parameter) and restoring webpack configuration to original naming convention.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.