Skip to content

Conversation

@akzmoudud
Copy link
Contributor

@akzmoudud akzmoudud commented Dec 26, 2025

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Related Pull Request(s)

  • Full PR Link

Closes

How to test the changes in this Pull Request:

  • Steps or issue link

Changelog entry

Title

Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.

Before Changes

Describe the issue before changes with screenshots(s).

After Changes

Describe the issue after changes with screenshot(s).

Feature Video (optional)

Link of detailed video if this PR is for a feature.

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Summary by CodeRabbit

  • Bug Fixes
    • Exported withdrawal files now report correct total row counts when filtering by status — exports and progress indicators reflect the actual number of rows for the selected filter.
    • When no specific status is chosen, export totals fall back to the overall withdrawal count so total summaries remain accurate.

✏️ Tip: You can customize this high-level summary in your review settings.

@akzmoudud akzmoudud requested a review from mrabbani December 26, 2025 06:37
@akzmoudud akzmoudud self-assigned this Dec 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

Replaced a direct array lookup for status counts with a conditional fallback in WithdrawController::get_items export path: $statuses[$args['status']] ?? $withdraws->total. Added an explanatory comment to avoid null/undefined array key access.

Changes

Cohort / File(s) Summary
WithdrawController total_rows fix
includes/REST/WithdrawController.php
In get_items export path, changed $statuses[ $args['status'] ] to $statuses[ $args['status'] ] ?? $withdraws->total and added a comment clarifying fallback logic to prevent using null as an array key.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • mrabbani
  • Aunshon

Poem

🐰 A little key once wandered astray,
I nudged it safe and paved the way.
Counts now check before they peep,
No warnings wake me from my sleep,
Exports hop along — all bright and gay!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. While the author checked key items (coding standards, requirements, testing, PHPCS), critical sections are missing: no explanation of changes proposed, no testing steps provided, no changelog entry, and no before/after descriptions despite the template prompting for them. Complete the 'Changes proposed' section with clear explanation, add explicit testing steps, provide changelog entry with before/after behavior description, and include before/after screenshots or code examples.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix PHP Deprecated warning in withdraw controller' accurately describes the main change: addressing a PHP deprecation warning in the WithdrawController by using null coalescing to prevent null from being used as an array offset.
Linked Issues check ✅ Passed The code change directly addresses issue #5129 by using null coalescing ($statuses[$args['status']] ?? $withdraws->total) to prevent null from being used as an array offset, resolving both the deprecation warning and undefined array key warning mentioned in the issue.
Out of Scope Changes check ✅ Passed All changes are scoped to the WithdrawController::get_items method and directly address the null array offset issue described in linked issue #5129; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/php-deprecated-warning-in-withdraw-controller

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 837e699 and c14e4cb.

📒 Files selected for processing (1)
  • includes/REST/WithdrawController.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • includes/REST/WithdrawController.php
⏰ 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). (4)
  • GitHub Check: e2e tests (2, 3)
  • GitHub Check: e2e tests (1, 3)
  • GitHub Check: api tests (1, 1)
  • GitHub Check: e2e tests (3, 3)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@akzmoudud akzmoudud added Needs: Dev Review It requires a developer review and approval Needs: Testing This requires further testing labels Dec 26, 2025
@mrabbani mrabbani added Needs: Author Reply and removed Needs: Dev Review It requires a developer review and approval labels Dec 28, 2025
@akzmoudud akzmoudud added Needs: Dev Review It requires a developer review and approval and removed Needs: Author Reply labels Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Dev Review It requires a developer review and approval Needs: Testing This requires further testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants