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

fix(wcs): migrate-expired-subscriptions handle manual subscriptions #3663

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

chickenn00dle
Copy link
Contributor

@chickenn00dle chickenn00dle commented Jan 9, 2025

All Submissions:

Changes proposed in this Pull Request:

This PR adds support for manual subscriptions to the migrate-expired-subscriptions cli tool.

How to test the changes in this Pull Request:

  • Ensure you have a manual subscription that is on-hold because it has reached it's next payment date.
  • Make sure the next payment date is within whatever you have set as the on-hold duration in WooCommerce > Settings > Subscriptions > Newspack Subscriptions Settings. If you need to, you can adjust this via wp shell:
$s = wcs_get_subscription(12345);
$s->update_dates(['next_payment' => "2025-01-09 20:51:28"]);
  • Run the wp newspack migrate-expired-subscriptions --verbose --ids=12345 command.
  • Verify the output indicates the subscription is within the on-hold duration
  • Now run the command with the --live flag
  • Verify the subscription status has NOT changed in wp-admin
  • Either test another manual subscription with a next payment date that is beyond the on-hold duration, or use wp shell to manually adjust the next payment date
  • Repeat the command without the --live flag and verify the output says the status is updated to expired
  • Repeat with the --live flag and verify the subscription status has actually changed in wp-admin

BONUS: If you have any subscriptions that are still around from before this feature was launched that are on-hold, and have retries, smoke test the command with these as well.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@chickenn00dle chickenn00dle force-pushed the fix/migrate-expired-subs-tool branch from a5f53b6 to 5679868 Compare January 9, 2025 21:56
@chickenn00dle chickenn00dle changed the title fix(wcs): expand migrate-expired-subscriptions functionality fix(wcs): migrate-expired-subscriptions handle manual subscriptions Jan 9, 2025
@chickenn00dle chickenn00dle marked this pull request as ready for review January 9, 2025 22:59
@chickenn00dle chickenn00dle requested a review from a team as a code owner January 9, 2025 22:59
@chickenn00dle chickenn00dle added the [Status] Needs Review The issue or pull request needs to be reviewed label Jan 9, 2025
}
}
if ( should_expire ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo, missing $

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed in 16605d5

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Jan 14, 2025
@chickenn00dle chickenn00dle merged commit e0f32e8 into trunk Jan 14, 2025
8 checks passed
Copy link

Hey @chickenn00dle, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

@chickenn00dle chickenn00dle deleted the fix/migrate-expired-subs-tool branch January 14, 2025 22:06
matticbot pushed a commit that referenced this pull request Jan 16, 2025
# [5.12.0-alpha.2](v5.12.0-alpha.1...v5.12.0-alpha.2) (2025-01-16)

### Bug Fixes

* **mc:** handle standard MC merge fields when fixing duplicates ([#3637](#3637)) ([80248a2](80248a2))
* **wcs:** migrate-expired-subscriptions handle manual subscriptions ([#3663](#3663)) ([e0f32e8](e0f32e8))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.12.0-alpha.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jan 20, 2025
# [5.12.0](v5.11.3...v5.12.0) (2025-01-20)

### Bug Fixes

* **cli:** verify-reader CLI command ([#3660](#3660)) ([c639af7](c639af7))
* **recaptcha:** replace alerts with generic errors ([#3627](#3627)) ([44ef2d2](44ef2d2))
* remove newspack_corrections_ids meta ([#3675](#3675)) ([dad258b](dad258b))
* **wcs:** migrate-expired-subscriptions handle manual subscriptions ([#3663](#3663)) ([e0f32e8](e0f32e8))

### Features

* **corrections:** add corrections and clarifications behind feature flag ([#3638](#3638)) ([ea745cf](ea745cf))

### Performance Improvements

* **data-events:** queue dispatches to execute on shutdown ([#3616](#3616)) ([510a1a0](510a1a0))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants