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

Add woothemes-sensei detection to the extensions API #5282

Merged
merged 6 commits into from
Jun 20, 2022

Conversation

fjorgemota
Copy link
Member

@fjorgemota fjorgemota commented Jun 16, 2022

Changes proposed in this Pull Request

  • Use filters to decide when to show or not the editor wizard upsells;

Testing instructions

  1. Create a build of woothemes-sensei based on this branch;
  2. Install in a clean WordPress installation;
  3. Verify if the upsell to Sensei Pro doesn't appear more on the Sensei Extensions page /wp-admin/edit.php?post_type=course&page=sensei-extensions;
  4. Verify if the upsells to Sensei Pro don't appear on the Editor Wizard anymore (both on the Course Wizard, which has a dedicated step just as a upsell for Sensei Pro, as well as for the Premium Lessons Patterns step)

I also recommend testing in another WordPress installation to check if both upsells don't appear when Sensei LMS (based on this branch) + Sensei Pro is installed and activated.

@fjorgemota fjorgemota self-assigned this Jun 16, 2022
Copy link
Member Author

@fjorgemota fjorgemota left a comment

Choose a reason for hiding this comment

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

Just a few useful comments to understand the code better.

includes/admin/class-sensei-extensions.php Outdated Show resolved Hide resolved
includes/admin/class-sensei-extensions.php Outdated Show resolved Hide resolved
includes/admin/class-sensei-extensions.php Outdated Show resolved Hide resolved
@fjorgemota fjorgemota added this to the 4.5.1 milestone Jun 16, 2022
@fjorgemota fjorgemota requested a review from a team June 16, 2022 19:17
@fjorgemota fjorgemota marked this pull request as ready for review June 16, 2022 19:18
@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #5282 (6ef29d3) into trunk (b4e0b86) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              trunk    #5282   +/-   ##
=========================================
  Coverage     40.75%   40.75%           
  Complexity     8616     8616           
=========================================
  Files           284      284           
  Lines         29042    29042           
=========================================
  Hits          11837    11837           
  Misses        17205    17205           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c36818f...6ef29d3. Read the comment docs.

const replaces = {};

if ( wizardData.title ) {
replaces[ 'sensei-content-title' ] = wizardData.title;
}

const isSenseiProActivated =
! senseiProExtension || senseiProExtension.is_activated === true;
const isSenseiProActivated = useHideEditorWizardUpsell();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we update the variable naming to match the logic? So instead of isSenseiProActivated maybe we use shouldHideEditorWizardUpsell? (Also in the Course wizard below)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, fixed in 6ef29d3.

Co-authored-by: Alex Sanford <alex.sanford1@gmail.com>
@fjorgemota fjorgemota force-pushed the fix/woothemes-sensei-detection branch from c3b049b to 6ef29d3 Compare June 20, 2022 18:39
Copy link
Contributor

@alexsanford alexsanford left a comment

Choose a reason for hiding this comment

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

It works! 🎉

@fjorgemota fjorgemota merged commit 5f704b5 into trunk Jun 20, 2022
@fjorgemota fjorgemota deleted the fix/woothemes-sensei-detection branch June 20, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants