Conversation
Beta 2 bugfixes
Beta 2 bugfixes 2
Beta 2 - Bugfixes Round 3
|
Warning CodeRabbit GitHub Action detectedThe repository is using both CodeRabbit Pro and CodeRabbit Open Source (via GitHub Actions), which is not recommended as it may lead to duplicate comments and extra noise. Please remove the CodeRabbit GitHub Action. Warning Rate limit exceeded@krugazul has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 34 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes in this pull request encompass various modifications across multiple files, primarily focusing on styling updates, block variations in WordPress, and the restructuring of class methods. Key updates include enhancements to currency icon styling, the introduction of new block variations for tour operators, and significant modifications to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
WalkthroughThis update brings a series of changes aimed at improving code robustness, streamlining stylesheets, enhancing data presentation, and updating plugin metadata. The modifications span across CSS selectors, class names, block variations, function calls, and array handling. Notably, the update also introduces a new gallery block template and removes LSX Customizer integration related to color schemes. Changes
Uplevel your code reviews with CodeRabbit ProCodeRabbit ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects. |
There was a problem hiding this comment.
Actionable comments posted: 14
🧹 Outside diff range and nitpick comments (19)
assets/js/src/custom.js (3)
Line range hint
275-276: Fix incorrect child element count checkUsing
$this.children.lengthmay not return the correct number of child elements because$this.childrenis a jQuery method, not a property. You should use$this.children().lengthto get the number of child elements.Apply this diff to fix the issue:
-if ( 1 < $this.children.length ) { +if ( 1 < $this.children().length ) {
72-73: Remove debugging statementsThere are
console.logstatements at lines 72-73, 275-276, and 321, 323 that should be removed to avoid cluttering the console and potential performance issues in production.Apply this diff to remove the
console.logstatements:- console.log(contentWrapper); - console.log(contentWrapper.length); - console.log($this); - console.log(roomImages);Also applies to: 275-276, 321-321, 323-323
75-76: Use consistent variable declarationsYou're mixing
varandletdeclarations in the same scope. For consistency and to adhere to modern JavaScript best practices, consider usingletorconstfor all variable declarations.Apply this diff to use
letconsistently:-var limit = 1; +let limit = 1;includes/classes/legacy/class-frontend.php (1)
382-405: Consider refactoring duplicated code in breadcrumb methodsThe methods
accommodation_breadcrumb_linksandtour_breadcrumb_linkscontain similar logic for building breadcrumbs based on primary terms and fallback terms. To improve maintainability and reduce code duplication, consider refactoring this logic into a shared function or method.Also applies to: 431-460
assets/js/blocks/tour.js (3)
958-1078: Ensure consistency in block variation naming and registrationThe
Price Include & Excludeblock variation uses inconsistent naming conventions compared to other block variations. Align the naming to maintain consistency across the codebase.Apply this diff to standardise the naming:
-name: 'lsx-tour-operator/price-include-exclude', +name: 'lsx-tour-operator/price-include-exclude-wrapper',
Line range hint
301-317: Optimise image URLs for portabilityHardcoding image URLs can lead to broken links when migrating between environments. Use
wp_get_attachment_url()orget_template_directory_uri()to generate the image URLs dynamically.Apply this diff to use dynamic image URLs:
-url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/Typelocation-icon.png', +url: '<?php echo esc_url( get_template_directory_uri() . "/assets/img/Typelocation-icon.png" ); ?>',
Line range hint
920-955: Avoid duplication by creating reusable componentsThe block variations for
Departs FromandEnds Inshare similar structures. Consider creating a reusable function or component to reduce code duplication and improve maintainability.assets/css/scss/_slider.scss (2)
6-7: Remove unnecessary empty linesThere are extra empty lines at the beginning of the file that can be removed for cleaner code.
Apply this diff:
- -
Line range hint
162-168: Ensure consistent vendor prefixes for cross-browser compatibilityIn the
.slick-arrowclass, properties liketransformandtransitionshould include vendor prefixes for broader browser support.includes/patterns/gallery.php (1)
3-39: Provide a description for the gallery patternThe 'description' key is currently empty. Adding a meaningful description enhances understanding and usability within the block editor.
Apply this diff:
- 'description' => __( '', 'tour-operator' ), + 'description' => __( 'A gallery pattern for the Tour Operator theme.', 'tour-operator' ),includes/classes/blocks/class-templates.php (1)
112-115: Proper defensive programming implementation!The function_exists check is a good addition to prevent errors on WordPress versions where register_block_template isn't available. Consider adding a debug log when the function isn't available to help with troubleshooting.
if ( function_exists( 'register_block_template' ) ) { register_block_template( 'lsx-tour-operator//' . $key, $args ); +} else { + error_log( 'register_block_template function not available. WordPress version might be outdated.' ); }includes/classes/class-tour-operator.php (1)
Line range hint
222-226: Good architectural improvement moving away from singletons!The direct instantiation pattern is better for testing and dependency management. However, we should verify the initialization order as these classes might have interdependencies.
Consider implementing a dependency injection container to manage these instances and their dependencies more effectively.
includes/classes/legacy/class-accommodation.php (1)
Line range hint
121-139: Critical: Potential price truncation issue in currency handlingThe casting of price value to integer using (int) could truncate decimal prices. This might lead to incorrect price displays.
Apply this fix to preserve decimal precision:
-$value = number_format( (int) $value, 2 ); +$value = number_format( (float) $value, 2 );vendor/cmb-field-select2/cmb-field-select2.php (1)
125-127: Brilliant addition of a default option!The default "Select" option improves user experience when no items are selected. However, consider making the text translatable for multilingual support.
- $selected_items = '<option value="" selected="selected">Select</option>'; + $selected_items = '<option value="" selected="selected">' . esc_html__('Select', 'cmb-field-select2') . '</option>';assets/css/style.css (1)
5-7: Brilliant work on maintaining styling consistency!The addition of
.lsx-single-supplement-wrapperand.unit-price-wrapperensures consistent currency icon styling. However, consider using SASS mixins to reduce repetition in the CSS.Example mixin approach:
@mixin currency-wrapper { .amount .currency-icon:after { margin-right: 0px; } } .lsx-price-wrapper, .lsx-single-supplement-wrapper, .unit-price-wrapper { @include currency-wrapper; }Also applies to: 149-151, 156-158
includes/metaboxes/config-tour.php (2)
260-269: Consider using constants for option valuesThe drinks basis options would be more maintainable if defined as constants.
Consider refactoring like this:
+define( 'LSX_DRINKS_BASIS_NONE', 'None' ); +define( 'LSX_DRINKS_BASIS_TEA_COFFEE', 'TeaCoffee' ); // ... more constants ... 'options' => array( - 'None' => esc_html__( 'None', 'tour-operator' ), - 'TeaCoffee' => esc_html__( 'Tea and Coffee Only', 'tour-operator' ), + LSX_DRINKS_BASIS_NONE => esc_html__( 'None', 'tour-operator' ), + LSX_DRINKS_BASIS_TEA_COFFEE => esc_html__( 'Tea and Coffee Only', 'tour-operator' ),
276-293: Standardise translation stringsThe room basis options use inconsistent formatting in translation strings.
Consider standardising the format:
-'BedAndBreakfast' => esc_html__( 'B&B: Bed and Breakfast', 'tour-operator' ), +'BedAndBreakfast' => esc_html__( 'Bed and Breakfast (B&B)', 'tour-operator' ),includes/template-tags/helpers.php (1)
Line range hint
949-949: Mind the CSS selector changes, chaps!The class name changes from plural to singular form might affect existing CSS styles:
lsx-special-interests-wrapper→lsx-special-interest-wrapperlsx-facilities-wrapper→lsx-facility-wrapperPlease ensure all CSS selectors are updated accordingly in your stylesheets.
Also applies to: 1047-1047
assets/js/blocks/accommodation.js (1)
Line range hint
1-1300: Eish, those hardcoded image URLs need sorting!The block variations contain hardcoded URLs to image assets (e.g.,
https://tour-operator.lsx.design/wp-content/uploads/...). This isn't ideal for different environments.Consider using WordPress's asset handling functions or environment variables for image URLs.
Ag, let's DRY up this code, hey?
There's quite a bit of repeated styling patterns across block variations. For example, the padding and spacing configurations are duplicated.
Extract common styles into shared configuration objects:
const commonStyles = { spacing: { padding: { top: '2px', bottom: '2px' } } }; const commonLayout = { type: 'flex', flexWrap: 'nowrap' }; // Use in block variations wp.blocks.registerBlockVariation('core/group', { // ... style: commonStyles, layout: commonLayout // ... });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (3)
assets/css/style.css.mapis excluded by!**/*.mapassets/img/rating-star-empty.pngis excluded by!**/*.pngassets/img/rating-star-full.pngis excluded by!**/*.png
📒 Files selected for processing (34)
assets/css/scss/_icons.scss(1 hunks)assets/css/scss/_slider.scss(1 hunks)assets/css/scss/style.scss(0 hunks)assets/css/style.css(3 hunks)assets/js/blocks/accommodation.js(3 hunks)assets/js/blocks/general.js(3 hunks)assets/js/blocks/tour.js(3 hunks)assets/js/src/custom.js(5 hunks)bin/build.command(0 hunks)includes/actions.php(0 hunks)includes/classes/admin/class-setup.php(3 hunks)includes/classes/blocks/class-bindings.php(13 hunks)includes/classes/blocks/class-registration.php(7 hunks)includes/classes/blocks/class-templates.php(1 hunks)includes/classes/class-tour-operator.php(1 hunks)includes/classes/legacy/class-accommodation.php(3 hunks)includes/classes/legacy/class-admin.php(0 hunks)includes/classes/legacy/class-frontend.php(2 hunks)includes/classes/legacy/class-tour-operator.php(2 hunks)includes/classes/legacy/class-tour.php(1 hunks)includes/classes/legacy/class-unit-query.php(2 hunks)includes/customizer.php(0 hunks)includes/functions.php(1 hunks)includes/layout.php(0 hunks)includes/metaboxes/config-tour.php(1 hunks)includes/patterns/gallery.php(1 hunks)includes/patterns/room-card.php(3 hunks)includes/template-tags/accommodation.php(2 hunks)includes/template-tags/helpers.php(1 hunks)post-types/accommodation.json(0 hunks)post-types/destinations.json(0 hunks)post-types/tours.json(0 hunks)tour-operator-bootstrap.php(0 hunks)vendor/cmb-field-select2/cmb-field-select2.php(1 hunks)
💤 Files with no reviewable changes (10)
- tour-operator-bootstrap.php
- bin/build.command
- post-types/destinations.json
- assets/css/scss/style.scss
- includes/customizer.php
- includes/classes/legacy/class-admin.php
- post-types/tours.json
- post-types/accommodation.json
- includes/layout.php
- includes/actions.php
🧰 Additional context used
🪛 Biome (1.9.4)
assets/js/blocks/general.js
[error] 410-410: This property value named name is later overwritten by an object member with the same name.
Overwritten with this value.
If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored.
Unsafe fix: Remove this property value named name
(lint/suspicious/noDuplicateObjectKeys)
🔇 Additional comments (15)
includes/classes/blocks/class-registration.php (1)
298-298: Verify that 'lsx_to_item_has_children' function exists
At line 298, you're calling lsx_to_item_has_children( get_the_ID(), 'destination' ). Please ensure that this function is defined and accessible in the current context. If it's part of a plugin or theme, verify that it's correctly included.
includes/classes/blocks/class-bindings.php (3)
616-619: Ensure $gallery is always an array to prevent errors
The additional check to ensure $gallery is an array is good practice. This prevents errors when $gallery is not in the expected format.
630-634: Set default values to avoid undefined index notices
The introduction of $target with a default empty string avoids potential undefined index notices when linkTarget is not set.
135-136:
Initialise variables to prevent undefined behaviour
The variable $value is declared without initialisation. Ensure that variables are initialised to avoid potential undefined variable notices.
Apply this diff to initialise $value:
+ $value = '';Likely invalid or redundant comment.
assets/css/scss/_icons.scss (2)
119-121: Combine selector definitions for better maintainability
Combining .lsx-price-wrapper, .lsx-single-supplement-wrapper, and .unit-price-wrapper into a single declaration enhances readability and maintainability.
119-121: Adjust margin for currency icons to ensure proper spacing
The adjustment of margin-right to 0px on .currency-icon:after within .amount may affect layout. Verify that this change maintains the desired visual spacing.
includes/classes/legacy/class-tour.php (1)
135-140: Enhancement to currency field handling looks good!
The addition of the $currency_fields array improves code maintainability and allows for consistent currency formatting across different price fields.
includes/classes/legacy/class-unit-query.php (2)
Line range hint 211-224: Good improvement to image size handling!
The addition of the $size parameter with a default value maintains backwards compatibility while providing more flexibility.
Line range hint 237-265: Verify gallery items handling
The gallery validation has been improved, but we should ensure this doesn't affect existing gallery displays.
✅ Verification successful
Let me gather more information about gallery-related functionality to ensure we have a complete picture.
Let me check for any template files and gallery usage in the broader codebase.
Gallery handling changes are safe to proceed
The improved gallery validation in class-unit-query.php is isolated to the room thumbnail generation and won't affect existing gallery displays because:
- The gallery implementation is used consistently across accommodation, tours and destinations with the same structure
- The
lsx_to_accommodation_room_thumbnailfilter is only used within the room context - The new block-based gallery rendering in
class-bindings.phphandles galleries independently - The core gallery data structure (
gallerymeta field) remains unchanged
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for any existing gallery implementations that might be affected
rg -A 3 "item_thumbnails\(\)" --type php
Length of output: 349
Script:
#!/bin/bash
# Check for gallery-related filters and implementations
rg -A 3 "lsx_to_accommodation_room_thumbnail" --type php
# Check for gallery usage in templates
rg -A 3 "gallery" --type php includes/templates/
Length of output: 1037
Script:
#!/bin/bash
# Find template directories and files
fd -t d "templates"
# Check for gallery-related functions and hooks
rg -A 3 "gallery|get_gallery" --type php
# Check for any gallery-related filters
rg -A 3 "add_filter.*accommodation.*gallery|add_filter.*gallery" --type php
Length of output: 19027
includes/patterns/room-card.php (2)
Line range hint 38-53: Good semantic improvement to wrapper classes!
The change from itin-type-wrapper to unit-type-wrapper better reflects the content purpose.
Line range hint 54-67: Verify price wrapper styling
The new unit-price-wrapper class needs to be checked for consistent styling across different themes.
✅ Verification successful
Currency styling is properly handled for the unit-price-wrapper class
The codebase shows comprehensive CSS styling for the unit-price-wrapper class across multiple currency types. The styling includes:
- Consistent margin handling for currency icons
- Support for 25+ international currency symbols
- Proper currency symbol positioning and spacing
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for any custom CSS overrides that might affect the new wrapper
rg -A 3 "unit-price-wrapper|unit-price" --type css
Length of output: 7152
assets/js/blocks/general.js (2)
2-6: Spot on with the gallery icon change!
The change from "admin-multisite" to "gallery" icon is more intuitive and better represents the block's purpose.
43-47: Good job adding the category definition!
The explicit category definition for the price block improves organization in the block editor.
includes/template-tags/helpers.php (2)
287-289: Brilliant addition of array filtering!
The addition of array_filter before imploding ensures cleaner output by removing empty values.
Line range hint 1121-1141: Verify the facilities data migration
The switch from taxonomy terms to post connections for facilities display might require data migration. Please ensure all existing facility data has been properly migrated.
| $allowedstyles[] = 'display'; | ||
| $allowedstyles[] = 'background-image'; | ||
|
|
There was a problem hiding this comment.
Review security implications of allowing 'background-image' CSS property
Adding 'background-image' to the list of allowed CSS properties in safe_style_css can introduce security risks because URLs specified in 'background-image' can be exploited for XSS attacks if not properly sanitised. Please ensure that any URLs used in 'background-image' styles are properly sanitised and that only safe protocols are permitted.
|
|
||
| /** | ||
| * Allow extra tags and attributes to wp_kses_post() | ||
| */ | ||
| public function wp_kses_allowed_html( $allowedtags, $context ) { | ||
| if ( ! isset( $allowedtags['i'] ) ) { | ||
| $allowedtags['i'] = array(); | ||
| } | ||
| $allowedtags['i']['aria-hidden'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['span'] ) ) { | ||
| $allowedtags['span'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['span']['aria-hidden'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['button'] ) ) { | ||
| $allowedtags['button'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['button']['aria-label'] = true; | ||
| $allowedtags['button']['data-dismiss'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['li'] ) ) { | ||
| $allowedtags['li'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['li']['data-target'] = true; | ||
| $allowedtags['li']['data-slide-to'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['a'] ) ) { | ||
| $allowedtags['a'] = array(); | ||
| } | ||
|
|
||
|
|
||
| $allowedtags['a']['target'] = true; | ||
| $allowedtags['a']['data-toggle'] = true; | ||
| $allowedtags['a']['data-target'] = true; | ||
| $allowedtags['a']['data-slide'] = true; | ||
| $allowedtags['a']['data-collapsed'] = true; | ||
| $allowedtags['a']['data-envira-caption'] = true; | ||
| $allowedtags['a']['data-envira-retina'] = true; | ||
| $allowedtags['a']['data-thumbnail'] = true; | ||
| $allowedtags['a']['data-mobile-thumbnail'] = true; | ||
| $allowedtags['a']['data-envirabox-type'] = true; | ||
| $allowedtags['a']['data-video-width'] = true; | ||
| $allowedtags['a']['data-video-height'] = true; | ||
| $allowedtags['a']['data-video-aspect-ratio'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['h2'] ) ) { | ||
| $allowedtags['h2'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['h2']['data-target'] = true; | ||
| $allowedtags['h2']['data-toggle'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['div'] ) ) { | ||
| $allowedtags['div'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['div']['aria-labelledby'] = true; | ||
| $allowedtags['div']['data-interval'] = true; | ||
| $allowedtags['div']['data-icon'] = true; | ||
| $allowedtags['div']['data-id'] = true; | ||
| $allowedtags['div']['data-class'] = true; | ||
| $allowedtags['div']['data-long'] = true; | ||
| $allowedtags['div']['data-lat'] = true; | ||
| $allowedtags['div']['data-zoom'] = true; | ||
| $allowedtags['div']['data-link'] = true; | ||
| $allowedtags['div']['data-thumbnail'] = true; | ||
| $allowedtags['div']['data-title'] = true; | ||
| $allowedtags['div']['data-type'] = true; | ||
| $allowedtags['div']['data-cluster-small'] = true; | ||
| $allowedtags['div']['data-cluster-medium'] = true; | ||
| $allowedtags['div']['data-cluster-large'] = true; | ||
| $allowedtags['div']['data-fusion-tables'] = true; | ||
| $allowedtags['div']['data-fusion-tables-colour-border'] = true; | ||
| $allowedtags['div']['data-fusion-tables-width-border'] = true; | ||
| $allowedtags['div']['data-fusion-tables-colour-background'] = true; | ||
| $allowedtags['div']['itemscope'] = true; | ||
| $allowedtags['div']['itemtype'] = true; | ||
| $allowedtags['div']['data-row-height'] = true; | ||
| $allowedtags['div']['data-justified-margins'] = true; | ||
| $allowedtags['div']['data-slick'] = true; | ||
|
|
||
| //Envirta Gallery tags | ||
| // | ||
| $allowedtags['div']['data-envira-id'] = true; | ||
| $allowedtags['div']['data-gallery-config'] = true; | ||
| $allowedtags['div']['data-gallery-images'] = true; | ||
| $allowedtags['div']['data-gallery-theme'] = true; | ||
| $allowedtags['div']['data-envira-columns'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['img'] ) ) { | ||
| $allowedtags['img'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['img']['data-envira-index'] = true; | ||
| $allowedtags['img']['data-envira-caption'] = true; | ||
| $allowedtags['img']['data-envira-gallery-id'] = true; | ||
| $allowedtags['img']['data-envira-item-id'] = true; | ||
| $allowedtags['img']['data-envira-src'] = true; | ||
| $allowedtags['img']['data-envira-srcset'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['input'] ) ) { | ||
| $allowedtags['input'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['input']['type'] = true; | ||
| $allowedtags['input']['id'] = true; | ||
| $allowedtags['input']['name'] = true; | ||
| $allowedtags['input']['value'] = true; | ||
| $allowedtags['input']['size'] = true; | ||
| $allowedtags['input']['checked'] = true; | ||
| $allowedtags['input']['onclick'] = true; | ||
| $allowedtags['input']['class'] = true; | ||
| $allowedtags['input']['placeholder'] = true; | ||
| $allowedtags['input']['autocomplete'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['select'] ) ) { | ||
| $allowedtags['select'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['select']['name'] = true; | ||
| $allowedtags['select']['id'] = true; | ||
| $allowedtags['select']['disabled'] = true; | ||
| $allowedtags['select']['onchange'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['option'] ) ) { | ||
| $allowedtags['option'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['option']['value'] = true; | ||
| $allowedtags['option']['selected'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['iframe'] ) ) { | ||
| $allowedtags['iframe'] = array(); | ||
| } | ||
|
|
||
| $allowedtags['iframe']['src'] = true; | ||
| $allowedtags['iframe']['width'] = true; | ||
| $allowedtags['iframe']['height'] = true; | ||
| $allowedtags['iframe']['frameborder'] = true; | ||
| $allowedtags['iframe']['allowfullscreen'] = true; | ||
| $allowedtags['iframe']['style'] = true; | ||
|
|
||
| if ( ! isset( $allowedtags['noscript'] ) ) { | ||
| $allowedtags['noscript'] = array(); | ||
| } | ||
|
|
||
| return $allowedtags; | ||
| } |
There was a problem hiding this comment.
Ensure proper sanitisation for extended allowed HTML tags and attributes
The wp_kses_allowed_html function adds numerous tags and attributes to the allowed list, including potentially risky attributes like 'onclick', 'onchange', 'style', 'src', and 'href'. These attributes can be used to inject malicious code if not properly sanitised. Please review the added tags and attributes to ensure they do not introduce security vulnerabilities, and consider using WordPress's built-in sanitisation functions where appropriate.
| if ( 0 < stripos( $key, '-query' ) ) { | ||
|
|
||
| $query_key = str_replace( [ '-query' ], '', $key ); | ||
| $current_parent = get_post_parent( get_the_ID() ); |
There was a problem hiding this comment.
Undefined function 'get_post_parent'
At line 289, get_post_parent( get_the_ID() ); is used, but get_post_parent is not a standard WordPress function. You might have intended to use wp_get_post_parent_id( get_the_ID() );, which returns the parent post ID.
Apply this diff to fix the issue:
-$current_parent = get_post_parent( get_the_ID() );
+$current_parent = wp_get_post_parent_id( get_the_ID() );📝 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.
| $current_parent = get_post_parent( get_the_ID() ); | |
| $current_parent = wp_get_post_parent_id( get_the_ID() ); |
| $this->map_post_types = array( 'accommodation', 'activity', 'destination' ); | ||
| $this->markers = new \stdClass(); | ||
|
|
||
| do_action( 'qm/debug', $this->options['googlemaps_key'] ); |
There was a problem hiding this comment.
Remove debugging code leaking sensitive information
At line 330, do_action( 'qm/debug', $this->options['googlemaps_key'] ); is a debugging statement that outputs the Google Maps API key to the debug log. This can expose sensitive information and should be removed from the production code.
Apply this diff to fix the issue:
-do_action( 'qm/debug', $this->options['googlemaps_key'] );| // Single Supplement | ||
| wp.blocks.registerBlockVariation('core/group', { | ||
| name: 'lsx-tour-operator/single-supplement-wrapper', | ||
| title: 'Single Supplement', | ||
| category: 'lsx-tour-operator', | ||
| attributes: { | ||
| align: 'wide', | ||
| className: 'lsx-include-exclude-wrapper', | ||
| metadata: { | ||
| name: 'Single Supplement', | ||
| }, | ||
| className: 'lsx-single-supplement-wrapper', | ||
| style: { | ||
| spacing: { | ||
| padding: { | ||
| top: 'var:preset|spacing|x-small', | ||
| bottom: 'var:preset|spacing|x-small', | ||
| left: 'var:preset|spacing|x-small', | ||
| right: 'var:preset|spacing|x-small' | ||
| } | ||
| }, | ||
| border: { | ||
| radius: '8px', | ||
| width: '1px' | ||
| blockGap: '5px' | ||
| } | ||
| }, | ||
| backgroundColor: 'base', | ||
| borderColor: 'primary', | ||
| layout: { | ||
| type: 'constrained' | ||
| type: 'flex', | ||
| flexWrap: 'nowrap' | ||
| } | ||
| }, | ||
| innerBlocks: [ | ||
| [ | ||
| 'core/columns', { | ||
| align: 'wide', | ||
| style: { | ||
| spacing: { | ||
| blockGap: { | ||
| top: 'var:preset|spacing|medium', | ||
| left: 'var:preset|spacing|medium' | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| [ | ||
| [ | ||
| 'core/column', { | ||
| width: '50%', | ||
| id: 'lsx-included-wrapper', | ||
| ['core/group', { | ||
| style: { | ||
| spacing: { | ||
| blockGap: '0' | ||
| } | ||
| } | ||
| spacing: { | ||
| blockGap: '5px' | ||
| } | ||
| }, | ||
| layout: { | ||
| type: 'flex', | ||
| flexWrap: 'nowrap', | ||
| verticalAlignment: 'top' | ||
| } | ||
| }, | ||
| [ | ||
| [ | ||
| 'core/paragraph', { | ||
| ['core/image', { | ||
| id: 122733, | ||
| width: '20px', | ||
| sizeSlug: 'large', | ||
| linkDestination: 'none', | ||
| url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/single-supplement-icon-black-52px-1.svg', | ||
| alt: '' | ||
| }], | ||
| ['core/paragraph', { | ||
| style: { | ||
| elements: { | ||
| link: { | ||
| color: { | ||
| text: 'var:preset|color|primary-700' | ||
| } | ||
| spacing: { | ||
| padding: { | ||
| top: '2px', | ||
| bottom: '2px' | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| textColor: 'primary-700', | ||
| fontSize: 'medium' | ||
| }, | ||
| [ 'Price Includes:' ] | ||
| ], | ||
| [ | ||
| 'core/paragraph', { | ||
| metadata: { | ||
| bindings: { | ||
| content: { | ||
| source: 'lsx/post-meta', | ||
| args: { key: 'included' } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| [] | ||
| ] | ||
| fontSize: 'x-small', | ||
| content: '<strong>Single supplement:</strong>' | ||
| }] | ||
| ] | ||
| ], | ||
| [ | ||
| 'core/column', { | ||
| width: '50%', | ||
| className: 'lsx-not-included-wrapper', | ||
| ], | ||
| ['core/group', { | ||
| style: { | ||
| spacing: { | ||
| blockGap: '0' | ||
| } | ||
| spacing: { | ||
| blockGap: '5px' | ||
| }, | ||
| layout: { | ||
| type: 'flex', | ||
| flexWrap: 'nowrap' | ||
| } | ||
| } | ||
| }, | ||
| [ | ||
| [ | ||
| 'core/paragraph', { | ||
| style: { | ||
| elements: { | ||
| link: { | ||
| color: { | ||
| text: 'var:preset|color|primary-700' | ||
| ['core/paragraph', { | ||
| metadata: { | ||
| bindings: { | ||
| content: { | ||
| source: 'lsx/post-meta', | ||
| args: { | ||
| key: 'single_supplement' | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| className: 'amount has-primary-color has-text-color has-link-color', | ||
| style: { | ||
| elements: { | ||
| link: { | ||
| color: { | ||
| text: 'var:preset|color|primary-700' | ||
| } | ||
| } | ||
| }, | ||
| spacing: { | ||
| padding: { | ||
| top: '2px', | ||
| bottom: '2px' | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| textColor: 'primary-700', | ||
| fontSize: 'medium' | ||
| }, | ||
| [ 'Price Excludes:' ] | ||
| ], | ||
| [ | ||
| 'core/paragraph', { | ||
| metadata: { | ||
| bindings: { | ||
| content: { | ||
| source: 'lsx/post-meta', | ||
| args: { key: 'not_included' } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| [] | ||
| ] | ||
| ] | ||
| content: '' | ||
| }] | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| } ); | ||
| }); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Optimise the Single Supplement block variation for reusability and maintainability
The Single Supplement block variation contains hardcoded image URLs and IDs, which may cause issues when the environment changes or when the IDs differ between environments. Consider using dynamic retrieval methods for images and ensure that any media assets are properly registered and accessible.
Apply this diff to make the image ID and URL dynamic:
-['core/image', {
- id: 122733,
- width: '20px',
- sizeSlug: 'large',
- linkDestination: 'none',
- url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/single-supplement-icon-black-52px-1.svg',
- alt: ''
-}],
+['core/image', {
+ width: '20px',
+ sizeSlug: 'large',
+ linkDestination: 'none',
+ url: '<?php echo esc_url( get_template_directory_uri() . "/assets/img/single-supplement-icon.svg" ); ?>',
+ alt: 'Single Supplement Icon'
+}],Committable suggestion skipped: line range outside the PR's diff.
| 'single_supplement' | ||
| ]; | ||
|
|
||
| do_action( 'qm/debug', [ get_post_type(), $meta_key ] ); |
There was a problem hiding this comment.
Remove debug code before deployment
The debug action should not be present in production code as it could impact performance and potentially expose sensitive information.
-do_action( 'qm/debug', [ get_post_type(), $meta_key ] );| // View More Button Block | ||
| wp.blocks.registerBlockVariation('core/button', { | ||
| name: 'lsx-tour-operator/more-link', | ||
| title: 'More Button', | ||
| name: 'core/button', | ||
| category: "lsx-tour-operator", |
There was a problem hiding this comment.
Fix the duplicate 'name' property in the button variation.
There's a critical issue where the 'name' property is defined twice with different values, which could cause unexpected behaviour.
wp.blocks.registerBlockVariation('core/button', {
- name: 'lsx-tour-operator/more-link',
- title: 'More Button',
- name: 'core/button',
+ name: 'lsx-tour-operator/more-link',
+ title: 'More Button',
category: "lsx-tour-operator",📝 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.
| // View More Button Block | |
| wp.blocks.registerBlockVariation('core/button', { | |
| name: 'lsx-tour-operator/more-link', | |
| title: 'More Button', | |
| name: 'core/button', | |
| category: "lsx-tour-operator", | |
| // View More Button Block | |
| wp.blocks.registerBlockVariation('core/button', { | |
| name: 'lsx-tour-operator/more-link', | |
| title: 'More Button', | |
| category: "lsx-tour-operator", |
🧰 Tools
🪛 Biome (1.9.4)
[error] 410-410: This property value named name is later overwritten by an object member with the same name.
Overwritten with this value.
If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored.
Unsafe fix: Remove this property value named name
(lint/suspicious/noDuplicateObjectKeys)
|
|
||
| //Output in the order we want | ||
| if ( count( $main_facilities ) > 0 && count( $child_facilities ) > 0 ) { | ||
| $return .= '<div class="' . $heading->slug . ' wp-block-columns is-layout-flex wp-block-columns-is-layout-flex">'; |
There was a problem hiding this comment.
Fix undefined variable usage
The variable $heading is used before it's defined, which could cause PHP notices or errors.
Apply this diff to fix the issue:
-$return .= '<div class="' . $heading->slug . ' wp-block-columns is-layout-flex wp-block-columns-is-layout-flex">';
+$return .= '<div class="wp-block-columns is-layout-flex wp-block-columns-is-layout-flex">';📝 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.
| $return .= '<div class="' . $heading->slug . ' wp-block-columns is-layout-flex wp-block-columns-is-layout-flex">'; | |
| $return .= '<div class="wp-block-columns is-layout-flex wp-block-columns-is-layout-flex">'; |
| $return .= '<div class="' . $heading->slug . ' col-xs-12 col-sm-6"><div class="facilities-content"><h5 class="facilities-title"><a href="' . esc_url( get_term_link( $heading->slug, 'facility' ) ) . '">' . esc_html( $heading->name ) . '</a></h5>'; | ||
| $return .= '<ul class="facilities-list">'; | ||
| $return .= '<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"> | ||
| <p class="has-medium-font-size facilities-title wp-block-heading"><a href="' . esc_url( get_term_link( $heading->slug, 'facility' ) ) . '">' . esc_html( $heading->name ) . '</a></h5>'; |
There was a problem hiding this comment.
Correct heading structure inconsistency
The markup mixes heading semantics by using a paragraph tag with heading class.
Apply this diff to maintain proper heading hierarchy:
-<p class="has-medium-font-size facilities-title wp-block-heading"><a href="' . esc_url( get_term_link( $heading->slug, 'facility' ) ) . '">' . esc_html( $heading->name ) . '</a></h5>';
+<h3 class="has-medium-font-size facilities-title"><a href="' . esc_url( get_term_link( $heading->slug, 'facility' ) ) . '">' . esc_html( $heading->name ) . '</a></h3>';📝 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.
| <p class="has-medium-font-size facilities-title wp-block-heading"><a href="' . esc_url( get_term_link( $heading->slug, 'facility' ) ) . '">' . esc_html( $heading->name ) . '</a></h5>'; | |
| <h3 class="has-medium-font-size facilities-title"><a href="' . esc_url( get_term_link( $heading->slug, 'facility' ) ) . '">' . esc_html( $heading->name ) . '</a></h3>'; |
| if ( ! empty( $tour_itinerary->itinerary['featured_image_id'] ) ) { | ||
| $tour_itinerary->save_used_image( $tour_itinerary->itinerary['featured_image_id'] ); | ||
| $thumbnail = wp_get_attachment_image_src( $tour_itinerary->itinerary['featured_image_id'], $size ); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add validation for featured image ID
The featured image ID should be validated before use.
Apply this diff to add validation:
-if ( ! empty( $tour_itinerary->itinerary['featured_image_id'] ) ) {
+if ( ! empty( $tour_itinerary->itinerary['featured_image_id'] ) && wp_attachment_is_image( $tour_itinerary->itinerary['featured_image_id'] ) ) {
$tour_itinerary->save_used_image( $tour_itinerary->itinerary['featured_image_id'] );
$thumbnail = wp_get_attachment_image_src( $tour_itinerary->itinerary['featured_image_id'], $size );
+} else {
+ error_log( 'Invalid featured image ID in tour itinerary' );📝 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.
| if ( ! empty( $tour_itinerary->itinerary['featured_image_id'] ) ) { | |
| $tour_itinerary->save_used_image( $tour_itinerary->itinerary['featured_image_id'] ); | |
| $thumbnail = wp_get_attachment_image_src( $tour_itinerary->itinerary['featured_image_id'], $size ); | |
| if ( ! empty( $tour_itinerary->itinerary['featured_image_id'] ) && wp_attachment_is_image( $tour_itinerary->itinerary['featured_image_id'] ) ) { | |
| $tour_itinerary->save_used_image( $tour_itinerary->itinerary['featured_image_id'] ); | |
| $thumbnail = wp_get_attachment_image_src( $tour_itinerary->itinerary['featured_image_id'], $size ); | |
| } else { | |
| error_log( 'Invalid featured image ID in tour itinerary' ); |
There was a problem hiding this comment.
Files selected (32)
- assets/css/scss/_icons.scss (2)
- assets/css/scss/_slider.scss (1)
- assets/css/scss/style.scss (1)
- assets/css/style.css (3)
- assets/js/blocks/accommodation.js (3)
- assets/js/blocks/general.js (3)
- assets/js/blocks/tour.js (4)
- assets/js/src/custom.js (5)
- bin/build.command (1)
- includes/actions.php (1)
- includes/classes/admin/class-setup.php (4)
- includes/classes/blocks/class-bindings.php (15)
- includes/classes/blocks/class-registration.php (7)
- includes/classes/blocks/class-templates.php (1)
- includes/classes/class-tour-operator.php (1)
- includes/classes/legacy/class-accommodation.php (3)
- includes/classes/legacy/class-admin.php (1)
- includes/classes/legacy/class-frontend.php (6)
- includes/classes/legacy/class-tour-operator.php (6)
- includes/classes/legacy/class-tour.php (3)
- includes/classes/legacy/class-unit-query.php (2)
- includes/customizer.php (1)
- includes/functions.php (9)
- includes/layout.php (1)
- includes/metaboxes/config-tour.php (1)
- includes/patterns/gallery.php (1)
- includes/patterns/room-card.php (3)
- includes/template-tags/accommodation.php (2)
- includes/template-tags/helpers.php (1)
- readme.txt (1)
- tour-operator-bootstrap.php (1)
- tour-operator.php (1)
Files ignored due to filter (6)
- assets/img/rating-star-empty.png
- assets/img/rating-star-full.png
- post-types/accommodation.json
- post-types/destinations.json
- post-types/tours.json
- vendor/cmb-field-select2/cmb-field-select2.php
Files not summarized due to errors (9)
- assets/css/style.css (diff tokens exceeds limit)
- assets/js/blocks/tour.js (diff tokens exceeds limit)
- assets/js/src/custom.js (diff tokens exceeds limit)
- includes/classes/admin/class-setup.php (diff tokens exceeds limit)
- includes/classes/blocks/class-bindings.php (diff tokens exceeds limit)
- includes/classes/blocks/class-registration.php (diff tokens exceeds limit)
- includes/classes/legacy/class-frontend.php (diff tokens exceeds limit)
- includes/classes/legacy/class-tour-operator.php (diff tokens exceeds limit)
- includes/layout.php (diff tokens exceeds limit)
Files not reviewed due to errors (13)
- assets/js/blocks/general.js (no response)
- assets/js/blocks/tour.js (no response)
- assets/js/src/custom.js (no response)
- includes/classes/admin/class-setup.php (no response)
- includes/classes/blocks/class-bindings.php (no response)
- includes/classes/legacy/class-accommodation.php (no response)
- includes/classes/legacy/class-frontend.php (no response)
- includes/classes/blocks/class-registration.php (no response)
- includes/classes/legacy/class-tour-operator.php (no response)
- includes/classes/legacy/class-tour.php (no response)
- includes/functions.php (no response)
- includes/patterns/gallery.php (no response)
- includes/patterns/room-card.php (no response)
Files skipped from review due to trivial changes (12)
- assets/css/scss/_slider.scss
- assets/css/scss/style.scss
- bin/build.command
- includes/classes/blocks/class-templates.php
- includes/classes/class-tour-operator.php
- includes/classes/legacy/class-admin.php
- includes/metaboxes/config-tour.php
- includes/template-tags/accommodation.php
- includes/template-tags/helpers.php
- readme.txt
- tour-operator.php
- includes/layout.php (diff too large)
Review comments generated (11)
- Review: 7
- LGTM: 4
Tips
Chat with
CodeRabbit Bot (@coderabbitai)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitaiin a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignoreanywhere in the PR description to pause further reviews from the bot.
| .lsx-price-wrapper .amount .currency-icon:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon:after, | ||
| .unit-price-wrapper .amount .currency-icon:after { | ||
| margin-left: 3px; | ||
| margin-right: 3px; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.usd:after, .lsx-price-wrapper .amount .currency-icon.nad:after, .lsx-price-wrapper .amount .currency-icon.cad:after, .lsx-price-wrapper .amount .currency-icon.hkd:after, .lsx-price-wrapper .amount .currency-icon.sgd:after, .lsx-price-wrapper .amount .currency-icon.nzd:after, .lsx-price-wrapper .amount .currency-icon.aud:after { | ||
| .lsx-price-wrapper .amount .currency-icon.usd:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.usd:after, | ||
| .unit-price-wrapper .amount .currency-icon.usd:after, .lsx-price-wrapper .amount .currency-icon.nad:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.nad:after, | ||
| .unit-price-wrapper .amount .currency-icon.nad:after, .lsx-price-wrapper .amount .currency-icon.cad:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.cad:after, | ||
| .unit-price-wrapper .amount .currency-icon.cad:after, .lsx-price-wrapper .amount .currency-icon.hkd:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.hkd:after, | ||
| .unit-price-wrapper .amount .currency-icon.hkd:after, .lsx-price-wrapper .amount .currency-icon.sgd:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.sgd:after, | ||
| .unit-price-wrapper .amount .currency-icon.sgd:after, .lsx-price-wrapper .amount .currency-icon.nzd:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.nzd:after, | ||
| .unit-price-wrapper .amount .currency-icon.nzd:after, .lsx-price-wrapper .amount .currency-icon.aud:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.aud:after, | ||
| .unit-price-wrapper .amount .currency-icon.aud:after { | ||
| content: "$"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.eur:after { | ||
| .lsx-price-wrapper .amount .currency-icon.eur:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.eur:after, | ||
| .unit-price-wrapper .amount .currency-icon.eur:after { | ||
| content: "€"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.gbp:after { | ||
| .lsx-price-wrapper .amount .currency-icon.gbp:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.gbp:after, | ||
| .unit-price-wrapper .amount .currency-icon.gbp:after { | ||
| content: "£"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.zar:after { | ||
| .lsx-price-wrapper .amount .currency-icon.zar:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.zar:after, | ||
| .unit-price-wrapper .amount .currency-icon.zar:after { | ||
| content: "R"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.brl:after { | ||
| .lsx-price-wrapper .amount .currency-icon.brl:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.brl:after, | ||
| .unit-price-wrapper .amount .currency-icon.brl:after { | ||
| content: "R$"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.bwp:after { | ||
| .lsx-price-wrapper .amount .currency-icon.bwp:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.bwp:after, | ||
| .unit-price-wrapper .amount .currency-icon.bwp:after { | ||
| content: "P"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.cny:after, .lsx-price-wrapper .amount .currency-icon.jpy:after { | ||
| .lsx-price-wrapper .amount .currency-icon.cny:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.cny:after, | ||
| .unit-price-wrapper .amount .currency-icon.cny:after, .lsx-price-wrapper .amount .currency-icon.jpy:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.jpy:after, | ||
| .unit-price-wrapper .amount .currency-icon.jpy:after { | ||
| content: "¥"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.inr:after { | ||
| .lsx-price-wrapper .amount .currency-icon.inr:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.inr:after, | ||
| .unit-price-wrapper .amount .currency-icon.inr:after { | ||
| content: "₹"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.idr:after { | ||
| .lsx-price-wrapper .amount .currency-icon.idr:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.idr:after, | ||
| .unit-price-wrapper .amount .currency-icon.idr:after { | ||
| content: "₹"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.ils:after { | ||
| .lsx-price-wrapper .amount .currency-icon.ils:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.ils:after, | ||
| .unit-price-wrapper .amount .currency-icon.ils:after { | ||
| content: "₪"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.kes:after { | ||
| .lsx-price-wrapper .amount .currency-icon.kes:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.kes:after, | ||
| .unit-price-wrapper .amount .currency-icon.kes:after { | ||
| content: "K"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.lak:after { | ||
| .lsx-price-wrapper .amount .currency-icon.lak:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.lak:after, | ||
| .unit-price-wrapper .amount .currency-icon.lak:after { | ||
| content: "₭"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.mwk:after { | ||
| .lsx-price-wrapper .amount .currency-icon.mwk:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.mwk:after, | ||
| .unit-price-wrapper .amount .currency-icon.mwk:after { | ||
| content: "MK"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.myr:after { | ||
| .lsx-price-wrapper .amount .currency-icon.myr:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.myr:after, | ||
| .unit-price-wrapper .amount .currency-icon.myr:after { | ||
| content: "RM"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.mzn:after { | ||
| .lsx-price-wrapper .amount .currency-icon.mzn:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.mzn:after, | ||
| .unit-price-wrapper .amount .currency-icon.mzn:after { | ||
| content: "MT"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.nok:after, .lsx-price-wrapper .amount .currency-icon.sek:after { | ||
| .lsx-price-wrapper .amount .currency-icon.nok:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.nok:after, | ||
| .unit-price-wrapper .amount .currency-icon.nok:after, .lsx-price-wrapper .amount .currency-icon.sek:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.sek:after, | ||
| .unit-price-wrapper .amount .currency-icon.sek:after { | ||
| content: "kr"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.rub:after { | ||
| .lsx-price-wrapper .amount .currency-icon.rub:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.rub:after, | ||
| .unit-price-wrapper .amount .currency-icon.rub:after { | ||
| content: "руб"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.chf:after { | ||
| .lsx-price-wrapper .amount .currency-icon.chf:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.chf:after, | ||
| .unit-price-wrapper .amount .currency-icon.chf:after { | ||
| content: "CHF"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.tzs:after { | ||
| .lsx-price-wrapper .amount .currency-icon.tzs:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.tzs:after, | ||
| .unit-price-wrapper .amount .currency-icon.tzs:after { | ||
| content: "TSh"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.aed:after { | ||
| .lsx-price-wrapper .amount .currency-icon.aed:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.aed:after, | ||
| .unit-price-wrapper .amount .currency-icon.aed:after { | ||
| content: "د.إ"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.zmw:after { | ||
| .lsx-price-wrapper .amount .currency-icon.zmw:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.zmw:after, | ||
| .unit-price-wrapper .amount .currency-icon.zmw:after { | ||
| content: "Zk"; | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon.zwl:after { | ||
| .lsx-price-wrapper .amount .currency-icon.zwl:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon.zwl:after, | ||
| .unit-price-wrapper .amount .currency-icon.zwl:after { |
There was a problem hiding this comment.
The changes in this section are primarily about adding new CSS selectors for .lsx-single-supplement-wrapper and .unit-price-wrapper. This is to ensure that the styles applied to the .lsx-price-wrapper are also applied to these new classes. The changes seem to be consistent with the existing code and there doesn't appear to be any issues.
| .lsx-price-wrapper, | ||
| .lsx-single-supplement-wrapper, | ||
| .unit-price-wrapper { | ||
| /*&:before { | ||
| background-image: url( ../img/icons/price-icon.png ); | ||
| }*/ | ||
| } | ||
| .lsx-price-wrapper .amount .currency-icon:after { | ||
| .lsx-price-wrapper .amount .currency-icon:after, | ||
| .lsx-single-supplement-wrapper .amount .currency-icon:after, | ||
| .unit-price-wrapper .amount .currency-icon:after { |
There was a problem hiding this comment.
Similar to the previous hunk, this change adds new CSS selectors for .lsx-single-supplement-wrapper and .unit-price-wrapper. It seems like the intention is to apply the same styles as those applied to .lsx-price-wrapper. The changes are consistent with the existing code and there doesn't appear to be any issues.
| display: none; | ||
| } | ||
| /*# sourceMappingURL=style.css.map */ | ||
| /*# sourceMappingURL=style.css.map */ No newline at end of file |
There was a problem hiding this comment.
This line removes a newline at the end of the file. While it's not a critical issue, it's generally a good practice to end files with a newline. This helps with compatibility across different systems and tools.
- /*# sourceMappingURL=style.css.map */
+ /*# sourceMappingURL=style.css.map */
+ | name: 'Special Interests', | ||
| }, | ||
| className: 'lsx-special-interests-wrapper', | ||
| className: 'lsx-special-interest-wrapper', |
There was a problem hiding this comment.
The class name has been changed from 'lsx-special-interests-wrapper' to 'lsx-special-interest-wrapper'. If there are any CSS or JavaScript selectors that rely on the old class name, they will need to be updated to reflect this change.
- className: 'lsx-special-interests-wrapper',
+ className: 'lsx-special-interest-wrapper',| name: 'Facilities', | ||
| }, | ||
| className: 'lsx-facilities-wrapper', | ||
| className: 'lsx-facility-wrapper', |
There was a problem hiding this comment.
| ['core/paragraph', { | ||
| metadata: { | ||
| bindings: { | ||
| content: { | ||
| source: 'lsx/post-connection', | ||
| args: { | ||
| key: 'facilities' | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| className: 'has-septenary-color has-text-color has-link-color has-primary-color has-primary-700-color', | ||
| style: { | ||
| spacing: { | ||
| padding: { | ||
| top: '2px', | ||
| bottom: '2px' | ||
| } | ||
| } | ||
| }, | ||
| textColor: 'primary-700' |
There was a problem hiding this comment.
The block structure for displaying facilities has been significantly altered. The previous version used a 'core/post-terms' block with the term set to 'facility' and a font size of 'x-small'. The new version uses a 'core/paragraph' block with metadata bindings to source content from 'lsx/post-connection' with a key of 'facilities'. This is a significant change in how the facilities data is sourced and displayed, so it's important to ensure that the new method correctly retrieves and displays the desired data.
- ['core/post-terms', {
- term: 'facility',
- fontSize: 'x-small'
- }]
+ ['core/paragraph', {
+ metadata: {
+ bindings: {
+ content: {
+ source: 'lsx/post-connection',
+ args: {
+ key: 'facilities'
+ }
+ }
+ }
+ },
+ className: 'has-septenary-color has-text-color has-link-color has-primary-color has-primary-700-color',
+ style: {
+ spacing: {
+ padding: {
+ top: '2px',
+ bottom: '2px'
+ }
+ }
+ },
+ textColor: 'primary-700'
+ }]| public function item_thumbnail( $size = 'large' ) { | ||
| $thumbnail_src = false; | ||
| $thumbnail_src = apply_filters( 'lsx_to_accommodation_room_thumbnail', $thumbnail_src ); | ||
| if ( $this->have_query && false !== $this->query_item && ! empty( $this->query_item ) ) { | ||
| if ( false !== $this->query_item['gallery'] ) { | ||
| if ( isset( $this->query_item['gallery'] ) && ! empty( $this->query_item['gallery'] ) ) { | ||
| $images = array_keys( $this->query_item['gallery'] ); | ||
| $thumbnail = wp_get_attachment_image_src( $images[0], 'medium' ); | ||
| $thumbnail = wp_get_attachment_image_src( $images[0], $size ); |
There was a problem hiding this comment.
The new code introduces a parameter $size to the item_thumbnail function, which allows specifying the size of the thumbnail image. This is a good improvement for flexibility. However, there's no validation or sanitization on the $size input. It's important to ensure that the provided size is one of the sizes registered with WordPress to avoid potential errors or unexpected behavior.
public function item_thumbnail( $size = 'large' ) {
$thumbnail_src = false;
$thumbnail_src = apply_filters( 'lsx_to_accommodation_room_thumbnail', $thumbnail_src );
if ( $this->have_query && false !== $this->query_item && ! empty( $this->query_item ) ) {
if ( isset( $this->query_item['gallery'] ) && ! empty( $this->query_item['gallery'] ) ) {
$images = array_keys( $this->query_item['gallery'] );
+ if (!in_array($size, get_intermediate_image_sizes())) {
+ $size = 'large'; // default to 'large' if the provided size is not valid
+ }
$thumbnail = wp_get_attachment_image_src( $images[0], $size );
if ( is_array( $thumbnail ) ) {
$thumbnail_src = $thumbnail[0];
}
Description
The following PR were concluded to close off Bugherd and Issues list in the Tour Operator Project.
Pull Requests
#445
#446
#447
#450
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Chores
Documentation
Summary by CodeRabbit
Release Notes for Pull Request
price_filterandratingfunctions. Removed redundant arrays from theTourclass.add_tagline_form_fieldfunction.