Skip to content

fix: add WordPress status slug field#12

Open
soulevilx wants to merge 1 commit into
developfrom
fix/reconcile-status-dto-slug
Open

fix: add WordPress status slug field#12
soulevilx wants to merge 1 commit into
developfrom
fix/reconcile-status-dto-slug

Conversation

@soulevilx
Copy link
Copy Markdown
Contributor

@soulevilx soulevilx commented May 17, 2026

WHAT changed

  • Added an additive slug field to JOOservices\WordPress\Sdk\Data\Status.
  • Added unit coverage confirming the default value and DTO normalization output.

WHY changed

The WordPress REST API post-status schema includes slug, and current SDK status DTOs preserved the status name and flags but dropped the slug value returned by /wp/v2/statuses responses.

HOW implemented

  • Appended slug after the existing name constructor argument with a default empty string.
  • Preserved the current Status class name and all existing fields.
  • Did not port the backup rename to PostStatus because that would alter the public API.

Candidate fields checked

  • Status slug: ADD, present in official WordPress REST API post-status schema and missing locally.
  • name, public, protected, private, queryable, show_in_list, date_floating: SKIP_ALREADY_PRESENT.

Fields skipped and why

  • Backup Status -> PostStatus rename: SKIP_BREAKING/SKIP_OUTDATED.
  • Backup date_floating nullable change: SKIP_BREAKING because current DTO defaults to boolean false.
  • No backup deletions were ported.
  • No content-template code was reintroduced into SDK core.

Validation

  • vendor/bin/phpunit tests/Unit/Data/DataModelsTest.php: passed, 11 tests / 44 assertions
  • composer validate: passed
  • composer lint: passed
  • composer test: passed, 179 tests / 615 assertions
  • composer security: passed, no advisories
  • composer quality: passed
  • composer test:coverage: passed, 97.0% statements, coverage gate passed
  • composer test:integration: exited successfully with no tests executed in this local invocation
  • pre-commit hook: pint --test, phpstan, phpcs passed
  • pre-push hook: unit tests and composer audit passed

Risk / impact

Low. This is additive DTO field coverage only. Existing constructor usage such as new Status('Published') remains compatible.

@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@soulevilx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 13 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 23be9206-73a3-4a18-8f4d-b645d88860a4

📥 Commits

Reviewing files that changed from the base of the PR and between c38b0bd and ea7668e.

📒 Files selected for processing (2)
  • src/Data/Status.php
  • tests/Unit/Data/DataModelsTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reconcile-status-dto-slug

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.

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