Skip to content

Conversation

@vuckro
Copy link
Contributor

@vuckro vuckro commented Aug 22, 2025

Summary

Adds the missing wu_get_version() parameter to all _doing_it_wrong() calls in UI elements as requested by David in PR #159.

This addresses the compatibility issue with Slim SEO plugin that processes shortcodes before WP Ultimo is fully initialized, providing better debugging information when these defensive checks are triggered.

Changes

  • Added version parameter to _doing_it_wrong() calls in 5 UI element classes:
    • class-account-summary-element.php
    • class-billing-info-element.php
    • class-current-site-element.php
    • class-invoices-element.php
    • class-limits-element.php

Test plan

  • Verify all _doing_it_wrong() calls now have 3 parameters
  • Test with Slim SEO plugin to ensure proper error reporting
  • Confirm no functionality regression

Fixes the issue mentioned in PR #178.

Summary by CodeRabbit

  • New Features

    • No user-facing changes.
  • Chores

    • Improved diagnostic notices across Account Summary, Billing Info, Current Site, Invoices, and Limits UI elements by adding version context to internal warnings.
    • Enhances troubleshooting clarity when sites or memberships are missing, without altering normal behavior or display.

…lements

This addresses David's feedback in PR Multisite-Ultimate#159 to include the version parameter
in all _doing_it_wrong() calls for better debugging when Slim SEO processes
shortcodes before WP Ultimo is fully initialized.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 22, 2025

Walkthrough

Added wu_get_version() as the third argument to _doing_it_wrong calls within output() methods across several UI element classes. These changes occur in defensive branches when required context (site or membership) is missing. No other logic, control flow, or public signatures were changed.

Changes

Cohort / File(s) Summary of Changes
UI elements: add version to _doing_it_wrong
inc/ui/class-account-summary-element.php, inc/ui/class-billing-info-element.php, inc/ui/class-current-site-element.php, inc/ui/class-invoices-element.php, inc/ui/class-limits-element.php
Updated defensive _doing_it_wrong calls to pass a third argument: wu_get_version(). No functional or signature changes; return paths unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny taps logs with delicate care,
Adds a version nibble to warnings laid bare.
Hop, hop—no flows rearranged today,
Just breadcrumbs clearer along the way.
Carrots for context, sprinkled with cheer—
Debugs taste sweeter when versions appear. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc9d89 and 57c1bd0.

📒 Files selected for processing (5)
  • inc/ui/class-account-summary-element.php (1 hunks)
  • inc/ui/class-billing-info-element.php (1 hunks)
  • inc/ui/class-current-site-element.php (1 hunks)
  • inc/ui/class-invoices-element.php (1 hunks)
  • inc/ui/class-limits-element.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
inc/ui/class-invoices-element.php (1)
inc/functions/helper.php (1)
  • wu_get_version (21-24)
inc/ui/class-billing-info-element.php (1)
inc/functions/helper.php (1)
  • wu_get_version (21-24)
inc/ui/class-limits-element.php (1)
inc/functions/helper.php (1)
  • wu_get_version (21-24)
inc/ui/class-current-site-element.php (1)
inc/functions/helper.php (1)
  • wu_get_version (21-24)
inc/ui/class-account-summary-element.php (1)
inc/functions/helper.php (1)
  • wu_get_version (21-24)
⏰ 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). (12)
  • GitHub Check: cypress (8.4, chrome)
  • GitHub Check: cypress (8.3, firefox)
  • GitHub Check: cypress (8.4, firefox)
  • GitHub Check: cypress (8.3, chrome)
  • GitHub Check: cypress (8.0, chrome)
  • GitHub Check: cypress (8.1, chrome)
  • GitHub Check: cypress (8.2, firefox)
  • GitHub Check: cypress (8.2, chrome)
  • GitHub Check: cypress (7.4, chrome)
  • GitHub Check: cypress (8.0, firefox)
  • GitHub Check: cypress (8.1, firefox)
  • GitHub Check: cypress (7.4, firefox)
🔇 Additional comments (6)
inc/ui/class-current-site-element.php (2)

355-359: Added version to _doing_it_wrong — aligned with WP best practice

Passing wu_get_version() as the third argument is correct and will improve debugging in early-evaluation contexts (e.g., Slim SEO). Message and control flow remain intact. LGTM.


355-359: No remaining 2-argument _doing_it_wrong() calls detected

I ran a repo-wide scan of all PHP files (excluding vendor/) for _doing_it_wrong( calls with fewer than three arguments and found none. All _doing_it_wrong() usages now include the required version parameter.

inc/ui/class-invoices-element.php (1)

277-281: Good: version parameter added to _doing_it_wrong

wu_get_version() as the third parameter completes the signature and provides clearer logs if output() is invoked before setup. No functional changes introduced. Looks good.

inc/ui/class-account-summary-element.php (1)

297-301: Good: consistent 3rd argument for _doing_it_wrong

This aligns with the pattern used across the PR and will help diagnose early shortcode execution. Control flow (returning an empty string) is preserved. LGTM.

inc/ui/class-billing-info-element.php (1)

275-279: Good: add plugin version to _doing_it_wrong

Including wu_get_version() adds useful context for debugging and matches WP’s expected signature. No further issues spotted here.

inc/ui/class-limits-element.php (1)

243-247: Good: version passed to _doing_it_wrong

This completes the signature and standardizes diagnostics across UI elements. Behavior remains unchanged. LGTM.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
Collaborator

@superdav42 superdav42 left a comment

Choose a reason for hiding this comment

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

perfect, thanks

@superdav42 superdav42 merged commit 677b186 into Multisite-Ultimate:main Aug 26, 2025
19 checks passed
@vuckro vuckro deleted the fix/add-version-parameter-to-doing-it-wrong branch August 29, 2025 16:49
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.

2 participants