-
Notifications
You must be signed in to change notification settings - Fork 33
Update version number and changelog for 3.16.2 release #2676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Base branches to auto review (4)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughWalkthroughThe recent update to the Parse.ly WordPress plugin introduces version 3.16.2, featuring enhancements to the Personalized Content Hub (PCH) functionalities. Key improvements include refined Smart Linking capabilities, better handling of Related Posts loading issues, and an updated permissions system for increased user flexibility. Additional modifications bolster TypeScript definitions, improve error handling in smart linking, and provide new state management for enhanced user interactions across the editor interface. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Editor as Smart Linking Editor
participant Plugin as Parse.ly Plugin
participant API as External API
User->>Editor: Selects a block
Editor->>Plugin: Check if block is allowed
Plugin-->>Editor: Returns allowed status
Editor->>API: Fetch smart links
API-->>Editor: Returns smart links
Editor-->>User: Displays smart links
This diagram illustrates the interaction flow when a user selects a block in the Smart Linking Editor, showcasing how the plugin checks permissions and retrieves smart links. 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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
…6.2' into update/wp-parsely-version-to-3.16.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
CHANGELOG.md (1)
8-8: Add release date for version 3.16.2.Including the release date helps users understand when the changes were made.
- ## [3.16.2](https://github.com/Parsely/wp-parsely/compare/3.16.1...3.16.2) - 2024-07-30 + ## [3.16.2](https://github.com/Parsely/wp-parsely/compare/3.16.1...3.16.2) - 2024-07-30
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (5)
build/content-helper/editor-sidebar-rtl.cssis excluded by!build/**build/content-helper/editor-sidebar.asset.phpis excluded by!build/**build/content-helper/editor-sidebar.cssis excluded by!build/**build/content-helper/editor-sidebar.jsis excluded by!build/**package-lock.jsonis excluded by!**/package-lock.json
Files selected for processing (14)
- CHANGELOG.md (1 hunks)
- README.md (1 hunks)
- package.json (1 hunks)
- src/@types/assets/window.d.ts (1 hunks)
- src/class-permissions.php (1 hunks)
- src/content-helper/editor-sidebar/related-posts/hooks.ts (3 hunks)
- src/content-helper/editor-sidebar/smart-linking/class-smart-linking.php (3 hunks)
- src/content-helper/editor-sidebar/smart-linking/component-settings.tsx (8 hunks)
- src/content-helper/editor-sidebar/smart-linking/component.tsx (5 hunks)
- src/content-helper/editor-sidebar/smart-linking/smart-linking.scss (1 hunks)
- src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx (3 hunks)
- src/content-helper/editor-sidebar/smart-linking/utils.ts (3 hunks)
- tests/e2e/utils.ts (1 hunks)
- wp-parsely.php (3 hunks)
Files skipped from review due to trivial changes (4)
- README.md
- package.json
- src/content-helper/editor-sidebar/smart-linking/smart-linking.scss
- tests/e2e/utils.ts
Additional context used
Path-based instructions (9)
src/@types/assets/window.d.ts (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/related-posts/hooks.ts (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/class-permissions.php (1)
Pattern
**/*.{html,php}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the HTML and PHP code to ensure it is well-structured and adheres to best practices.
- Ensure the code follows WordPress coding standards and is well-documented.
- Confirm the code is secure and free from vulnerabilities.
- Optimize the code for performance, removing any unnecessary elements.
- Validate comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Verify code compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/class-smart-linking.php (1)
Pattern
**/*.{html,php}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the HTML and PHP code to ensure it is well-structured and adheres to best practices.
- Ensure the code follows WordPress coding standards and is well-documented.
- Confirm the code is secure and free from vulnerabilities.
- Optimize the code for performance, removing any unnecessary elements.
- Validate comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Verify code compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/component-settings.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
wp-parsely.php (1)
Pattern
**/*.{html,php}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the HTML and PHP code to ensure it is well-structured and adheres to best practices.
- Ensure the code follows WordPress coding standards and is well-documented.
- Confirm the code is secure and free from vulnerabilities.
- Optimize the code for performance, removing any unnecessary elements.
- Validate comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Verify code compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/component.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/utils.ts (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
Additional comments not posted (28)
src/@types/assets/window.d.ts (1)
34-34: LGTM!The addition of the
wpParselySmartLinkingAllowedBlocksproperty to theWindowinterface is well-structured and logically sound.src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx (4)
26-30: LGTM!The
DEFAULT_MAX_LINKSconstant is well-documented and adheres to WordPress coding standards.
33-38: LGTM!The
ALLOWED_BLOCKSconstant is well-documented and enhances the flexibility of the smart linking feature.
48-50: LGTM!The
withSettingsProviderfunction correctly checks if the block name is included inALLOWED_BLOCKS, enhancing the functionality.
72-72: LGTM!The
SmartLinkingInspectorControlPanelfunction correctly checks if the block name is included inALLOWED_BLOCKSand if the block is selected, ensuring proper functionality.src/content-helper/editor-sidebar/related-posts/hooks.ts (3)
7-7: LGTM!The import statement for
useEffectanduseStateis correct and necessary for the added functionality.
Line range hint
12-41:
LGTM!The
PostDatainterface is well-defined and the documentation comments are clear and adhere to WordPress coding standards.
Line range hint
48-152:
LGTM!The
usePostDatafunction is well-structured and the added state management for loading and resolution improves the reliability of the data handling. The code adheres to best practices.src/class-permissions.php (2)
86-98: Ensure accurate and secure filter usage.The new filter
wp_parsely_current_user_can_use_pch_featureallows overriding the default permissions check. Ensure that this filter is used securely and that any custom implementations properly validate user capabilities to prevent unauthorized access.
99-109: LGTM! Verify the filter's impact on permissions.The code changes are approved.
However, ensure that the filter's impact on permissions is thoroughly tested to prevent any security vulnerabilities.
src/content-helper/editor-sidebar/smart-linking/class-smart-linking.php (2)
25-34: LGTM! Ensure the allowed blocks are appropriate.The constant
BLOCKS_ALLOWEDis correctly defined. Ensure that the allowed blocks are appropriate for the Smart Linking feature and do not introduce any security risks.
186-205: LGTM! Verify the inline script's security.The method
add_inline_scriptis correctly implemented. Ensure that the inline script added is secure and does not introduce any vulnerabilities.Verification successful
To ensure the security of the inline script added by the
add_inline_scriptmethod, we need to verify the definition and sanitization ofself::BLOCKS_ALLOWEDand the usage of theapply_filtersfunction.
To ensure the security of the inline script added by the
add_inline_scriptmethod, we need to re-run the search for the usage ofapply_filterswith the correct syntax.
To ensure the security of the inline script added by the
add_inline_scriptmethod, we need to inspect the definition ofBLOCKS_ALLOWEDand review its content.
Verification Complete: Inline Script Security Confirmed
The
add_inline_scriptmethod is correctly implemented and secure. TheBLOCKS_ALLOWEDconstant contains safe predefined block types, and theapply_filtersfunction does not introduce any unsafe data.
- The
BLOCKS_ALLOWEDconstant is defined as:private const BLOCKS_ALLOWED = array( 'core/paragraph', );- The
apply_filtersfunction is used directly with this constant, ensuring no unsafe modifications.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the security of the inline script added by the `add_inline_script` method. # Test: Search for the method usage and ensure proper testing of the inline script. rg --type php 'add_inline_script'Length of output: 1076
Script:
#!/bin/bash # Description: Verify the definition and sanitization of `self::BLOCKS_ALLOWED` and the usage of `apply_filters`. # Search for the definition of `BLOCKS_ALLOWED` in the codebase. rg --type php 'const BLOCKS_ALLOWED' # Search for the usage of `apply_filters` for the 'wp_parsely_smart_linking_allowed_blocks' filter. rg --type php 'apply_filters( \'wp_parsely_smart_linking_allowed_blocks\''Length of output: 243
Script:
#!/bin/bash # Description: Verify the definition and sanitization of `self::BLOCKS_ALLOWED` and the usage of `apply_filters`. # Search for the definition of `BLOCKS_ALLOWED` in the codebase. rg --type php 'const BLOCKS_ALLOWED' # Search for the usage of `apply_filters` for the 'wp_parsely_smart_linking_allowed_blocks' filter. rg --type php "apply_filters\( 'wp_parsely_smart_linking_allowed_blocks'"Length of output: 405
Script:
#!/bin/bash # Description: Retrieve the definition of `BLOCKS_ALLOWED` to review its content. # Display the definition of `BLOCKS_ALLOWED` in the codebase. rg --type php --context 10 'const BLOCKS_ALLOWED' src/content-helper/editor-sidebar/smart-linking/class-smart-linking.phpLength of output: 512
src/content-helper/editor-sidebar/smart-linking/component-settings.tsx (6)
30-30: LGTM! Ensure the type change is correctly handled.The
selectedBlockprop type has been updated toBlockInstance | null. Ensure that this type change is correctly handled throughout the component.
53-54: LGTM! Ensure the new state variable is correctly used.The new state variable
selectedBlockIdis correctly introduced. Ensure that it is correctly used throughout the component.
92-93: LGTM! Ensure the state initialization is correct.The
applyToValuestate is correctly initialized based on the newselectedBlockId. Ensure that the state initialization is correct and does not introduce any issues.
94-107: LGTM! Ensure theuseEffecthook handles the selected block correctly.The
useEffecthook has been updated to handle cases where the selected block is not allowed. Ensure that the hook handles the selected block correctly and does not introduce any issues.
144-169: LGTM! Ensure themoveButtonAndShowHintfunction is correctly implemented.The
moveButtonAndShowHintfunction has been modified to accept ahintTextparameter. Ensure that the function is correctly implemented and does not introduce any issues.
178-186: LGTM! Ensure theuseEffecthook handles unsupported blocks correctly.The
useEffecthook has been updated to handle cases where the selected block is not supported. Ensure that the hook handles unsupported blocks correctly and does not introduce any issues.wp-parsely.php (3)
14-14: Version update approved.The version number has been correctly updated to 3.16.2.
73-73: Version update approved.The
PARSELY_VERSIONconstant has been correctly updated to 3.16.2.
298-307: Conditional check forEditor_Sidebarinitialization approved.The added check ensures that the
Editor_Sidebarobject is only instantiated if it has not already been set, enhancing code robustness.src/content-helper/editor-sidebar/smart-linking/component.tsx (4)
354-355: Return type specification approved.The return type of
processSmartLinkshas been correctly specified asPromise<SmartLink[]>, improving type safety and clarity.
357-357: Filtering logic approved.The function now correctly filters out links that have already been applied, preventing duplicates.
472-482: Error handling logic approved.The updated error handling logic improves specificity by throwing a clear error code when no smart links are generated.
699-699: Rendering logic approved.The
selectedBlockprop is now passed directly to theSmartLinkingSettingsComponent, streamlining interactions with the selected block.src/content-helper/editor-sidebar/smart-linking/utils.ts (2)
109-130: New functionisInsideHeadingOrCaptionapproved.The function enhances the ability to identify specific structural contexts in the DOM tree, improving the robustness of the smart linking feature.
380-394: Updates tocalculateSmartLinkingMatchesfunction approved.The function now includes checks for allowed blocks and uses the
isInsideHeadingOrCaptionfunction to skip processing links in inappropriate contexts, improving the relevance and robustness of the smart linking feature.CHANGELOG.md (1)
12-15: Ensure clarity and consistency in fix descriptions.The descriptions are clear and accurately reflect the changes made. Ensure consistency in the formatting.
This PR updates the plugin's version number and changelog in preparation for the 3.16.2 release.
Fixed
Summary by CodeRabbit
New Features
Bug Fixes
Versioning