Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-dev-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/hydrogen # 18.x
node-version: 18
cache: "yarn"
- name: Install composer deps
run: composer install --no-dev --prefer-dist --no-progress --no-suggest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/hydrogen # 18.x
node-version: 18
cache: "yarn"
- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/hydrogen # 18.x
node-version: 18
cache: "yarn"
- name: Build
run: |
Expand Down
1 change: 1 addition & 0 deletions assets/src/Components/ImportModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ const ImportModal = ( {
frontPage: importData.front_page,
shopPages: importData.shop_pages,
paymentForms: importData.payment_forms,
masteriyoData: importData.masteriyo_data,
demoSlug: importData.slug,
editor,
} )
Expand Down
33 changes: 33 additions & 0 deletions includes/Importers/Content_Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ public function import_remote_xml( WP_REST_Request $request ) {
}
do_action( 'themeisle_ob_after_payment_forms_setup' );

// Set Masteriyo data.
if ( isset( $body['masteriyoData'] ) ) {
$this->setup_masteriyo( $body['masteriyoData'] );
}
do_action( 'themeisle_ob_after_masteriyo_setup' );

if ( empty( $frontpage_id ) ) {
$this->logger->log( 'No front page ID.' );
}
Expand Down Expand Up @@ -327,6 +333,33 @@ function ( $key ) {
$this->logger->log( 'Payment forms set up.', 'success' );
}

/**
* Set up Masteriyo data.
*
* @param array $data the masteriyo data.
*/
public function setup_masteriyo( $data ) {
if ( empty( $data ) || ! is_array( $data ) ) {
$this->logger->log( 'No Masteriyo data.', 'success' );
return;
}

$this->logger->log( 'Setting up Masteriyo data.', 'progress' );

if ( ! function_exists( 'masteriyo_set_setting' ) ) {
$this->logger->log( 'Masteriyo not installed.', 'success' );
return;
}

if ( isset( $data['settings'] ) ) {
foreach ( $data['settings'] as $key => $value ) {
masteriyo_set_setting( $key, $value );
}
}

$this->logger->log( 'Masteriyo data set up.', 'success' );
}

/**
* Maybe bust cache for elementor plugin.
*/
Expand Down
25 changes: 25 additions & 0 deletions includes/Importers/Plugin_Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Plugin_Importer {
'pods' => 'init.php',
'wp-full-stripe-free' => 'wp-full-stripe.php',
'wp-cloudflare-page-cache' => 'wp-cloudflare-super-page-cache.php',
'learning-management-system' => 'lms.php',
);

public function __construct() {
Expand Down Expand Up @@ -174,6 +175,7 @@ private function remove_possible_redirects() {
delete_transient( '_wc_activation_redirect' );
delete_transient( 'wpforms_activation_redirect' );
update_option( 'themeisle_blocks_settings_redirect', false );
update_option( 'masteriyo_first_time_activation_flag', true );
}

/**
Expand Down Expand Up @@ -363,6 +365,11 @@ private function maybe_provide_activation_help( $slug, $path ) {
add_filter( 'woocommerce_create_pages', array( $this, 'woocommerce_activation_pages' ) );
}

if ( $slug === 'learning-management-system' ) {
// hook into this filter to remove pages on activation of masteriyo
add_filter( 'masteriyo_create_pages', array( $this, 'masteriyo_activation_pages' ) );
}

if ( $slug === 'estatik' ) {
update_option( 'es_is_demo_executed', 1 );
}
Expand All @@ -386,6 +393,24 @@ public function woocommerce_activation_pages( $pages ) {
return $pages;
}

/**
* Filter pages from masteriyo activation.
*
* @param array $pages List of pages to be created on activation.
*
* @return array
*/
public function masteriyo_activation_pages( $pages ) {
$filtered_pages = array( 'courses', 'checkout', 'account', 'learn', 'instructor-registration', 'instructors-list' );
foreach ( $filtered_pages as $filter ) {
if ( isset( $pages[ $filter ] ) ) {
unset( $pages[ $filter ] );
}
}

return $pages;
}

/**
* Check if plugin directory exists.
*
Expand Down
6 changes: 6 additions & 0 deletions onboarding/src/Components/FeaturesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ const pluginCollection = [
pluginSlug: 'restrict-content',
label: __('Membership Plugin', 'templates-patterns-collection'),
description: __('Membership plugin that allows you to monetize content access.', 'templates-patterns-collection')
},
{
id: 'learning-management-system',
pluginSlug: 'learning-management-system',
label: __('Masteriyo', 'templates-patterns-collection'),
description: __('Create and sell online courses with ease.', 'templates-patterns-collection')
}
];

Expand Down
1 change: 1 addition & 0 deletions onboarding/src/Components/Steps/Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ const Import = ( {
frontPage: importData.front_page,
shopPages: importData.shop_pages,
paymentForms: importData.payment_forms,
masteriyoData: importData.masteriyo_data,
demoSlug: importData.slug,
editor,
} )
Expand Down
Loading