Skip to content

Consistently display shortcodes with square brackets in WooCommerce system status report #59687

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

Merged

Conversation

nerrad
Copy link
Contributor

@nerrad nerrad commented Jul 15, 2025

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR addresses the inconsistency in shortcode display within the WooCommerce Status "WooCommerce pages" box. Previously, the My Account page showed shortcodes with square brackets (e.g., [woocommerce_my_account]) while Cart and Checkout pages showed them without brackets (e.g., woocommerce_cart, woocommerce_checkout).

The fix ensures all shortcodes are displayed consistently with square brackets for better clarity and consistency across the status report.

Closes #59673.

Screenshots or screen recordings:

Before After
Cart: "Contains the woocommerce_cart shortcode"
Checkout: "Contains the woocommerce_checkout shortcode"
My Account: "Contains the [woocommerce_my_account] shortcode"
Cart: "Contains the [woocommerce_cart] shortcode"
Checkout: "Contains the [woocommerce_checkout] shortcode"
My Account: "Contains the [woocommerce_my_account] shortcode"

How to test the changes in this Pull Request:

  1. Configure Cart and Checkout pages to use the relevant shortcodes instead of the blocks.
  2. Navigate to WooCommerce → Status in the WordPress admin
  3. Scroll down to the "WooCommerce pages" section
  4. Verify that all page status messages show shortcodes with square brackets:
    • Cart page should display: "Contains the [woocommerce_cart] shortcode"
    • Checkout page should display: "Contains the [woocommerce_checkout] shortcode"
    • My Account page should display: "Contains the [woocommerce_my_account] shortcode"

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Fix inconsistent shortcode display in WooCommerce Status pages section. This improvement ensures consistent formatting of shortcode display in the WooCommerce Status "WooCommerce pages" box, making all shortcodes appear with square brackets for better clarity and consistency.

Changelog Entry Comment

Comment

…rce Status 'WooCommerce pages' box\n\n- Cart and Checkout shortcodes now display as [woocommerce_cart] and [woocommerce_checkout] to match My Account.\n- Resolves #59673: #59673
@nerrad nerrad self-assigned this Jul 15, 2025
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jul 15, 2025
Copy link
Contributor

coderabbitai bot commented Jul 15, 2025

📝 Walkthrough

Walkthrough

The change updates the display logic for shortcodes in the WooCommerce admin status report. It ensures that all shortcodes are shown with square brackets, regardless of how they are stored, by programmatically adding brackets if they are missing before displaying them. Additionally, the PR template guidance was clarified to prohibit removal of checkbox items.

Changes

File Change Summary
plugins/woocommerce/includes/admin/views/html-admin-page-status-report.php Updated shortcode display logic to enforce square brackets.
plugins/woocommerce/changelog/59687-wooplug-5022-woocommerce-status-woocommerce-pages-box-wording-not Added patch note describing shortcode display consistency fix.
.cursor/rules/generate-pr-description.mdc Clarified PR template guidance to forbid removal of checkbox items while allowing erasure of irrelevant sections.

Sequence Diagram(s)

sequenceDiagram
    participant Admin as Admin User
    participant WooAdmin as WooCommerce Admin Page

    Admin->>WooAdmin: View status report
    WooAdmin->>WooAdmin: Retrieve page shortcodes
    WooAdmin->>WooAdmin: Check if shortcode has brackets
    alt Brackets missing
        WooAdmin->>WooAdmin: Add square brackets to shortcode
    end
    WooAdmin->>Admin: Display shortcode with square brackets
Loading

📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46485b4 and 7ba4bab.

📒 Files selected for processing (1)
  • .cursor/rules/generate-pr-description.mdc (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .cursor/rules/generate-pr-description.mdc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
  • GitHub Check: Metrics - @woocommerce/plugin-woocommerce [performance]
  • GitHub Check: Blocks e2e tests 6/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 9/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 10/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Core e2e tests 1/6 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 1/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: PHP: 8.4 WP: latest [WP latest] 1/2 - @woocommerce/plugin-woocommerce [unit:php]
  • GitHub Check: Blocks e2e tests 3/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 7/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 5/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: PHP: 7.4 WP: latest - 1 [WP 6.7.2] 1/2 - @woocommerce/plugin-woocommerce [unit:php]
  • GitHub Check: Core e2e tests 3/6 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Core e2e tests 4/6 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 2/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Core e2e tests 5/6 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 4/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Core e2e tests 6/6 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Blocks e2e tests 8/10 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: Core API tests - @woocommerce/plugin-woocommerce [api]
  • GitHub Check: PHP: 7.4 WP: latest - 1 [WP 6.7.2] 2/2 - @woocommerce/plugin-woocommerce [unit:php]
  • GitHub Check: Core e2e tests 2/6 - @woocommerce/plugin-woocommerce [e2e]
  • GitHub Check: PHP: 8.4 WP: latest [WP latest] 2/2 - @woocommerce/plugin-woocommerce [unit:php]
  • GitHub Check: Lint - @woocommerce/plugin-woocommerce
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Copy link
Contributor

github-actions bot commented Jul 15, 2025

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

@nerrad nerrad requested a review from a team as a code owner July 15, 2025 20:49
@nerrad nerrad requested review from albarin and removed request for a team July 15, 2025 20:49
Copy link
Contributor

Testing Guidelines

Hi @albarin ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

- **Remove Irrelevant Sections:** You may erase template sections that are not applicable to your PR, except for those required by automation.
- **Remove Irrelevant Sections:** You may erase template sections that are not applicable to your PR, except for those required by automation. Do not remove any checkbox items.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've included a minor tweak to the PR description rules for cursor to improve generation.

Copy link
Contributor

@albarin albarin left a comment

Choose a reason for hiding this comment

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

Looks good:

  • Comment in the .cursor/rules/generate-pr-description.mdc makes sense.
  • Confirmed woocommerce_cart and woocommerce_checkout are wrapped in brackets after the change:
Before After
Image Image

@nerrad nerrad merged commit 4f823e8 into trunk Jul 16, 2025
75 of 79 checks passed
@nerrad nerrad deleted the wooplug-5022-woocommerce-status-woocommerce-pages-box-wording-not branch July 16, 2025 12:00
@github-actions github-actions bot added this to the 10.1.0 milestone Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WooCommerce Status "WooCommerce pages" box wording not consistent
2 participants