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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The issue or pull request needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant