-
Notifications
You must be signed in to change notification settings - Fork 32
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
Update version number and changelog for 3.16.2 release #2676
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.css
is excluded by!build/**
build/content-helper/editor-sidebar.asset.php
is excluded by!build/**
build/content-helper/editor-sidebar.css
is excluded by!build/**
build/content-helper/editor-sidebar.js
is excluded by!build/**
package-lock.json
is 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
wpParselySmartLinkingAllowedBlocks
property to theWindow
interface is well-structured and logically sound.src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx (4)
26-30
: LGTM!The
DEFAULT_MAX_LINKS
constant is well-documented and adheres to WordPress coding standards.
33-38
: LGTM!The
ALLOWED_BLOCKS
constant is well-documented and enhances the flexibility of the smart linking feature.
48-50
: LGTM!The
withSettingsProvider
function correctly checks if the block name is included inALLOWED_BLOCKS
, enhancing the functionality.
72-72
: LGTM!The
SmartLinkingInspectorControlPanel
function correctly checks if the block name is included inALLOWED_BLOCKS
and 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
useEffect
anduseState
is correct and necessary for the added functionality.
Line range hint
12-41
:
LGTM!The
PostData
interface is well-defined and the documentation comments are clear and adhere to WordPress coding standards.
Line range hint
48-152
:
LGTM!The
usePostData
function 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_feature
allows 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_ALLOWED
is 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_script
is 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_script
method, we need to verify the definition and sanitization ofself::BLOCKS_ALLOWED
and the usage of theapply_filters
function.
To ensure the security of the inline script added by the
add_inline_script
method, we need to re-run the search for the usage ofapply_filters
with the correct syntax.
To ensure the security of the inline script added by the
add_inline_script
method, we need to inspect the definition ofBLOCKS_ALLOWED
and review its content.
Verification Complete: Inline Script Security Confirmed
The
add_inline_script
method is correctly implemented and secure. TheBLOCKS_ALLOWED
constant contains safe predefined block types, and theapply_filters
function does not introduce any unsafe data.
- The
BLOCKS_ALLOWED
constant is defined as:private const BLOCKS_ALLOWED = array( 'core/paragraph', );- The
apply_filters
function 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
selectedBlock
prop 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
selectedBlockId
is correctly introduced. Ensure that it is correctly used throughout the component.
92-93
: LGTM! Ensure the state initialization is correct.The
applyToValue
state is correctly initialized based on the newselectedBlockId
. Ensure that the state initialization is correct and does not introduce any issues.
94-107
: LGTM! Ensure theuseEffect
hook handles the selected block correctly.The
useEffect
hook 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 themoveButtonAndShowHint
function is correctly implemented.The
moveButtonAndShowHint
function has been modified to accept ahintText
parameter. Ensure that the function is correctly implemented and does not introduce any issues.
178-186
: LGTM! Ensure theuseEffect
hook handles unsupported blocks correctly.The
useEffect
hook 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_VERSION
constant has been correctly updated to 3.16.2.
298-307
: Conditional check forEditor_Sidebar
initialization approved.The added check ensures that the
Editor_Sidebar
object 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
processSmartLinks
has 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
selectedBlock
prop 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 functionisInsideHeadingOrCaption
approved.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 tocalculateSmartLinkingMatches
function approved.The function now includes checks for allowed blocks and uses the
isInsideHeadingOrCaption
function 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