15
15
class Admin {
16
16
17
17
/**
18
- * WP Full Pay reference key.
18
+ * Masteriyo LMS reference key.
19
19
*
20
20
* @var string
21
21
*/
22
- const WPFP_REF = 'wpfp_reference_key ' ;
22
+ const MASTERIYO_REF = 'masteriyo_reference_key ' ;
23
23
24
24
/**
25
25
* Admin constructor.
@@ -51,12 +51,11 @@ private function add_install_time() {
51
51
*/
52
52
public function setup_admin_hooks () {
53
53
add_action ( 'admin_notices ' , array ( $ this , 'render_welcome_notice ' ), 0 );
54
- add_action ( 'activated_plugin ' , array ( $ this , 'after_wpfs_activation ' ) );
54
+ add_action ( 'activated_plugin ' , array ( $ this , 'after_masteriyo_activation ' ) );
55
55
add_action ( 'wp_ajax_lmscourse_fse_dismiss_welcome_notice ' , array ( $ this , 'remove_welcome_notice ' ) );
56
- add_action ( 'wp_ajax_lmscourse_fse_set_wpfp_ref ' , array ( $ this , 'set_wpfp_ref ' ) );
56
+ add_action ( 'wp_ajax_lmscourse_fse_set_masteriyo_ref ' , array ( $ this , 'set_masteriyo_ref ' ) );
57
57
58
58
add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'register_internal_page ' ) );
59
- add_filter ( 'themeisle_sdk_blackfriday_data ' , array ( $ this , 'add_black_friday_data ' ) );
60
59
}
61
60
62
61
/**
@@ -69,7 +68,7 @@ public function render_welcome_notice() {
69
68
return ;
70
69
}
71
70
72
- $ wpfp_status = $ this ->get_wpfp_status ();
71
+ $ masteriyo_status = $ this ->get_masteriyo_status ();
73
72
74
73
Assets_Manager::enqueue_style ( Assets_Manager::ASSETS_SLUGS ['welcome-notice ' ], 'welcome-notice ' );
75
74
Assets_Manager::enqueue_script (
@@ -78,26 +77,26 @@ public function render_welcome_notice() {
78
77
true ,
79
78
array (),
80
79
array (
81
- 'nonce ' => wp_create_nonce ( 'lmscourse-fse-dismiss-welcome-notice ' ),
82
- 'wpfpRefNonce ' => wp_create_nonce ( 'lmscourse-fse-set-wpfp -ref ' ),
83
- 'ajaxUrl ' => esc_url ( admin_url ( 'admin-ajax.php ' ) ),
84
- 'wpfpStatus ' => $ wpfp_status ,
85
- 'activationUrl ' => esc_url (
80
+ 'nonce ' => wp_create_nonce ( 'lmscourse-fse-dismiss-welcome-notice ' ),
81
+ 'masteriyoRefNonce ' => wp_create_nonce ( 'lmscourse-fse-set-masteriyo -ref ' ),
82
+ 'ajaxUrl ' => esc_url ( admin_url ( 'admin-ajax.php ' ) ),
83
+ 'masteriyoStatus ' => $ masteriyo_status ,
84
+ 'activationUrl ' => esc_url (
86
85
add_query_arg (
87
86
array (
88
87
'plugin_status ' => 'all ' ,
89
88
'paged ' => '1 ' ,
90
89
'action ' => 'activate ' ,
91
- 'plugin ' => rawurlencode ( 'wp-full-stripe-free/wp-full-stripe .php ' ),
92
- '_wpnonce ' => wp_create_nonce ( 'activate-plugin_wp-full-stripe-free/wp-full-stripe .php ' ),
90
+ 'plugin ' => rawurlencode ( 'learning-management-system/lms .php ' ),
91
+ '_wpnonce ' => wp_create_nonce ( 'activate-plugin_learning-management-system/lms .php ' ),
93
92
),
94
93
admin_url ( 'plugins.php ' )
95
94
)
96
95
),
97
- 'redirectUrl ' => esc_url ( admin_url ( 'admin.php?page=wpfs-settings-stripe&onboarding=true ' ) ),
98
- 'activating ' => __ ( 'Activating ' , 'lmscourse-fse ' ) . '… ' ,
99
- 'installing ' => __ ( 'Installing ' , 'lmscourse-fse ' ) . '… ' ,
100
- 'done ' => __ ( 'Done ' , 'lmscourse-fse ' ),
96
+ 'redirectUrl ' => esc_url ( admin_url ( 'admin.php?page=masteriyo-onboard ' ) ),
97
+ 'activating ' => __ ( 'Activating ' , 'lmscourse-fse ' ) . '… ' ,
98
+ 'installing ' => __ ( 'Installing ' , 'lmscourse-fse ' ) . '… ' ,
99
+ 'done ' => __ ( 'Done ' , 'lmscourse-fse ' ),
101
100
)
102
101
);
103
102
@@ -108,36 +107,37 @@ public function render_welcome_notice() {
108
107
$ notice_html .= '<div class="notice-copy"> ' ;
109
108
110
109
$ notice_html .= '<h2 class="notice-subtitle"> ' ;
111
- $ notice_html .= '<span class="dashicons dashicons-star-filled "></span> ' ;
110
+ $ notice_html .= '<span class="dashicons dashicons-welcome-learn-more "></span> ' ;
112
111
/* translators: %s: 🎉 emoji */
113
- $ notice_html .= sprintf ( __ ( 'Accept Donations on Your Church Site %s ' , 'lmscourse-fse ' ), ' 🎉 ' );
112
+ $ notice_html .= __ ( 'The theme was designed to work best with Masteriyo LMS ' , 'lmscourse-fse ' );
114
113
$ notice_html .= '</h2> ' ;
115
114
116
115
$ notice_html .= '<h1 class="notice-title"> ' ;
117
- /* translators: %s: WP Full Pay */
118
- $ notice_html .= sprintf ( __ ( 'Start Collecting Funds with %s! ' , 'lmscourse-fse ' ), '<span>WP Full Pay </span> ' );
116
+ /* translators: %s: Masteriyo LMS */
117
+ $ notice_html .= sprintf ( __ ( 'Create and Sell Online Courses with %s! ' , 'lmscourse-fse ' ), '<span>Masteriyo LMS </span> ' );
119
118
120
119
$ notice_html .= '</h1> ' ;
121
120
122
- $ notice_html .= '<p class="description"> ' . __ ( 'The simplest way to accept donations and payments on your WordPress site. Set up in minutes with no technical knowledge required. ' , 'lmscourse-fse ' ) . '</p> ' ;
123
- $ notice_html .= '<p class="description"><span class="dashicons dashicons-yes"></span><strong> ' . __ ( 'Quick setup ' , 'lmscourse-fse ' ) . '</strong> - ' . __ ( 'Connect to Stripe and create your first donation form in minutes ' , 'lmscourse-fse ' ) . '</p> ' ;
124
- $ notice_html .= '<p class="description"><span class="dashicons dashicons-yes"></span><strong> ' . __ ( 'Multiple payment options ' , 'lmscourse-fse ' ) . '</strong> - ' . __ ( 'One-time and recurring donations with customizable amounts ' , 'lmscourse-fse ' ) . '</p> ' ;
121
+ $ notice_html .= '<p class="description"> ' . __ ( 'The complete WordPress LMS solution for educators and businesses. Build engaging courses, track student progress, and monetize your knowledge with zero coding required. ' , 'lmscourse-fse ' ) . '</p> ' ;
122
+ $ notice_html .= '<p class="description"><span class="dashicons dashicons-yes"></span><strong> ' . __ ( 'Quick setup ' , 'lmscourse-fse ' ) . '</strong> - ' . __ ( 'Install and create your first course in minutes ' , 'lmscourse-fse ' ) . '</p> ' ;
123
+ $ notice_html .= '<p class="description"><span class="dashicons dashicons-yes"></span><strong> ' . __ ( 'Multiple payment options ' , 'lmscourse-fse ' ) . '</strong> - ' . __ ( 'Built-in payment system with Stripe, PayPal & more ' , 'lmscourse-fse ' ) . '</p> ' ;
124
+ $ notice_html .= '<p class="description"><span class="dashicons dashicons-yes"></span><strong> ' . __ ( 'Complete course builder ' , 'lmscourse-fse ' ) . '</strong> - ' . __ ( 'Drag & drop builder with quizzes, certificates & assignments ' , 'lmscourse-fse ' ) . '</p> ' ;
125
125
126
126
$ notice_html .= '<div class="actions"> ' ;
127
127
128
- /* translators: %s: WP Full Pay */
129
- $ notice_html .= '<button id="lmscourse-fse-install-wpfp " class="button button-primary button-hero"> ' ;
128
+ /* translators: %s: Masteriyo LMS */
129
+ $ notice_html .= '<button id="lmscourse-fse-install-masteriyo " class="button button-primary button-hero"> ' ;
130
130
$ notice_html .= '<span class="dashicons dashicons-update hidden"></span> ' ;
131
131
$ notice_html .= '<span class="text"> ' ;
132
- $ notice_html .= 'installed ' === $ wpfp_status ?
133
- /* translators: %s: WP Full Pay */
134
- sprintf ( __ ( 'Activate %s ' , 'lmscourse-fse ' ), 'WP Full Pay ' ) :
135
- /* translators: %s: WP Full Pay */
136
- sprintf ( __ ( 'Install & Activate %s ' , 'lmscourse-fse ' ), 'WP Full Pay ' );
132
+ $ notice_html .= 'installed ' === $ masteriyo_status ?
133
+ /* translators: %s: Masteriyo LMS */
134
+ sprintf ( __ ( 'Activate %s ' , 'lmscourse-fse ' ), 'Masteriyo LMS ' ) :
135
+ /* translators: %s: Masteriyo LMS */
136
+ sprintf ( __ ( 'Install & Activate %s ' , 'lmscourse-fse ' ), 'Masteriyo LMS ' );
137
137
$ notice_html .= '</span> ' ;
138
138
$ notice_html .= '</button> ' ;
139
139
140
- $ notice_html .= '<a href="https://wordpress.org/plugins/wp-full-stripe-free /" target="_blank" class="button button-secondary button-hero"> ' ;
140
+ $ notice_html .= '<a href="https://wordpress.org/plugins/learning-management-system /" target="_blank" class="button button-secondary button-hero"> ' ;
141
141
$ notice_html .= '<span> ' . __ ( 'Learn More ' , 'lmscourse-fse ' ) . '</span> ' ;
142
142
$ notice_html .= '<span class="dashicons dashicons-external"></span> ' ;
143
143
$ notice_html .= '</a> ' ;
@@ -146,7 +146,7 @@ public function render_welcome_notice() {
146
146
147
147
$ notice_html .= '</div> ' ;
148
148
149
- $ notice_html .= '<img class="wpfp -preview" src=" ' . esc_url ( Assets_Manager::get_image_url ( 'welcome-notice.png ' ) ) . '" alt=" ' . esc_attr__ ( 'WP Full Pay preview ' , 'lmscourse-fse ' ) . '"/> ' ;
149
+ $ notice_html .= '<img class="masteriyo -preview" src=" ' . esc_url ( Assets_Manager::get_image_url ( 'welcome-notice.webp ' ) ) . '" alt=" ' . esc_attr__ ( 'Masteriyo LMS preview ' , 'lmscourse-fse ' ) . '"/> ' ;
150
150
$ notice_html .= '</div> ' ;
151
151
$ notice_html .= '</div> ' ;
152
152
@@ -176,8 +176,8 @@ public function remove_welcome_notice() {
176
176
* @return bool
177
177
*/
178
178
private function should_show_welcome_notice (): bool {
179
- // Already using WPFP .
180
- if ( is_plugin_active ( 'wp-full-stripe-free/wp-full-stripe .php ' ) ) {
179
+ // Already using Masteriyo .
180
+ if ( is_plugin_active ( 'learning-management-system/lms .php ' ) ) {
181
181
return false ;
182
182
}
183
183
@@ -231,33 +231,33 @@ private function should_show_welcome_notice(): bool {
231
231
}
232
232
233
233
/**
234
- * Get the WP Full Pay plugin status.
234
+ * Get the Masteriyo LMS plugin status.
235
235
*
236
236
* @return string
237
237
*/
238
- private function get_wpfp_status (): string {
238
+ private function get_masteriyo_status (): string {
239
239
$ status = 'not-installed ' ;
240
240
241
- if ( is_plugin_active ( 'wp-full-stripe-free/wp-full-stripe .php ' ) ) {
241
+ if ( is_plugin_active ( 'learning-management-system/lms .php ' ) ) {
242
242
return 'active ' ;
243
243
}
244
244
245
- if ( file_exists ( ABSPATH . 'wp-content/plugins/wp-full-stripe-free/wp-full-stripe .php ' ) ) {
245
+ if ( file_exists ( ABSPATH . 'wp-content/plugins/learning-management-system/lms .php ' ) ) {
246
246
return 'installed ' ;
247
247
}
248
248
249
249
return $ status ;
250
250
}
251
251
252
252
/**
253
- * Run after WP Full Pay activation.
253
+ * Run after Masteriyo LMS activation.
254
254
*
255
255
* @param string $plugin Plugin name.
256
256
*
257
257
* @return void
258
258
*/
259
- public function after_wpfs_activation ( $ plugin ) {
260
- if ( 'wp-full-stripe-free/wp-full-stripe .php ' !== $ plugin ) {
259
+ public function after_masteriyo_activation ( $ plugin ) {
260
+ if ( 'learning-management-system/lms .php ' !== $ plugin ) {
261
261
return ;
262
262
}
263
263
@@ -266,47 +266,20 @@ public function after_wpfs_activation( $plugin ) {
266
266
}
267
267
268
268
/**
269
- * Update WP Full Pay reference key.
269
+ * Update Masteriyo LMS reference key.
270
270
*
271
271
* @return void
272
272
*/
273
- public function set_wpfp_ref () {
274
- if ( empty ( $ _POST ['nonce ' ] ) || ! wp_verify_nonce ( sanitize_text_field ( $ _POST ['nonce ' ] ), 'lmscourse-fse-set-wpfp -ref ' ) ) {
273
+ public function set_masteriyo_ref () {
274
+ if ( empty ( $ _POST ['nonce ' ] ) || ! wp_verify_nonce ( sanitize_text_field ( $ _POST ['nonce ' ] ), 'lmscourse-fse-set-masteriyo -ref ' ) ) {
275
275
return ;
276
276
}
277
277
278
- update_option ( self ::WPFP_REF , 'lmscourse-fse ' );
278
+ update_option ( self ::MASTERIYO_REF , 'lmscourse-fse ' );
279
279
280
280
wp_send_json_success ();
281
281
}
282
282
283
- /**
284
- * Add Black Friday data.
285
- *
286
- * @param array $configs The configuration array for the loaded products.
287
- *
288
- * @return array
289
- */
290
- public function add_black_friday_data ( $ configs ) {
291
- $ config = $ configs ['default ' ];
292
-
293
- // translators: %1$s - plugin name, %2$s - discount.
294
- $ message_template = __ ( 'Need to accept payments or donations? Try %1$s, built by the same team as your theme — now up to %2$s OFF, for a limited time only. ' , 'lmscourse-fse ' );
295
-
296
- $ config ['dismiss ' ] = true ; // Note: Allow dismiss since it appears on `/wp-admin`.
297
- $ config ['message ' ] = sprintf ( $ message_template , 'WP Full Pay ' , '70% ' );
298
- $ config ['sale_url ' ] = add_query_arg (
299
- array (
300
- 'utm_term ' => 'free ' ,
301
- ),
302
- tsdk_translate_link ( tsdk_utmify ( 'https://themeisle.link/wpfp-bf ' , 'bfcm ' , 'lmscourse-fse ' ) )
303
- );
304
-
305
- $ configs [ LMSCOURSE_FSE_PRODUCT_SLUG ] = $ config ;
306
-
307
- return $ configs ;
308
- }
309
-
310
283
/**
311
284
* Register internal pages.
312
285
*
0 commit comments