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

Eb pro dev #30

Merged
merged 4 commits into from
Aug 18, 2023
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
6 changes: 6 additions & 0 deletions edwiser-bridge/admin/assets/js/eb-setup-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@
return;
}

if ( woo_int == 1 && eb_setup_wizard.is_woo_active == false ){
$('.eb_setup_settings_error_msg').html(eb_setup_wizard.msg_woo_enable_error).show();
$("#eb-lading-parent").hide();
return;
}

data = { 'sso': sso, 'woo_integration': woo_int, 'bulk_purchase': bulk_purchase, 'selective_sync': selective_sync, 'custom_fields': custom_fields, 'current_step' : current_step, 'next_step' : next_step, 'is_next_sub_step': is_next_sub_step };
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ public function eb_setup_save_and_continue() {

// Get the priority of the existing progress data.
// If the existing priority is greater then dont update it, let old progress be as it is.

if ( isset( $setup_data['progress'] ) && $steps[ $setup_data['progress'] ]['priority'] < $steps[ $current_step ]['priority'] ) {
if ( isset( $setup_data['progress'] ) && 'completed_setup' !== $current_step && $steps[ $setup_data['progress'] ]['priority'] < $steps[ $current_step ]['priority'] ) {
$setup_data['progress'] = $current_step;
$setup_data['next_step'] = $next_step;
update_option( 'eb_setup_data', $setup_data );
Expand Down Expand Up @@ -541,8 +540,8 @@ public function eb_setup_save_and_continue() {
break;

case 'wi_products_sync':
require_once ABSPATH . '/wp-content/plugins/woocommerce-integration/includes/class-bridge-woocommerce.php';
require_once ABSPATH . '/wp-content/plugins/woocommerce-integration/includes/class-bridge-woocommerce-course.php';
// require_once ABSPATH . '/wp-content/plugins/woocommerce-integration/includes/class-bridge-woocommerce.php';
// require_once ABSPATH . '/wp-content/plugins/woocommerce-integration/includes/class-bridge-woocommerce-course.php';

$sync_options = array(
'bridge_woo_synchronize_product_categories' => 1,
Expand Down Expand Up @@ -573,7 +572,7 @@ public function eb_setup_save_and_continue() {

// Save step form progress.
$setup_data = get_option( 'eb_setup_data' );
$setup_data['progress'] = '';
$setup_data['progress'] = 'initialize';
$setup_data['next_step'] = '';
update_option( 'eb_setup_data', $setup_data );
break;
Expand Down Expand Up @@ -698,6 +697,8 @@ public function enqueue_scripts() {
'msg_woo_int_enable_error' => esc_html__( 'WooCommerce Integration must be enabled to use Bulk Purchase feature.', 'edwiser-bridge' ),
'msg_empty_license_key' => esc_html__( 'Please enter a valid license key.', 'edwiser-bridge' ),
'msg_no_plugin_selected_error' => esc_html__( 'No pro feature selected.', 'edwiser-bridge' ),
'is_woo_active' => is_plugin_active('woocommerce/woocommerce.php'),
'msg_woo_enable_error' => esc_html__( 'WooCommerce must be active to use WooCommerce Integration feature.', 'edwiser-bridge' ),
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,39 +1183,39 @@ public function eb_setup_pro_plugins( $ajax = 1 ) {
<input type="checkbox" class='eb_setup_sso_inp' <?php echo 'active' === $module_data['sso'] ? 'checked' : ''; ?>>
<span class="esw-cb-checkmark"></span>
<label class='eb_setup_h2 es-sec-h es-p-l-30'> <?php esc_html_e( 'Edwiser Bridge Single Sign On', 'edwiser-bridge' ); ?></label>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Copy and paste the license key without any white space for Edwiser Bridge Pro.', 'edwiser-bridge' ); ?></span> </i>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Experience seamless login synchronization between Moodle and WordPress, eliminating login hassles and saving time for learners.', 'edwiser-bridge' ); ?></span> </i>
</label>
</div>
<div class='eb_setup_pro_plugin_inp_wrap'>
<label class="esw-cb-container">
<input type="checkbox" class='eb_setup_woo_int_inp' <?php echo 'active' === $module_data['woo_integration'] ? 'checked' : ''; ?>>
<span class="esw-cb-checkmark"></span>
<label class='eb_setup_h2 es-sec-h es-p-l-30'> <?php esc_html_e( 'WooCommerce Integration', 'edwiser-bridge' ); ?></label>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Copy and paste the license key without any white space for Edwiser Bridge Pro.', 'edwiser-bridge' ); ?></span> </i>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Effortlessly sell Moodle courses on WordPress with WooCommerce, optimizing pages and integrating with Moodle LMS.', 'edwiser-bridge' ); ?></span> </i>
</label>
</div>
<div class='eb_setup_pro_plugin_inp_wrap'>
<label class="esw-cb-container">
<input type="checkbox" class='eb_setup_bulk_purchase_inp' <?php echo 'active' === $module_data['bulk_purchase'] ? 'checked' : ''; ?>>
<span class="esw-cb-checkmark"></span>
<label class='eb_setup_h2 es-sec-h es-p-l-30'> <?php esc_html_e( 'Bulk Purchase', 'edwiser-bridge' ); ?></label>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Copy and paste the license key without any white space for Edwiser Bridge Pro.', 'edwiser-bridge' ); ?></span> </i>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Create a loyal user base by offering course bundles, increasing earnings and user satisfaction through discounts.', 'edwiser-bridge' ); ?></span> </i>
</label>
</div>
<div class='eb_setup_pro_plugin_inp_wrap'>
<label class="esw-cb-container">
<input type="checkbox" class='eb_setup_selective_sync_inp' <?php echo 'active' === $module_data['selective_sync'] ? 'checked' : ''; ?>>
<span class="esw-cb-checkmark"></span>
<label class='eb_setup_h2 es-sec-h es-p-l-30'> <?php esc_html_e( 'Selective Sync', 'edwiser-bridge' ); ?></label>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Copy and paste the license key without any white space for Edwiser Bridge Pro.', 'edwiser-bridge' ); ?></span> </i>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Flexiblity to choose specific courses to sync. Save time by choosing to sync only updated courses, course categories and users.', 'edwiser-bridge' ); ?></span> </i>
</label>
</div>
<div class='eb_setup_pro_plugin_inp_wrap'>
<label class="esw-cb-container">
<input type="checkbox" class='eb_setup_custom_fields_inp' <?php echo 'active' === $module_data['custom_fields'] ? 'checked' : ''; ?>>
<span class="esw-cb-checkmark"></span>
<label class='eb_setup_h2 es-sec-h es-p-l-30'> <?php esc_html_e( 'Edwiser Bridge Custom Fields', 'edwiser-bridge' ); ?></label>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Copy and paste the license key without any white space for Edwiser Bridge Pro.', 'edwiser-bridge' ); ?></span> </i>
<i class="dashicons dashicons-info-outline eb-tooltip"> <span class='eb-tooltiptext'><?php esc_html_e( 'Enhance registration and checkout forms with Custom Fields in WordPress, WooCommerce, and Edwiser Bridge for personalized information collection.', 'edwiser-bridge' ); ?></span> </i>
</label>
</div>
<div class='eb_setup_settings_error_msg' style="display:none;"></div>
Expand Down
4 changes: 2 additions & 2 deletions edwiser-bridge/includes/class-eb-usage-tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function send_usage_analytics() {
);
$result = wp_remote_post( $url, $request_args );

if ( 200 === wp_remote_retrieve_response_code( $response ) ) {
if ( 200 === wp_remote_retrieve_response_code( $result ) ) {
$result_arr = json_decode( $result, 1 );
}
}
Expand Down Expand Up @@ -199,7 +199,7 @@ private function detect_site_type() {
'127.0.0.1',
'::1',
);

$is_local = '';
// Check if site is running on localhost or not.
if ( isset( $_SERVER['REMOTE_ADDR'] ) && in_array( $_SERVER['REMOTE_ADDR'], $whitelist, true ) ) {
$is_local = 'localsite--';
Expand Down
74 changes: 39 additions & 35 deletions edwiser-bridge/languages/edwiser-bridge.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Edwiser Bridge - WordPress Moodle LMS Integration\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-05 10:20+0530\n"
"POT-Creation-Date: 2023-07-31 13:33+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -90,32 +90,32 @@ msgid "Please save the changes."
msgstr ""

#: admin/class-eb-admin.php:168
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:693
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:692
msgid "Connection successful, Please save your connection details."
msgstr ""

#: admin/class-eb-admin.php:169
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:694
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:693
msgid "Courses synchronized successfully."
msgstr ""

#: admin/class-eb-admin.php:170
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:695
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:694
msgid "There is a problem while connecting to moodle server."
msgstr ""

#: admin/class-eb-admin.php:171
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:696
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:695
msgid "Error occured for following users: "
msgstr ""

#: admin/class-eb-admin.php:172
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:697
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:696
msgid "User's course enrollment status synced successfully."
msgstr ""

#: admin/class-eb-admin.php:174
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:692
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:691
msgid "User's linked to moodle successfully."
msgstr ""

Expand Down Expand Up @@ -722,12 +722,12 @@ msgid "Mail sent successfully"
msgstr ""

#: admin/class-eb-welcome.php:46
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:726
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:727
msgid "About Edwiser Bridge"
msgstr ""

#: admin/class-eb-welcome.php:47 admin/class-eb-welcome.php:212
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:727
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:728
msgid "Welcome to Edwiser Bridge"
msgstr ""

Expand Down Expand Up @@ -935,7 +935,7 @@ msgstr ""

#: admin/licensing/class-licensing-settings.php:291
#: admin/licensing/html-licensing.php:189
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:895
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:896
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1281
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1285
#: includes/class-eb-email-template-parser.php:197
Expand All @@ -945,12 +945,12 @@ msgid "Click here"
msgstr ""

#: admin/licensing/class-licensing-settings.php:292
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:896
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:897
msgid "License key cannot be empty, Please enter the valid license key."
msgstr ""

#: admin/licensing/class-licensing-settings.php:292
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:896
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:897
msgid " to get the license key."
msgstr ""

Expand All @@ -963,7 +963,7 @@ msgid "Plugin installation failed."
msgstr ""

#: admin/licensing/class-licensing-settings.php:324
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1017
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1018
msgid ""
"Empty download link. Please check your license key or contact edwiser support "
"for more detials."
Expand Down Expand Up @@ -2095,30 +2095,35 @@ msgid "Pro Features"
msgstr ""

#: admin/settings/class-eb-settings-pro-featuers.php:120
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1186
msgid ""
"Experience seamless login synchronization between Moodle and WordPress, "
"eliminating login hassles and saving time for learners."
msgstr ""

#: admin/settings/class-eb-settings-pro-featuers.php:126
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1194
msgid ""
"Effortlessly sell Moodle courses on WordPress with WooCommerce, optimizing "
"pages and integrating with Moodle LMS."
msgstr ""

#: admin/settings/class-eb-settings-pro-featuers.php:132
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1202
msgid ""
"Create a loyal user base by offering course bundles, increasing earnings and "
"user satisfaction through discounts."
msgstr ""

#: admin/settings/class-eb-settings-pro-featuers.php:138
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1210
msgid ""
"Flexiblity to choose specific courses to sync. Save time by choosing to sync "
"only updated courses, course categories and users."
msgstr ""

#: admin/settings/class-eb-settings-pro-featuers.php:144
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1218
msgid ""
"Enhance registration and checkout forms with Custom Fields in WordPress, "
"WooCommerce, and Edwiser Bridge for personalized information collection."
Expand Down Expand Up @@ -2436,71 +2441,75 @@ msgstr ""
msgid "License key is invalid."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:698
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:697
msgid "WooCommerce Integration must be enabled to use Bulk Purchase feature."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:699
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:698
msgid "Please enter a valid license key."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:700
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:699
msgid "No pro feature selected."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:879
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:701
msgid "WooCommerce must be active to use WooCommerce Integration feature."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:880
msgid "Plugin insallation failed"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:932
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:933
msgid "Please activate the WooCommerce Integration plugin first."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:940
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:941
msgid "WooCommerce Integration plugin Version 2.2.1 required."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:968
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:969
msgid "License activated"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:970
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:971
msgid "License is activated to maximum limit"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:972
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:973
msgid "License is expired"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:974
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:975
msgid "License activation failed"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:977
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:978
msgid "License already activated"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:984
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:985
msgid "Plugin already installed"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:988
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:989
msgid " and activated"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1012
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1013
msgid "Plugin installed"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1027
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1028
msgid "plugin activation failed"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1029
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1030
msgid "plugin activated"
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1058
#: admin/setup-wizard/class-eb-setup-wizard-functions.php:1059
msgid "Unable to connect to the filesystem. Please confirm your credentials."
msgstr ""

Expand Down Expand Up @@ -2933,11 +2942,6 @@ msgid "My account page on Edwiser."
msgstr ""

#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1108
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1186
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1194
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1202
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1210
#: admin/setup-wizard/class-eb-setup-wizard-templates.php:1218
msgid ""
"Copy and paste the license key without any white space for Edwiser Bridge Pro."
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion edwiser-bridge/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: WisdmLabs
Tags: Moodle, Moodle ecommerce, WordPress Moodle, Sell Moodle Courses, LMS Integration, Moodle Integration, Moodle WordPress, WP Moodle, eLearning, WooCommerce
Requires at least: 5.8
Tested up to: 6.2.2
Tested up to: 6.3
Stable tag: trunk
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down