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: check Woo plugins status before enabling RAS #2076

Merged
merged 2 commits into from
Oct 13, 2022
Merged

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Oct 11, 2022

All Submissions:

Changes proposed in this Pull Request:

RAS features will behave unpredictably if WooCommerce or WooCommerce Subscriptions plugins are not active. This PR adds a check for these required plugins before considering RAS enabled Also adds a plugin installer component to the RAS wizard if either plugin is missing for ease of setup.

Also updates the description for WooCommerce Subscriptions with the correct plugin description from the WP.org repository.

How to test the changes in this Pull Request:

  1. On a site with RAS already enabled and configured, check out this branch and deactivate WooCommerce and/or WooCommerce Subscriptions.
  2. Confirm on the front-end that no reader-facing RAS features are enabled (no My Account link, no registration block).
  3. In the dashboard > Newspack > Engagement Reader Activation, confirm that you see a plugin installer prompt:

Screen Shot 2022-10-11 at 3 30 14 PM

  1. Install/activate both plugins and confirm that the RAS wizard reappears after both plugins are confirmed active.
  2. Revisit the front-end and confirm that reader-facing RAS features are available again.

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?

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
miguelpeixe Miguel Peixe
@dkoo dkoo added [Status] Needs Review The issue or pull request needs to be reviewed enhancement labels Oct 11, 2022
@dkoo dkoo self-assigned this Oct 11, 2022
@dkoo dkoo requested a review from a team as a code owner October 11, 2022 21:32

Verified

This commit was signed with the committer’s verified signature.
miguelpeixe Miguel Peixe
Copy link
Member

@adekbadek adekbadek left a comment

Choose a reason for hiding this comment

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

Works fine, but there's one code duplication issue.

@leogermani leogermani added [Status] Needs changes or feedback The issue or pull request needs action from the original creator and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Oct 12, 2022
@dkoo dkoo requested review from adekbadek and leogermani October 12, 2022 17:23
@github-actions github-actions bot added the [Status] Approved The pull request has been reviewed and is ready to merge label Oct 13, 2022
@leogermani
Copy link
Contributor

I confirmed everything works, including the Donation block, when using Stripe as payment platform and when Name your Price is not available

@dkoo dkoo merged commit 3aedbd4 into master Oct 13, 2022
@dkoo dkoo deleted the fix/ras-check-woo branch October 13, 2022 15:11
@miguelpeixe
Copy link
Member

Reader_Activation:is_enabled() can be called before the WooCommerce class is available. This is the case for the initialization of RAS:

public static function init() {
if ( self::is_enabled() ) {
\add_action( 'wp_enqueue_scripts', [ __CLASS__, 'enqueue_scripts' ] );

This is currently breaking RAS functionality on the frontend and should be reverted or resolved asap.\

cc @dkoo

matticbot pushed a commit that referenced this pull request Oct 21, 2022

Verified

This commit was signed with the committer’s verified signature.
miguelpeixe Miguel Peixe
# [1.95.0-alpha.1](v1.94.0...v1.95.0-alpha.1) (2022-10-21)

### Bug Fixes

* "Sign In" page styles ([#2075](#2075)) ([04ce12c](04ce12c))
* **ads:** rename GAM methods ([#2074](#2074)) ([6e7cb90](6e7cb90))
* check Woo plugins status before enabling RAS ([#2076](#2076)) ([3aedbd4](3aedbd4))
* overzealous woo check for RAS front-end ([#2080](#2080)) ([6b4c253](6b4c253))
* show display name in My Account UI ([#2079](#2079)) ([91fd1b8](91fd1b8))
* sql error with starter content queries ([#2077](#2077)) ([84665ed](84665ed))

### Features

* Add Meta pixel settings section (aka Facebook pixel) ([f6e8bca](f6e8bca)), closes [#1994](#1994)
* **ads:** publisher media kit add-on ([#2048](#2048)) ([709e66c](709e66c))
* Allow user to mark revisions as Major revisions and they'll never be deleted ([#2033](#2033)) ([174ea7f](174ea7f))
* **reader-auth:** improved otp ux ([#2043](#2043)) ([c89a467](c89a467))
* **stripe:** synchronise with WooCommerce Subscriptions ([#1936](#1936)) ([6526770](6526770))
@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Oct 31, 2022

Verified

This commit was signed with the committer’s verified signature.
miguelpeixe Miguel Peixe
# [1.95.0](v1.94.0...v1.95.0) (2022-10-31)

### Bug Fixes

* "Sign In" page styles ([#2075](#2075)) ([04ce12c](04ce12c))
* **ads:** rename GAM methods ([#2074](#2074)) ([6e7cb90](6e7cb90))
* check Woo plugins status before enabling RAS ([#2076](#2076)) ([3aedbd4](3aedbd4))
* overzealous woo check for RAS front-end ([#2080](#2080)) ([6b4c253](6b4c253))
* show display name in My Account UI ([#2079](#2079)) ([91fd1b8](91fd1b8))
* sql error with starter content queries ([#2077](#2077)) ([84665ed](84665ed))

### Features

* Add Meta pixel settings section (aka Facebook pixel) ([f6e8bca](f6e8bca)), closes [#1994](#1994)
* **ads:** publisher media kit add-on ([#2048](#2048)) ([709e66c](709e66c))
* Allow user to mark revisions as Major revisions and they'll never be deleted ([#2033](#2033)) ([174ea7f](174ea7f))
* **reader-auth:** improved otp ux ([#2043](#2043)) ([c89a467](c89a467))
* **stripe:** synchronise with WooCommerce Subscriptions ([#1936](#1936)) ([6526770](6526770))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.95.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
enhancement released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge [Status] Needs changes or feedback The issue or pull request needs action from the original creator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants