Skip to content
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.1 release #2659

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

vaurdan
Copy link
Contributor

@vaurdan vaurdan commented Jul 18, 2024

This PR updates the plugin's version number and changelog in preparation for the 3.16.1 release.

Fixed

  • PCH Performance Stats: Remove UTM parameters from the 'View in Parse.ly' button (#2655)
  • PCH Smart Linking: Show error when API returns empty list of Smart Link suggestions (#2654)
  • PCH Smart Linking: Fix CSS leaking from the Block Preview (#2652)
  • PCH Smart Linking: Use the post title as the Smart Link title. (#2650)
  • Permissions: Fix PHP Warning when the user role is invalid (#2649)

Summary by CodeRabbit

  • New Features

    • Added new parameters to existing methods for better customization and functionality (e.g., get_parsely_post_url).
  • Bug Fixes

    • Improved error handling and JSX structure in the Smart Linking review modal.
    • Fixed issues related to performance stats, smart linking, and permissions.
  • Documentation

    • Updated README with new version, PHP requirements, and compatibility details.
    • Fixed various issues in the CHANGELOG.
  • Chores

    • Updated plugin version to 3.16.1 in multiple files.

@vaurdan vaurdan requested a review from a team as a code owner July 18, 2024 12:56
@vaurdan vaurdan added this to the 3.16.1 milestone Jul 18, 2024
@vaurdan vaurdan self-assigned this Jul 18, 2024
Copy link
Contributor

coderabbitai bot commented Jul 18, 2024

Walkthrough

Walkthrough

The wp-parsely plugin has been updated to version 3.16.1 with several improvements. These include performance optimizations for PCH Performance Stats and PCH Smart Linking, enhanced error handling, and better code readability. PHP requirements were updated to 7.2, and the plugin has been tested up to WordPress version 6.5.

Changes

File Path Change Summary
CHANGELOG.md Fixed various issues related to PCH Performance Stats, PCH Smart Linking, and Permissions.
README.md Updated Parse.ly version to 3.16.1, specified PHP requirement as 7.2, updated tested version to 6.5.
package.json, wp-parsely.php Updated version to 3.16.1 for "wp-parsely" plugin.
src/Models/class-smart-link.php Updated __construct method to conditionally set title property based on destination_post_id.
src/class-dashboard-link.php Updated generate_url method to make $campaign and $source parameters optional.
src/class-permissions.php Refactored current_user_can_use_pch_feature function for improved readability and logic flow.
src/content-helper/editor-sidebar/class-editor-sidebar.php Modified get_parsely_post_url method to include a new parameter $add_utm_params.
src/content-helper/editor-sidebar/smart-linking/component.tsx Updated behavior based on smartLinks.length === 0 condition.
src/content-helper/editor-sidebar/smart-linking/review-modal/component-block-preview.tsx Enhanced error handling and structure of JSX elements.
src/content-helper/editor-sidebar/smart-linking/smart-linking.scss Adjusted styling of .wp-parsely-preview-editor class.
tests/e2e/specs/content-helper/top-bar-icon.spec.ts Modified import statements and function call in a test case.
tests/e2e/utils.ts Updated PLUGIN_VERSION constant and introduced toggleMoreMenu function.

Possibly related issues


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vaurdan vaurdan changed the base branch from develop to prepare/3.16.1 July 18, 2024 12:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post

Actionable comments posted: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 990a1a5 and 768b38c.

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 (13)
  • CHANGELOG.md (1 hunks)
  • README.md (1 hunks)
  • package.json (1 hunks)
  • src/Models/class-smart-link.php (1 hunks)
  • src/class-dashboard-link.php (2 hunks)
  • src/class-permissions.php (1 hunks)
  • src/content-helper/editor-sidebar/class-editor-sidebar.php (3 hunks)
  • src/content-helper/editor-sidebar/smart-linking/component.tsx (1 hunks)
  • src/content-helper/editor-sidebar/smart-linking/review-modal/component-block-preview.tsx (3 hunks)
  • src/content-helper/editor-sidebar/smart-linking/smart-linking.scss (2 hunks)
  • tests/e2e/specs/content-helper/top-bar-icon.spec.ts (3 hunks)
  • tests/e2e/utils.ts (2 hunks)
  • wp-parsely.php (2 hunks)
Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
Additional context used
Path-based instructions (10)
src/class-dashboard-link.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."
tests/e2e/specs/content-helper/top-bar-icon.spec.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/class-editor-sidebar.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/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/review-modal/component-block-preview.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."
tests/e2e/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."
src/content-helper/editor-sidebar/smart-linking/smart-linking.scss (1)

Pattern **/*.{css,scss}: "Perform a detailed review of the provided code with following key aspects in mind:

  • Review the SCSS code to ensure it is well-structured and adheres to best practices.
  • Convert dimensions greater than or equal to 3px to rem units using the to_rem function.
  • Utilize variables for sizes and colors defined in src/content-helper/common/css/variables.scss instead of hardcoding values."
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/Models/class-smart-link.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."
Additional comments not posted (35)
src/class-dashboard-link.php (2)

28-28: Update the docblock to reflect the changes.

The docblock has been updated to indicate that the $campaign and $source parameters are now optional.


Line range hint 36-64:
LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to generate_url match the new signature.

Verification successful

Verification Successful: All function calls to generate_url match the new signature.

The function generate_url has been correctly updated in all instances across the codebase to match the new signature.

  • src/content-helper/editor-sidebar/class-editor-sidebar.php at lines 123 and 126
  • tests/Integration/DashboardLinkTest.php at lines 48 and 69
  • src/UI/class-row-actions.php at line 78
  • src/UI/class-admin-bar.php at line 89
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `generate_url` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type php -A 5 $'generate_url'

Length of output: 4739


Script:

#!/bin/bash
# Description: Verify all function calls to `generate_url` match the new signature.

# Extract lines where generate_url is called in the identified files.
rg --type php 'generate_url' -n -A 0 -B 0

Length of output: 1470

package.json (1)

3-3: Version number update approved.

The version number has been correctly updated to "3.16.1".

tests/e2e/specs/content-helper/top-bar-icon.spec.ts (2)

Line range hint 4-14:
Import statement changes approved.

The toggleMoreMenu function has been correctly moved from a grouped import to an individual import.


85-85: Function call update approved.

The parameter 'open' has been correctly added to the toggleMoreMenu function call.

src/content-helper/editor-sidebar/class-editor-sidebar.php (3)

98-98: Update the docblock to reflect the changes.

The docblock has been updated to indicate that the $add_utm_params parameter has been added.


168-169: Function call update approved.

The parameter false has been correctly passed to the get_parsely_post_url function call to ensure that UTM parameters are not added to the URL.


Line range hint 101-125:
LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to get_parsely_post_url match the new signature.

Verification successful

Verification successful: All function calls to get_parsely_post_url match the new signature.

  • The function call $this->get_parsely_post_url( null, false ); matches the updated signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `get_parsely_post_url` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type php -A 5 $'get_parsely_post_url'

Length of output: 1214

src/class-permissions.php (6)

84-85: Ensure variable initialization.

The $user_roles variable is initialized correctly by fetching the roles of the current user.


86-87: Handle edge case: User with no roles.

The function correctly handles the case where the user has no roles.


91-93: Retrieve valid roles with edit_posts capability.

The function retrieves roles with the capability to edit posts using array_keys.


94-95: Check user roles against valid roles.

The function checks if at least one of the user's roles has the capability to edit posts using array_intersect.


99-103: Check user roles against allowed roles.

The function checks if at least one of the user's roles has access to the specific feature/post using array_intersect.


105-107: Check if user can edit the post.

The function checks if the user can edit the post when a valid post ID is provided.

src/content-helper/editor-sidebar/smart-linking/review-modal/component-block-preview.tsx (9)

9-9: Import useState from @wordpress/element.

The useState hook is correctly imported and necessary for managing state in the component.


17-26: Define Style type.

The Style type is defined correctly and includes optional properties.


32-35: Update styles prop in StylesProps to use Style type.

The styles prop is correctly updated to use the new Style type.


48-95: Add prefixSelectors function.

The prefixSelectors function is correctly implemented to prefix CSS selectors.


97-97: Add processedStyles state.

The processedStyles state is correctly initialized using useState.


99-121: Add processStyles function.

The processStyles function is correctly implemented to process styles with prefixing.


104-121: Modify useEffect to process styles with prefixing.

The useEffect hook is correctly modified to process styles with prefixing.


125-126: Update JSX to use processedStyles.

The JSX elements are correctly updated to use processedStyles instead of filteredStyles.


261-276: Modify JSX structure in BlockPreview.

The structure of JSX elements in BlockPreview is correctly updated.

README.md (3)

3-3: Update version information.

The version information is correctly updated from 3.16.0 to 3.16.1.


3-3: Specify PHP requirement.

The PHP requirement is correctly specified as 7.2.


3-3: Update tested version.

The tested version is correctly updated to 6.5.

tests/e2e/utils.ts (2)

11-11: Update PLUGIN_VERSION constant.

The PLUGIN_VERSION constant is correctly updated from '3.16.0' to '3.16.1'.


246-281: Add toggleMoreMenu function.

The toggleMoreMenu function is correctly implemented to replace the findSidebarPanelToggleButtonWithTitle function.

src/content-helper/editor-sidebar/smart-linking/smart-linking.scss (2)

507-507: Use variables for colors.

Ensure that the color is using variables defined in variables.scss instead of hardcoding values.

- color: var(--sidebar-black) !important;
+ color: var(--sidebar-black) !important;

Likely invalid or redundant comment.


492-495: Use rem units for dimensions.

Ensure that dimensions greater than or equal to 3px are converted to rem units using the to_rem function.

- padding-bottom: 0;
- font-size: var(--font-size--medium);
+ padding-bottom: to_rem(0);
+ font-size: to_rem(var(--font-size--medium));

Likely invalid or redundant comment.

wp-parsely.php (2)

14-14: Version update confirmed.

The plugin version has been correctly updated to 3.16.1.


73-73: Constant update confirmed.

The PARSELY_VERSION constant has been correctly updated to 3.16.1.

src/Models/class-smart-link.php (2)

132-137: Conditional title assignment confirmed.

The logic for setting the title property based on destination_post_id is correct and efficient.


131-131: Property assignment confirmed.

The title property assignment in the constructor is consistent with the updated logic.

src/content-helper/editor-sidebar/smart-linking/component.tsx (1)

485-495: State setting logic confirmed.

The logic for setting IsReviewModalOpen based on smartLinks.length === 0 is correct and enhances error handling.

Comments failed to post (1)
src/content-helper/editor-sidebar/smart-linking/smart-linking.scss

495-495: Use variables for background colors.

Ensure that the background color is using variables defined in variables.scss instead of hardcoding values.

- background: var(--Gutenberg-White, #fff);
+ background: var(--Gutenberg-White);
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.

		background: var(--Gutenberg-White);

@vaurdan vaurdan merged commit a252abf into prepare/3.16.1 Jul 18, 2024
37 checks passed
@vaurdan vaurdan deleted the update/wp-parsely-version-to-3.16.1 branch July 18, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant