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

feat: add RAS CLI commands #2666

Merged
merged 2 commits into from
Sep 27, 2023
Merged

feat: add RAS CLI commands #2666

merged 2 commits into from
Sep 27, 2023

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Sep 26, 2023

All Submissions:

Changes proposed in this Pull Request:

Adds some convenience commands for testing/debugging RAS features.

How to test the changes in this Pull Request:

Setup command

This command lets you bypass the RAS wizard and just create all default prompts + segments and enable RAS account features with a single command. It still requires some pre-setup to connect an ESP and Reader Revenue platform, so we can't quite fully automate and add to the existing wp newspack setup command, unfortunately.

  1. Create a new JN site and set up Newspack. Make sure to install Campaigns, set up donations in Reader Revenue, and connect a Newsletters ESP and enable some lists in Engagement (not sure how we might automate that).
  2. Run wp newspack ras setup. Confirm that it succeeds with a message Success: RAS enabled with default prompts.. Also confirm that the default RAS segments and prompts have been created in the Campaigns wizard.
  3. Confirm that the prompts work as expected on the front-end.

Verify user command

This command lets you instantly mark any WP user account as verified, bypassing the need to complete the email verification flow to allow access to My Account features.

  1. Register as a new reader on the front-end.
  2. Run the command: wp newspack verify-reader <email or user ID>
  3. Go to My Account and confirm that you have access to all My Account features, including the ability to update display name and manage newsletter subscriptions.
  4. Test with both a user ID and an email address associated with a user account.

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?

@dkoo dkoo added [Status] Needs Review The issue or pull request needs to be reviewed Advertising labels Sep 26, 2023
@dkoo dkoo requested a review from a team as a code owner September 26, 2023 18:13
@dkoo dkoo self-assigned this Sep 26, 2023
@dkoo dkoo removed the Advertising label Sep 26, 2023
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Tests well!

Non-blocking suggestion: this file is almost at 2k lines. WDYT of moving the CLI methods to a includes/reader-activation/class-cli.php file?

includes/reader-activation/class-reader-activation.php Outdated Show resolved Hide resolved
@dkoo
Copy link
Contributor Author

dkoo commented Sep 26, 2023

Non-blocking suggestion: this file is almost at 2k lines. WDYT of moving the CLI methods to a includes/reader-activation/class-cli.php file?

Good call—I ended up moving the add_command calls to the existing includes/cli/class-initializer.php file and the command callbacks themselves to a new file also in the includes/cli folder. Makes sense to me to keep all these CLI scripts together.

@dkoo dkoo requested a review from miguelpeixe September 26, 2023 20:44
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

🙌

@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 Sep 27, 2023
@dkoo dkoo merged commit 5afc049 into master Sep 27, 2023
3 checks passed
@dkoo dkoo deleted the feat/add-ras-cli-commands branch September 27, 2023 15:50
matticbot pushed a commit that referenced this pull request Sep 28, 2023
# [2.8.0-alpha.1](v2.7.1...v2.8.0-alpha.1) (2023-09-28)

### Bug Fixes

* **woocommerce:** hook for rendering UTM inputs ([#2671](#2671)) ([634f7bf](634f7bf))

### Features

* add RAS CLI commands ([#2666](#2666)) ([5afc049](5afc049))
* remove unused GA code ([#2664](#2664)) ([1fa99fa](1fa99fa))
* search credit metadata on media library ([#2594](#2594)) ([c33c5b2](c33c5b2))
* **woocommerce:** store UTM parameters as order meta ([#2665](#2665)) ([39dfc31](39dfc31))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.8.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Oct 9, 2023
# [2.8.0](v2.7.5...v2.8.0) (2023-10-09)

### Bug Fixes

* inline documentation for `Donations::get_donation_settings()` ([#2675](#2675)) ([c6c7916](c6c7916))
* **woocommerce:** check method exists before syncing reader ([#2673](#2673)) ([063509c](063509c))
* **woocommerce:** hook for rendering UTM inputs ([#2671](#2671)) ([634f7bf](634f7bf))

### Features

* add RAS CLI commands ([#2666](#2666)) ([5afc049](5afc049))
* **campaigns:** newsletter subscription list criteria ([#2658](#2658)) ([69c8f88](69c8f88))
* remove unused GA code ([#2664](#2664)) ([1fa99fa](1fa99fa))
* search credit metadata on media library ([#2594](#2594)) ([c33c5b2](c33c5b2))
* **woocommerce:** store UTM parameters as order meta ([#2665](#2665)) ([39dfc31](39dfc31))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.8.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