LearnPress – WordPress LMS Plugin - Version 4.1.7.3

Version Description

(2022-11-02) = ~ Updated: text grammar. ~ Modified: LP_DateTime class. ~ Added: Course category and tag to menu. ~ Changed: input type regular price, sale price to text. ~ Call quiz get_questions function to get_question_ids. ~ Fixed: upgrade LP3 to LP4 missing result of lesson. ~ Remove file class-lp-backward-plugins.php, class-lp-factory.php, class-lp-query-search.php, class-lp-course-utils.php, class-lp-rest-authentication.php ~ Remove code deprecated before.

Download this release

Release Info

Developer ThimPress
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 4.1.7.3
Comparing to
See all releases

Code changes from version 4.1.7.2 to 4.1.7.3

Files changed (222) hide show
  1. assets/css/admin/admin-rtl.css +3 -0
  2. assets/css/admin/admin.css +3 -0
  3. assets/css/learnpress-rtl.css +2 -0
  4. assets/css/learnpress.css +2 -0
  5. assets/js/dist/admin/pages/tools.min.js +1 -1
  6. assets/js/dist/blocks/index.min.js +2 -2
  7. assets/js/dist/frontend/courses.js +5 -5
  8. assets/js/dist/frontend/profile.js +15 -35
  9. assets/js/dist/frontend/profile.min.js +1 -1
  10. assets/js/dist/frontend/question-types.min.js +1 -1
  11. assets/js/dist/frontend/quiz.js +9 -3
  12. assets/js/dist/frontend/quiz.min.js +1 -1
  13. assets/js/dist/frontend/single-course.js +2 -8
  14. assets/js/dist/frontend/single-curriculum.js +2 -8
  15. assets/src/apps/js/admin/pages/tools/database/upgrade.js +4 -0
  16. assets/src/apps/js/blocks/template/edit.js +1 -1
  17. assets/src/apps/js/frontend/profile/avatar.js +2 -2
  18. assets/src/apps/js/frontend/question-types/components/question-base/index.js +1 -1
  19. assets/src/apps/js/frontend/quiz/components/attempts/index.js +1 -1
  20. assets/src/apps/js/frontend/quiz/components/buttons/button-check.js +2 -2
  21. assets/src/apps/js/frontend/quiz/components/buttons/index.js +2 -2
  22. assets/src/apps/js/frontend/quiz/components/status/index.js +1 -1
  23. assets/src/apps/js/frontend/quiz/store/reducer.js +2 -3
  24. assets/src/apps/js/frontend/single-course/student-list.js +0 -96
  25. config/settings/course.php +14 -14
  26. config/settings/general.php +7 -7
  27. inc/abstract-settings.php +1 -1
  28. inc/abstracts/abstract-addon.php +4 -0
  29. inc/abstracts/abstract-object-data.php +38 -31
  30. inc/abstracts/abstract-rest-api.php +1 -1
  31. inc/admin/class-lp-admin-ajax.php +5 -5
  32. inc/admin/class-lp-admin-assets.php +2 -2
  33. inc/admin/class-lp-admin-menu.php +49 -37
  34. inc/admin/class-lp-admin.php +56 -89
  35. inc/admin/class-lp-install-sample-data.php +4 -4
  36. inc/admin/class-lp-reset-data.php +16 -10
  37. inc/admin/class-lp-setup-wizard.php +1 -1
  38. inc/admin/class-lp-updater.php +5 -5
  39. inc/admin/editor/class-lp-admin-editor-quiz.php +6 -4
  40. inc/admin/lp-admin-actions.php +2 -8
  41. inc/admin/lp-admin-functions.php +14 -32
  42. inc/admin/meta-box/fields/email-content.php +2 -2
  43. inc/admin/meta-box/fields/image-advanced.php +1 -1
  44. inc/admin/settings/class-lp-settings-advanced.php +2 -2
  45. inc/admin/settings/class-lp-settings-payments.php +3 -3
  46. inc/admin/settings/class-lp-settings-profile.php +3 -3
  47. inc/admin/sub-menus/abstract-submenu.php +9 -0
  48. inc/admin/sub-menus/class-lp-submenu-addons.php +3 -2
  49. inc/admin/sub-menus/class-lp-submenu-categories.php +17 -0
  50. inc/admin/sub-menus/class-lp-submenu-settings.php +1 -0
  51. inc/admin/sub-menus/class-lp-submenu-statistics.php +1 -1
  52. inc/admin/sub-menus/class-lp-submenu-tags.php +17 -0
  53. inc/admin/sub-menus/class-lp-submenu-tools.php +8 -18
  54. inc/admin/views/addons/html-plugins-more.php +1 -1
  55. inc/admin/views/course/editor.php +1 -1
  56. inc/admin/views/course/modal-choose-items.php +1 -1
  57. inc/admin/views/course/section-item.php +2 -2
  58. inc/admin/views/dashboard/plugin-status/html-results.php +1 -1
  59. inc/admin/views/html-admin-notice-templates.php +3 -3
  60. inc/admin/views/meta-boxes/course/settings.php +17 -17
  61. inc/admin/views/meta-boxes/fields/autocomplete.php +3 -0
  62. inc/admin/views/meta-boxes/order/actions.php +1 -1
  63. inc/admin/views/meta-boxes/order/details.php +6 -6
  64. inc/admin/views/meta-boxes/question/settings.php +2 -2
  65. inc/admin/views/meta-boxes/quiz/settings.php +8 -8
  66. inc/admin/views/question/answer.php +1 -1
  67. inc/admin/views/question/fib-answer-editor.php +5 -5
  68. inc/admin/views/quiz/modal-choose-items.php +1 -1
  69. inc/admin/views/quiz/question-actions.php +2 -2
  70. inc/admin/views/quiz/question-meta.php +2 -2
  71. inc/admin/views/setup/setup-paypal.php +1 -1
  72. inc/admin/views/setup/steps/currency.php +2 -2
  73. inc/admin/views/setup/steps/emails.php +3 -3
  74. inc/admin/views/setup/steps/pages.php +2 -2
  75. inc/admin/views/statistics/general.php +1 -1
  76. inc/admin/views/tools/database/html-upgrade-database.php +1 -1
  77. inc/admin/views/tools/html-cron.php +0 -34
  78. inc/admin/views/updates/html-updated-latest-message.php +1 -1
  79. inc/admin/views/updates/html-updating-message.php +1 -1
  80. inc/admin/views/user/courses.php +1 -1
  81. inc/background-process/class-lp-background-query-items.php +3 -3
  82. inc/background-process/class-lp-background-single-course.php +1 -1
  83. inc/cart/class-lp-cart.php +2 -56
  84. inc/class-lp-ajax.php +2 -2
  85. inc/class-lp-backward-plugins.php +0 -117
  86. inc/class-lp-checkout.php +2 -2
  87. inc/class-lp-datetime.php +55 -45
  88. inc/class-lp-factory.php +0 -20
  89. inc/class-lp-forms-handler.php +51 -17
  90. inc/class-lp-global.php +9 -50
  91. inc/class-lp-helper.php +5 -4
  92. inc/class-lp-install.php +1 -55
  93. inc/class-lp-nonce-helper.php +2 -2
  94. inc/class-lp-page-controller.php +4 -4
  95. inc/class-lp-query-search.php +0 -107
  96. inc/class-lp-request-handler.php +2 -0
  97. inc/class-lp-shortcodes.php +1 -1
  98. inc/class-lp-strings.php +6 -6
  99. inc/class-lp-template.php +18 -5
  100. inc/class-lp-widget.php +1 -1
  101. inc/course/abstract-course.php +8 -19
  102. inc/course/class-lp-course-item.php +2 -2
  103. inc/course/class-lp-course-no-required-enroll.php +2 -2
  104. inc/course/class-lp-course-section.php +1 -1
  105. inc/course/class-lp-course-utils.php +0 -107
  106. inc/course/class-lp-course.php +1 -1
  107. inc/course/lp-course-functions.php +9 -37
  108. inc/curds/class-lp-course-curd.php +5 -5
  109. inc/curds/class-lp-lesson-curd.php +1 -1
  110. inc/curds/class-lp-order-curd.php +3 -3
  111. inc/curds/class-lp-question-curd.php +5 -5
  112. inc/curds/class-lp-quiz-curd.php +25 -68
  113. inc/curds/class-lp-section-curd.php +2 -2
  114. inc/curds/class-lp-user-curd.php +10 -10
  115. inc/curds/class-lp-user-item-curd.php +3 -3
  116. inc/custom-post-types/abstract.php +4 -4
  117. inc/custom-post-types/course.php +9 -9
  118. inc/custom-post-types/lesson.php +2 -2
  119. inc/custom-post-types/order.php +4 -4
  120. inc/custom-post-types/question.php +4 -4
  121. inc/custom-post-types/quiz.php +4 -4
  122. inc/databases/class-lp-course-db.php +0 -35
  123. inc/databases/class-lp-order-db.php +2 -2
  124. inc/databases/class-lp-section-db.php +2 -2
  125. inc/databases/class-lp-user-items-db.php +3 -3
  126. inc/emails/admin/class-lp-email-cancelled-order-admin.php +3 -3
  127. inc/emails/admin/class-lp-email-completed-order-admin.php +3 -3
  128. inc/emails/admin/class-lp-email-enrolled-course-admin.php +3 -3
  129. inc/emails/admin/class-lp-email-finished-course-admin.php +3 -3
  130. inc/emails/class-lp-email.php +1 -1
  131. inc/emails/guest/class-lp-email-cancelled-order-guest.php +1 -1
  132. inc/emails/guest/class-lp-email-completed-order-guest.php +1 -1
  133. inc/emails/guest/class-lp-email-new-order-guest.php +1 -1
  134. inc/emails/guest/class-lp-email-processing-order-guest.php +1 -1
  135. inc/emails/instructor/class-lp-email-cancelled-order-instructor.php +3 -3
  136. inc/emails/instructor/class-lp-email-enrolled-course-instructor.php +3 -3
  137. inc/emails/instructor/class-lp-email-finished-course-instructor.php +3 -3
  138. inc/emails/instructor/class-lp-email-instructor-accepted.php +3 -3
  139. inc/emails/instructor/class-lp-email-instructor-denied.php +3 -3
  140. inc/emails/instructor/class-lp-email-new-order-instructor.php +1 -1
  141. inc/emails/student/class-lp-email-cancelled-order-user.php +1 -1
  142. inc/emails/student/class-lp-email-completed-order-user.php +1 -1
  143. inc/emails/student/class-lp-email-enrolled-course-user.php +3 -3
  144. inc/emails/student/class-lp-email-finished-course-user.php +3 -3
  145. inc/emails/student/class-lp-email-new-order-user.php +1 -1
  146. inc/emails/student/class-lp-email-processing-order-user.php +1 -1
  147. inc/emails/types/class-lp-email-reset-password.php +1 -1
  148. inc/emails/types/class-lp-email-type-finished-course.php +3 -1
  149. inc/external-plugin/elementor/widgets/become-a-teacher.php +1 -1
  150. inc/external-plugin/elementor/widgets/login-form.php +1 -1
  151. inc/external-plugin/elementor/widgets/register-form.php +1 -1
  152. inc/gateways/offline-payment/class-lp-gateway-offline-payment.php +1 -1
  153. inc/gateways/paypal/class-lp-gateway-paypal.php +1 -1
  154. inc/handle-steps/class-lp-handle-steps.php +3 -3
  155. inc/jwt/includes/class-jwt-public.php +2 -2
  156. inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php +24 -23
  157. inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php +8 -8
  158. inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php +13 -13
  159. inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php +3 -3
  160. inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php +10 -10
  161. inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php +8 -8
  162. inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php +7 -7
  163. inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php +7 -7
  164. inc/lp-core-functions.php +60 -72
  165. inc/lp-deprecated.php +28 -28
  166. inc/lp-template-functions.php +4 -21
  167. inc/lp-webhooks.php +1 -1
  168. inc/order/class-lp-order.php +4 -6
  169. inc/order/lp-order-functions.php +4 -4
  170. inc/question/class-lp-question.php +4 -4
  171. inc/quiz/class-lp-quiz.php +42 -47
  172. inc/quiz/lp-quiz-functions.php +3 -1
  173. inc/rest-api/class-lp-rest-authentication.php +0 -185
  174. inc/rest-api/v1/admin/class-lp-admin-rest-reset-data-controller.php +1 -1
  175. inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php +18 -15
  176. inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php +7 -7
  177. inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php +7 -7
  178. inc/rest-api/v1/frontend/class-lp-rest-settings-controller.php +1 -1
  179. inc/rest-api/v1/frontend/class-lp-rest-users-controller.php +25 -21
  180. inc/settings/abstract-settings-page.php +1 -1
  181. inc/shortcodes/class-lp-shortcode-become-a-teacher.php +2 -2
  182. inc/shortcodes/class-lp-shortcode-button-enroll.php +0 -96
  183. inc/shortcodes/class-lp-shortcode-button-purchase.php +0 -1
  184. inc/shortcodes/class-lp-shortcode-profile.php +1 -1
  185. inc/templates/class-lp-template-course.php +19 -13
  186. inc/updates/learnpress-upgrade-4.php +131 -15
  187. inc/user-item/class-lp-user-item-course.php +9 -9
  188. inc/user-item/class-lp-user-item-quiz.php +5 -5
  189. inc/user-item/class-lp-user-item.php +37 -97
  190. inc/user/abstract-lp-user.php +18 -21
  191. inc/user/class-lp-profile-tabs.php +0 -1
  192. inc/user/class-lp-profile.php +15 -37
  193. inc/user/class-lp-user-factory.php +17 -18
  194. inc/user/class-lp-user.php +24 -25
  195. inc/user/lp-user-functions.php +55 -65
  196. inc/widgets/course-progress.php +2 -2
  197. languages/learnpress.pot +743 -782
  198. learnpress.php +5 -15
  199. mu-plugin/class-lp-mu-plugin.php +0 -149
  200. readme.txt +11 -1
  201. templates/checkout/form.php +1 -1
  202. templates/checkout/guest-checkout.php +1 -1
  203. templates/checkout/order-received.php +1 -1
  204. templates/content-lesson/button-complete.php +1 -1
  205. templates/content-lesson/content.php +1 -1
  206. templates/global/before-main-content.php +2 -2
  207. templates/global/block-content.php +1 -1
  208. templates/global/no-courses-found.php +1 -1
  209. templates/pages/profile.php +1 -1
  210. templates/profile/content.php +1 -1
  211. templates/profile/tabs/courses/course-list.php +4 -2
  212. templates/profile/tabs/courses/general-statistic.php +5 -5
  213. templates/profile/tabs/orders/recover-order.php +2 -2
  214. templates/profile/tabs/settings/change-password.php +1 -1
  215. templates/single-course/buttons/retry.php +1 -1
  216. templates/single-course/content-item/popup-sidebar.php +1 -1
  217. templates/single-course/content-protected.php +1 -1
  218. templates/single-course/sidebar/user-progress.php +4 -8
  219. templates/single-course/sidebar/user-time.php +9 -9
  220. templates/single-course/tabs/curriculum-v2.php +1 -1
  221. templates/single-course/tabs/curriculum.php +1 -1
  222. templates/single-course/tabs/tabs.php +1 -1
assets/css/admin/admin-rtl.css CHANGED
@@ -1172,6 +1172,7 @@ ul .clearfix {
1172
  .learn-press-advertisement-slider .slide-item .slide-detail .slide-controls .button {
1173
  margin-bottom: 0;
1174
  }
 
1175
  .wp-responsive-open .learn-press-advertisement-slider {
1176
  margin-right: 56px;
1177
  }
@@ -2566,6 +2567,7 @@ input[name=_lp_course_result]:checked ~ #passing-condition-quiz-result {
2566
  .plugin-card:not(.hide-if-js):nth-child(even) {
2567
  margin-left: 8px;
2568
  }
 
2569
  .plugin-card:not(.hide-if-js):nth-child(3n) {
2570
  margin-left: 0;
2571
  }
@@ -6069,6 +6071,7 @@ body.lp-item-moving {
6069
  .learn-press-dropdown-pages .select2-selection__rendered {
6070
  line-height: 31px !important;
6071
  }
 
6072
  #learn-press-advertisement {
6073
  margin: 0 12px;
6074
  padding-bottom: 0;
1172
  .learn-press-advertisement-slider .slide-item .slide-detail .slide-controls .button {
1173
  margin-bottom: 0;
1174
  }
1175
+
1176
  .wp-responsive-open .learn-press-advertisement-slider {
1177
  margin-right: 56px;
1178
  }
2567
  .plugin-card:not(.hide-if-js):nth-child(even) {
2568
  margin-left: 8px;
2569
  }
2570
+
2571
  .plugin-card:not(.hide-if-js):nth-child(3n) {
2572
  margin-left: 0;
2573
  }
6071
  .learn-press-dropdown-pages .select2-selection__rendered {
6072
  line-height: 31px !important;
6073
  }
6074
+
6075
  #learn-press-advertisement {
6076
  margin: 0 12px;
6077
  padding-bottom: 0;
assets/css/admin/admin.css CHANGED
@@ -1172,6 +1172,7 @@ ul .clearfix {
1172
  .learn-press-advertisement-slider .slide-item .slide-detail .slide-controls .button {
1173
  margin-bottom: 0;
1174
  }
 
1175
  .wp-responsive-open .learn-press-advertisement-slider {
1176
  margin-left: 56px;
1177
  }
@@ -2566,6 +2567,7 @@ input[name=_lp_course_result]:checked ~ #passing-condition-quiz-result {
2566
  .plugin-card:not(.hide-if-js):nth-child(even) {
2567
  margin-right: 8px;
2568
  }
 
2569
  .plugin-card:not(.hide-if-js):nth-child(3n) {
2570
  margin-right: 0;
2571
  }
@@ -6069,6 +6071,7 @@ body.lp-item-moving {
6069
  .learn-press-dropdown-pages .select2-selection__rendered {
6070
  line-height: 31px !important;
6071
  }
 
6072
  #learn-press-advertisement {
6073
  margin: 0 12px;
6074
  padding-bottom: 0;
1172
  .learn-press-advertisement-slider .slide-item .slide-detail .slide-controls .button {
1173
  margin-bottom: 0;
1174
  }
1175
+
1176
  .wp-responsive-open .learn-press-advertisement-slider {
1177
  margin-left: 56px;
1178
  }
2567
  .plugin-card:not(.hide-if-js):nth-child(even) {
2568
  margin-right: 8px;
2569
  }
2570
+
2571
  .plugin-card:not(.hide-if-js):nth-child(3n) {
2572
  margin-right: 0;
2573
  }
6071
  .learn-press-dropdown-pages .select2-selection__rendered {
6072
  line-height: 31px !important;
6073
  }
6074
+
6075
  #learn-press-advertisement {
6076
  margin: 0 12px;
6077
  padding-bottom: 0;
assets/css/learnpress-rtl.css CHANGED
@@ -3519,6 +3519,7 @@ input[name=course-faqs-box-ratio]:checked + .course-faqs-box .course-faqs-box__t
3519
  body.course-item-popup.wpadminbar #learn-press-course-curriculum {
3520
  top: 106px;
3521
  }
 
3522
  .learn-press-course-results-progress {
3523
  margin-left: 0%;
3524
  }
@@ -6912,6 +6913,7 @@ body.lp-sidebar-toggle__close #popup-course #popup-header, body.lp-sidebar-toggl
6912
  body.admin-bar #popup-course {
6913
  top: 46px;
6914
  }
 
6915
  #popup-course #popup-sidebar {
6916
  flex-basis: 250px;
6917
  }
3519
  body.course-item-popup.wpadminbar #learn-press-course-curriculum {
3520
  top: 106px;
3521
  }
3522
+
3523
  .learn-press-course-results-progress {
3524
  margin-left: 0%;
3525
  }
6913
  body.admin-bar #popup-course {
6914
  top: 46px;
6915
  }
6916
+
6917
  #popup-course #popup-sidebar {
6918
  flex-basis: 250px;
6919
  }
assets/css/learnpress.css CHANGED
@@ -3519,6 +3519,7 @@ input[name=course-faqs-box-ratio]:checked + .course-faqs-box .course-faqs-box__t
3519
  body.course-item-popup.wpadminbar #learn-press-course-curriculum {
3520
  top: 106px;
3521
  }
 
3522
  .learn-press-course-results-progress {
3523
  margin-right: 0%;
3524
  }
@@ -6912,6 +6913,7 @@ body.lp-sidebar-toggle__close #popup-course #popup-header, body.lp-sidebar-toggl
6912
  body.admin-bar #popup-course {
6913
  top: 46px;
6914
  }
 
6915
  #popup-course #popup-sidebar {
6916
  flex-basis: 250px;
6917
  }
3519
  body.course-item-popup.wpadminbar #learn-press-course-curriculum {
3520
  top: 106px;
3521
  }
3522
+
3523
  .learn-press-course-results-progress {
3524
  margin-right: 0%;
3525
  }
6913
  body.admin-bar #popup-course {
6914
  top: 46px;
6915
  }
6916
+
6917
  #popup-course #popup-sidebar {
6918
  flex-basis: 250px;
6919
  }
assets/js/dist/admin/pages/tools.min.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";const e=jQuery;let t=null;const s={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init(){return!!this.instance||(this.elLPOverlay=e(".lp-overlay"),!!this.elLPOverlay.length&&(t=this.elLPOverlay,this.elMainContent=t.find(".main-content"),this.elTitle=t.find(".modal-title"),this.elBtnYes=t.find(".btn-yes"),this.elBtnNo=t.find(".btn-no"),this.elFooter=t.find(".lp-modal-footer"),e(document).on("click",".close, .btn-no",(function(){t.hide()})),e(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof s.callBackYes&&s.callBackYes()})),this.instance=this,!0))},setElCalledModal(e){this.elCalledModal=e},setContentModal(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal(e){this.elTitle.html(e)}};var l=s,n=function(e,t,s){wp.apiFetch({path:e,method:"POST",data:t}).then((e=>{"function"==typeof s.success&&s.success(e)})).catch((e=>{"function"==typeof s.error&&s.error(e)})).then((()=>{"function"==typeof s.completed&&s.completed()}))};const o=jQuery,a=o("#lp-tool-upgrade-db"),r=()=>{let e=0;const t=a.find(".wrapper-terms-upgrade"),s=a.find(".wrapper-lp-status-upgrade"),r=a.find(".wrapper-lp-upgrade-message");let i=null;if(t.length){l.setContentModal(t.html());const e=l.elLPOverlay.find(".terms-upgrade"),a=e.find("input[name=lp-agree-term]"),r=e.find(".error"),c=o("input[name=message-when-upgrading]").val();i=function(){return r.hide(),r.removeClass("learn-press-message"),a.is(":checked")?(n("/lp/v1/database/agree_terms",{agree_terms:1},{}),l.elFooter.find(".learn-press-notice").remove(),l.elFooter.prepend('<span class="learn-press-notice">'+c+"</span>"),l.setContentModal(s.html()),!0):(r.show(),r.addClass("learn-press-message"),l.elMainContent.animate({scrollTop:r.offset().top}),!1)}}else l.setContentModal(s.html()),i=function(){return!0};l.setTitleModal(a.find("h2").html()),l.elBtnYes.text("Upgrade"),l.elBtnYes.show(),l.elBtnNo.text("close"),l.callBackYes=function(){if(!i())return;e=1,l.elBtnYes.hide(),l.elBtnNo.hide();const t="/lp/v1/database/upgrade",s=l.elLPOverlay.find(".lp-group-step"),c=a.find(".lp-item-step"),d=[];o.each(c,(function(e,t){const s=o(t);if(!s.hasClass("completed")){const e=s.find("input").val();d.push(e)}}));const p={steps:d,step:d[0]};let u=null;const m=(e,t)=>{u=s.find("input[value="+e+"]").closest(".lp-item-step"),u.addClass("running"),100===t&&u.removeClass("running").addClass("completed"),u.find(".progress-bar").css("width",t+"%"),u.find(".percent").text(t+"%")};m(d[0],.1);const h={success:o=>{m(p.step,o.percent),p.step!==o.name&&m(o.name,.1),(e=>{u=s.find("input[value="+e+"]").closest(".lp-item-step");const t=u.offset().top-l.elMainContent.offset().top+l.elMainContent.scrollTop();l.elMainContent.stop().animate({scrollTop:t},600)})(p.step),"success"===o.status?(p.step=o.name,p.data=o.data,setTimeout((()=>{n(t,p,h)}),800)):"finished"===o.status?(e=0,u.removeClass("running").addClass("completed"),setTimeout((()=>{l.setContentModal(r.html())}),1e3),l.elFooter.find(".learn-press-notice").remove(),l.elBtnNo.show(),l.elBtnNo.on("click",(()=>{window.location.reload()}))):(e=0,l.elFooter.find(".learn-press-notice").remove(),u.removeClass("running").addClass("error"),l.setContentModal(r.html(),(function(){l.elBtnYes.text("Retry").show(),l.callBackYes=()=>{window.location.href=lpGlobalSettings.siteurl+"/wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},l.elBtnNo.show(),o.message||(o.message="Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help"),l.elMainContent.find(".learn-press-message").addClass("error").html(o.message)})))},error:t=>{e=0,l.setContentModal(r.html(),(function(){l.elBtnYes.text("Retry").show(),l.callBackYes=()=>{window.location.location="wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},l.elBtnNo.show(),t.message||(t.message="Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help"),l.elMainContent.find(".learn-press-message").addClass("error").html(t.message)}))},completed:()=>{}};n(t,p,h)},window.onbeforeunload=function(){if(e)return"LP is upgrading Database. Are you want to reload page?"},window.onclose=function(){if(e)return"LP is upgrading Database. Are you want to close page?"}};var i=window.wp.element;const{__:__}=wp.i18n,{TextControl:c,Button:d,Spinner:p,CheckboxControl:u,Notice:m}=wp.components,{useState:h,useEffect:g}=wp.element,{addQueryArgs:f}=wp.url;var y=()=>{const[e,t]=h(!1),[s,l]=h(""),[n,o]=h([]),[a,r]=h([]),[y,v]=h([]),[b,C]=h(!1);g((()=>{w(s)}),[s]);const w=async s=>{try{if(!s||e)return v([]),void o([]);if(s.length<3)return v([{status:"error",message:"Please enter at least 3 characters to searching course."}]),void o([]);t(!0);const l=await wp.apiFetch({path:f("lp/v1/admin/tools/reset-data/search-courses",{s:s}),method:"GET"}),{status:n,data:a}=l;t(!1),"success"===n?(o(a),v([])):(v([{status:"error",message:l.message||"LearnPress: Search Course Fail!"}]),o([]))}catch(e){console.log(e.message)}};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h2",null,__("Reset course progress","learnpress")),(0,i.createElement)("div",{className:"description"},(0,i.createElement)("p",null,__("This action will reset progress of a course for all users have enrolled.","learnpress")),(0,i.createElement)("p",null,__("Search results only show course have user data.","learnpress")),(0,i.createElement)("div",null,(0,i.createElement)(c,{placeholder:__("Search course by name","learnpress"),value:s,onChange:e=>l(e),style:{width:300}}))),e&&(0,i.createElement)(p,null),n.length>0&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"lp-reset-course_progress",style:{border:"1px solid #eee"}},(0,i.createElement)("div",null,(0,i.createElement)("div",{style:{background:"#eee"}},(0,i.createElement)("div",null,(0,i.createElement)(u,{checked:a.length===n.length,onChange:()=>{a.length===n.length?r([]):r(n.map((e=>e.id)))},style:{margin:0}})),(0,i.createElement)("div",null,__("ID","learnpress")),(0,i.createElement)("div",null,__("Name","learnpress")),(0,i.createElement)("div",null,__("Students","learnpress")))),(0,i.createElement)("div",{style:{height:"100%",maxHeight:200,overflow:"auto"}},n.map((e=>(0,i.createElement)("div",{style:{borderTop:"1px solid #eee"},key:e.id},(0,i.createElement)("div",null,(0,i.createElement)(u,{checked:a.includes(e.id),onChange:()=>function(e){const t=[...a];if(t.includes(e)){const s=t.indexOf(e);s>-1&&t.splice(s,1)}else t.push(e);r(t)}(e.id)})),(0,i.createElement)("div",null,"#",e.id),(0,i.createElement)("div",null,e.title),(0,i.createElement)("div",null,e.students)))))),b?(0,i.createElement)(p,null):(0,i.createElement)(d,{isPrimary:!0,onClick:()=>(async()=>{if(0===a.length)return void v([{status:"error",message:"Please chooce Course for reset data!"}]);if(!confirm("Are you sure to reset course progress of all users enrolled this course?"))return;const e=[];try{C(!0);for(const t of a){const s=await wp.apiFetch({path:f("lp/v1/admin/tools/reset-data/reset-courses",{courseId:t}),method:"GET"}),{status:l,data:n,message:o}=s;e.push({status:l,message:o||`Course #${t} reset successfully!`})}C(!1)}catch(t){e.push({status:"error",message:t.message||"LearnPress Error: Reset Course Data."})}v(e)})(),style:{marginTop:10,height:30}},__("Reset now","learnpress"))),y.length>0&&y.map(((e,t)=>(0,i.createElement)(m,{status:e.status,key:t,isDismissible:!1},e.message))),(0,i.createElement)("style",null,"\t\t\t\t.lp-reset-course_progress .components-base-control__field {\t\t\t\t\tmargin: 0;\t\t\t\t}\t\t\t\t.components-notice{\t\t\t\t\tmargin-left: 0;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div{\t\t\t\t\tdisplay: grid;\t\t\t\t\tgrid-template-columns: 80px 50px 1fr 80px;\t\t\t\t\talign-items: center;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div > div{\t\t\t\t\tmaegin: 0;\t\t\t\t\tpadding: 8px 10px;\t\t\t\t}\t\t\t\t"))};!function(e){const t=e(document);let s=!1;const c=function(t){t.preventDefault();const l=e(this);s||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(l.addClass("disabled").html(l.data("installing-text")),e(".lp-install-sample__response").remove(),s=!0,e.ajax({url:l.attr("href"),data:e(".lp-install-sample__options").serializeJSON(),success(t){l.removeClass("disabled").html(l.data("text")),s=!1,e(t).insertBefore(l.parent())},error(){l.removeClass("disabled").html(l.data("text")),s=!1,e(response).insertBefore(l.parent())}}))},d=function(t){t.preventDefault();const l=e(this);s||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(l.addClass("disabled").html(l.data("uninstalling-text")),s=!0,e.ajax({url:l.attr("href"),success(t){l.removeClass("disabled").html(l.data("text")),s=!1,e(t).insertBefore(l.parent())},error(){l.removeClass("disabled").html(l.data("text")),s=!1,e(response).insertBefore(l.parent())}}))},p=function(t){t.preventDefault();const s=e(this);s.hasClass("disabled")||(s.addClass("disabled").html(s.data("cleaning-text")),e.ajax({url:s.attr("href"),data:{},success(e){s.removeClass("disabled").html(s.data("text"))},error(){s.removeClass("disabled").html(s.data("text"))}}))},u=function(){e.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success(e){},error(){}})},m=function(t){t.preventDefault(),e(".lp-install-sample__options").toggleClass("hide-if-js")};e((function(){(()=>{if(!a.length)return;if(!l.init())return;const e=o(".wrapper-lp-status-upgrade"),t=window.location.search,s=new URLSearchParams(t).get("action");"upgrade-db"===s&&(l.elLPOverlay.show(),l.setTitleModal(a.find("h2").html()),l.setContentModal(o(".wrapper-lp-loading").html())),n("/lp/v1/database/get_steps",{},{success:t=>{const{steps_completed:n,steps_default:a}=t;if(void 0===n||void 0===a)return console.log("invalid steps_completed and steps_default"),!1;let i="";for(const t in a){const c=a[t],d=c.steps;i='<div class="lp-group-step">',i+="<h3>"+c.label+"</h3>";for(const e in d){const t=d[e];let s="";void 0!==n[e]&&(s="completed"),i+='<div class="lp-item-step '+s+'">',i+='<div class="lp-item-step-left"><input type="hidden" name="lp_steps_upgrade_db[]" value="'+t.name+'" /></div>',i+='<div class="lp-item-step-right">',i+='<label for=""><strong></strong>'+t.label+"</label>",i+='<div class="description">'+t.description+"</div>",i+='<div class="percent"></div>',i+='<span class="progress-bar"></span>',i+="</div>",i+="</div>"}i+="</div>",e.append(i);const p=o(".lp-btn-upgrade-db");"upgrade-db"===s&&r(),p.on("click",(function(){l.elLPOverlay.show(),r()}))}},error:e=>{},completed:()=>{}})})(),(()=>{const e=document.querySelector("#lp-tool-create-indexes-tables");e&&e.querySelector(".lp-btn-create-indexes").addEventListener("click",(t=>{t.preventDefault();const s=e.querySelector(".wrapper-lp-loading");if(!l.init())return;l.elLPOverlay.show(),l.setContentModal(s.innerHTML),l.setTitleModal(e.querySelector("h2").textContent),l.elBtnYes[0].style.display="inline-block",l.elBtnYes[0].textContent="Run",l.elBtnNo[0].textContent="Close";const o={success:e=>{const{status:t,message:s,data:{tables:o,table:a}}=e,r=document.querySelector(".example-lp-group-step");l.setContentModal(r.innerHTML);const i=l.elLPOverlay[0].querySelector(".lp-group-step "),c=(e,t)=>{const s=i.querySelector("input[value="+e+"]").closest(".lp-item-step");s.classList.add("running"),100===t&&(s.classList.remove("running"),s.classList.add("completed")),s.querySelector(".progress-bar").style.width=t};for(const e in o){const t=l.elLPOverlay[0].querySelector(".lp-item-step").cloneNode(!0),s=t.querySelector("input");t.querySelector("label").textContent=`Table: ${e}`,s.value=e,i.append(t)}l.callBackYes=()=>{const e="/lp/v1/admin/tools/create-indexs",t={tables:o,table:a};l.elBtnNo[0].style.display="none",l.elBtnYes[0].style.display="none",c(a,.1);const s={success:o=>{const{status:a,message:r,data:{table:d,percent:p}}=o;c(t.table,p),void 0!==d&&(t.table!==d&&(c(d,.1),(e=>{const t=i.querySelector("input[value="+e+"]").closest(".lp-item-step").offsetTop-l.elMainContent[0].offsetTop+l.elMainContent[0].scrollTop;l.elMainContent.stop().animate({scrollTop:t},600)})(d)),t.table=d),"success"===a?setTimeout((()=>{n(e,t,s)}),2e3):"finished"===a?(console.log("finished"),l.elBtnNo[0].style.display="inline-block",l.elBtnNo[0].textContent="Finish"):console.log(r)},error:e=>{console.log(e)},completed:()=>{}};n(e,t,s)}},error:e=>{},completed:()=>{}};n("/lp/v1/admin/tools/list-tables-indexs",{},o)}))})(),(()=>{const e=document.querySelector("#lp-tool-re-upgrade-db");if(!e)return;let t="lp/v1/database/check-db-valid-re-upgrade";n(t,{},{success(s){const{data:{can_re_upgrade:l}}=s;if(!l)return;e.style.display="block";const o=e.querySelector(".lp-btn-re-upgrade-db"),a=e.querySelector(".learn-press-message");o.addEventListener("click",(()=>{confirm("Are you want to Re Upgrade!")&&(t="lp/v1/database/del-tb-lp-upgrade-db",n(t,{},{success(e){const{status:t,message:s,data:{url:l}}=e;"success"===t&&void 0!==l&&(window.location.href=l)},error(e){a.classList.add("error"),a.textContent=e.message,a.style.display="block"}}))}))},error(e){}})})(),document.querySelectorAll("#learn-press-reset-course-users").length>0&&wp.element.render((0,i.createElement)(y,null),[...document.querySelectorAll("#learn-press-reset-course-users")][0]),(()=>{const e=document.querySelector("#lp-tool-clean-database");e&&e.querySelector(".lp-btn-clean-db").addEventListener("click",(function(t){t.preventDefault();const s=document.querySelector("#tools-select__id"),o=s.querySelectorAll("ul li input"),a=Array.prototype.slice.call(o).some((e=>e.checked)),r=e.querySelector(".tools-prepare__message");if(0==a)return r.style.display="block",void(r.textContent="You must choose at least one table to take this action");r.style.display="none";const i=e.querySelector(".wrapper-lp-loading");if(!l.init())return;l.elLPOverlay.show(),l.setContentModal(i.innerHTML),l.setTitleModal(e.querySelector("h2").textContent),l.elBtnYes[0].style.display="inline-block",l.elBtnYes[0].textContent="Run",l.elBtnNo[0].textContent="Close";const c=new Array;s.querySelectorAll("ul li input:checked").forEach((e=>{c.push(e.value)}));const d=c[0],p=i.querySelector(".progressbar__item").getAttribute("data-total"),u=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");if(p<=0)return l.elBtnYes[0].style.display="none",u.textContent="There is no data that need to be repaired in the chosen tables",void(u.style.display="block");l.callBackYes=()=>{if(0==confirm("The modified data is impossible to be restored. Please backup your website before doing this."))return;const e=document.querySelector(".lp-modal-body .main-content"),t=e.querySelector(".lp-tool__message");t.textContent="This action is in processing. Don't close this page",t.style.display="block";const s="/lp/v1/admin/tools/clean-tables",o={tables:d,itemtotal:p};l.elBtnNo[0].style.display="none",l.elBtnYes[0].style.display="none";const a={success:t=>{const{status:r,message:i,data:{processed:c,percent:d}}=t,u=e.querySelector(".progressbar__item"),m=u.querySelector(".progressbar__rows"),h=u.querySelector(".progressbar__percent"),g=u.querySelector(".progressbar__value");if(console.log(r),"success"===r)setTimeout((()=>{n(s,o,a)}),2e3),m.textContent=c+" / "+p,h.textContent="( "+d+"% )",g.style.width=d+"%";else if("finished"===r){m.textContent=p+" / "+p,h.textContent="( 100% )";const e=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");e.textContent="Process has been completed. Press click the finish button to close this popup",e.style.color="white",e.style.background="green",g.style.width="100%",l.elBtnNo[0].style.display="inline-block",l.elBtnNo[0].textContent="Finish",l.elBtnNo[0].addEventListener("click",(function(){location.reload()}))}else console.log(i)},error:e=>{console.log(e)},completed:()=>{}};n(s,o,a)}}))})(),t.on("click",".lp-install-sample__install",c).on("click",".lp-install-sample__uninstall",d).on("click","#learn-press-clear-cache",p).on("click",'input[name="enable_hard_cache"]',u).on("click",".lp-install-sample__toggle-options",m)}))}(jQuery)}();
1
+ !function(){"use strict";const e=jQuery;let t=null;const s={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init(){return!!this.instance||(this.elLPOverlay=e(".lp-overlay"),!!this.elLPOverlay.length&&(t=this.elLPOverlay,this.elMainContent=t.find(".main-content"),this.elTitle=t.find(".modal-title"),this.elBtnYes=t.find(".btn-yes"),this.elBtnNo=t.find(".btn-no"),this.elFooter=t.find(".lp-modal-footer"),e(document).on("click",".close, .btn-no",(function(){t.hide()})),e(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof s.callBackYes&&s.callBackYes()})),this.instance=this,!0))},setElCalledModal(e){this.elCalledModal=e},setContentModal(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal(e){this.elTitle.html(e)}};var l=s,n=function(e,t,s){wp.apiFetch({path:e,method:"POST",data:t}).then((e=>{"function"==typeof s.success&&s.success(e)})).catch((e=>{"function"==typeof s.error&&s.error(e)})).then((()=>{"function"==typeof s.completed&&s.completed()}))};const o=jQuery,a=o("#lp-tool-upgrade-db"),r=()=>{let e=0;const t=a.find(".wrapper-terms-upgrade"),s=a.find(".wrapper-lp-status-upgrade"),r=a.find(".wrapper-lp-upgrade-message");let i=null;if(t.length){l.setContentModal(t.html());const e=l.elLPOverlay.find(".terms-upgrade"),a=e.find("input[name=lp-agree-term]"),r=e.find(".error"),c=o("input[name=message-when-upgrading]").val();i=function(){return r.hide(),r.removeClass("learn-press-message"),a.is(":checked")?(n("/lp/v1/database/agree_terms",{agree_terms:1},{}),l.elFooter.find(".learn-press-notice").remove(),l.elFooter.prepend('<span class="learn-press-notice">'+c+"</span>"),l.setContentModal(s.html()),!0):(r.show(),r.addClass("learn-press-message"),l.elMainContent.animate({scrollTop:r.offset().top}),!1)}}else l.setContentModal(s.html()),i=function(){return!0};l.setTitleModal(a.find("h2").html()),l.elBtnYes.text("Upgrade"),l.elBtnYes.show(),l.elBtnNo.text("close"),l.callBackYes=function(){if(!i())return;e=1,l.elBtnYes.hide(),l.elBtnNo.hide();const t="/lp/v1/database/upgrade",s=l.elLPOverlay.find(".lp-group-step"),c=a.find(".lp-item-step"),d=[];o.each(c,(function(e,t){const s=o(t);if(!s.hasClass("completed")){const e=s.find("input").val();d.push(e)}}));const p={steps:d,step:d[0]};let u=null;const m=(e,t)=>{u=s.find("input[value="+e+"]").closest(".lp-item-step"),u.addClass("running"),100===t&&u.removeClass("running").addClass("completed"),u.find(".progress-bar").css("width",t+"%"),u.find(".percent").text(t+"%")};m(d[0],.1);const h={success:o=>{m(p.step,o.percent),p.step!==o.name&&m(o.name,.1),(e=>{if(u=s.find("input[value="+e+"]").closest(".lp-item-step"),!u.length)return;const t=u.offset().top-l.elMainContent.offset().top+l.elMainContent.scrollTop();l.elMainContent.stop().animate({scrollTop:t},600)})(p.step),"success"===o.status?(p.step=o.name,p.data=o.data,setTimeout((()=>{n(t,p,h)}),800)):"finished"===o.status?(e=0,u.removeClass("running").addClass("completed"),setTimeout((()=>{l.setContentModal(r.html())}),1e3),l.elFooter.find(".learn-press-notice").remove(),l.elBtnNo.show(),l.elBtnNo.on("click",(()=>{window.location.reload()}))):(e=0,l.elFooter.find(".learn-press-notice").remove(),u.removeClass("running").addClass("error"),l.setContentModal(r.html(),(function(){l.elBtnYes.text("Retry").show(),l.callBackYes=()=>{window.location.href=lpGlobalSettings.siteurl+"/wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},l.elBtnNo.show(),o.message||(o.message="Upgrade not success! Please clear cache, restart sever then retry or contact to LP to help"),l.elMainContent.find(".learn-press-message").addClass("error").html(o.message)})))},error:t=>{e=0,l.setContentModal(r.html(),(function(){l.elBtnYes.text("Retry").show(),l.callBackYes=()=>{window.location.location="wp-admin/admin.php?page=learn-press-tools&tab=database&action=upgrade-db"},l.elBtnNo.show(),t.message||(t.message="Upgrade not success! Something wrong. Please clear cache, restart sever then retry or contact to LP to help"),l.elMainContent.find(".learn-press-message").addClass("error").html(t.message)}))},completed:()=>{}};n(t,p,h)},window.onbeforeunload=function(){if(e)return"LP is upgrading Database. Are you want to reload page?"},window.onclose=function(){if(e)return"LP is upgrading Database. Are you want to close page?"}};var i=window.wp.element;const{__:__}=wp.i18n,{TextControl:c,Button:d,Spinner:p,CheckboxControl:u,Notice:m}=wp.components,{useState:h,useEffect:g}=wp.element,{addQueryArgs:f}=wp.url;var y=()=>{const[e,t]=h(!1),[s,l]=h(""),[n,o]=h([]),[a,r]=h([]),[y,v]=h([]),[b,C]=h(!1);g((()=>{w(s)}),[s]);const w=async s=>{try{if(!s||e)return v([]),void o([]);if(s.length<3)return v([{status:"error",message:"Please enter at least 3 characters to searching course."}]),void o([]);t(!0);const l=await wp.apiFetch({path:f("lp/v1/admin/tools/reset-data/search-courses",{s:s}),method:"GET"}),{status:n,data:a}=l;t(!1),"success"===n?(o(a),v([])):(v([{status:"error",message:l.message||"LearnPress: Search Course Fail!"}]),o([]))}catch(e){console.log(e.message)}};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h2",null,__("Reset course progress","learnpress")),(0,i.createElement)("div",{className:"description"},(0,i.createElement)("p",null,__("This action will reset progress of a course for all users have enrolled.","learnpress")),(0,i.createElement)("p",null,__("Search results only show course have user data.","learnpress")),(0,i.createElement)("div",null,(0,i.createElement)(c,{placeholder:__("Search course by name","learnpress"),value:s,onChange:e=>l(e),style:{width:300}}))),e&&(0,i.createElement)(p,null),n.length>0&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"lp-reset-course_progress",style:{border:"1px solid #eee"}},(0,i.createElement)("div",null,(0,i.createElement)("div",{style:{background:"#eee"}},(0,i.createElement)("div",null,(0,i.createElement)(u,{checked:a.length===n.length,onChange:()=>{a.length===n.length?r([]):r(n.map((e=>e.id)))},style:{margin:0}})),(0,i.createElement)("div",null,__("ID","learnpress")),(0,i.createElement)("div",null,__("Name","learnpress")),(0,i.createElement)("div",null,__("Students","learnpress")))),(0,i.createElement)("div",{style:{height:"100%",maxHeight:200,overflow:"auto"}},n.map((e=>(0,i.createElement)("div",{style:{borderTop:"1px solid #eee"},key:e.id},(0,i.createElement)("div",null,(0,i.createElement)(u,{checked:a.includes(e.id),onChange:()=>function(e){const t=[...a];if(t.includes(e)){const s=t.indexOf(e);s>-1&&t.splice(s,1)}else t.push(e);r(t)}(e.id)})),(0,i.createElement)("div",null,"#",e.id),(0,i.createElement)("div",null,e.title),(0,i.createElement)("div",null,e.students)))))),b?(0,i.createElement)(p,null):(0,i.createElement)(d,{isPrimary:!0,onClick:()=>(async()=>{if(0===a.length)return void v([{status:"error",message:"Please chooce Course for reset data!"}]);if(!confirm("Are you sure to reset course progress of all users enrolled this course?"))return;const e=[];try{C(!0);for(const t of a){const s=await wp.apiFetch({path:f("lp/v1/admin/tools/reset-data/reset-courses",{courseId:t}),method:"GET"}),{status:l,data:n,message:o}=s;e.push({status:l,message:o||`Course #${t} reset successfully!`})}C(!1)}catch(t){e.push({status:"error",message:t.message||"LearnPress Error: Reset Course Data."})}v(e)})(),style:{marginTop:10,height:30}},__("Reset now","learnpress"))),y.length>0&&y.map(((e,t)=>(0,i.createElement)(m,{status:e.status,key:t,isDismissible:!1},e.message))),(0,i.createElement)("style",null,"\t\t\t\t.lp-reset-course_progress .components-base-control__field {\t\t\t\t\tmargin: 0;\t\t\t\t}\t\t\t\t.components-notice{\t\t\t\t\tmargin-left: 0;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div{\t\t\t\t\tdisplay: grid;\t\t\t\t\tgrid-template-columns: 80px 50px 1fr 80px;\t\t\t\t\talign-items: center;\t\t\t\t}\t\t\t\t.lp-reset-course_progress > div > div > div{\t\t\t\t\tmaegin: 0;\t\t\t\t\tpadding: 8px 10px;\t\t\t\t}\t\t\t\t"))};!function(e){const t=e(document);let s=!1;const c=function(t){t.preventDefault();const l=e(this);s||confirm(lpGlobalSettings.i18n.confirm_install_sample_data)&&(l.addClass("disabled").html(l.data("installing-text")),e(".lp-install-sample__response").remove(),s=!0,e.ajax({url:l.attr("href"),data:e(".lp-install-sample__options").serializeJSON(),success(t){l.removeClass("disabled").html(l.data("text")),s=!1,e(t).insertBefore(l.parent())},error(){l.removeClass("disabled").html(l.data("text")),s=!1,e(response).insertBefore(l.parent())}}))},d=function(t){t.preventDefault();const l=e(this);s||confirm(lpGlobalSettings.i18n.confirm_uninstall_sample_data)&&(l.addClass("disabled").html(l.data("uninstalling-text")),s=!0,e.ajax({url:l.attr("href"),success(t){l.removeClass("disabled").html(l.data("text")),s=!1,e(t).insertBefore(l.parent())},error(){l.removeClass("disabled").html(l.data("text")),s=!1,e(response).insertBefore(l.parent())}}))},p=function(t){t.preventDefault();const s=e(this);s.hasClass("disabled")||(s.addClass("disabled").html(s.data("cleaning-text")),e.ajax({url:s.attr("href"),data:{},success(e){s.removeClass("disabled").html(s.data("text"))},error(){s.removeClass("disabled").html(s.data("text"))}}))},u=function(){e.ajax({url:"admin.php?page=lp-toggle-hard-cache-option",data:{v:this.checked?"yes":"no"},success(e){},error(){}})},m=function(t){t.preventDefault(),e(".lp-install-sample__options").toggleClass("hide-if-js")};e((function(){(()=>{if(!a.length)return;if(!l.init())return;const e=o(".wrapper-lp-status-upgrade"),t=window.location.search,s=new URLSearchParams(t).get("action");"upgrade-db"===s&&(l.elLPOverlay.show(),l.setTitleModal(a.find("h2").html()),l.setContentModal(o(".wrapper-lp-loading").html())),n("/lp/v1/database/get_steps",{},{success:t=>{const{steps_completed:n,steps_default:a}=t;if(void 0===n||void 0===a)return console.log("invalid steps_completed and steps_default"),!1;let i="";for(const t in a){const c=a[t],d=c.steps;i='<div class="lp-group-step">',i+="<h3>"+c.label+"</h3>";for(const e in d){const t=d[e];let s="";void 0!==n[e]&&(s="completed"),i+='<div class="lp-item-step '+s+'">',i+='<div class="lp-item-step-left"><input type="hidden" name="lp_steps_upgrade_db[]" value="'+t.name+'" /></div>',i+='<div class="lp-item-step-right">',i+='<label for=""><strong></strong>'+t.label+"</label>",i+='<div class="description">'+t.description+"</div>",i+='<div class="percent"></div>',i+='<span class="progress-bar"></span>',i+="</div>",i+="</div>"}i+="</div>",e.append(i);const p=o(".lp-btn-upgrade-db");"upgrade-db"===s&&r(),p.on("click",(function(){l.elLPOverlay.show(),r()}))}},error:e=>{},completed:()=>{}})})(),(()=>{const e=document.querySelector("#lp-tool-create-indexes-tables");e&&e.querySelector(".lp-btn-create-indexes").addEventListener("click",(t=>{t.preventDefault();const s=e.querySelector(".wrapper-lp-loading");if(!l.init())return;l.elLPOverlay.show(),l.setContentModal(s.innerHTML),l.setTitleModal(e.querySelector("h2").textContent),l.elBtnYes[0].style.display="inline-block",l.elBtnYes[0].textContent="Run",l.elBtnNo[0].textContent="Close";const o={success:e=>{const{status:t,message:s,data:{tables:o,table:a}}=e,r=document.querySelector(".example-lp-group-step");l.setContentModal(r.innerHTML);const i=l.elLPOverlay[0].querySelector(".lp-group-step "),c=(e,t)=>{const s=i.querySelector("input[value="+e+"]").closest(".lp-item-step");s.classList.add("running"),100===t&&(s.classList.remove("running"),s.classList.add("completed")),s.querySelector(".progress-bar").style.width=t};for(const e in o){const t=l.elLPOverlay[0].querySelector(".lp-item-step").cloneNode(!0),s=t.querySelector("input");t.querySelector("label").textContent=`Table: ${e}`,s.value=e,i.append(t)}l.callBackYes=()=>{const e="/lp/v1/admin/tools/create-indexs",t={tables:o,table:a};l.elBtnNo[0].style.display="none",l.elBtnYes[0].style.display="none",c(a,.1);const s={success:o=>{const{status:a,message:r,data:{table:d,percent:p}}=o;c(t.table,p),void 0!==d&&(t.table!==d&&(c(d,.1),(e=>{const t=i.querySelector("input[value="+e+"]").closest(".lp-item-step").offsetTop-l.elMainContent[0].offsetTop+l.elMainContent[0].scrollTop;l.elMainContent.stop().animate({scrollTop:t},600)})(d)),t.table=d),"success"===a?setTimeout((()=>{n(e,t,s)}),2e3):"finished"===a?(console.log("finished"),l.elBtnNo[0].style.display="inline-block",l.elBtnNo[0].textContent="Finish"):console.log(r)},error:e=>{console.log(e)},completed:()=>{}};n(e,t,s)}},error:e=>{},completed:()=>{}};n("/lp/v1/admin/tools/list-tables-indexs",{},o)}))})(),(()=>{const e=document.querySelector("#lp-tool-re-upgrade-db");if(!e)return;let t="lp/v1/database/check-db-valid-re-upgrade";n(t,{},{success(s){const{data:{can_re_upgrade:l}}=s;if(!l)return;e.style.display="block";const o=e.querySelector(".lp-btn-re-upgrade-db"),a=e.querySelector(".learn-press-message");o.addEventListener("click",(()=>{confirm("Are you want to Re Upgrade!")&&(t="lp/v1/database/del-tb-lp-upgrade-db",n(t,{},{success(e){const{status:t,message:s,data:{url:l}}=e;"success"===t&&void 0!==l&&(window.location.href=l)},error(e){a.classList.add("error"),a.textContent=e.message,a.style.display="block"}}))}))},error(e){}})})(),document.querySelectorAll("#learn-press-reset-course-users").length>0&&wp.element.render((0,i.createElement)(y,null),[...document.querySelectorAll("#learn-press-reset-course-users")][0]),(()=>{const e=document.querySelector("#lp-tool-clean-database");e&&e.querySelector(".lp-btn-clean-db").addEventListener("click",(function(t){t.preventDefault();const s=document.querySelector("#tools-select__id"),o=s.querySelectorAll("ul li input"),a=Array.prototype.slice.call(o).some((e=>e.checked)),r=e.querySelector(".tools-prepare__message");if(0==a)return r.style.display="block",void(r.textContent="You must choose at least one table to take this action");r.style.display="none";const i=e.querySelector(".wrapper-lp-loading");if(!l.init())return;l.elLPOverlay.show(),l.setContentModal(i.innerHTML),l.setTitleModal(e.querySelector("h2").textContent),l.elBtnYes[0].style.display="inline-block",l.elBtnYes[0].textContent="Run",l.elBtnNo[0].textContent="Close";const c=new Array;s.querySelectorAll("ul li input:checked").forEach((e=>{c.push(e.value)}));const d=c[0],p=i.querySelector(".progressbar__item").getAttribute("data-total"),u=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");if(p<=0)return l.elBtnYes[0].style.display="none",u.textContent="There is no data that need to be repaired in the chosen tables",void(u.style.display="block");l.callBackYes=()=>{if(0==confirm("The modified data is impossible to be restored. Please backup your website before doing this."))return;const e=document.querySelector(".lp-modal-body .main-content"),t=e.querySelector(".lp-tool__message");t.textContent="This action is in processing. Don't close this page",t.style.display="block";const s="/lp/v1/admin/tools/clean-tables",o={tables:d,itemtotal:p};l.elBtnNo[0].style.display="none",l.elBtnYes[0].style.display="none";const a={success:t=>{const{status:r,message:i,data:{processed:c,percent:d}}=t,u=e.querySelector(".progressbar__item"),m=u.querySelector(".progressbar__rows"),h=u.querySelector(".progressbar__percent"),g=u.querySelector(".progressbar__value");if(console.log(r),"success"===r)setTimeout((()=>{n(s,o,a)}),2e3),m.textContent=c+" / "+p,h.textContent="( "+d+"% )",g.style.width=d+"%";else if("finished"===r){m.textContent=p+" / "+p,h.textContent="( 100% )";const e=document.querySelector(".lp-modal-body .main-content").querySelector(".lp-tool__message");e.textContent="Process has been completed. Press click the finish button to close this popup",e.style.color="white",e.style.background="green",g.style.width="100%",l.elBtnNo[0].style.display="inline-block",l.elBtnNo[0].textContent="Finish",l.elBtnNo[0].addEventListener("click",(function(){location.reload()}))}else console.log(i)},error:e=>{console.log(e)},completed:()=>{}};n(s,o,a)}}))})(),t.on("click",".lp-install-sample__install",c).on("click",".lp-install-sample__uninstall",d).on("click","#learn-press-clear-cache",p).on("click",'input[name="enable_hard_cache"]',u).on("click",".lp-install-sample__toggle-options",m)}))}(jQuery)}();
assets/js/dist/blocks/index.min.js CHANGED
@@ -1,3 +1,3 @@
1
- !function(){"use strict";var e={d:function(t,r){for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{metadata:function(){return c},name:function(){return d},settings:function(){return u}});var r=window.wp.blocks,a=window.wp.i18n;(0,r.setCategories)([...(0,r.getCategories)().filter((e=>{let{slug:t}=e;return"learnpress"!==t})),{slug:"learnpress",title:(0,a.__)("LearnPress","learnpress")}]);var n=window.wp.element,l=window.wp.blockEditor,s=window.wp.components,o=window.wp.primitives,i=(0,n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(o.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));const p={"single-course":{title:(0,a.__)("LearnPress Single Course Template","learnpress"),placeholder:"single-course"},"archive-course":{title:(0,a.__)("LearnPress Course Archive Template","learnpress"),placeholder:"archive-course"}};var c=JSON.parse('{"apiVersion":2,"name":"learnpress/template","category":"learnpress","attributes":{"template":{"type":"string","default":""}}}');const{name:d}=c,u={title:"LearnPress Template",keywords:["learnpress","template"],description:(0,a.__)("Renders LearnPress PHP templates.","learnpress"),icon:"archive",edit:function(e){var t,r;let{attributes:o}=e;const c=(0,l.useBlockProps)(),d=null!==(t=null===(r=p[o.template])||void 0===r?void 0:r.title)&&void 0!==t?t:o.template;return(0,n.createElement)("div",c,(0,n.createElement)(s.Placeholder,{icon:i,label:d,className:"wp-block-learnpress-template__placeholder"},(0,n.createElement)("div",{className:"wp-block-learnpress-template__placeholder-inner"},(0,a.sprintf)(
2
  /* translators: %s is the template title */
3
- (0,a.__)("This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your course image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.","learnpress"),d))))},save:()=>null};[t].forEach((e=>{if(!e)return;const{metadata:t,settings:a,name:n}=e;(0,r.registerBlockType)(n,{...t,...a})}))}();
1
+ !function(){"use strict";var e={d:function(t,r){for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{metadata:function(){return c},name:function(){return d},settings:function(){return u}});var r=window.wp.blocks,a=window.wp.i18n;(0,r.setCategories)([...(0,r.getCategories)().filter((e=>{let{slug:t}=e;return"learnpress"!==t})),{slug:"learnpress",title:(0,a.__)("LearnPress","learnpress")}]);var n=window.wp.element,s=window.wp.blockEditor,l=window.wp.components,o=window.wp.primitives,i=(0,n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(o.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));const p={"single-course":{title:(0,a.__)("LearnPress Single Course Template","learnpress"),placeholder:"single-course"},"archive-course":{title:(0,a.__)("LearnPress Course Archive Template","learnpress"),placeholder:"archive-course"}};var c=JSON.parse('{"apiVersion":2,"name":"learnpress/template","category":"learnpress","attributes":{"template":{"type":"string","default":""}}}');const{name:d}=c,u={title:"LearnPress Template",keywords:["learnpress","template"],description:(0,a.__)("Renders LearnPress PHP templates.","learnpress"),icon:"archive",edit:function(e){var t,r;let{attributes:o}=e;const c=(0,s.useBlockProps)(),d=null!==(t=null===(r=p[o.template])||void 0===r?void 0:r.title)&&void 0!==t?t:o.template;return(0,n.createElement)("div",c,(0,n.createElement)(l.Placeholder,{icon:i,label:d,className:"wp-block-learnpress-template__placeholder"},(0,n.createElement)("div",{className:"wp-block-learnpress-template__placeholder-inner"},(0,a.sprintf)(
2
  /* translators: %s is the template title */
3
+ (0,a.__)("This is an editor placeholder for the %s. This will be replaced by the template in your store and displayed with your course image(s), title, price, and so on. You can move this placeholder around and add further blocks around it to extend the template.","learnpress"),d))))},save:()=>null};[t].forEach((e=>{if(!e)return;const{metadata:t,settings:a,name:n}=e;(0,r.registerBlockType)(n,{...t,...a})}))}();
assets/js/dist/frontend/courses.js CHANGED
@@ -10,8 +10,8 @@ let skeleton;
10
  let skeletonClone;
11
  let isLoading = false;
12
  let firstLoad = 1;
13
- let elNoLoadAjaxFirst;
14
- let elArchive;
15
 
16
  if (lpGlobalSettings.is_course_archive) {
17
  const queryString = window.location.search;
@@ -39,10 +39,10 @@ const lpArchiveCourse = () => {
39
 
40
  if (!elNoLoadAjaxFirst) {
41
  lpArchiveRequestCourse(filterCourses);
 
 
 
42
  }
43
-
44
- lpArchivePaginationCourse();
45
- lpArchiveSearchCourse();
46
  };
47
 
48
  window.lpArchiveRequestCourse = (args, callBackSuccess) => {
10
  let skeletonClone;
11
  let isLoading = false;
12
  let firstLoad = 1;
13
+ let elNoLoadAjaxFirst = null;
14
+ let elArchive = null;
15
 
16
  if (lpGlobalSettings.is_course_archive) {
17
  const queryString = window.location.search;
39
 
40
  if (!elNoLoadAjaxFirst) {
41
  lpArchiveRequestCourse(filterCourses);
42
+ } else {
43
+ lpArchivePaginationCourse();
44
+ lpArchiveSearchCourse();
45
  }
 
 
 
46
  };
47
 
48
  window.lpArchiveRequestCourse = (args, callBackSuccess) => {
assets/js/dist/frontend/profile.js CHANGED
@@ -1549,8 +1549,8 @@ function (_super) {
1549
  function Cropper() {
1550
  var _this = _super !== null && _super.apply(this, arguments) || this;
1551
 
1552
- _this.imageRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
1553
- _this.videoRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
1554
  _this.containerRef = null;
1555
  _this.styleRef = null;
1556
  _this.containerRect = null;
@@ -1634,13 +1634,13 @@ function (_super) {
1634
  _this.computeSizes = function () {
1635
  var _a, _b, _c, _d, _e, _f;
1636
 
1637
- var mediaRef = _this.imageRef.current || _this.videoRef.current;
1638
 
1639
  if (mediaRef && _this.containerRef) {
1640
  _this.containerRect = _this.containerRef.getBoundingClientRect();
1641
  var containerAspect = _this.containerRect.width / _this.containerRect.height;
1642
- var naturalWidth = ((_a = _this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
1643
- var naturalHeight = ((_c = _this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
1644
  var isMediaScaledDown = mediaRef.offsetWidth < naturalWidth || mediaRef.offsetHeight < naturalHeight;
1645
  var mediaAspect = naturalWidth / naturalHeight; // We do not rely on the offsetWidth/offsetHeight if the media is scaled down
1646
  // as the values they report are rounded. That will result in precision losses
@@ -1677,16 +1677,6 @@ function (_super) {
1677
  height: _this.containerRect.height
1678
  };
1679
  break;
1680
-
1681
- case 'auto-cover':
1682
- renderedMediaSize = naturalWidth > naturalHeight ? {
1683
- width: _this.containerRect.width,
1684
- height: _this.containerRect.width / mediaAspect
1685
- } : {
1686
- width: _this.containerRect.height * mediaAspect,
1687
- height: _this.containerRect.height
1688
- };
1689
- break;
1690
  }
1691
  } else {
1692
  renderedMediaSize = {
@@ -1942,27 +1932,13 @@ function (_super) {
1942
  if (!this.props.disableAutomaticStylesInjection) {
1943
  this.styleRef = document.createElement('style');
1944
  this.styleRef.setAttribute('type', 'text/css');
1945
-
1946
- if (this.props.nonce) {
1947
- this.styleRef.setAttribute('nonce', this.props.nonce);
1948
- }
1949
-
1950
  this.styleRef.innerHTML = css_248z;
1951
  document.head.appendChild(this.styleRef);
1952
  } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called
1953
 
1954
 
1955
- if (this.imageRef.current && this.imageRef.current.complete) {
1956
  this.onMediaLoad();
1957
- } // set image and video refs in the parent if the callbacks exist
1958
-
1959
-
1960
- if (this.props.setImageRef) {
1961
- this.props.setImageRef(this.imageRef);
1962
- }
1963
-
1964
- if (this.props.setVideoRef) {
1965
- this.props.setVideoRef(this.videoRef);
1966
  }
1967
  };
1968
 
@@ -2007,7 +1983,7 @@ function (_super) {
2007
  }
2008
 
2009
  if (prevProps.video !== this.props.video) {
2010
- (_j = this.videoRef.current) === null || _j === void 0 ? void 0 : _j.load();
2011
  }
2012
  };
2013
 
@@ -2088,10 +2064,12 @@ function (_super) {
2088
  className: classNames('reactEasyCrop_Container', containerClassName)
2089
  }, image ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({
2090
  alt: "",
2091
- className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', objectFit === 'auto-cover' && (this.mediaSize.naturalWidth > this.mediaSize.naturalHeight ? 'reactEasyCrop_Cover_Horizontal' : 'reactEasyCrop_Cover_Vertical'), mediaClassName)
2092
  }, mediaProps, {
2093
  src: image,
2094
- ref: this.imageRef,
 
 
2095
  style: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, mediaStyle), {
2096
  transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")"
2097
  }),
@@ -2100,9 +2078,11 @@ function (_super) {
2100
  autoPlay: true,
2101
  loop: true,
2102
  muted: true,
2103
- className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', objectFit === 'auto-cover' && (this.mediaSize.naturalWidth > this.mediaSize.naturalHeight ? 'reactEasyCrop_Cover_Horizontal' : 'reactEasyCrop_Cover_Vertical'), mediaClassName)
2104
  }, mediaProps, {
2105
- ref: this.videoRef,
 
 
2106
  onLoadedMetadata: this.onMediaLoad,
2107
  style: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, mediaStyle), {
2108
  transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")"
1549
  function Cropper() {
1550
  var _this = _super !== null && _super.apply(this, arguments) || this;
1551
 
1552
+ _this.imageRef = null;
1553
+ _this.videoRef = null;
1554
  _this.containerRef = null;
1555
  _this.styleRef = null;
1556
  _this.containerRect = null;
1634
  _this.computeSizes = function () {
1635
  var _a, _b, _c, _d, _e, _f;
1636
 
1637
+ var mediaRef = _this.imageRef || _this.videoRef;
1638
 
1639
  if (mediaRef && _this.containerRef) {
1640
  _this.containerRect = _this.containerRef.getBoundingClientRect();
1641
  var containerAspect = _this.containerRect.width / _this.containerRect.height;
1642
+ var naturalWidth = ((_a = _this.imageRef) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
1643
+ var naturalHeight = ((_c = _this.imageRef) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
1644
  var isMediaScaledDown = mediaRef.offsetWidth < naturalWidth || mediaRef.offsetHeight < naturalHeight;
1645
  var mediaAspect = naturalWidth / naturalHeight; // We do not rely on the offsetWidth/offsetHeight if the media is scaled down
1646
  // as the values they report are rounded. That will result in precision losses
1677
  height: _this.containerRect.height
1678
  };
1679
  break;
 
 
 
 
 
 
 
 
 
 
1680
  }
1681
  } else {
1682
  renderedMediaSize = {
1932
  if (!this.props.disableAutomaticStylesInjection) {
1933
  this.styleRef = document.createElement('style');
1934
  this.styleRef.setAttribute('type', 'text/css');
 
 
 
 
 
1935
  this.styleRef.innerHTML = css_248z;
1936
  document.head.appendChild(this.styleRef);
1937
  } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called
1938
 
1939
 
1940
+ if (this.imageRef && this.imageRef.complete) {
1941
  this.onMediaLoad();
 
 
 
 
 
 
 
 
 
1942
  }
1943
  };
1944
 
1983
  }
1984
 
1985
  if (prevProps.video !== this.props.video) {
1986
+ (_j = this.videoRef) === null || _j === void 0 ? void 0 : _j.load();
1987
  }
1988
  };
1989
 
2064
  className: classNames('reactEasyCrop_Container', containerClassName)
2065
  }, image ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({
2066
  alt: "",
2067
+ className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
2068
  }, mediaProps, {
2069
  src: image,
2070
+ ref: function ref(el) {
2071
+ return _this.imageRef = el;
2072
+ },
2073
  style: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, mediaStyle), {
2074
  transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")"
2075
  }),
2078
  autoPlay: true,
2079
  loop: true,
2080
  muted: true,
2081
+ className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
2082
  }, mediaProps, {
2083
+ ref: function ref(el) {
2084
+ return _this.videoRef = el;
2085
+ },
2086
  onLoadedMetadata: this.onMediaLoad,
2087
  style: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, mediaStyle), {
2088
  transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")"
assets/js/dist/frontend/profile.min.js CHANGED
@@ -1 +1 @@
1
- !function(){var e={796:function(e,t,o){e.exports=o(643)},264:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=o},518:function(e){var t,o,r,n,a,i,s,c,l,p,d,h,u,m,v,g=!1;function f(){if(!g){g=!0;var e=navigator.userAgent,f=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),w=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(h=/\b(iPhone|iP[ao]d)/.exec(e),u=/\b(iP[ao]d)/.exec(e),p=/Android/i.exec(e),m=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),d=!!/Win64/.exec(e),f){(t=f[1]?parseFloat(f[1]):f[5]?parseFloat(f[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(e);i=y?parseFloat(y[1])+4:t,o=f[2]?parseFloat(f[2]):NaN,r=f[3]?parseFloat(f[3]):NaN,(n=f[4]?parseFloat(f[4]):NaN)?(f=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=f&&f[1]?parseFloat(f[1]):NaN):a=NaN}else t=o=r=a=n=NaN;if(w){if(w[1]){var S=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!S||parseFloat(S[1].replace("_","."))}else s=!1;c=!!w[2],l=!!w[3]}else s=c=l=!1}}var w={ie:function(){return f()||t},ieCompatibilityMode:function(){return f()||i>t},ie64:function(){return w.ie()&&d},firefox:function(){return f()||o},opera:function(){return f()||r},webkit:function(){return f()||n},safari:function(){return w.webkit()},chrome:function(){return f()||a},windows:function(){return f()||c},osx:function(){return f()||s},linux:function(){return f()||l},iphone:function(){return f()||h},mobile:function(){return f()||h||u||p||v},nativeApp:function(){return f()||m},android:function(){return f()||p},ipad:function(){return f()||u}};e.exports=w},534:function(e,t,o){"use strict";var r,n=o(264);n.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!n.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,a=o in document;if(!a){var i=document.createElement("div");i.setAttribute(o,"return;"),a="function"==typeof i[o]}return!a&&r&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}},643:function(e,t,o){"use strict";var r=o(518),n=o(534);function a(e){var t=0,o=0,r=0,n=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),r=10*t,n=10*o,"deltaY"in e&&(n=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||n)&&e.deltaMode&&(1==e.deltaMode?(r*=40,n*=40):(r*=800,n*=800)),r&&!t&&(t=r<1?-1:1),n&&!o&&(o=n<1?-1:1),{spinX:t,spinY:o,pixelX:r,pixelY:n}}a.getEventType=function(){return r.firefox()?"DOMMouseScroll":n("wheel")?"wheel":"mousewheel"},e.exports=a}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.url;const r=window.jQuery;var n=window.wp.apiFetch,a=o.n(n),i=window.wp.i18n,s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},s(e,t)},c=function(){return c=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},c.apply(this,arguments)};Object.create,Object.create;var l=window.React,p=o.n(l),d=o(796),h=o.n(d);function u(e,t,o,r,n,a){void 0===a&&(a=0);var i=E(e,t,a),s=i.width,c=i.height,l=Math.min(s,o),p=Math.min(c,r);return l>p*n?{width:p*n,height:p}:{width:l,height:l/n}}function m(e,t,o,r,n){void 0===n&&(n=0);var a=E(t.width,t.height,n),i=a.width,s=a.height;return{x:v(e.x,i,o.width,r),y:v(e.y,s,o.height,r)}}function v(e,t,o,r){var n=t*r/2-o/2;return x(e,-n,n)}function g(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function f(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function w(e,t,o,r,n,a,i){void 0===a&&(a=0),void 0===i&&(i=!0);var s=i?y:S,l=E(t.width,t.height,a),p=E(t.naturalWidth,t.naturalHeight,a),d={x:s(100,((l.width-o.width/n)/2-e.x/n)/l.width*100),y:s(100,((l.height-o.height/n)/2-e.y/n)/l.height*100),width:s(100,o.width/l.width*100/n),height:s(100,o.height/l.height*100/n)},h=Math.round(s(p.width,d.width*p.width/100)),u=Math.round(s(p.height,d.height*p.height/100)),m=p.width>=p.height*r?{width:Math.round(u*r),height:u}:{width:h,height:Math.round(h/r)};return{croppedAreaPercentages:d,croppedAreaPixels:c(c({},m),{x:Math.round(s(p.width-m.width,d.x*p.width/100)),y:Math.round(s(p.height-m.height,d.y*p.height/100))})}}function y(e,t){return Math.min(e,Math.max(0,t))}function S(e,t){return t}function C(e,t,o,r,n,a){var i=E(t.width,t.height,o),s=x(r.width/i.width*(100/e.width),n,a);return{crop:{x:s*i.width/2-r.width/2-i.width*s*(e.x/100),y:s*i.height/2-r.height/2-i.height*s*(e.y/100)},zoom:s}}function _(e,t,o,r,n,a){void 0===o&&(o=0);var i=E(t.naturalWidth,t.naturalHeight,o),s=x(function(e,t,o){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}(e,t,r),n,a),c=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*c,y:((i.height-e.height)/2-e.y)*c},zoom:s}}function b(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function E(e,t,o){var r=o*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function x(e,t,o){return Math.min(Math.max(e,t),o)}function z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var M=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.imageRef=p().createRef(),o.videoRef=p().createRef(),o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.state={cropSize:null,hasWheelJustStarted:!1},o.preventZoomSafari=function(e){return e.preventDefault()},o.cleanEvents=function(){document.removeEventListener("mousemove",o.onMouseMove),document.removeEventListener("mouseup",o.onDragStopped),document.removeEventListener("touchmove",o.onTouchMove),document.removeEventListener("touchend",o.onDragStopped)},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var e=o.computeSizes();e&&(o.emitCropData(),o.setInitialCrop(e)),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(e){if(o.props.initialCroppedAreaPercentages){var t=C(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom),r=t.crop,n=t.zoom;o.props.onCropChange(r),o.props.onZoomChange&&o.props.onZoomChange(n)}else if(o.props.initialCroppedAreaPixels){var a=_(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom);r=a.crop,n=a.zoom,o.props.onCropChange(r),o.props.onZoomChange&&o.props.onZoomChange(n)}},o.computeSizes=function(){var e,t,r,n,a,i,s=o.imageRef.current||o.videoRef.current;if(s&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect();var l=o.containerRect.width/o.containerRect.height,p=(null===(e=o.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=o.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,d=(null===(r=o.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(n=o.videoRef.current)||void 0===n?void 0:n.videoHeight)||0,h=p/d,m=void 0;if(s.offsetWidth<p||s.offsetHeight<d)switch(o.props.objectFit){default:case"contain":m=l>h?{width:o.containerRect.height*h,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/h};break;case"horizontal-cover":m={width:o.containerRect.width,height:o.containerRect.width/h};break;case"vertical-cover":m={width:o.containerRect.height*h,height:o.containerRect.height};break;case"auto-cover":m=p>d?{width:o.containerRect.width,height:o.containerRect.width/h}:{width:o.containerRect.height*h,height:o.containerRect.height}}else m={width:s.offsetWidth,height:s.offsetHeight};o.mediaSize=c(c({},m),{naturalWidth:p,naturalHeight:d});var v=o.props.cropSize?o.props.cropSize:u(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(null===(a=o.state.cropSize)||void 0===a?void 0:a.height)===v.height&&(null===(i=o.state.cropSize)||void 0===i?void 0:i.width)===v.width||o.props.onCropSizeChange&&o.props.onCropSizeChange(v),o.setState({cropSize:v},o.recomputeCropPosition),v}},o.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",o.onMouseMove),document.addEventListener("mouseup",o.onDragStopped),o.onDragStart(t.getMousePoint(e))},o.onMouseMove=function(e){return o.onDrag(t.getMousePoint(e))},o.onTouchStart=function(e){o.props.onTouchRequest&&!o.props.onTouchRequest(e)||(document.addEventListener("touchmove",o.onTouchMove,{passive:!1}),document.addEventListener("touchend",o.onDragStopped),2===e.touches.length?o.onPinchStart(e):1===e.touches.length&&o.onDragStart(t.getTouchPoint(e.touches[0])))},o.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?o.onPinchMove(e):1===e.touches.length&&o.onDrag(t.getTouchPoint(e.touches[0]))},o.onDragStart=function(e){var t,r,n=e.x,a=e.y;o.dragStartPosition={x:n,y:a},o.dragStartCrop=c({},o.props.crop),null===(r=(t=o.props).onInteractionStart)||void 0===r||r.call(t)},o.onDrag=function(e){var t=e.x,r=e.y;o.rafDragTimeout&&window.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=window.requestAnimationFrame((function(){if(o.state.cropSize&&void 0!==t&&void 0!==r){var e=t-o.dragStartPosition.x,n=r-o.dragStartPosition.y,a={x:o.dragStartCrop.x+e,y:o.dragStartCrop.y+n},i=o.props.restrictPosition?m(a,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):a;o.props.onCropChange(i)}}))},o.onDragStopped=function(){var e,t;o.cleanEvents(),o.emitCropData(),null===(t=(e=o.props).onInteractionEnd)||void 0===t||t.call(e)},o.onWheel=function(e){if(!o.props.onWheelRequest||o.props.onWheelRequest(e)){e.preventDefault();var r=t.getMousePoint(e),n=h()(e).pixelY,a=o.props.zoom-n*o.props.zoomSpeed/200;o.setNewZoom(a,r),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=o.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=window.setTimeout((function(){return o.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=o.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},o.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(t-o.containerRect.left),y:o.containerRect.height/2-(r-o.containerRect.top)}},o.getPointOnMedia=function(e){var t=e.x,r=e.y,n=o.props,a=n.crop,i=n.zoom;return{x:(t+a.x)/i,y:(r+a.y)/i}},o.setNewZoom=function(e,t){if(o.state.cropSize&&o.props.onZoomChange){var r=o.getPointOnContainer(t),n=o.getPointOnMedia(r),a=x(e,o.props.minZoom,o.props.maxZoom),i={x:n.x*a-r.x,y:n.y*a-r.y},s=o.props.restrictPosition?m(i,o.mediaSize,o.state.cropSize,a,o.props.rotation):i;o.props.onCropChange(s),o.props.onZoomChange(a)}},o.getCropData=function(){return o.state.cropSize?w(o.props.restrictPosition?m(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition):null},o.emitCropData=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(t,r),o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.emitCropAreaChange=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var e=o.props.restrictPosition?m(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;o.props.onCropChange(e),o.emitCropData()}},o}return function(e,t){function __(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,o,r,n,a,i,s,c,l;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.width)?this.computeSizes():(null===(a=e.crop)||void 0===a?void 0:a.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(c=this.props.crop)||void 0===c?void 0:c.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(l=this.videoRef.current)||void 0===l||l.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,o=e.aspect;return t?t.width/t.height:o},t.prototype.onPinchStart=function(e){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=g(o,r),this.lastPinchRotation=f(o,r),this.onDragStart(b(o,r))},t.prototype.onPinchMove=function(e){var o=this,r=t.getTouchPoint(e.touches[0]),n=t.getTouchPoint(e.touches[1]),a=b(r,n);this.onDrag(a),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=g(r,n),t=o.props.zoom*(e/o.lastPinchDistance);o.setNewZoom(t,a),o.lastPinchDistance=e;var i=f(r,n),s=o.props.rotation+(i-o.lastPinchRotation);o.props.onRotationChange&&o.props.onRotationChange(s),o.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,o=t.image,r=t.video,n=t.mediaProps,a=t.transform,i=t.crop,s=i.x,l=i.y,d=t.rotation,h=t.zoom,u=t.cropShape,m=t.showGrid,v=t.style,g=v.containerStyle,f=v.cropAreaStyle,w=v.mediaStyle,y=t.classes,S=y.containerClassName,C=y.cropAreaClassName,_=y.mediaClassName,b=t.objectFit;return p().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:z("reactEasyCrop_Container",S)},o?p().createElement("img",c({alt:"",className:z("reactEasyCrop_Image","contain"===b&&"reactEasyCrop_Contain","horizontal-cover"===b&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===b&&"reactEasyCrop_Cover_Vertical","auto-cover"===b&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},n,{src:o,ref:this.imageRef,style:c(c({},w),{transform:a||"translate("+s+"px, "+l+"px) rotate("+d+"deg) scale("+h+")"}),onLoad:this.onMediaLoad})):r&&p().createElement("video",c({autoPlay:!0,loop:!0,muted:!0,className:z("reactEasyCrop_Video","contain"===b&&"reactEasyCrop_Contain","horizontal-cover"===b&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===b&&"reactEasyCrop_Cover_Vertical","auto-cover"===b&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},n,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:c(c({},w),{transform:a||"translate("+s+"px, "+l+"px) rotate("+d+"deg) scale("+h+")"}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return p().createElement("source",c({key:e.src},e))}))),this.state.cropSize&&p().createElement("div",{style:c(c({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:z("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",C)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(p().Component),R=M;const P=e=>new Promise(((t,o)=>{const r=new Image;r.addEventListener("load",(()=>t(r))),r.addEventListener("error",(e=>o(e))),r.setAttribute("crossOrigin","anonymous"),r.src=e}));function A(e){return e*Math.PI/180}function L(e,t,o){const r=A(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}document.addEventListener("DOMContentLoaded",(function(e){(()=>{const e=document.querySelectorAll(".learn-press-course-tab__filter__content"),o=function(e,o){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];wp.apiFetch({path:(0,t.addQueryArgs)("lp/v1/profile/course-tab",o),method:"GET"}).then((t=>{const i=e.querySelector(".lp-skeleton-animation");if(i&&i.remove(),"success"===t.status&&t.data?n?e.innerHTML+=t.data:e.innerHTML=t.data:n?e.innerHTML+=`<div class="lp-ajax-message" style="display:block">${t.message&&t.message}</div>`:e.innerHTML=`<div class="lp-ajax-message" style="display:block">${t.message&&t.message}</div>`,a){a.classList.remove("loading");const e=a.dataset.paged;a.dataset.number<=e&&a.remove(),a.dataset.paged=parseInt(e)+1}r(e,o)})).catch((t=>{if(n?e.innerHTML+=`<div class="lp-ajax-message error" style="display:block">${t.message&&t.message}</div>`:e.innerHTML=`<div class="lp-ajax-message error" style="display:block">${t.message&&t.message}</div>`,a){a.classList.remove("loading");const e=a.dataset.paged;a.dataset.number<=e&&a.remove(),a.dataset.paged=parseInt(e)+1}}))};if("IntersectionObserver"in window){const t=new IntersectionObserver(((e,r)=>{e.forEach((e=>{if(e.isIntersecting){const r=e.target,n=r.parentNode.querySelector(".lp_profile_tab_input_param"),a={...JSON.parse(n.value),status:r.dataset.tab||""};o(r,a),t.unobserve(r)}}))}));[...e].map((e=>{if("all"!==e.dataset.tab)t.observe(e);else{const t=e.parentNode.querySelector(".lp_profile_tab_input_param"),r={...JSON.parse(t.value),status:"all"===e.dataset.tab?"":e.dataset.tab||""};o(e,r)}}))}document.querySelectorAll(".learn-press-course-tab-filters").forEach((e=>{const t=e.querySelectorAll(".learn-press-filters a");t.forEach((o=>{o.addEventListener("click",(r=>{r.preventDefault();const n=o.dataset.tab;[...t].map((e=>{e.classList.remove("active")})),o.classList.add("active"),[...e.querySelectorAll(".learn-press-course-tab__filter__content")].map((e=>{e.style.display="none",e.dataset.tab===n&&(e.style.display="")}))}))}))})),document.querySelectorAll(".learn-press-profile-course__tab__inner").forEach((e=>{const t=e.querySelectorAll("li> a");t.forEach((e=>{e.addEventListener("click",(o=>{o.preventDefault();const r=e.dataset.tab;[...t].map((e=>{e.classList.remove("active")})),e.classList.add("active"),[...document.querySelectorAll(".learn-press-course-tab-filters")].map((e=>{e.style.display="none",e.dataset.tab===r&&(e.style.display="")}))}))}))}));const r=(e,t)=>{const r=e.querySelector("button[data-paged]");r&&r.addEventListener("click",(n=>{n.preventDefault();const a=r&&r.dataset.paged;r.classList.add("loading");const i="list"===t.layout?".lp_profile_course_progress":".learn-press-courses";o(e.querySelector(i),{...t,paged:a},!0,r)}))}})(),(()=>{const e=document.querySelector(".learn-press-profile-course__statistic");if(!e)return;const o=document.querySelector('[name="args_query_user_courses_statistic"]');if(!o)return;const r=JSON.parse(o.value);var n,a;n=e,a=r,wp.apiFetch({path:(0,t.addQueryArgs)("lp/v1/profile/statistic",a),method:"GET"}).then((e=>{"success"===e.status&&e.data?n.innerHTML=e.data:n.innerHTML=`<div class="lp-ajax-message error" style="display:block">${e.message&&e.message}</div>`})).catch((e=>{console.log(e)}))})(),function(){const e=r(".order-recover"),t=e.find(".button-recover-order");t.on("click",(()=>{e.find(".learn-press-message").remove(),r(".profile-recover-order").find(".learn-press-message").remove(),r.post({url:"",data:e.serializeJSON(),beforeSend(){t.addClass("loading").attr("disabled","disabled")},success(o){if((o=LP.parseJSON(o)).message){const t=r('<div class="learn-press-message icon"><i class="fa"></i> '+o.message+"</div>");"error"==o.result&&t.addClass("error"),e.before(t)}o.redirect&&(window.location.href=o.redirect),t.removeClass("loading").removeAttr("disabled","")},error(){t.removeClass("loading").removeAttr("disabled","")}})}))}()})),document.getElementById("learnpress-avatar-upload")&&wp.element.render((0,e.createElement)((function(){const[t,o]=(0,e.useState)(),[r,n]=(0,e.useState)(0),[s,c]=(0,e.useState)(0),[l,p]=(0,e.useState)({x:0,y:0}),[d,h]=(0,e.useState)(0),[u,m]=(0,e.useState)(null),[v,g]=(0,e.useState)(0),[f,w]=(0,e.useState)(0),[y,S]=(0,e.useState)(!1),[C,_]=(0,e.useState)(!0),[b,E]=(0,e.useState)(""),[x,z]=(0,e.useState)({type:"",message:""}),M=(0,e.useRef)();(0,e.useEffect)((()=>{!async function(){_(!0);try{var e,t,r;const i=await a()({method:"GET",path:"lp/v1/profile/get-avatar"});n(null!=i&&null!==(e=i.data)&&void 0!==e&&e.width?parseInt(i.data.width):0),c(null!=i&&null!==(t=i.data)&&void 0!==t&&t.height?parseInt(i.data.height):0),o(null!=i&&null!==(r=i.data)&&void 0!==r&&r.url?i.data.url:"")}catch(e){z({type:"error",message:e.message})}_(!1)}()}),[]);const D=(0,e.useCallback)(((e,t)=>{m(t)}),[]),T=(0,e.useCallback)((async()=>{S({save:!0});try{const e=await async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{horizontal:!1,vertical:!1};const n=await P(e),a=document.createElement("canvas"),i=a.getContext("2d");if(!i)return null;const s=A(o),{width:c,height:l}=L(n.width,n.height,o);a.width=c,a.height=l,i.translate(c/2,l/2),i.rotate(s),i.scale(r.horizontal?-1:1,r.vertical?-1:1),i.translate(-n.width/2,-n.height/2),i.drawImage(n,0,0);const p=i.getImageData(t.x,t.y,t.width,t.height);return a.width=t.width,a.height=t.height,i.putImageData(p,0,0),a.toDataURL("image/jpeg")}(t,u,d),o=await((e,t,o)=>new Promise(((r,n)=>{const a=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.setAttribute("crossOrigin","anonymous"),i.onload=()=>{(i.naturalWidth>t||i.naturalHeight>o)&&(a.width=t,a.height=o,a.getContext("2d").drawImage(i,0,0,t,o),r(a.toDataURL("image/jpeg"))),r(e)},i.onerror=e=>n(e)})))(e,r,s),n=await a()({path:"lp/v1/profile/upload-avatar",method:"POST",data:{file:o||""}}),{data:i,status:c,message:l}=await n;"success"===c&&window.location.reload(),z({type:c,message:l})}catch(e){z({type:"error",message:e.message||""})}S({save:!1})}),[u,d]);return(0,e.createElement)("div",{className:"learnpress_avatar"},C?(0,e.createElement)("ul",{className:"lp-skeleton-animation"},(0,e.createElement)("li",{style:{width:200,height:200}}),(0,e.createElement)("li",{style:{width:200,height:20}}),(0,e.createElement)("li",{style:{width:200,height:20}})):(0,e.createElement)(e.Fragment,null,t&&!b&&(0,e.createElement)(e.Fragment,null,f&&v?(0,e.createElement)("div",{className:"learnpress_avatar__cropper"},(0,e.createElement)("div",{style:{position:"relative",width:v,height:f,zIndex:9999,maxWidth:"100%",maxHeight:"800px"}},(0,e.createElement)(R,{image:t,crop:l,zoom:"1",cropSize:{width:r,height:s},onCropChange:p,onCropComplete:D})),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--save "+(null!=y&&y.save?"learnpress_avatar__button--loading":""),onClick:T},(0,i.__)("Save","learnpress")))):(0,e.createElement)("div",{className:"learnpress_avatar__cropper"},(0,e.createElement)("img",{src:t,alt:""}),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--replace",onClick:()=>M.current&&M.current.click()},(0,i.__)("Replace","learnpress")),(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--remove "+(null!=y&&y.remove?"learnpress_avatar__button--loading":""),onClick:async function(){if(confirm((0,i.__)("Are you sure you want to remove your avatar?","learnpress"))){S({remove:!0});try{const e=await a()({path:"lp/v1/profile/remove-avatar",method:"POST"}),{data:t,status:r,message:n}=await e;z({type:r,message:n}),o("")}catch(e){z({type:"error",message:e.message||""})}S({remove:!1})}}},(0,i.__)("Remove","learnpress"))))),(0,e.createElement)("form",{style:{display:t?"none":""}},(0,e.createElement)("div",{className:"learnpress_avatar__form"},(0,e.createElement)("div",{className:"learnpress_avatar__form-group"},(0,e.createElement)("label",{htmlFor:"avatar-file"},(0,e.createElement)("div",{className:"learnpress_avatar__form__upload"},(0,e.createElement)("div",null,(0,e.createElement)("span",null,(0,e.createElement)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"plus",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},(0,e.createElement)("defs",null,(0,e.createElement)("style",null)),(0,e.createElement)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,e.createElement)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}))),(0,e.createElement)("div",null,(0,i.__)("Upload","learnpress")))),(0,e.createElement)("input",{ref:M,type:"file",id:"avatar-file",accept:"image/*",onChange:e=>(async e=>{const t=await function(e){return new Promise((t=>{const o=new FileReader;o.addEventListener("load",(()=>t(o.result)),!1),o.readAsDataURL(e)}))}(e),n=new Image;n.src=await t,n.onload=await(function(){g(n.naturalWidth),w(n.naturalHeight);let a="";parseInt(e.size)>2097152?a=(0,i.__)("File size too large. You need to upload a file < 2MB","learnpress"):(n.naturalWidth<r||n.naturalHeight<s)&&(a=(0,i.sprintf)((0,i.__)("Image size must be greater than or equal to %1$sx%2$spx","learnpress"),r,s)),a?E(a):(E(""),o(t))})})(e.target.files&&e.target.files.length>0?e.target.files[0]:"")}))))),b&&(0,e.createElement)("div",{className:"lp-ajax-message error",style:{display:"block"}},b),!b&&x&&x.type&&x.message&&(0,e.createElement)("div",{className:`lp-ajax-message ${x.type}`,style:{display:"block"}},x.message)))}),null),document.getElementById("learnpress-avatar-upload"))}()}();
1
+ !function(){var e={796:function(e,t,o){e.exports=o(643)},264:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=o},518:function(e){var t,o,r,n,a,i,s,c,l,p,d,h,u,m,v,g=!1;function f(){if(!g){g=!0;var e=navigator.userAgent,f=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),w=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(h=/\b(iPhone|iP[ao]d)/.exec(e),u=/\b(iP[ao]d)/.exec(e),p=/Android/i.exec(e),m=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),d=!!/Win64/.exec(e),f){(t=f[1]?parseFloat(f[1]):f[5]?parseFloat(f[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(e);i=y?parseFloat(y[1])+4:t,o=f[2]?parseFloat(f[2]):NaN,r=f[3]?parseFloat(f[3]):NaN,(n=f[4]?parseFloat(f[4]):NaN)?(f=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=f&&f[1]?parseFloat(f[1]):NaN):a=NaN}else t=o=r=a=n=NaN;if(w){if(w[1]){var S=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!S||parseFloat(S[1].replace("_","."))}else s=!1;c=!!w[2],l=!!w[3]}else s=c=l=!1}}var w={ie:function(){return f()||t},ieCompatibilityMode:function(){return f()||i>t},ie64:function(){return w.ie()&&d},firefox:function(){return f()||o},opera:function(){return f()||r},webkit:function(){return f()||n},safari:function(){return w.webkit()},chrome:function(){return f()||a},windows:function(){return f()||c},osx:function(){return f()||s},linux:function(){return f()||l},iphone:function(){return f()||h},mobile:function(){return f()||h||u||p||v},nativeApp:function(){return f()||m},android:function(){return f()||p},ipad:function(){return f()||u}};e.exports=w},534:function(e,t,o){"use strict";var r,n=o(264);n.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!n.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,a=o in document;if(!a){var i=document.createElement("div");i.setAttribute(o,"return;"),a="function"==typeof i[o]}return!a&&r&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}},643:function(e,t,o){"use strict";var r=o(518),n=o(534);function a(e){var t=0,o=0,r=0,n=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),r=10*t,n=10*o,"deltaY"in e&&(n=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||n)&&e.deltaMode&&(1==e.deltaMode?(r*=40,n*=40):(r*=800,n*=800)),r&&!t&&(t=r<1?-1:1),n&&!o&&(o=n<1?-1:1),{spinX:t,spinY:o,pixelX:r,pixelY:n}}a.getEventType=function(){return r.firefox()?"DOMMouseScroll":n("wheel")?"wheel":"mousewheel"},e.exports=a}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.url;const r=window.jQuery;var n=window.wp.apiFetch,a=o.n(n),i=window.wp.i18n,s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},s(e,t)},c=function(){return c=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},c.apply(this,arguments)};Object.create,Object.create;var l=window.React,p=o.n(l),d=o(796),h=o.n(d);function u(e,t,o,r,n,a){void 0===a&&(a=0);var i=E(e,t,a),s=i.width,c=i.height,l=Math.min(s,o),p=Math.min(c,r);return l>p*n?{width:p*n,height:p}:{width:l,height:l/n}}function m(e,t,o,r,n){void 0===n&&(n=0);var a=E(t.width,t.height,n),i=a.width,s=a.height;return{x:v(e.x,i,o.width,r),y:v(e.y,s,o.height,r)}}function v(e,t,o,r){var n=t*r/2-o/2;return x(e,-n,n)}function g(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function f(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function w(e,t,o,r,n,a,i){void 0===a&&(a=0),void 0===i&&(i=!0);var s=i?y:S,l=E(t.width,t.height,a),p=E(t.naturalWidth,t.naturalHeight,a),d={x:s(100,((l.width-o.width/n)/2-e.x/n)/l.width*100),y:s(100,((l.height-o.height/n)/2-e.y/n)/l.height*100),width:s(100,o.width/l.width*100/n),height:s(100,o.height/l.height*100/n)},h=Math.round(s(p.width,d.width*p.width/100)),u=Math.round(s(p.height,d.height*p.height/100)),m=p.width>=p.height*r?{width:Math.round(u*r),height:u}:{width:h,height:Math.round(h/r)};return{croppedAreaPercentages:d,croppedAreaPixels:c(c({},m),{x:Math.round(s(p.width-m.width,d.x*p.width/100)),y:Math.round(s(p.height-m.height,d.y*p.height/100))})}}function y(e,t){return Math.min(e,Math.max(0,t))}function S(e,t){return t}function C(e,t,o,r,n,a){var i=E(t.width,t.height,o),s=x(r.width/i.width*(100/e.width),n,a);return{crop:{x:s*i.width/2-r.width/2-i.width*s*(e.x/100),y:s*i.height/2-r.height/2-i.height*s*(e.y/100)},zoom:s}}function b(e,t,o,r,n,a){void 0===o&&(o=0);var i=E(t.naturalWidth,t.naturalHeight,o),s=x(function(e,t,o){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}(e,t,r),n,a),c=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*c,y:((i.height-e.height)/2-e.y)*c},zoom:s}}function _(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function E(e,t,o){var r=o*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function x(e,t,o){return Math.min(Math.max(e,t),o)}function M(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var z=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.imageRef=null,o.videoRef=null,o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.state={cropSize:null,hasWheelJustStarted:!1},o.preventZoomSafari=function(e){return e.preventDefault()},o.cleanEvents=function(){document.removeEventListener("mousemove",o.onMouseMove),document.removeEventListener("mouseup",o.onDragStopped),document.removeEventListener("touchmove",o.onTouchMove),document.removeEventListener("touchend",o.onDragStopped)},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var e=o.computeSizes();e&&(o.emitCropData(),o.setInitialCrop(e)),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(e){if(o.props.initialCroppedAreaPercentages){var t=C(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom),r=t.crop,n=t.zoom;o.props.onCropChange(r),o.props.onZoomChange&&o.props.onZoomChange(n)}else if(o.props.initialCroppedAreaPixels){var a=b(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom);r=a.crop,n=a.zoom,o.props.onCropChange(r),o.props.onZoomChange&&o.props.onZoomChange(n)}},o.computeSizes=function(){var e,t,r,n,a,i,s=o.imageRef||o.videoRef;if(s&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect();var l=o.containerRect.width/o.containerRect.height,p=(null===(e=o.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=o.videoRef)||void 0===t?void 0:t.videoWidth)||0,d=(null===(r=o.imageRef)||void 0===r?void 0:r.naturalHeight)||(null===(n=o.videoRef)||void 0===n?void 0:n.videoHeight)||0,h=p/d,m=void 0;if(s.offsetWidth<p||s.offsetHeight<d)switch(o.props.objectFit){default:case"contain":m=l>h?{width:o.containerRect.height*h,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/h};break;case"horizontal-cover":m={width:o.containerRect.width,height:o.containerRect.width/h};break;case"vertical-cover":m={width:o.containerRect.height*h,height:o.containerRect.height}}else m={width:s.offsetWidth,height:s.offsetHeight};o.mediaSize=c(c({},m),{naturalWidth:p,naturalHeight:d});var v=o.props.cropSize?o.props.cropSize:u(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(null===(a=o.state.cropSize)||void 0===a?void 0:a.height)===v.height&&(null===(i=o.state.cropSize)||void 0===i?void 0:i.width)===v.width||o.props.onCropSizeChange&&o.props.onCropSizeChange(v),o.setState({cropSize:v},o.recomputeCropPosition),v}},o.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",o.onMouseMove),document.addEventListener("mouseup",o.onDragStopped),o.onDragStart(t.getMousePoint(e))},o.onMouseMove=function(e){return o.onDrag(t.getMousePoint(e))},o.onTouchStart=function(e){o.props.onTouchRequest&&!o.props.onTouchRequest(e)||(document.addEventListener("touchmove",o.onTouchMove,{passive:!1}),document.addEventListener("touchend",o.onDragStopped),2===e.touches.length?o.onPinchStart(e):1===e.touches.length&&o.onDragStart(t.getTouchPoint(e.touches[0])))},o.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?o.onPinchMove(e):1===e.touches.length&&o.onDrag(t.getTouchPoint(e.touches[0]))},o.onDragStart=function(e){var t,r,n=e.x,a=e.y;o.dragStartPosition={x:n,y:a},o.dragStartCrop=c({},o.props.crop),null===(r=(t=o.props).onInteractionStart)||void 0===r||r.call(t)},o.onDrag=function(e){var t=e.x,r=e.y;o.rafDragTimeout&&window.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=window.requestAnimationFrame((function(){if(o.state.cropSize&&void 0!==t&&void 0!==r){var e=t-o.dragStartPosition.x,n=r-o.dragStartPosition.y,a={x:o.dragStartCrop.x+e,y:o.dragStartCrop.y+n},i=o.props.restrictPosition?m(a,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):a;o.props.onCropChange(i)}}))},o.onDragStopped=function(){var e,t;o.cleanEvents(),o.emitCropData(),null===(t=(e=o.props).onInteractionEnd)||void 0===t||t.call(e)},o.onWheel=function(e){if(!o.props.onWheelRequest||o.props.onWheelRequest(e)){e.preventDefault();var r=t.getMousePoint(e),n=h()(e).pixelY,a=o.props.zoom-n*o.props.zoomSpeed/200;o.setNewZoom(a,r),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=o.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=window.setTimeout((function(){return o.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=o.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},o.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(t-o.containerRect.left),y:o.containerRect.height/2-(r-o.containerRect.top)}},o.getPointOnMedia=function(e){var t=e.x,r=e.y,n=o.props,a=n.crop,i=n.zoom;return{x:(t+a.x)/i,y:(r+a.y)/i}},o.setNewZoom=function(e,t){if(o.state.cropSize&&o.props.onZoomChange){var r=o.getPointOnContainer(t),n=o.getPointOnMedia(r),a=x(e,o.props.minZoom,o.props.maxZoom),i={x:n.x*a-r.x,y:n.y*a-r.y},s=o.props.restrictPosition?m(i,o.mediaSize,o.state.cropSize,a,o.props.rotation):i;o.props.onCropChange(s),o.props.onZoomChange(a)}},o.getCropData=function(){return o.state.cropSize?w(o.props.restrictPosition?m(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition):null},o.emitCropData=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(t,r),o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.emitCropAreaChange=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var e=o.props.restrictPosition?m(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;o.props.onCropChange(e),o.emitCropData()}},o}return function(e,t){function __(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,o,r,n,a,i,s,c,l;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.width)?this.computeSizes():(null===(a=e.crop)||void 0===a?void 0:a.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(c=this.props.crop)||void 0===c?void 0:c.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(l=this.videoRef)||void 0===l||l.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,o=e.aspect;return t?t.width/t.height:o},t.prototype.onPinchStart=function(e){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=g(o,r),this.lastPinchRotation=f(o,r),this.onDragStart(_(o,r))},t.prototype.onPinchMove=function(e){var o=this,r=t.getTouchPoint(e.touches[0]),n=t.getTouchPoint(e.touches[1]),a=_(r,n);this.onDrag(a),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=g(r,n),t=o.props.zoom*(e/o.lastPinchDistance);o.setNewZoom(t,a),o.lastPinchDistance=e;var i=f(r,n),s=o.props.rotation+(i-o.lastPinchRotation);o.props.onRotationChange&&o.props.onRotationChange(s),o.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,o=t.image,r=t.video,n=t.mediaProps,a=t.transform,i=t.crop,s=i.x,l=i.y,d=t.rotation,h=t.zoom,u=t.cropShape,m=t.showGrid,v=t.style,g=v.containerStyle,f=v.cropAreaStyle,w=v.mediaStyle,y=t.classes,S=y.containerClassName,C=y.cropAreaClassName,b=y.mediaClassName,_=t.objectFit;return p().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:M("reactEasyCrop_Container",S)},o?p().createElement("img",c({alt:"",className:M("reactEasyCrop_Image","contain"===_&&"reactEasyCrop_Contain","horizontal-cover"===_&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===_&&"reactEasyCrop_Cover_Vertical",b)},n,{src:o,ref:function(t){return e.imageRef=t},style:c(c({},w),{transform:a||"translate("+s+"px, "+l+"px) rotate("+d+"deg) scale("+h+")"}),onLoad:this.onMediaLoad})):r&&p().createElement("video",c({autoPlay:!0,loop:!0,muted:!0,className:M("reactEasyCrop_Video","contain"===_&&"reactEasyCrop_Contain","horizontal-cover"===_&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===_&&"reactEasyCrop_Cover_Vertical",b)},n,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:c(c({},w),{transform:a||"translate("+s+"px, "+l+"px) rotate("+d+"deg) scale("+h+")"}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return p().createElement("source",c({key:e.src},e))}))),this.state.cropSize&&p().createElement("div",{style:c(c({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:M("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",C)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(p().Component),P=z;const R=e=>new Promise(((t,o)=>{const r=new Image;r.addEventListener("load",(()=>t(r))),r.addEventListener("error",(e=>o(e))),r.setAttribute("crossOrigin","anonymous"),r.src=e}));function A(e){return e*Math.PI/180}function L(e,t,o){const r=A(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}document.addEventListener("DOMContentLoaded",(function(e){(()=>{const e=document.querySelectorAll(".learn-press-course-tab__filter__content"),o=function(e,o){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];wp.apiFetch({path:(0,t.addQueryArgs)("lp/v1/profile/course-tab",o),method:"GET"}).then((t=>{const i=e.querySelector(".lp-skeleton-animation");if(i&&i.remove(),"success"===t.status&&t.data?n?e.innerHTML+=t.data:e.innerHTML=t.data:n?e.innerHTML+=`<div class="lp-ajax-message" style="display:block">${t.message&&t.message}</div>`:e.innerHTML=`<div class="lp-ajax-message" style="display:block">${t.message&&t.message}</div>`,a){a.classList.remove("loading");const e=a.dataset.paged;a.dataset.number<=e&&a.remove(),a.dataset.paged=parseInt(e)+1}r(e,o)})).catch((t=>{if(n?e.innerHTML+=`<div class="lp-ajax-message error" style="display:block">${t.message&&t.message}</div>`:e.innerHTML=`<div class="lp-ajax-message error" style="display:block">${t.message&&t.message}</div>`,a){a.classList.remove("loading");const e=a.dataset.paged;a.dataset.number<=e&&a.remove(),a.dataset.paged=parseInt(e)+1}}))};if("IntersectionObserver"in window){const t=new IntersectionObserver(((e,r)=>{e.forEach((e=>{if(e.isIntersecting){const r=e.target,n=r.parentNode.querySelector(".lp_profile_tab_input_param"),a={...JSON.parse(n.value),status:r.dataset.tab||""};o(r,a),t.unobserve(r)}}))}));[...e].map((e=>{if("all"!==e.dataset.tab)t.observe(e);else{const t=e.parentNode.querySelector(".lp_profile_tab_input_param"),r={...JSON.parse(t.value),status:"all"===e.dataset.tab?"":e.dataset.tab||""};o(e,r)}}))}document.querySelectorAll(".learn-press-course-tab-filters").forEach((e=>{const t=e.querySelectorAll(".learn-press-filters a");t.forEach((o=>{o.addEventListener("click",(r=>{r.preventDefault();const n=o.dataset.tab;[...t].map((e=>{e.classList.remove("active")})),o.classList.add("active"),[...e.querySelectorAll(".learn-press-course-tab__filter__content")].map((e=>{e.style.display="none",e.dataset.tab===n&&(e.style.display="")}))}))}))})),document.querySelectorAll(".learn-press-profile-course__tab__inner").forEach((e=>{const t=e.querySelectorAll("li> a");t.forEach((e=>{e.addEventListener("click",(o=>{o.preventDefault();const r=e.dataset.tab;[...t].map((e=>{e.classList.remove("active")})),e.classList.add("active"),[...document.querySelectorAll(".learn-press-course-tab-filters")].map((e=>{e.style.display="none",e.dataset.tab===r&&(e.style.display="")}))}))}))}));const r=(e,t)=>{const r=e.querySelector("button[data-paged]");r&&r.addEventListener("click",(n=>{n.preventDefault();const a=r&&r.dataset.paged;r.classList.add("loading");const i="list"===t.layout?".lp_profile_course_progress":".learn-press-courses";o(e.querySelector(i),{...t,paged:a},!0,r)}))}})(),(()=>{const e=document.querySelector(".learn-press-profile-course__statistic");if(!e)return;const o=document.querySelector('[name="args_query_user_courses_statistic"]');if(!o)return;const r=JSON.parse(o.value);var n,a;n=e,a=r,wp.apiFetch({path:(0,t.addQueryArgs)("lp/v1/profile/statistic",a),method:"GET"}).then((e=>{"success"===e.status&&e.data?n.innerHTML=e.data:n.innerHTML=`<div class="lp-ajax-message error" style="display:block">${e.message&&e.message}</div>`})).catch((e=>{console.log(e)}))})(),function(){const e=r(".order-recover"),t=e.find(".button-recover-order");t.on("click",(()=>{e.find(".learn-press-message").remove(),r(".profile-recover-order").find(".learn-press-message").remove(),r.post({url:"",data:e.serializeJSON(),beforeSend(){t.addClass("loading").attr("disabled","disabled")},success(o){if((o=LP.parseJSON(o)).message){const t=r('<div class="learn-press-message icon"><i class="fa"></i> '+o.message+"</div>");"error"==o.result&&t.addClass("error"),e.before(t)}o.redirect&&(window.location.href=o.redirect),t.removeClass("loading").removeAttr("disabled","")},error(){t.removeClass("loading").removeAttr("disabled","")}})}))}()})),document.getElementById("learnpress-avatar-upload")&&wp.element.render((0,e.createElement)((function(){const[t,o]=(0,e.useState)(),[r,n]=(0,e.useState)(0),[s,c]=(0,e.useState)(0),[l,p]=(0,e.useState)({x:0,y:0}),[d,h]=(0,e.useState)(0),[u,m]=(0,e.useState)(null),[v,g]=(0,e.useState)(0),[f,w]=(0,e.useState)(0),[y,S]=(0,e.useState)(!1),[C,b]=(0,e.useState)(!0),[_,E]=(0,e.useState)(""),[x,M]=(0,e.useState)({type:"",message:""}),z=(0,e.useRef)();(0,e.useEffect)((()=>{!async function(){b(!0);try{var e,t,r;const i=await a()({method:"GET",path:"lp/v1/profile/get-avatar"});n(null!=i&&null!==(e=i.data)&&void 0!==e&&e.width?parseInt(i.data.width):0),c(null!=i&&null!==(t=i.data)&&void 0!==t&&t.height?parseInt(i.data.height):0),o(null!=i&&null!==(r=i.data)&&void 0!==r&&r.url?i.data.url:"")}catch(e){M({type:"error",message:e.message})}b(!1)}()}),[]);const D=(0,e.useCallback)(((e,t)=>{m(t)}),[]),T=(0,e.useCallback)((async()=>{S({save:!0});try{const e=await async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{horizontal:!1,vertical:!1};const n=await R(e),a=document.createElement("canvas"),i=a.getContext("2d");if(!i)return null;const s=A(o),{width:c,height:l}=L(n.width,n.height,o);a.width=c,a.height=l,i.translate(c/2,l/2),i.rotate(s),i.scale(r.horizontal?-1:1,r.vertical?-1:1),i.translate(-n.width/2,-n.height/2),i.drawImage(n,0,0);const p=i.getImageData(t.x,t.y,t.width,t.height);return a.width=t.width,a.height=t.height,i.putImageData(p,0,0),a.toDataURL("image/jpeg")}(t,u,d),o=await((e,t,o)=>new Promise(((r,n)=>{const a=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.setAttribute("crossOrigin","anonymous"),i.onload=()=>{(i.naturalWidth>t||i.naturalHeight>o)&&(a.width=t,a.height=o,a.getContext("2d").drawImage(i,0,0,t,o),r(a.toDataURL("image/jpeg"))),r(e)},i.onerror=e=>n(e)})))(e,r,s),n=await a()({path:"lp/v1/profile/upload-avatar",method:"POST",data:{file:o||""}}),{data:i,status:c,message:l}=await n;"success"===c&&window.location.reload(),M({type:c,message:l})}catch(e){M({type:"error",message:e.message||""})}S({save:!1})}),[u,d]);return(0,e.createElement)("div",{className:"learnpress_avatar"},C?(0,e.createElement)("ul",{className:"lp-skeleton-animation"},(0,e.createElement)("li",{style:{width:200,height:200}}),(0,e.createElement)("li",{style:{width:200,height:20}}),(0,e.createElement)("li",{style:{width:200,height:20}})):(0,e.createElement)(e.Fragment,null,t&&!_&&(0,e.createElement)(e.Fragment,null,f&&v?(0,e.createElement)("div",{className:"learnpress_avatar__cropper"},(0,e.createElement)("div",{style:{position:"relative",width:v,height:f,zIndex:9999,maxWidth:"100%",maxHeight:"800px"}},(0,e.createElement)(P,{image:t,crop:l,zoom:"1",cropSize:{width:r,height:s},onCropChange:p,onCropComplete:D})),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--save "+(null!=y&&y.save?"learnpress_avatar__button--loading":""),onClick:T},(0,i.__)("Save","learnpress")))):(0,e.createElement)("div",{className:"learnpress_avatar__cropper"},(0,e.createElement)("img",{src:t,alt:""}),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--replace",onClick:()=>z.current&&z.current.click()},(0,i.__)("Replace","learnpress")),(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--remove "+(null!=y&&y.remove?"learnpress_avatar__button--loading":""),onClick:async function(){if(confirm((0,i.__)("Are you sure you want to remove your avatar?","learnpress"))){S({remove:!0});try{const e=await a()({path:"lp/v1/profile/remove-avatar",method:"POST"}),{data:t,status:r,message:n}=await e;M({type:r,message:n}),o("")}catch(e){M({type:"error",message:e.message||""})}S({remove:!1})}}},(0,i.__)("Remove","learnpress"))))),(0,e.createElement)("form",{style:{display:t?"none":""}},(0,e.createElement)("div",{className:"learnpress_avatar__form"},(0,e.createElement)("div",{className:"learnpress_avatar__form-group"},(0,e.createElement)("label",{htmlFor:"avatar-file"},(0,e.createElement)("div",{className:"learnpress_avatar__form__upload"},(0,e.createElement)("div",null,(0,e.createElement)("span",null,(0,e.createElement)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"plus",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},(0,e.createElement)("defs",null,(0,e.createElement)("style",null)),(0,e.createElement)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,e.createElement)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}))),(0,e.createElement)("div",null,(0,i.__)("Upload","learnpress")))),(0,e.createElement)("input",{ref:z,type:"file",id:"avatar-file",accept:"image/*",onChange:e=>(async e=>{const t=await function(e){return new Promise((t=>{const o=new FileReader;o.addEventListener("load",(()=>t(o.result)),!1),o.readAsDataURL(e)}))}(e),n=new Image;n.src=await t,n.onload=await(function(){g(n.naturalWidth),w(n.naturalHeight);let a="";parseInt(e.size)>2097152?a=(0,i.__)("The file size is too large. You need to upload a file < 2MB.","learnpress"):(n.naturalWidth<r||n.naturalHeight<s)&&(a=(0,i.sprintf)((0,i.__)("The image size must be greater than or equal to %1$sx%2$spx","learnpress"),r,s)),a?E(a):(E(""),o(t))})})(e.target.files&&e.target.files.length>0?e.target.files[0]:"")}))))),_&&(0,e.createElement)("div",{className:"lp-ajax-message error",style:{display:"block"}},_),!_&&x&&x.type&&x.message&&(0,e.createElement)("div",{className:`lp-ajax-message ${x.type}`,style:{display:"block"}},x.message)))}),null),document.getElementById("learnpress-avatar-upload"))}()}();
assets/js/dist/frontend/question-types.min.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";var e={d:function(t,s){for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function s(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}e.r(t),e.d(t,{FillInBlanks:function(){return f},MultipleChoices:function(){return w},QuestionBase:function(){return u},SingleChoice:function(){return d},TrueOrFalse:function(){return m},default:function(){return g}});var n=window.wp.element,r=window.wp.compose,i=window.wp.data,o=window.wp.i18n;const{isArray:a,get:p,set:l}=lodash;class c extends n.Component{constructor(e){super(...arguments),s(this,"prepare",((e,t)=>{const{question:s}=e;return s&&s.id!==t.questionId?{options:t.self.parseOptions(s.options)}:null})),s(this,"setInputRef",((e,t)=>{this.inputs||(this.inputs={}),this.inputs[t]=e})),s(this,"maybeShowCorrectAnswer",(()=>{const{status:e,isCheckedAnswer:t,showCorrectReview:s,isReviewing:n}=this.props;return"completed"===e&&s||t&&!n})),s(this,"maybeDisabledOption",(e=>{const{answered:t,status:s,isCheckedAnswer:n}=this.props;return n||"started"!==s})),s(this,"setAnswerChecked",(()=>e=>{const{updateUserQuestionAnswers:t,question:s,status:n}=this.props;if("started"!==n)return(0,o.__)("LP Error: can not set answers","learnpress");const r=this.$wrap.find(".option-check"),i=[],a="multi_choice"!==s.type;r.each(((e,t)=>{if(t.checked&&(i.push(t.value),a))return!1})),t(s.id,a?i[0]:i)})),s(this,"maybeCheckedAnswer",(e=>{const{answered:t}=this.props;return a(t)?!!t.find((t=>t==e)):e==t})),s(this,"getOptionType",((e,t)=>{let s="radio";return"multi_choice"===e&&(s="checkbox"),s})),s(this,"isDefaultType",(()=>this.props.supportOptions)),s(this,"getWarningMessage",(()=>(0,n.createElement)(n.Fragment,null,(0,o.__)("Render function should be overwritten from base.","learnpress")))),s(this,"getOptionClass",(e=>{const{answered:t}=this.props;return["answer-option"]})),s(this,"parseOptions",(e=>(e&&(e=a(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=a(e)?e:JSON.parse(e)),e||[]))),s(this,"getOptions",(()=>this.state.options||[])),s(this,"isCorrect",(()=>{const{answered:e}=this.props;if(!e)return!1;let t,s,n;for(t=0,n=this.getOptions();t<n.length;t++)if(s=n[t],"yes"===s.isTrue&&e==s.value)return!0;return!1})),s(this,"isChecked",(()=>{const{question:e}=this.props;return(0,i.select)("learnpress/quiz").isCheckedAnswer(e.id)})),s(this,"getCorrectLabel",(()=>{const{status:e,answered:t,question:s}=this.props,r=(LP.config.isQuestionCorrect[s.type]||this.isCorrect).call(this);return this.maybeShowCorrectAnswer()&&(0,n.createElement)("div",{className:"question-response"+(r?" correct":" incorrect")},(0,n.createElement)("span",{className:"label"},r?(0,o.__)("Correct","learnpress"):(0,o.__)("Incorrect","learnpress")),(0,n.createElement)("span",{className:"point"},sprintf((0,o.__)("%d/%d point","learnpress"),r?s.point:0,s.point)))}));const{question:t}=e;this.state={optionClass:["answer-option"],questionId:0,options:t?this.parseOptions(t.options):[],self:this},e.$wrap&&(this.$wrap=e.$wrap)}static getDerivedStateFromProps(e,t){return t.self.prepare(e,t)}componentDidMount(){const e=this.prepare(this.props,this.state);e&&this.setState(e)}render(){const{question:e,status:t}=this.props;return(0,n.createElement)("div",{className:"question-answers"},this.isDefaultType()&&(0,n.createElement)("ul",{id:`answer-options-${e.id}`,className:"answer-options"},this.getOptions().map((s=>{const r=`learn-press-answer-option-${s.uid}`;return(0,n.createElement)("li",{className:this.getOptionClass(s).join(" "),key:`answer-option-${s.uid}`},(0,n.createElement)("input",{type:this.getOptionType(e.type,s),className:"option-check",name:"started"===t?`learn-press-question-${e.id}`:"",id:r,ref:e=>{this.setInputRef(e,s.value)},onChange:this.setAnswerChecked(),disabled:this.maybeDisabledOption(s),checked:this.maybeCheckedAnswer(s.value),value:"started"===t?s.value:""}),(0,n.createElement)("label",{htmlFor:r,className:"option-title",dangerouslySetInnerHTML:{__html:s.title||s.value}}))}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}var u=c,d=class extends u{constructor(){super(...arguments),s(this,"getOptionClass",(e=>{const{answered:t}=this.props,s=[...this.state.optionClass];return this.maybeShowCorrectAnswer()&&("yes"===e.isTrue&&s.push("answer-correct"),t&&("yes"===e.isTrue?t===e.value&&s.push("answered-correct"):t===e.value&&s.push("answered-wrong"))),s}))}};const{isBoolean:h}=lodash;var w=class extends u{constructor(){super(...arguments),s(this,"isCorrect",(()=>{const{answered:e}=this.props;if(h(e)||!e)return!1;let t,s,n;for(t=0,n=this.getOptions();t<n.length;t++)if(s=n[t],"yes"===s.isTrue){if(-1===e.indexOf(s.value))return!1}else if(-1!==e.indexOf(s.value))return!1;return!0})),s(this,"getOptionClass",(e=>{const{answered:t}=this.props,s=[...this.state.optionClass];return this.maybeShowCorrectAnswer()&&("yes"===e.isTrue&&s.push("answer-correct"),t&&("yes"===e.isTrue?-1!==t.indexOf(e.value)&&s.push("answered-correct"):-1!==t.indexOf(e.value)&&s.push("answered-wrong"))),s}))}},m=class extends u{constructor(){super(...arguments),s(this,"getOptionClass",(e=>{const{answered:t}=this.props,s=[...this.state.optionClass];return this.maybeShowCorrectAnswer()&&("yes"===e.isTrue&&s.push("answer-correct"),t&&("yes"===e.isTrue?t===e.value&&s.push("answered-correct"):t===e.value&&s.push("answered-wrong"))),s}))}},f=class extends u{constructor(){super(...arguments),s(this,"updateFibAnswer",(()=>{const e=document.querySelectorAll(".lp-fib-input > input"),{answered:t}=this.props,s=t||{};[...e].map((e=>{void 0===t&&(e.value=""),e.addEventListener("input",(t=>{this.setAnswered(s,e.dataset.id,t.target.value)})),e.addEventListener("paste",(t=>{this.setAnswered(s,e.dataset.id,t.target.value)}))}))})),s(this,"setAnswered",((e,t,s)=>{const{updateUserQuestionAnswers:n,question:r,status:i}=this.props;if("started"!==i)return"LP Error: can not set answers";const o=Object.assign(e,{[t]:s});n(r.id,o)})),s(this,"getCorrectLabel",(()=>{const{question:e,mark:t}=this.props;let s=t||0;return t&&(Number.isInteger(t)||(s=t.toFixed(2))),this.maybeShowCorrectAnswer()&&(0,n.createElement)("div",{className:"question-response correct"},(0,n.createElement)("span",{className:"label"},(0,o.__)("Points","learnpress")),(0,n.createElement)("span",{className:"point"},`${s}/${e.point} ${(0,o.__)("point","learnpress")}`),(0,n.createElement)("span",{className:"lp-fib-note"},(0,n.createElement)("span",{style:{background:"#00adff"}}),(0,o.__)("Correct","learnpress")),(0,n.createElement)("span",{className:"lp-fib-note"},(0,n.createElement)("span",{style:{background:"#d85554"}}),(0,o.__)("Incorrect","learnpress")))})),s(this,"convertInputField",(e=>{const{answered:t,isReviewing:s,showCorrectReview:n,isCheckedAnswer:r}=this.props;let i=e.title;const o=null==e?void 0:e.answers;return e.ids.map(((e,a)=>{const p="{{FIB_"+e+"}}";let l="";const c=o?null==o?void 0:o[e]:void 0;var u,d;c||s?(l+=`<span class="lp-fib-answered ${(n||r)&&null!=c&&c.correct?null!=c&&c.isCorrect?"correct":"fail":""}">`,null!=c&&c.isCorrect||(l+=`<span class="lp-fib-answered__answer">${null!==(d=null==t?void 0:t[e])&&void 0!==d?d:""}</span>`),null!=c&&c.isCorrect||null==c||!c.correct||(l+=" → "),l+=`<span class="lp-fib-answered__fill">${null!==(u=null==c?void 0:c.correct)&&void 0!==u?u:""}</span>`,l+="</span>"):(l+='<div class="lp-fib-input" style="display: inline-block; width: auto;">',l+='<input type="text" data-id="'+e+'" value="" />',l+="</div>");i=i.replace(p,l)})),i}))}componentDidMount(){const{answered:e}=this.props;e&&[...document.querySelectorAll(".lp-fib-input > input")].map((t=>{e[t.dataset.id]&&(t.value=e[t.dataset.id])})),this.updateFibAnswer()}componentDidUpdate(e){e.answered||this.updateFibAnswer()}render(){return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"lp-fib-content"},this.getOptions().map((e=>(0,n.createElement)("div",{key:`blank-${e.uid}`,dangerouslySetInnerHTML:{__html:this.convertInputField(e)||e.value}})))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}};class y extends n.Component{constructor(){super(...arguments),s(this,"getQuestion",(()=>{const{question:e}=this.props;return LP.Hook.applyFilters("question-types",{single_choice:LP.questionTypes.SingleChoice,multi_choice:LP.questionTypes.MultipleChoices,true_or_false:LP.questionTypes.TrueOrFalse,fill_in_blanks:LP.questionTypes.FillInBlanks})[e.type]}))}render(){const{question:e,supportOptions:t}=this.props,s={...this.props};s.supportOptions=-1!==t.indexOf(e.type);const r=this.getQuestion()||function(){return(0,n.createElement)("div",{className:"question-types",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("Question <code>%s</code> invalid!","learnpress"),e.type)}})};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r,s))}}var g=(0,r.compose)((0,i.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getData:n,isCheckedAnswer:r}=e("learnpress/quiz");return{supportOptions:n("supportOptions"),isCheckedAnswer:r(s),keyPressed:n("keyPressed"),showCorrectReview:n("showCorrectReview"),isReviewing:"reviewing"===n("mode")}})),(0,i.withDispatch)((()=>({}))))(y);(window.LP=window.LP||{}).questionTypes=t}();
1
+ !function(){"use strict";var e={d:function(t,s){for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function s(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}e.r(t),e.d(t,{FillInBlanks:function(){return f},MultipleChoices:function(){return w},QuestionBase:function(){return u},SingleChoice:function(){return d},TrueOrFalse:function(){return m},default:function(){return g}});var n=window.wp.element,r=window.wp.compose,i=window.wp.data,o=window.wp.i18n;const{isArray:a,get:p,set:l}=lodash;class c extends n.Component{constructor(e){super(...arguments),s(this,"prepare",((e,t)=>{const{question:s}=e;return s&&s.id!==t.questionId?{options:t.self.parseOptions(s.options)}:null})),s(this,"setInputRef",((e,t)=>{this.inputs||(this.inputs={}),this.inputs[t]=e})),s(this,"maybeShowCorrectAnswer",(()=>{const{status:e,isCheckedAnswer:t,showCorrectReview:s,isReviewing:n}=this.props;return"completed"===e&&s||t&&!n})),s(this,"maybeDisabledOption",(e=>{const{answered:t,status:s,isCheckedAnswer:n}=this.props;return n||"started"!==s})),s(this,"setAnswerChecked",(()=>e=>{const{updateUserQuestionAnswers:t,question:s,status:n}=this.props;if("started"!==n)return(0,o.__)("LP Error: can not set answers","learnpress");const r=this.$wrap.find(".option-check"),i=[],a="multi_choice"!==s.type;r.each(((e,t)=>{if(t.checked&&(i.push(t.value),a))return!1})),t(s.id,a?i[0]:i)})),s(this,"maybeCheckedAnswer",(e=>{const{answered:t}=this.props;return a(t)?!!t.find((t=>t==e)):e==t})),s(this,"getOptionType",((e,t)=>{let s="radio";return"multi_choice"===e&&(s="checkbox"),s})),s(this,"isDefaultType",(()=>this.props.supportOptions)),s(this,"getWarningMessage",(()=>(0,n.createElement)(n.Fragment,null,(0,o.__)("The render function should be overwritten from the base.","learnpress")))),s(this,"getOptionClass",(e=>{const{answered:t}=this.props;return["answer-option"]})),s(this,"parseOptions",(e=>(e&&(e=a(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=a(e)?e:JSON.parse(e)),e||[]))),s(this,"getOptions",(()=>this.state.options||[])),s(this,"isCorrect",(()=>{const{answered:e}=this.props;if(!e)return!1;let t,s,n;for(t=0,n=this.getOptions();t<n.length;t++)if(s=n[t],"yes"===s.isTrue&&e==s.value)return!0;return!1})),s(this,"isChecked",(()=>{const{question:e}=this.props;return(0,i.select)("learnpress/quiz").isCheckedAnswer(e.id)})),s(this,"getCorrectLabel",(()=>{const{status:e,answered:t,question:s}=this.props,r=(LP.config.isQuestionCorrect[s.type]||this.isCorrect).call(this);return this.maybeShowCorrectAnswer()&&(0,n.createElement)("div",{className:"question-response"+(r?" correct":" incorrect")},(0,n.createElement)("span",{className:"label"},r?(0,o.__)("Correct","learnpress"):(0,o.__)("Incorrect","learnpress")),(0,n.createElement)("span",{className:"point"},sprintf((0,o.__)("%d/%d point","learnpress"),r?s.point:0,s.point)))}));const{question:t}=e;this.state={optionClass:["answer-option"],questionId:0,options:t?this.parseOptions(t.options):[],self:this},e.$wrap&&(this.$wrap=e.$wrap)}static getDerivedStateFromProps(e,t){return t.self.prepare(e,t)}componentDidMount(){const e=this.prepare(this.props,this.state);e&&this.setState(e)}render(){const{question:e,status:t}=this.props;return(0,n.createElement)("div",{className:"question-answers"},this.isDefaultType()&&(0,n.createElement)("ul",{id:`answer-options-${e.id}`,className:"answer-options"},this.getOptions().map((s=>{const r=`learn-press-answer-option-${s.uid}`;return(0,n.createElement)("li",{className:this.getOptionClass(s).join(" "),key:`answer-option-${s.uid}`},(0,n.createElement)("input",{type:this.getOptionType(e.type,s),className:"option-check",name:"started"===t?`learn-press-question-${e.id}`:"",id:r,ref:e=>{this.setInputRef(e,s.value)},onChange:this.setAnswerChecked(),disabled:this.maybeDisabledOption(s),checked:this.maybeCheckedAnswer(s.value),value:"started"===t?s.value:""}),(0,n.createElement)("label",{htmlFor:r,className:"option-title",dangerouslySetInnerHTML:{__html:s.title||s.value}}))}))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}}var u=c,d=class extends u{constructor(){super(...arguments),s(this,"getOptionClass",(e=>{const{answered:t}=this.props,s=[...this.state.optionClass];return this.maybeShowCorrectAnswer()&&("yes"===e.isTrue&&s.push("answer-correct"),t&&("yes"===e.isTrue?t===e.value&&s.push("answered-correct"):t===e.value&&s.push("answered-wrong"))),s}))}};const{isBoolean:h}=lodash;var w=class extends u{constructor(){super(...arguments),s(this,"isCorrect",(()=>{const{answered:e}=this.props;if(h(e)||!e)return!1;let t,s,n;for(t=0,n=this.getOptions();t<n.length;t++)if(s=n[t],"yes"===s.isTrue){if(-1===e.indexOf(s.value))return!1}else if(-1!==e.indexOf(s.value))return!1;return!0})),s(this,"getOptionClass",(e=>{const{answered:t}=this.props,s=[...this.state.optionClass];return this.maybeShowCorrectAnswer()&&("yes"===e.isTrue&&s.push("answer-correct"),t&&("yes"===e.isTrue?-1!==t.indexOf(e.value)&&s.push("answered-correct"):-1!==t.indexOf(e.value)&&s.push("answered-wrong"))),s}))}},m=class extends u{constructor(){super(...arguments),s(this,"getOptionClass",(e=>{const{answered:t}=this.props,s=[...this.state.optionClass];return this.maybeShowCorrectAnswer()&&("yes"===e.isTrue&&s.push("answer-correct"),t&&("yes"===e.isTrue?t===e.value&&s.push("answered-correct"):t===e.value&&s.push("answered-wrong"))),s}))}},f=class extends u{constructor(){super(...arguments),s(this,"updateFibAnswer",(()=>{const e=document.querySelectorAll(".lp-fib-input > input"),{answered:t}=this.props,s=t||{};[...e].map((e=>{void 0===t&&(e.value=""),e.addEventListener("input",(t=>{this.setAnswered(s,e.dataset.id,t.target.value)})),e.addEventListener("paste",(t=>{this.setAnswered(s,e.dataset.id,t.target.value)}))}))})),s(this,"setAnswered",((e,t,s)=>{const{updateUserQuestionAnswers:n,question:r,status:i}=this.props;if("started"!==i)return"LP Error: can not set answers";const o=Object.assign(e,{[t]:s});n(r.id,o)})),s(this,"getCorrectLabel",(()=>{const{question:e,mark:t}=this.props;let s=t||0;return t&&(Number.isInteger(t)||(s=t.toFixed(2))),this.maybeShowCorrectAnswer()&&(0,n.createElement)("div",{className:"question-response correct"},(0,n.createElement)("span",{className:"label"},(0,o.__)("Points","learnpress")),(0,n.createElement)("span",{className:"point"},`${s}/${e.point} ${(0,o.__)("point","learnpress")}`),(0,n.createElement)("span",{className:"lp-fib-note"},(0,n.createElement)("span",{style:{background:"#00adff"}}),(0,o.__)("Correct","learnpress")),(0,n.createElement)("span",{className:"lp-fib-note"},(0,n.createElement)("span",{style:{background:"#d85554"}}),(0,o.__)("Incorrect","learnpress")))})),s(this,"convertInputField",(e=>{const{answered:t,isReviewing:s,showCorrectReview:n,isCheckedAnswer:r}=this.props;let i=e.title;const o=null==e?void 0:e.answers;return e.ids.map(((e,a)=>{const p="{{FIB_"+e+"}}";let l="";const c=o?null==o?void 0:o[e]:void 0;var u,d;c||s?(l+=`<span class="lp-fib-answered ${(n||r)&&null!=c&&c.correct?null!=c&&c.isCorrect?"correct":"fail":""}">`,null!=c&&c.isCorrect||(l+=`<span class="lp-fib-answered__answer">${null!==(d=null==t?void 0:t[e])&&void 0!==d?d:""}</span>`),null!=c&&c.isCorrect||null==c||!c.correct||(l+=" → "),l+=`<span class="lp-fib-answered__fill">${null!==(u=null==c?void 0:c.correct)&&void 0!==u?u:""}</span>`,l+="</span>"):(l+='<div class="lp-fib-input" style="display: inline-block; width: auto;">',l+='<input type="text" data-id="'+e+'" value="" />',l+="</div>");i=i.replace(p,l)})),i}))}componentDidMount(){const{answered:e}=this.props;e&&[...document.querySelectorAll(".lp-fib-input > input")].map((t=>{e[t.dataset.id]&&(t.value=e[t.dataset.id])})),this.updateFibAnswer()}componentDidUpdate(e){e.answered||this.updateFibAnswer()}render(){return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"lp-fib-content"},this.getOptions().map((e=>(0,n.createElement)("div",{key:`blank-${e.uid}`,dangerouslySetInnerHTML:{__html:this.convertInputField(e)||e.value}})))),!this.isDefaultType()&&this.getWarningMessage(),this.getCorrectLabel())}};class y extends n.Component{constructor(){super(...arguments),s(this,"getQuestion",(()=>{const{question:e}=this.props;return LP.Hook.applyFilters("question-types",{single_choice:LP.questionTypes.SingleChoice,multi_choice:LP.questionTypes.MultipleChoices,true_or_false:LP.questionTypes.TrueOrFalse,fill_in_blanks:LP.questionTypes.FillInBlanks})[e.type]}))}render(){const{question:e,supportOptions:t}=this.props,s={...this.props};s.supportOptions=-1!==t.indexOf(e.type);const r=this.getQuestion()||function(){return(0,n.createElement)("div",{className:"question-types",dangerouslySetInnerHTML:{__html:(0,o.sprintf)((0,o.__)("Question <code>%s</code> invalid!","learnpress"),e.type)}})};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r,s))}}var g=(0,r.compose)((0,i.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getData:n,isCheckedAnswer:r}=e("learnpress/quiz");return{supportOptions:n("supportOptions"),isCheckedAnswer:r(s),keyPressed:n("keyPressed"),showCorrectReview:n("showCorrectReview"),isReviewing:"reviewing"===n("mode")}})),(0,i.withDispatch)((()=>({}))))(y);(window.LP=window.LP||{}).questionTypes=t}();
assets/js/dist/frontend/quiz.js CHANGED
@@ -1907,12 +1907,18 @@ const Timer = () => {
1907
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('learnpress/quiz');
1908
  const totalTime = getData('totalTime');
1909
  const durationTime = getData('duration');
1910
- const [seconds, setSeconds] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(totalTime);
1911
- let [timeSpend, setTimeSpend] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(0); //const limitTime = totalTime > 0;
 
 
 
1912
 
 
 
 
1913
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1914
  const myInterval = setInterval(() => {
1915
- if (durationTime > 0) {
1916
  let remainSeconds = seconds;
1917
  remainSeconds -= 1;
1918
 
1907
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('learnpress/quiz');
1908
  const totalTime = getData('totalTime');
1909
  const durationTime = getData('duration');
1910
+ /* const endTime = getData( 'endTime' );
1911
+ const d1 = new Date( endTime.replace( /-/g, '/' ) );
1912
+ const d2 = new Date();
1913
+ const tz = new Date().getTimezoneOffset();
1914
+ const t = parseInt( ( d1.getTime() / 1000 ) - ( ( d2.getTime() / 1000 ) + ( tz * 60 ) ) );*/
1915
 
1916
+ const [seconds, setSeconds] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(totalTime);
1917
+ let [timeSpend, setTimeSpend] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
1918
+ const limitTime = totalTime > 0;
1919
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
1920
  const myInterval = setInterval(() => {
1921
+ if (limitTime) {
1922
  let remainSeconds = seconds;
1923
  remainSeconds -= 1;
1924
 
assets/js/dist/frontend/quiz.min.js CHANGED
@@ -1 +1 @@
1
- !function(){var e={605:function(){LP.Hook.addAction("lp-compatible-builder",(()=>{LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(()=>(LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0))),LP.Hook.addAction("lp-question-compatible-builder",(()=>(LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0)))},184:function(e,t){var s;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var i=typeof s;if("string"===i||"number"===i)e.push(s);else if(Array.isArray(s)){if(s.length){var o=r.apply(null,s);o&&e.push(o)}}else if("object"===i)if(s.toString===Object.prototype.toString)for(var a in s)n.call(s,a)&&s[a]&&e.push(a);else e.push(s.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(s=function(){return r}.apply(t,[]))||(e.exports=s)}()},965:function(e){"use strict";function t(e,s){var n;if(Array.isArray(s))for(n=0;n<s.length;n++)t(e,s[n]);else for(n in s)e[n]=(e[n]||[]).concat(s[n])}e.exports=function(e){var s,n={};return t(n,e),(s=function(e){return function(t){return function(s){var r,i,o=n[s.type],a=t(s);if(o)for(r=0;r<o.length;r++)(i=o[r](s,e))&&e.dispatch(i);return a}}}).effects=n,s}}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,s),i.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";s.r(n),s.d(n,{default:function(){return tt},init:function(){return st}});var e={};s.r(e),s.d(e,{__requestBeforeStartQuiz:function(){return ge},__requestCheckAnswerSuccess:function(){return ze},__requestShowHintSuccess:function(){return ye},__requestStartQuizSuccess:function(){return fe},__requestSubmitQuiz:function(){return qe},__requestSubmitQuizSuccess:function(){return we},checkAnswer:function(){return be},markQuestionRendered:function(){return ke},sendKey:function(){return Qe},setCurrentPage:function(){return he},setCurrentQuestion:function(){return me},setQuizData:function(){return pe},setQuizMode:function(){return Pe},showHint:function(){return Ee},startQuiz:function(){return _e},submitQuiz:function(){return ve},updateUserQuestionAnswers:function(){return Se}});var t={};s.r(t),s.d(t,{getCurrentQuestion:function(){return Fe},getData:function(){return xe},getDefaultRestArgs:function(){return De},getItemStatus:function(){return Ae},getProp:function(){return Te},getQuestion:function(){return Ue},getQuestionAnswered:function(){return Me},getQuestionMark:function(){return He},getQuestionOptions:function(){return Ce},getQuestions:function(){return Le},getQuestionsSelectedAnswers:function(){return Be},getQuizAnswered:function(){return Oe},getQuizAttempts:function(){return Re},getUserMark:function(){return Je},isCheckedAnswer:function(){return $e},isCorrect:function(){return je}});var r=window.wp.element;function i(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var o=window.wp.compose,a=window.wp.data,u=window.wp.i18n,l=e=>{let t;const s=86400;if(e>s)t=(e-e%s)/s,e%=s;else if(e==s)return"24:00";const n=new Date(1e3*e).toUTCString().match(/\d{2}:\d{2}:\d{2}/)[0].split(":");return t&&(n[0]=parseInt(n[0])+24*t),n.join(":")};const{Hook:c}=LP;var d=()=>{const e=e=>(0,a.select)("learnpress/quiz").getData(e),t=c.applyFilters("quiz-meta-fields",{duration:{title:(0,u.__)("Duration:","learnpress"),name:"duration",content:l(e("duration"))||"--"},passingGrade:{title:(0,u.__)("Passing grade:","learnpress"),name:"passing-grade",content:e("passingGrade")||"--"},questionsCount:{title:(0,u.__)("Questions:","learnpress"),name:"questions-count",content:e("questionIds")?e("questionIds").length:0}});return t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("ul",{className:"quiz-intro"},Object.values(t).map(((e,t)=>{const s=e.name||t;return(0,r.createElement)("li",{key:`quiz-intro-field-${t}`,className:`quiz-intro-item quiz-intro-item--${s}`},(0,r.createElement)("div",{className:"quiz-intro-item__title",dangerouslySetInnerHTML:{__html:e.title}}),(0,r.createElement)("span",{className:"quiz-intro-item__content",dangerouslySetInnerHTML:{__html:e.content}}))}))))};class p extends r.Component{constructor(){super(...arguments),i(this,"startQuiz",(e=>{e&&e.preventDefault();const t=document.querySelector(".lp-button.start");t&&t.setAttribute("disabled","disabled"),t.classList.add("loading");const{startQuiz:s,status:n}=this.props;if("completed"===n){const{confirm:e,isOpen:s}=(0,a.select)("learnpress/modal");if("no"===e((0,u.__)("Are you sure you want to retake quiz?","learnpress"),this.startQuiz))return void(!s()&&t&&t.removeAttribute("disabled"))}s()})),i(this,"nav",(e=>t=>{let{questionNav:s,currentPage:n,numPages:r,setCurrentPage:i}=this.props;"prev"===e?n>1?n-=1:n="infinity"===s?r:1:n<r?n+=1:n="infinity"===s?1:r,i(n)})),i(this,"moveTo",(e=>t=>{t.preventDefault();const{numPages:s,setCurrentPage:n}=this.props;e<1||e>s||n(e)})),i(this,"isLast",(()=>{const{currentPage:e,numPages:t}=this.props;return e===t})),i(this,"isFirst",(()=>{const{currentPage:e}=this.props;return 1===e})),i(this,"submit",(()=>{const{submitQuiz:e}=this.props,{confirm:t}=(0,a.select)("learnpress/modal");"no"!==t((0,u.__)("Are you sure to submit quiz?","learnpress"),this.submit)&&e()})),i(this,"setQuizMode",(e=>()=>{const{setQuizMode:t}=this.props;t(e)})),i(this,"isReviewing",(()=>{const{isReviewing:e}=this.props;return e}))}pageNumbers(e){const{numPages:t,currentPage:s}=this.props;if(t<2)return"";(e={numPages:t,currentPage:s,midSize:1,endSize:1,prevNext:!0,...e||{}}).endSize<1&&(e.endSize=1),e.midSize<0&&(e.midSize=1);const n=[...Array(t).keys()];let i=!1;return(0,r.createElement)("div",{className:"nav-links"},e.prevNext&&!this.isFirst()&&(0,r.createElement)("button",{className:"page-numbers prev","data-type":"question-navx",onClick:this.nav("prev")},(0,u.__)("Prev","learnpress")),n.map((t=>(t+=1)===e.currentPage?(i=!0,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers current"},t)):t<=e.endSize||e.currentPage&&t>=e.currentPage-e.midSize&&t<=e.currentPage+e.midSize||t>e.numPages-e.endSize?(i=!0,(0,r.createElement)("button",{key:`page-number-${t}`,className:"page-numbers",onClick:this.moveTo(t)},t)):i?(i=!1,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers dots"},"…")):"")),e.prevNext&&!this.isLast()&&(0,r.createElement)("button",{className:"page-numbers next","data-type":"question-navx",onClick:this.nav("next")},(0,u.__)("Next","learnpress")))}render(){const{status:e,questionNav:t,isReviewing:s,showReview:n,numPages:i,question:o,questionsPerPage:a,canRetry:l,retakeNumber:c,requiredPassword:d,allowRetake:p}=this.props,m=["quiz-buttons"];("started"===e||s)&&m.push("align-center"),"questionNav"===t&&m.push("infinity"),this.isFirst()&&m.push("is-first"),this.isLast()&&m.push("is-last");const h=document.querySelector("#popup-sidebar"),g=document.querySelector("#learn-press-quiz-app");let f="";f="started"===e||s?{marginLeft:h&&h.offsetWidth/2,width:g&&g.offsetWidth}:null;let _=" fixed";return"no"==lpQuizSettings.navigationPosition&&(_=" nav-center"),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:m.join(" ")},(0,r.createElement)("div",{className:"button-left"+("started"===e||s?_:""),style:f},("completed"===e&&l||-1!==["","viewed"].indexOf(e))&&!s&&!d&&(0,r.createElement)("button",{className:"lp-button start",onClick:this.startQuiz},"completed"===e?`${(0,u.__)("Retake","learnpress")} ${p?"":" "+(c?` (${c})`:"")} `:" "+(0,u.__)("Start","learnpress")),("started"===e||s)&&i>1&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"questions-pagination"},this.pageNumbers()))),(0,r.createElement)("div",{className:"button-right"},"started"===e&&(0,r.createElement)(r.Fragment,null,("infinity"===t||this.isLast())&&!s&&(0,r.createElement)("button",{className:"lp-button submit-quiz",onClick:this.submit},(0,u.__)("Finish Quiz","learnpress"))),s&&n&&(0,r.createElement)("button",{className:"lp-button back-quiz",onClick:this.setQuizMode("")},(0,u.__)("Result","learnpress")),"completed"===e&&n&&!s&&(0,r.createElement)("button",{className:"lp-button review-quiz",onClick:this.setQuizMode("reviewing")},(0,u.__)("Review","learnpress")))),this.props.message&&!0!==this.props.success&&(0,r.createElement)("div",{className:"learn-press-message error"},this.props.message))}}const m=(0,o.compose)((0,a.withSelect)((e=>{const{getData:t}=e("learnpress/quiz");return{status:t("status"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),questionsPerPage:t("questionsPerPage")}})))((e=>{const{showCheck:t,checkedQuestions:s,hintedQuestions:n,question:i,status:o,type:a,Button:u}=e;if("started"!==o)return!1;const l=(0,r.createElement)(u,{question:i});switch(a){case"hint":return n?!!i.hasHint&&-1===n.indexOf(i.id)&&l:l;case"check":return!!t&&(s?-1===s.indexOf(i.id)&&l:l)}}));var h=(0,o.compose)([(0,a.withSelect)((e=>{const{getData:t,getCurrentQuestion:s}=e("learnpress/quiz"),n={id:t("id"),status:t("status"),questionIds:t("questionIds"),questionNav:t("questionNav"),isReviewing:t("reviewQuestions")&&"reviewing"===t("mode"),showReview:t("reviewQuestions"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),numPages:t("numPages"),pages:t("pages"),currentPage:t("currentPage"),questionsPerPage:t("questionsPerPage"),pageNumbers:t("pageNumbers"),keyPressed:t("keyPressed"),canRetry:t("retakeCount")>0&&t("retaken")<t("retakeCount"),retakeNumber:t("retakeCount")>0&&t("retaken")<t("retakeCount")?t("retakeCount")-t("retaken"):null,message:t("messageResponse")||!1,success:void 0===t("successResponse")||t("successResponse"),requiredPassword:t("requiredPassword"),allowRetake:t("allowRetake")};if(1===n.questionsPerPage&&(n.question=s("object")),1===lpQuizSettings.checkNorequizenroll){const e=window.localStorage.getItem("quiz_off_retaken_"+lpQuizSettings.id);t("retakeCount")>e?(n.retakeNumber=t("retakeCount")-e,n.canRetry=!0):n.canRetry=!1}return n.allowRetake&&(n.canRetry=!0),n})),(0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{startQuiz:n,setCurrentQuestion:r,submitQuiz:i,setQuizMode:o,showHint:a,checkAnswer:u,setCurrentPage:l}=e("learnpress/quiz");return{startQuiz:n,setCurrentQuestion:r,setQuizMode:o,setCurrentPage:l,submitQuiz(e){i(e)},showHint(e){a(e)},checkAnswer(e){u(e)}}}))])(p);function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},g.apply(this,arguments)}class f extends r.Component{constructor(){super(...arguments),i(this,"showHint",(()=>{const{showHint:e,question:t}=this.props;e(t.id,!t.showHint)}))}render(){const{question:e}=this.props;return e.hint?(0,r.createElement)("button",{className:"btn-show-hint",onClick:this.showHint},(0,r.createElement)("span",null,(0,u.__)("Hint","learnpress"))):""}}var _=(0,o.compose)((0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{showHint:n}=e("learnpress/quiz");return{showHint(e,t){n(e,t)}}})))(f),q=s(184),w=s.n(q);class v extends r.Component{constructor(){super(...arguments),i(this,"checkAnswer",(()=>{const{checkAnswer:e,question:t,answered:s}=this.props;s&&(e(t.id),this.setState({loading:!0}))})),this.state={loading:!1}}render(){const{answered:e}=this.props;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("button",{className:w()("lp-button","instant-check",{loading:this.state.loading,disable:!e}),onClick:this.checkAnswer},(0,r.createElement)("span",{className:"instant-check__icon"}),(0,u.__)("Check answer","learnpress"),!e&&(0,r.createElement)("div",{className:"instant-check__info",dangerouslySetInnerHTML:{__html:(0,u.__)("You need to answer the question before check answer.","learnpress")}})))}}var S=(0,o.compose)((0,a.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getQuestionAnswered:n}=e("learnpress/quiz");return{answered:n(s)}})),(0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{checkAnswer:n}=e("learnpress/quiz");return{checkAnswer(e){n(e)}}})))(v),y=function(e){const{question:t}=e,s={"instant-check":()=>(0,r.createElement)(m,{type:"check",Button:S,question:t}),hint:()=>(0,r.createElement)(m,{type:"hint",Button:_,question:t})};return(0,r.createElement)(r.Fragment,null,LP.config.questionFooterButtons().map((e=>(0,r.createElement)(r.Fragment,{key:`button-${e}`},s[e]&&s[e]()))))};const E=window.jQuery,{uniqueId:z,isArray:b,isNumber:k,bind:P}=lodash;class Q extends r.Component{constructor(){super(...arguments),i(this,"setRef",(e=>{this.$wrap=E(e)})),i(this,"parseOptions",(e=>(e&&(e=b(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=b(e)?e:JSON.parse(e)),e||[]))),i(this,"getWrapperClass",(()=>{const{question:e,answered:t}=this.props,s=["question","question-"+e.type],n=this.parseOptions(e.options);return n.length&&void 0!==n[0].isTrue&&s.push("question-answered"),s})),i(this,"getEditLink",(()=>{const{question:e,editPermalink:t}=this.props;return t?t.replace(/post=(.*[0-9])/,`post=${e.id}`):""})),i(this,"editPermalink",(e=>(0,u.sprintf)('<a href="%s">%s</a>',e,(0,u.__)("Edit","learnpress")))),this.state={time:null,showHint:!1},this.$wrap=null}componentDidMount(e){const{question:t,isCurrent:s,markQuestionRendered:n}=this.props;return s&&n(t.id),this.state.time||this.setState({time:new Date}),LP.Hook.doAction("lp-question-compatible-builder"),"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),e}render(){const{question:e,isShow:t,isShowIndex:s,isShowHint:n,status:i}=this.props,o=LP.questionTypes.default,a=this.getEditLink();a&&jQuery("#wp-admin-bar-edit-lp_question").find(".ab-item").attr("href",a);const l={index:()=>s?(0,r.createElement)("span",{className:"question-index"},s,"."):"",title:()=>(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:e.title}}),hint:()=>(0,r.createElement)(_,{question:e}),"edit-permalink":()=>a&&(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:this.editPermalink(a)},className:"edit-link"})},c={title:()=>(0,r.createElement)("h4",{className:"question-title"},LP.config.questionTitleParts().map((e=>(0,r.createElement)(r.Fragment,{key:`title-part-${e}`},l[e]&&l[e]())))),content:()=>(0,r.createElement)("div",{className:"question-content",dangerouslySetInnerHTML:{__html:e.content}}),"answer-options":()=>this.$wrap&&(0,r.createElement)(o,g({},this.props,{$wrap:this.$wrap})),explanation:()=>e.explanation&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-explanation-content"},(0,r.createElement)("strong",{className:"explanation-title"},(0,u.__)("Explanation","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.explanation}}))),hint:()=>e.hint&&!e.explanation&&e.showHint&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-hint-content"},(0,r.createElement)("strong",{className:"hint-title"},(0,u.__)("Hint","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.hint}}))),buttons:()=>"started"===i&&(0,r.createElement)(y,{question:e})},d=LP.config.questionBlocks();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:this.getWrapperClass().join(" "),style:{display:t?"":"none"},"data-id":e.id,ref:this.setRef},d.map((e=>(0,r.createElement)(r.Fragment,{key:`block-${e}`},c[e]?c[e]():"")))))}}var N=(0,o.compose)([(0,a.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getData:n,getQuestionAnswered:r,getQuestionMark:i}=e("learnpress/quiz");return{status:n("status"),questions:n("question"),answered:r(s),questionsRendered:n("questionsRendered"),editPermalink:n("editPermalink"),numPages:n("numPages"),mark:i(s)||""}})),(0,a.withDispatch)((e=>{const{updateUserQuestionAnswers:t,markQuestionRendered:s}=e("learnpress/quiz");return{markQuestionRendered:s,updateUserQuestionAnswers:t}}))])(Q);class I extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{e.preventDefault();const{startQuiz:t}=this.props;t()})),i(this,"isInVisibleRange",((e,t)=>{const{currentPage:s,questionsPerPage:n}=this.props;return s===Math.ceil(t/n)})),i(this,"nav",(e=>{const{sendKey:t}=this.props;switch(e.keyCode){case 37:return t("left");case 38:case 40:return;case 39:return t("right");default:e.keyCode>=49&&e.keyCode<=57&&t(e.keyCode-48)}})),this.needToTop=!1,this.state={isReviewing:null,currentPage:0,self:this}}static getDerivedStateFromProps(e,t){const s=["isReviewing","currentPage"],n={};for(let r=0;r<s.length;r++)e[s[r]]!==t[s[r]]&&(n[s[r]]=e[s[r]]);return Object.values(n).length?(t.self.needToTop=!0,n):null}componentDidUpdate(){this.needToTop&&(jQuery("#popup-content").animate({scrollTop:0}).find(".content-item-scrollable:last").animate({scrollTop:0}),this.needToTop=!1)}render(){const{status:e,currentQuestion:t,questions:s,questionsRendered:n,isReviewing:i,questionsPerPage:o}=this.props;let a=!0;return"completed"!==e||i||(a=!1),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{tabIndex:100,onKeyUp:this.nav},(0,r.createElement)("div",{className:"quiz-questions",style:{display:a?"":"none"}},s.map(((e,s)=>{const i=!o&&t===e.id,a=n&&-1!==n.indexOf(e.id),u=this.isInVisibleRange(e.id,s+1);return a||!a||u?(0,r.createElement)(N,{key:`loop-question-${e.id}`,isCurrent:i,isShow:u,isShowIndex:!!o&&s+1,questionsPerPage:o,question:e}):""})))))}}var C=(0,o.compose)((0,a.withSelect)(((e,t,s)=>{const{getData:n,getQuestions:r}=e("learnpress/quiz");return{status:n("status"),currentQuestion:n("currentQuestion"),questions:r(),questionsRendered:n("questionsRendered"),isReviewing:"reviewing"===n("mode"),numPages:n("numPages"),currentPage:n("currentPage"),questionsPerPage:n("questionsPerPage")||1}})),(0,a.withDispatch)((e=>{const{startQuiz:t,sendKey:s}=e("learnpress/quiz");return{startQuiz:t,sendKey:s}})))(I),A=()=>{const e=(0,a.select)("learnpress/quiz").getData("attempts")||[],t=e&&!!e.length;return!!t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"quiz-attempts"},(0,r.createElement)("h4",{className:"attempts-heading"},(0,u.__)("Last Attempted","learnpress")),t&&(0,r.createElement)("table",null,(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)("th",{className:"quiz-attempts__questions"},(0,u.__)("Questions","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__spend"},(0,u.__)("Time spent","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__marks"},(0,u.__)("Marks","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__grade"},(0,u.__)("Passing grade","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__result"},(0,u.__)("Result","learnpress")))),(0,r.createElement)("tbody",null,e.map(((e,t)=>(0,r.createElement)("tr",{key:`attempt-${t}`},(0,r.createElement)("td",{className:"quiz-attempts__questions"},`${e.questionCorrect} / ${e.questionCount}`),(0,r.createElement)("td",{className:"quiz-attempts__spend"},e.timeSpend||"--"),(0,r.createElement)("td",{className:"quiz-attempts__marks"},`${e.userMark} / ${e.mark}`),(0,r.createElement)("td",{className:"quiz-attempts__grade"},e.passingGrade||"-"),(0,r.createElement)("td",{className:"quiz-attempts__result"},`${parseFloat(e.result).toFixed(2)}%`," ",(0,r.createElement)("span",null,e.graduationText)))))))))},T=()=>{const{getData:e}=(0,a.select)("learnpress/quiz"),{submitQuiz:t}=(0,a.dispatch)("learnpress/quiz"),s=e("totalTime"),n=e("duration"),[i,o]=(0,r.useState)(s);let[u,l]=(0,r.useState)(0);return(0,r.useEffect)((()=>{const e=setInterval((()=>{if(n>0){let s=i;s-=1,s>0?(o(s),u++,l(n-s)):(clearInterval(e),t())}else u++,l(u),o(u)}),1e3);return()=>clearInterval(e)}),[i,u]),(0,r.createElement)("div",{className:"countdown"},(0,r.createElement)("i",{className:"fas fa-stopwatch"}),(0,r.createElement)("span",null,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";const t=[];let n;return s<3600?(t.push((i-i%60)/60),t.push(i%60)):s&&(t.push((i-i%3600)/3600),n=i%3600,t.push((n-n%60)/60),t.push(n%60)),t.map((e=>e<10?`0${e}`:e)).join(e)}()),(0,r.createElement)("input",{type:"hidden",name:"lp-quiz-time-spend",value:u}))},R=window.wp.url;const O=jQuery;let L=null;const x={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init(){return!!this.instance||(this.elLPOverlay=O(".lp-overlay"),!!this.elLPOverlay.length&&(L=this.elLPOverlay,this.elMainContent=L.find(".main-content"),this.elTitle=L.find(".modal-title"),this.elBtnYes=L.find(".btn-yes"),this.elBtnNo=L.find(".btn-no"),this.elFooter=L.find(".lp-modal-footer"),O(document).on("click",".close, .btn-no",(function(){L.hide()})),O(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof x.callBackYes&&x.callBackYes()})),this.instance=this,!0))},setElCalledModal(e){this.elCalledModal=e},setContentModal(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal(e){this.elTitle.html(e)}};var D=x,M={elBtnFinishCourse:null,elBtnCompleteItem:null,init(){D.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((e=>e.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})))))}};const{debounce:H}=lodash;var F=()=>{const[e,t]=(0,r.useState)(0),[s,n]=(0,r.useState)(!1),i=(0,a.useSelect)((e=>e("learnpress/quiz").getData("id")),[]),o=(0,a.useSelect)((e=>e("learnpress/quiz").getData("results")),[]),l=(0,a.useSelect)((e=>e("learnpress/quiz").getData("passingGrade")),[]),c=(0,a.useSelect)((e=>e("learnpress/quiz").getData("submitting")),[]);(0,r.useEffect)((()=>{p();let e="";if(e=o.graduation?o.graduation:o.result>=f?"passed":"failed",e){const t=document.querySelector(`.course-curriculum .course-item.course-item-${i}`);t&&(t.classList.remove("failed","passed"),t.classList.add("has-status","status-completed",e))}const t=[...document.querySelectorAll("#popup-header .items-progress")][0],s=document.querySelector(".curriculum-sections");if(t&&s){const e=t.dataset.totalItems,s=t.querySelector(".items-completed"),n=t.querySelector(".learn-press-progress__active");if(s){const t=document.querySelectorAll("#popup-sidebar .course-curriculum .course-item.status-completed");s.textContent=parseInt(t.length);const r=100-100*parseInt(t.length)/parseInt(e);n.style.left="-"+r+"%"}}}),[o]),(0,r.useEffect)((()=>{void 0!==c&&d()}),[c]);const d=()=>{const e=document.querySelectorAll(".popup-header__inner");e.length>0&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&(async e=>{const t=await wp.apiFetch({path:(0,R.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"}),{data:s}=t;e.innerHTML+=s,M.init()})(e[0])},p=()=>{t(0),n(!1),jQuery.easing._customEasing=function(e,t,s,n,r){return n*Math.sqrt(1-(t=t/r-1)*t)+s},H((()=>{const e=jQuery("<span />").css({width:1,height:1}).appendTo(document.body);e.css("left",0).animate({left:o.result},{duration:1500,step:(e,s)=>{t(e)},done:()=>{n(!0),e.remove(),jQuery("#quizResultGrade").css({transform:"scale(1.3)",transition:"all 0.25s"}),H((()=>{jQuery("#quizResultGrade").css({transform:"scale(1)"})}),500)()},easing:"_customEasing"})}),o.result>0?1e3:10)()};let m=e;Number.isInteger(e)||(m=parseFloat(e).toFixed(2));const h=190*Math.PI,g={strokeDasharray:`${h} ${h}`,strokeDashoffset:h-m/100*h},f=parseFloat(o.passingGrade||l);let _="";_=o.graduation?o.graduation:m>=f?"passed":"failed";let q="";q=o.graduationText?o.graduationText:"passed"===_?(0,u.__)("Passed","learnpress"):(0,u.__)("Failed","learnpress");const w=["quiz-result",_];return(0,r.createElement)("div",{className:w.join(" ")},(0,r.createElement)("h3",{className:"result-heading"},(0,u.__)("Your Result","learnpress")),(0,r.createElement)("div",{id:"quizResultGrade",className:"result-grade"},(0,r.createElement)("svg",{className:"circle-progress-bar",width:200,height:200},(0,r.createElement)("circle",{className:"circle-progress-bar__circle",stroke:"",strokeWidth:10,style:g,fill:"transparent",r:95,cx:100,cy:100})),(0,r.createElement)("span",{className:"result-achieved"},`${m}%`),(0,r.createElement)("span",{className:"result-require"},f+"%"||0)),s&&(0,r.createElement)("p",{className:"result-message"},q),(0,r.createElement)("ul",{className:"result-statistic"},(0,r.createElement)("li",{className:"result-statistic-field result-time-spend"},(0,r.createElement)("span",null,(0,u.__)("Time spent","learnpress")),(0,r.createElement)("p",null,o.timeSpend)),(0,r.createElement)("li",{className:"result-statistic-field result-point"},(0,r.createElement)("span",null,(0,u.__)("Points","learnpress")),(0,r.createElement)("p",null,o.userMark," / ",o.mark)),(0,r.createElement)("li",{className:"result-statistic-field result-questions"},(0,r.createElement)("span",null,(0,u.__)("Questions","learnpress")),(0,r.createElement)("p",null,o.questionCount)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-correct"},(0,r.createElement)("span",null,(0,u.__)("Correct","learnpress")),(0,r.createElement)("p",null,o.questionCorrect)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-wrong"},(0,r.createElement)("span",null,(0,u.__)("Wrong","learnpress")),(0,r.createElement)("p",null,o.questionWrong)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-skipped"},(0,r.createElement)("span",null,(0,u.__)("Skipped","learnpress")),(0,r.createElement)("p",null,o.questionEmpty))))};const U=jQuery,{debounce:$}=lodash;var j=()=>{const{submitQuiz:e}=(0,a.dispatch)("learnpress/quiz");(0,r.useEffect)((()=>{const e=U("#popup-content");if(!e.length)return;const t=e.find(".content-item-scrollable:eq(1)"),s=e.find(".content-item-wrap"),n=e.find(".quiz-status"),r=n.offset().top-92;let i=!1,o="-"+s.css("margin-left");U(window).on("resize.refresh-quiz-stauts-bar",$((function(){o="-"+s.css("margin-left"),n.css({"margin-left":o,"margin-right":o})}),100)).trigger("resize.refresh-quiz-stauts-bar"),t.on("scroll",(()=>{if(t.scrollTop()>=r){if(i)return;i=!0}else{if(!i)return;i=!1}i?e.addClass("fixed-quiz-status"):e.removeClass("fixed-quiz-status")}))}),[]);const t=()=>{const{confirm:s}=(0,a.select)("learnpress/modal");"no"!==s((0,u.__)("Are you sure to submit quiz?","learnpress"),t)&&e()},{getData:s,getUserMark:n}=(0,a.select)("learnpress/quiz"),i=s("currentPage"),o=s("questionsPerPage"),l=s("questionIds").length,c=s("submitting"),d=(s("duration"),n()),p=["quiz-status"],m=(i-1)*o+1;let h=m+o-1,g="";return h=Math.min(h,l),c&&p.push("submitting"),g=h<l?o>1?(0,u.sprintf)((0,u.__)("Question <span>%d to %d of %d</span>","learnpress"),m,h,l):(0,u.sprintf)((0,u.__)("Question <span>%d of %d</span>","learnpress"),m,l):(0,u.sprintf)((0,u.__)("Question <span>%d to %d</span>","learnpress"),m,h),(0,r.createElement)("div",{className:p.join(" ")},(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"questions-index",dangerouslySetInnerHTML:{__html:g}}),(0,r.createElement)("div",{className:"current-point"},(0,u.sprintf)((0,u.__)("Earned Point: %s","learnpress"),d)),(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"submit-quiz"},(0,r.createElement)("button",{className:"lp-button",id:"button-submit-quiz",onClick:t},c?(0,u.__)("Submitting...","learnpress"):(0,u.__)("Finish Quiz","learnpress"))),(0,r.createElement)(T,null))))};const{omit:B,flow:J,isArray:G,chunk:K}=lodash,{camelCaseDashObjectKeys:W}=LP,{get:Z,set:Y}=LP.localStorage,V={},X=(e,t)=>{const{answered:s,id:n}=e,r={...s[t.questionId]||{},answered:t.answers,temp:!0};return n&&localStorage.setItem(`LP_Quiz_${n}_Answered`,JSON.stringify({...e.answered,[t.questionId]:r})),{...e,answered:{...e.answered,[t.questionId]:r}}},ee=(e,t)=>{const{questionsRendered:s}=e;return G(s)?(s.push(t.questionId),{...e,questionsRendered:[...s]}):{...e,questionsRendered:[t.questionId]}},te=(e,t)=>(t.currentPage&&Y(`Q${e.id}.currentPage`,t.currentPage),{...e,...t}),se=(e,t)=>{const s=e.questions.map((e=>e.id==t.questionId?{...e,showHint:t.showHint}:e));return{...e,questions:[...s]}},ne=(e,t)=>{const s=e.questions.map((e=>{if(e.id!==t.questionId)return e;const s={explanation:t.explanation};return t.options&&(s.options=t.options),{...e,...s}})),n={...e.answered,[t.questionId]:t.result};let r=localStorage.getItem(`LP_Quiz_${e.id}_Answered`);return r&&(r={...JSON.parse(r),...n},localStorage.setItem(`LP_Quiz_${e.id}_Answered`,JSON.stringify(r))),{...e,questions:[...s],answered:n,checkedQuestions:[...e.checkedQuestions,t.questionId]}},re=(e,t)=>{localStorage.removeItem(`LP_Quiz_${e.id}_Answered`);const s=e.questions.map((s=>{const n={};return e.reviewQuestions&&(t.results.questions[s.id].explanation&&(n.explanation=t.results.questions[s.id].explanation),t.results.questions[s.id].options&&(n.options=t.results.questions[s.id].options)),{...s,...n}}));return te(e,{submitting:!1,currentPage:1,...t.results,questions:[...s]})},ie=(e,t)=>{const s=void 0!==t.results.success&&t.results.success,n=t.results.message||!1;return te(e,{checkedQuestions:[],hintedQuestions:[],mode:"",currentPage:1,...t.results.results,successResponse:s,messageResponse:n})},oe=J(a.combineReducers,(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)))({a(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{a:1}},b(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{b:2}}});var ae=(0,a.combineReducers)({blocks:oe,userQuiz:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_QUIZ_DATA":1>t.data.questionsPerPage&&(t.data.questionsPerPage=1);const s=K(e.questionIds||t.data.questionIds,t.data.questionsPerPage);return t.data.numPages=s.length,t.data.pages=s,{...e,...t.data,currentPage:Z(`Q${t.data.id}.currentPage`)||t.data.currentPage};case"SUBMIT_QUIZ":return{...e,submitting:!0};case"START_QUIZ":case"START_QUIZ_SUCCESS":return ie(e,t);case"SET_CURRENT_QUESTION":return Y(`Q${e.id}.currentQuestion`,t.questionId),{...e,currentQuestion:t.questionId};case"SET_CURRENT_PAGE":return Y(`Q${e.id}.currentPage`,t.currentPage),{...e,currentPage:t.currentPage};case"SUBMIT_QUIZ_SUCCESS":return re(e,t);case"UPDATE_USER_QUESTION_ANSWERS":return"started"===e.status?X(e,t):e;case"MARK_QUESTION_RENDERED":return ee(e,t);case"SET_QUIZ_MODE":return"reviewing"==t.mode?te(e,{mode:t.mode}):{...e,mode:t.mode};case"SET_QUESTION_HINT":return se(e,t);case"CHECK_ANSWER":return ne(e,t);case"SEND_KEY":return{...e,keyPressed:t.keyPressed}}return e}}),ue=window.LP.dataControls;function le(){const e=[].slice.call(arguments,2),t=(0,a.dispatch)(arguments[0]),s=arguments[1];t[s](...e)}const{camelCaseDashObjectKeys:ce,Hook:de}=LP;function pe(e,t){return{type:"SET_QUIZ_DATA",data:ce(t="string"==typeof e?{[e]:t}:e)}}function me(e){return{type:"SET_CURRENT_QUESTION",questionId:e}}function he(e){return{type:"SET_CURRENT_PAGE",currentPage:e}}function ge(e,t,s){return{type:"BEFORE_START_QUIZ"}}function fe(e,t,s,n){return de.doAction("quiz-started",e,t,s,n),{type:"START_QUIZ_SUCCESS",quizId:t,courseId:s,userId:n,results:e}}const _e=function*(){const{itemId:e,courseId:t}=(0,a.select)("learnpress/quiz").getDefaultRestArgs();if(!0!==de.applyFilters("before-start-quiz",!0,e,t))return;let s=yield(0,ue.apiFetch)({path:"lp/v1/users/start-quiz",method:"POST",data:{item_id:e,course_id:t}});const n=document.querySelector(".lp-button.start");if("error"!==s.status){if(s=de.applyFilters("request-start-quiz-response",s,e,t),1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id;window.localStorage.removeItem(e);const t={endTime:Date.now()+1e3*s.results.duration,status:s.results.status};window.localStorage.setItem(e,JSON.stringify(t));const n="quiz_off_retaken_"+lpQuizSettings.id;let r=window.localStorage.getItem(n);null===r?r=0:r++,window.localStorage.setItem(n,r)}yield le("learnpress/quiz","__requestStartQuizSuccess",ce(s),e,t)}else{const e=document.querySelector(".quiz-buttons"),t=`<div class="learn-press-message error">${s.message}</div>`;e.insertAdjacentHTML("afterend",t),n.classList.remove("loading")}};function qe(){return{type:"SUBMIT_QUIZ"}}function we(e,t,s){return de.doAction("quiz-submitted",e,t,s),{type:"SUBMIT_QUIZ_SUCCESS",results:e}}function*ve(){const{getDefaultRestArgs:e,getQuestionsSelectedAnswers:t}=(0,a.select)("learnpress/quiz"),{itemId:s,courseId:n}=e();if(!0!==de.applyFilters("before-submit-quiz",!0))return;const r=t();if(1===lpQuizSettings.checkNorequizenroll){const e=`LP_Quiz_${s}_Answered`,t=localStorage.getItem(e);if(null!==t){const e=JSON.parse(t);for(const[t,s]of Object.entries(e))r[t]=s.answered}}let i=0;const o=document.querySelector("input[name=lp-quiz-time-spend]");o&&(i=o.value);let u=yield(0,ue.apiFetch)({path:"lp/v1/users/submit-quiz",method:"POST",data:{item_id:s,course_id:n,answered:r,time_spend:i}});if(u=de.applyFilters("request-submit-quiz-response",u,s,n),"success"===u.status){if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,t=window.localStorage.getItem(e);if(null!==t){const s=JSON.parse(t);s.status=u.results.status,s.results=u.results.results,window.localStorage.setItem(e,JSON.stringify(s)),window.localStorage.removeItem("LP_Quiz_"+lpQuizSettings.id+"_Answered")}}yield le("learnpress/quiz","__requestSubmitQuizSuccess",ce(u.results),s,n)}}function Se(e,t,s){return{type:"UPDATE_USER_QUESTION_ANSWERS",questionId:e,answers:t}}function ye(e,t){return{type:"SET_QUESTION_HINT",questionId:e,showHint:t}}function*Ee(e,t){yield le("learnpress/quiz","__requestShowHintSuccess",e,t)}function ze(e,t){return{type:"CHECK_ANSWER",questionId:e,...t}}function*be(e){const{getDefaultRestArgs:t,getQuestionAnswered:s}=(0,a.select)("learnpress/quiz"),{itemId:n,courseId:r}=t(),i=yield(0,ue.apiFetch)({path:"lp/v1/users/check-answer",method:"POST",data:{item_id:n,course_id:r,question_id:e,answered:s(e)||""}});if("success"===i.status){if(1===lpQuizSettings.checkNorequizenroll){const t="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(t);if(null!==s){const n=JSON.parse(s),r=i.options;void 0===n.checked_questions?(n.checked_questions=[],n.checked_questions.push(e)):-1===n.checked_questions.indexOf(e)&&n.checked_questions.push(e),void 0===n.question_options?(n.question_options={},n.question_options[e]=r):void 0===n.question_options[e]&&(n.question_options[e]=r),window.localStorage.setItem(t,JSON.stringify(n))}}yield le("learnpress/quiz","__requestCheckAnswerSuccess",e,ce(i))}}function ke(e){return{type:"MARK_QUESTION_RENDERED",questionId:e}}function Pe(e){return{type:"SET_QUIZ_MODE",mode:e}}function Qe(e){return setTimeout((()=>{le("learnpress/quiz","sendKey","")}),300),{type:"SEND_KEY",keyPressed:e}}const{get:Ne,isArray:Ie}=lodash,Ce=function(e,t){console.time("parseOptions");let s=Ue(e,t).options;return s=Ie(s)?s:JSON.parse(CryptoJS.AES.decrypt(s.data,s.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),s=Ie(s)?s:JSON.parse(s),console.timeEnd("parseOptions"),s};function Ae(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.status"):""}function Te(e,t,s){return e[t]||s}function Re(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.attempts"):[]}function Oe(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.answered",{}):{}}function Le(e){const{userQuiz:t}=e,s=Ne(t,"questions");return s?Object.values(s):[]}function xe(e,t){const{userQuiz:s}=e;return t?Ne(s,t):s}function De(e){const{userQuiz:t}=e;return{itemId:t.id,courseId:t.courseId}}function Me(e,t){const{userQuiz:s}=e;return Ne(s,`answered.${t}.answered`)||void 0}function He(e,t){const{userQuiz:s}=e;return Ne(s,`answered.${t}.mark`)||void 0}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=Ne(e,"userQuiz.questionsPerPage")||1;if(s>1)return!1;const n=Ne(e,"userQuiz.currentPage")||1;return Ne(e,"object"===t?`userQuiz.questions[${n-1}]`:`userQuiz.questionIds[${n-1}]`)}const Ue=function(e,t){const{userQuiz:s}=e;return(0,a.select)("learnpress/quiz").getQuestions().find((e=>e.id==t))};function $e(e,t){return-1!==(Ne(e,"userQuiz.checkedQuestions")||[]).indexOf(t)}function je(e,t){}const Be=function(e,t){const s=Ne(e,"userQuiz.answered"),n={};for(const e in s)if(s.hasOwnProperty(e)&&(s[e].temp||s[e].blanks)){if(t&&e===t)return s[e].answered;n[e]=s[e].answered}return n};function Je(e){const t=e.userQuiz||{},{answered:s,negativeMarking:n,questions:r,checkedQuestions:i}=t;let o=0;for(let e in s){if(!s.hasOwnProperty(e))continue;e=parseInt(e);const t=s[e],a=t.questionMark?t.questionMark:function(){const t=r.find((t=>t.id===e));return t?t.point:0}();i.indexOf(e),t.temp||(n?t.answered&&(o=t.correct?o+t.mark:o-a):t.answered&&t.correct&&(o+=t.mark))}return o>0?o:0}var Ge=s(965),Ke=s.n(Ge);const We={ENROLL_COURSE_X:(e,t)=>{}};const{controls:Ze}=LP.dataControls;!function(e){let t=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:e.getState,dispatch:function(){return t(...arguments)}};t=Ke()(We)(s)(e.dispatch),e.dispatch=t}((0,a.registerStore)("learnpress/quiz",{reducer:ae,selectors:t,actions:e,controls:{...Ze}}));const{chunk:Ye}=lodash;class Ve extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{this.props.startQuiz()})),this.state={currentPage:1,numPages:0,pages:[]}}componentDidMount(){const{settings:e,setQuizData:t}=this.props,{question_ids:s,questions_per_page:n}=e,r=Ye(s,n);e.currentPage=1,e.numPages=r.length,e.pages=r;const i=!!e.id&&localStorage.getItem(`LP_Quiz_${e.id}_Answered`);i&&(e.answered=JSON.parse(i)),t(e)}componentDidUpdate(e,t,s){const{status:n}=e,r=document.querySelector(".quiz-content");void 0!==n&&r&&(r.style.display="none")}render(){const{status:e,isReviewing:t}=this.props,s=-1!==["","completed","viewed"].indexOf(e)||!e,n=-1!==["","viewed",void 0].indexOf(e)||!e;return void 0!==e&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,!t&&"completed"===e&&(0,r.createElement)(F,null),!t&&n&&(0,r.createElement)(d,null),"started"===e&&(0,r.createElement)(j,null),(-1!==["completed","started"].indexOf(e)||t)&&(0,r.createElement)(C,null),(0,r.createElement)(h,null),s&&!t&&(0,r.createElement)(A,null)))}}var Xe=(0,o.compose)([(0,a.withSelect)((e=>{const{getQuestions:t,getData:s}=e("learnpress/quiz");return{questions:t(),status:s("status"),store:s(),answered:s("answered"),isReviewing:"reviewing"===s("mode"),questionIds:s("questionIds"),checkCount:s("instantCheck"),questionsPerPage:s("questionsPerPage")||1}})),(0,a.withDispatch)((e=>{const{setQuizData:t,startQuiz:s}=e("learnpress/quiz");return{setQuizData:t,startQuiz:s}}))])(Ve);s(605);const{modal:{default:et}}=LP;var tt=Xe;const st=(e,t)=>{if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(e);if(null!==s){const e=JSON.parse(s);if(t.status=e.status,"started"===e.status){const s=Date.now();t.total_time=Math.floor((e.endTime-s)/1e3)}else"completed"===e.status&&(t.results=e.results,t.answered=e.results.answered,t.questions=e.results.questions);if(void 0!==e.checked_questions&&(t.checked_questions=e.checked_questions),void 0!==e.question_options)for(const s in t.questions){let n=t.questions[s];void 0!==e.question_options[n.id]&&(n.options=e.question_options[n.id]),t.questions[s]=n}}}wp.element.render((0,r.createElement)(et,null,(0,r.createElement)(Xe,{settings:t})),[...document.querySelectorAll(e)][0]),LP.Hook.doAction("lp-quiz-compatible-builder")}}(),(window.LP=window.LP||{}).quiz=n}();
1
+ !function(){var e={605:function(){LP.Hook.addAction("lp-compatible-builder",(()=>{LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(()=>(LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0))),LP.Hook.addAction("lp-question-compatible-builder",(()=>(LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0)))},184:function(e,t){var s;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var i=typeof s;if("string"===i||"number"===i)e.push(s);else if(Array.isArray(s)){if(s.length){var o=r.apply(null,s);o&&e.push(o)}}else if("object"===i)if(s.toString===Object.prototype.toString)for(var a in s)n.call(s,a)&&s[a]&&e.push(a);else e.push(s.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(s=function(){return r}.apply(t,[]))||(e.exports=s)}()},965:function(e){"use strict";function t(e,s){var n;if(Array.isArray(s))for(n=0;n<s.length;n++)t(e,s[n]);else for(n in s)e[n]=(e[n]||[]).concat(s[n])}e.exports=function(e){var s,n={};return t(n,e),(s=function(e){return function(t){return function(s){var r,i,o=n[s.type],a=t(s);if(o)for(r=0;r<o.length;r++)(i=o[r](s,e))&&e.dispatch(i);return a}}}).effects=n,s}}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,s),i.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";s.r(n),s.d(n,{default:function(){return tt},init:function(){return st}});var e={};s.r(e),s.d(e,{__requestBeforeStartQuiz:function(){return ge},__requestCheckAnswerSuccess:function(){return ze},__requestShowHintSuccess:function(){return ye},__requestStartQuizSuccess:function(){return fe},__requestSubmitQuiz:function(){return qe},__requestSubmitQuizSuccess:function(){return we},checkAnswer:function(){return ke},markQuestionRendered:function(){return be},sendKey:function(){return Qe},setCurrentPage:function(){return he},setCurrentQuestion:function(){return me},setQuizData:function(){return pe},setQuizMode:function(){return Pe},showHint:function(){return Ee},startQuiz:function(){return _e},submitQuiz:function(){return ve},updateUserQuestionAnswers:function(){return Se}});var t={};s.r(t),s.d(t,{getCurrentQuestion:function(){return Fe},getData:function(){return xe},getDefaultRestArgs:function(){return De},getItemStatus:function(){return Ae},getProp:function(){return Te},getQuestion:function(){return Ue},getQuestionAnswered:function(){return Me},getQuestionMark:function(){return He},getQuestionOptions:function(){return Ce},getQuestions:function(){return Le},getQuestionsSelectedAnswers:function(){return Be},getQuizAnswered:function(){return Oe},getQuizAttempts:function(){return Re},getUserMark:function(){return Je},isCheckedAnswer:function(){return $e},isCorrect:function(){return je}});var r=window.wp.element;function i(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var o=window.wp.compose,a=window.wp.data,u=window.wp.i18n,l=e=>{let t;const s=86400;if(e>s)t=(e-e%s)/s,e%=s;else if(e==s)return"24:00";const n=new Date(1e3*e).toUTCString().match(/\d{2}:\d{2}:\d{2}/)[0].split(":");return t&&(n[0]=parseInt(n[0])+24*t),n.join(":")};const{Hook:c}=LP;var d=()=>{const e=e=>(0,a.select)("learnpress/quiz").getData(e),t=c.applyFilters("quiz-meta-fields",{duration:{title:(0,u.__)("Duration:","learnpress"),name:"duration",content:l(e("duration"))||"--"},passingGrade:{title:(0,u.__)("Passing grade:","learnpress"),name:"passing-grade",content:e("passingGrade")||"--"},questionsCount:{title:(0,u.__)("Questions:","learnpress"),name:"questions-count",content:e("questionIds")?e("questionIds").length:0}});return t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("ul",{className:"quiz-intro"},Object.values(t).map(((e,t)=>{const s=e.name||t;return(0,r.createElement)("li",{key:`quiz-intro-field-${t}`,className:`quiz-intro-item quiz-intro-item--${s}`},(0,r.createElement)("div",{className:"quiz-intro-item__title",dangerouslySetInnerHTML:{__html:e.title}}),(0,r.createElement)("span",{className:"quiz-intro-item__content",dangerouslySetInnerHTML:{__html:e.content}}))}))))};class p extends r.Component{constructor(){super(...arguments),i(this,"startQuiz",(e=>{e&&e.preventDefault();const t=document.querySelector(".lp-button.start");t&&t.setAttribute("disabled","disabled"),t.classList.add("loading");const{startQuiz:s,status:n}=this.props;if("completed"===n){const{confirm:e,isOpen:s}=(0,a.select)("learnpress/modal");if("no"===e((0,u.__)("Are you sure you want to retake the quiz?","learnpress"),this.startQuiz))return void(!s()&&t&&t.removeAttribute("disabled"))}s()})),i(this,"nav",(e=>t=>{let{questionNav:s,currentPage:n,numPages:r,setCurrentPage:i}=this.props;"prev"===e?n>1?n-=1:n="infinity"===s?r:1:n<r?n+=1:n="infinity"===s?1:r,i(n)})),i(this,"moveTo",(e=>t=>{t.preventDefault();const{numPages:s,setCurrentPage:n}=this.props;e<1||e>s||n(e)})),i(this,"isLast",(()=>{const{currentPage:e,numPages:t}=this.props;return e===t})),i(this,"isFirst",(()=>{const{currentPage:e}=this.props;return 1===e})),i(this,"submit",(()=>{const{submitQuiz:e}=this.props,{confirm:t}=(0,a.select)("learnpress/modal");"no"!==t((0,u.__)("Are you sure to submit the quiz?","learnpress"),this.submit)&&e()})),i(this,"setQuizMode",(e=>()=>{const{setQuizMode:t}=this.props;t(e)})),i(this,"isReviewing",(()=>{const{isReviewing:e}=this.props;return e}))}pageNumbers(e){const{numPages:t,currentPage:s}=this.props;if(t<2)return"";(e={numPages:t,currentPage:s,midSize:1,endSize:1,prevNext:!0,...e||{}}).endSize<1&&(e.endSize=1),e.midSize<0&&(e.midSize=1);const n=[...Array(t).keys()];let i=!1;return(0,r.createElement)("div",{className:"nav-links"},e.prevNext&&!this.isFirst()&&(0,r.createElement)("button",{className:"page-numbers prev","data-type":"question-navx",onClick:this.nav("prev")},(0,u.__)("Prev","learnpress")),n.map((t=>(t+=1)===e.currentPage?(i=!0,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers current"},t)):t<=e.endSize||e.currentPage&&t>=e.currentPage-e.midSize&&t<=e.currentPage+e.midSize||t>e.numPages-e.endSize?(i=!0,(0,r.createElement)("button",{key:`page-number-${t}`,className:"page-numbers",onClick:this.moveTo(t)},t)):i?(i=!1,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers dots"},"…")):"")),e.prevNext&&!this.isLast()&&(0,r.createElement)("button",{className:"page-numbers next","data-type":"question-navx",onClick:this.nav("next")},(0,u.__)("Next","learnpress")))}render(){const{status:e,questionNav:t,isReviewing:s,showReview:n,numPages:i,question:o,questionsPerPage:a,canRetry:l,retakeNumber:c,requiredPassword:d,allowRetake:p}=this.props,m=["quiz-buttons"];("started"===e||s)&&m.push("align-center"),"questionNav"===t&&m.push("infinity"),this.isFirst()&&m.push("is-first"),this.isLast()&&m.push("is-last");const h=document.querySelector("#popup-sidebar"),g=document.querySelector("#learn-press-quiz-app");let f="";f="started"===e||s?{marginLeft:h&&h.offsetWidth/2,width:g&&g.offsetWidth}:null;let _=" fixed";return"no"==lpQuizSettings.navigationPosition&&(_=" nav-center"),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:m.join(" ")},(0,r.createElement)("div",{className:"button-left"+("started"===e||s?_:""),style:f},("completed"===e&&l||-1!==["","viewed"].indexOf(e))&&!s&&!d&&(0,r.createElement)("button",{className:"lp-button start",onClick:this.startQuiz},"completed"===e?`${(0,u.__)("Retake","learnpress")} ${p?"":" "+(c?` (${c})`:"")} `:" "+(0,u.__)("Start","learnpress")),("started"===e||s)&&i>1&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"questions-pagination"},this.pageNumbers()))),(0,r.createElement)("div",{className:"button-right"},"started"===e&&(0,r.createElement)(r.Fragment,null,("infinity"===t||this.isLast())&&!s&&(0,r.createElement)("button",{className:"lp-button submit-quiz",onClick:this.submit},(0,u.__)("Finish Quiz","learnpress"))),s&&n&&(0,r.createElement)("button",{className:"lp-button back-quiz",onClick:this.setQuizMode("")},(0,u.__)("Result","learnpress")),"completed"===e&&n&&!s&&(0,r.createElement)("button",{className:"lp-button review-quiz",onClick:this.setQuizMode("reviewing")},(0,u.__)("Review","learnpress")))),this.props.message&&!0!==this.props.success&&(0,r.createElement)("div",{className:"learn-press-message error"},this.props.message))}}const m=(0,o.compose)((0,a.withSelect)((e=>{const{getData:t}=e("learnpress/quiz");return{status:t("status"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),questionsPerPage:t("questionsPerPage")}})))((e=>{const{showCheck:t,checkedQuestions:s,hintedQuestions:n,question:i,status:o,type:a,Button:u}=e;if("started"!==o)return!1;const l=(0,r.createElement)(u,{question:i});switch(a){case"hint":return n?!!i.hasHint&&-1===n.indexOf(i.id)&&l:l;case"check":return!!t&&(s?-1===s.indexOf(i.id)&&l:l)}}));var h=(0,o.compose)([(0,a.withSelect)((e=>{const{getData:t,getCurrentQuestion:s}=e("learnpress/quiz"),n={id:t("id"),status:t("status"),questionIds:t("questionIds"),questionNav:t("questionNav"),isReviewing:t("reviewQuestions")&&"reviewing"===t("mode"),showReview:t("reviewQuestions"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),numPages:t("numPages"),pages:t("pages"),currentPage:t("currentPage"),questionsPerPage:t("questionsPerPage"),pageNumbers:t("pageNumbers"),keyPressed:t("keyPressed"),canRetry:t("retakeCount")>0&&t("retaken")<t("retakeCount"),retakeNumber:t("retakeCount")>0&&t("retaken")<t("retakeCount")?t("retakeCount")-t("retaken"):null,message:t("messageResponse")||!1,success:void 0===t("successResponse")||t("successResponse"),requiredPassword:t("requiredPassword"),allowRetake:t("allowRetake")};if(1===n.questionsPerPage&&(n.question=s("object")),1===lpQuizSettings.checkNorequizenroll){const e=window.localStorage.getItem("quiz_off_retaken_"+lpQuizSettings.id);t("retakeCount")>e?(n.retakeNumber=t("retakeCount")-e,n.canRetry=!0):n.canRetry=!1}return n.allowRetake&&(n.canRetry=!0),n})),(0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{startQuiz:n,setCurrentQuestion:r,submitQuiz:i,setQuizMode:o,showHint:a,checkAnswer:u,setCurrentPage:l}=e("learnpress/quiz");return{startQuiz:n,setCurrentQuestion:r,setQuizMode:o,setCurrentPage:l,submitQuiz(e){i(e)},showHint(e){a(e)},checkAnswer(e){u(e)}}}))])(p);function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},g.apply(this,arguments)}class f extends r.Component{constructor(){super(...arguments),i(this,"showHint",(()=>{const{showHint:e,question:t}=this.props;e(t.id,!t.showHint)}))}render(){const{question:e}=this.props;return e.hint?(0,r.createElement)("button",{className:"btn-show-hint",onClick:this.showHint},(0,r.createElement)("span",null,(0,u.__)("Hint","learnpress"))):""}}var _=(0,o.compose)((0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{showHint:n}=e("learnpress/quiz");return{showHint(e,t){n(e,t)}}})))(f),q=s(184),w=s.n(q);class v extends r.Component{constructor(){super(...arguments),i(this,"checkAnswer",(()=>{const{checkAnswer:e,question:t,answered:s}=this.props;s&&(e(t.id),this.setState({loading:!0}))})),this.state={loading:!1}}render(){const{answered:e}=this.props;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("button",{className:w()("lp-button","instant-check",{loading:this.state.loading,disable:!e}),onClick:this.checkAnswer},(0,r.createElement)("span",{className:"instant-check__icon"}),(0,u.__)("Check answers","learnpress"),!e&&(0,r.createElement)("div",{className:"instant-check__info",dangerouslySetInnerHTML:{__html:(0,u.__)("You need to answer the question before checking the answer key.","learnpress")}})))}}var S=(0,o.compose)((0,a.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getQuestionAnswered:n}=e("learnpress/quiz");return{answered:n(s)}})),(0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{checkAnswer:n}=e("learnpress/quiz");return{checkAnswer(e){n(e)}}})))(v),y=function(e){const{question:t}=e,s={"instant-check":()=>(0,r.createElement)(m,{type:"check",Button:S,question:t}),hint:()=>(0,r.createElement)(m,{type:"hint",Button:_,question:t})};return(0,r.createElement)(r.Fragment,null,LP.config.questionFooterButtons().map((e=>(0,r.createElement)(r.Fragment,{key:`button-${e}`},s[e]&&s[e]()))))};const E=window.jQuery,{uniqueId:z,isArray:k,isNumber:b,bind:P}=lodash;class Q extends r.Component{constructor(){super(...arguments),i(this,"setRef",(e=>{this.$wrap=E(e)})),i(this,"parseOptions",(e=>(e&&(e=k(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=k(e)?e:JSON.parse(e)),e||[]))),i(this,"getWrapperClass",(()=>{const{question:e,answered:t}=this.props,s=["question","question-"+e.type],n=this.parseOptions(e.options);return n.length&&void 0!==n[0].isTrue&&s.push("question-answered"),s})),i(this,"getEditLink",(()=>{const{question:e,editPermalink:t}=this.props;return t?t.replace(/post=(.*[0-9])/,`post=${e.id}`):""})),i(this,"editPermalink",(e=>(0,u.sprintf)('<a href="%s">%s</a>',e,(0,u.__)("Edit","learnpress")))),this.state={time:null,showHint:!1},this.$wrap=null}componentDidMount(e){const{question:t,isCurrent:s,markQuestionRendered:n}=this.props;return s&&n(t.id),this.state.time||this.setState({time:new Date}),LP.Hook.doAction("lp-question-compatible-builder"),"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),e}render(){const{question:e,isShow:t,isShowIndex:s,isShowHint:n,status:i}=this.props,o=LP.questionTypes.default,a=this.getEditLink();a&&jQuery("#wp-admin-bar-edit-lp_question").find(".ab-item").attr("href",a);const l={index:()=>s?(0,r.createElement)("span",{className:"question-index"},s,"."):"",title:()=>(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:e.title}}),hint:()=>(0,r.createElement)(_,{question:e}),"edit-permalink":()=>a&&(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:this.editPermalink(a)},className:"edit-link"})},c={title:()=>(0,r.createElement)("h4",{className:"question-title"},LP.config.questionTitleParts().map((e=>(0,r.createElement)(r.Fragment,{key:`title-part-${e}`},l[e]&&l[e]())))),content:()=>(0,r.createElement)("div",{className:"question-content",dangerouslySetInnerHTML:{__html:e.content}}),"answer-options":()=>this.$wrap&&(0,r.createElement)(o,g({},this.props,{$wrap:this.$wrap})),explanation:()=>e.explanation&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-explanation-content"},(0,r.createElement)("strong",{className:"explanation-title"},(0,u.__)("Explanation","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.explanation}}))),hint:()=>e.hint&&!e.explanation&&e.showHint&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-hint-content"},(0,r.createElement)("strong",{className:"hint-title"},(0,u.__)("Hint","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.hint}}))),buttons:()=>"started"===i&&(0,r.createElement)(y,{question:e})},d=LP.config.questionBlocks();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:this.getWrapperClass().join(" "),style:{display:t?"":"none"},"data-id":e.id,ref:this.setRef},d.map((e=>(0,r.createElement)(r.Fragment,{key:`block-${e}`},c[e]?c[e]():"")))))}}var N=(0,o.compose)([(0,a.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getData:n,getQuestionAnswered:r,getQuestionMark:i}=e("learnpress/quiz");return{status:n("status"),questions:n("question"),answered:r(s),questionsRendered:n("questionsRendered"),editPermalink:n("editPermalink"),numPages:n("numPages"),mark:i(s)||""}})),(0,a.withDispatch)((e=>{const{updateUserQuestionAnswers:t,markQuestionRendered:s}=e("learnpress/quiz");return{markQuestionRendered:s,updateUserQuestionAnswers:t}}))])(Q);class I extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{e.preventDefault();const{startQuiz:t}=this.props;t()})),i(this,"isInVisibleRange",((e,t)=>{const{currentPage:s,questionsPerPage:n}=this.props;return s===Math.ceil(t/n)})),i(this,"nav",(e=>{const{sendKey:t}=this.props;switch(e.keyCode){case 37:return t("left");case 38:case 40:return;case 39:return t("right");default:e.keyCode>=49&&e.keyCode<=57&&t(e.keyCode-48)}})),this.needToTop=!1,this.state={isReviewing:null,currentPage:0,self:this}}static getDerivedStateFromProps(e,t){const s=["isReviewing","currentPage"],n={};for(let r=0;r<s.length;r++)e[s[r]]!==t[s[r]]&&(n[s[r]]=e[s[r]]);return Object.values(n).length?(t.self.needToTop=!0,n):null}componentDidUpdate(){this.needToTop&&(jQuery("#popup-content").animate({scrollTop:0}).find(".content-item-scrollable:last").animate({scrollTop:0}),this.needToTop=!1)}render(){const{status:e,currentQuestion:t,questions:s,questionsRendered:n,isReviewing:i,questionsPerPage:o}=this.props;let a=!0;return"completed"!==e||i||(a=!1),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{tabIndex:100,onKeyUp:this.nav},(0,r.createElement)("div",{className:"quiz-questions",style:{display:a?"":"none"}},s.map(((e,s)=>{const i=!o&&t===e.id,a=n&&-1!==n.indexOf(e.id),u=this.isInVisibleRange(e.id,s+1);return a||!a||u?(0,r.createElement)(N,{key:`loop-question-${e.id}`,isCurrent:i,isShow:u,isShowIndex:!!o&&s+1,questionsPerPage:o,question:e}):""})))))}}var C=(0,o.compose)((0,a.withSelect)(((e,t,s)=>{const{getData:n,getQuestions:r}=e("learnpress/quiz");return{status:n("status"),currentQuestion:n("currentQuestion"),questions:r(),questionsRendered:n("questionsRendered"),isReviewing:"reviewing"===n("mode"),numPages:n("numPages"),currentPage:n("currentPage"),questionsPerPage:n("questionsPerPage")||1}})),(0,a.withDispatch)((e=>{const{startQuiz:t,sendKey:s}=e("learnpress/quiz");return{startQuiz:t,sendKey:s}})))(I),A=()=>{const e=(0,a.select)("learnpress/quiz").getData("attempts")||[],t=e&&!!e.length;return!!t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"quiz-attempts"},(0,r.createElement)("h4",{className:"attempts-heading"},(0,u.__)("Last Attempt","learnpress")),t&&(0,r.createElement)("table",null,(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)("th",{className:"quiz-attempts__questions"},(0,u.__)("Questions","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__spend"},(0,u.__)("Time spent","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__marks"},(0,u.__)("Marks","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__grade"},(0,u.__)("Passing grade","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__result"},(0,u.__)("Result","learnpress")))),(0,r.createElement)("tbody",null,e.map(((e,t)=>(0,r.createElement)("tr",{key:`attempt-${t}`},(0,r.createElement)("td",{className:"quiz-attempts__questions"},`${e.questionCorrect} / ${e.questionCount}`),(0,r.createElement)("td",{className:"quiz-attempts__spend"},e.timeSpend||"--"),(0,r.createElement)("td",{className:"quiz-attempts__marks"},`${e.userMark} / ${e.mark}`),(0,r.createElement)("td",{className:"quiz-attempts__grade"},e.passingGrade||"-"),(0,r.createElement)("td",{className:"quiz-attempts__result"},`${parseFloat(e.result).toFixed(2)}%`," ",(0,r.createElement)("span",null,e.graduationText)))))))))},T=()=>{const{getData:e}=(0,a.select)("learnpress/quiz"),{submitQuiz:t}=(0,a.dispatch)("learnpress/quiz"),s=e("totalTime"),n=e("duration"),[i,o]=(0,r.useState)(s);let[u,l]=(0,r.useState)(0);return(0,r.useEffect)((()=>{const e=setInterval((()=>{if(n>0){let s=i;s-=1,s>0?(o(s),u++,l(n-s)):(clearInterval(e),t())}else u++,l(u),o(u)}),1e3);return()=>clearInterval(e)}),[i,u]),(0,r.createElement)("div",{className:"countdown"},(0,r.createElement)("i",{className:"fas fa-stopwatch"}),(0,r.createElement)("span",null,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";const t=[];let n;return s<3600?(t.push((i-i%60)/60),t.push(i%60)):s&&(t.push((i-i%3600)/3600),n=i%3600,t.push((n-n%60)/60),t.push(n%60)),t.map((e=>e<10?`0${e}`:e)).join(e)}()),(0,r.createElement)("input",{type:"hidden",name:"lp-quiz-time-spend",value:u}))},R=window.wp.url;const O=jQuery;let L=null;const x={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init(){return!!this.instance||(this.elLPOverlay=O(".lp-overlay"),!!this.elLPOverlay.length&&(L=this.elLPOverlay,this.elMainContent=L.find(".main-content"),this.elTitle=L.find(".modal-title"),this.elBtnYes=L.find(".btn-yes"),this.elBtnNo=L.find(".btn-no"),this.elFooter=L.find(".lp-modal-footer"),O(document).on("click",".close, .btn-no",(function(){L.hide()})),O(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof x.callBackYes&&x.callBackYes()})),this.instance=this,!0))},setElCalledModal(e){this.elCalledModal=e},setContentModal(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal(e){this.elTitle.html(e)}};var D=x,M={elBtnFinishCourse:null,elBtnCompleteItem:null,init(){D.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((e=>e.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})))))}};const{debounce:H}=lodash;var F=()=>{const[e,t]=(0,r.useState)(0),[s,n]=(0,r.useState)(!1),i=(0,a.useSelect)((e=>e("learnpress/quiz").getData("id")),[]),o=(0,a.useSelect)((e=>e("learnpress/quiz").getData("results")),[]),l=(0,a.useSelect)((e=>e("learnpress/quiz").getData("passingGrade")),[]),c=(0,a.useSelect)((e=>e("learnpress/quiz").getData("submitting")),[]);(0,r.useEffect)((()=>{p();let e="";if(e=o.graduation?o.graduation:o.result>=f?"passed":"failed",e){const t=document.querySelector(`.course-curriculum .course-item.course-item-${i}`);t&&(t.classList.remove("failed","passed"),t.classList.add("has-status","status-completed",e))}const t=[...document.querySelectorAll("#popup-header .items-progress")][0],s=document.querySelector(".curriculum-sections");if(t&&s){const e=t.dataset.totalItems,s=t.querySelector(".items-completed"),n=t.querySelector(".learn-press-progress__active");if(s){const t=document.querySelectorAll("#popup-sidebar .course-curriculum .course-item.status-completed");s.textContent=parseInt(t.length);const r=100-100*parseInt(t.length)/parseInt(e);n.style.left="-"+r+"%"}}}),[o]),(0,r.useEffect)((()=>{void 0!==c&&d()}),[c]);const d=()=>{const e=document.querySelectorAll(".popup-header__inner");e.length>0&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&(async e=>{const t=await wp.apiFetch({path:(0,R.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"}),{data:s}=t;e.innerHTML+=s,M.init()})(e[0])},p=()=>{t(0),n(!1),jQuery.easing._customEasing=function(e,t,s,n,r){return n*Math.sqrt(1-(t=t/r-1)*t)+s},H((()=>{const e=jQuery("<span />").css({width:1,height:1}).appendTo(document.body);e.css("left",0).animate({left:o.result},{duration:1500,step:(e,s)=>{t(e)},done:()=>{n(!0),e.remove(),jQuery("#quizResultGrade").css({transform:"scale(1.3)",transition:"all 0.25s"}),H((()=>{jQuery("#quizResultGrade").css({transform:"scale(1)"})}),500)()},easing:"_customEasing"})}),o.result>0?1e3:10)()};let m=e;Number.isInteger(e)||(m=parseFloat(e).toFixed(2));const h=190*Math.PI,g={strokeDasharray:`${h} ${h}`,strokeDashoffset:h-m/100*h},f=parseFloat(o.passingGrade||l);let _="";_=o.graduation?o.graduation:m>=f?"passed":"failed";let q="";q=o.graduationText?o.graduationText:"passed"===_?(0,u.__)("Passed","learnpress"):(0,u.__)("Failed","learnpress");const w=["quiz-result",_];return(0,r.createElement)("div",{className:w.join(" ")},(0,r.createElement)("h3",{className:"result-heading"},(0,u.__)("Your Result","learnpress")),(0,r.createElement)("div",{id:"quizResultGrade",className:"result-grade"},(0,r.createElement)("svg",{className:"circle-progress-bar",width:200,height:200},(0,r.createElement)("circle",{className:"circle-progress-bar__circle",stroke:"",strokeWidth:10,style:g,fill:"transparent",r:95,cx:100,cy:100})),(0,r.createElement)("span",{className:"result-achieved"},`${m}%`),(0,r.createElement)("span",{className:"result-require"},f+"%"||0)),s&&(0,r.createElement)("p",{className:"result-message"},q),(0,r.createElement)("ul",{className:"result-statistic"},(0,r.createElement)("li",{className:"result-statistic-field result-time-spend"},(0,r.createElement)("span",null,(0,u.__)("Time spent","learnpress")),(0,r.createElement)("p",null,o.timeSpend)),(0,r.createElement)("li",{className:"result-statistic-field result-point"},(0,r.createElement)("span",null,(0,u.__)("Points","learnpress")),(0,r.createElement)("p",null,o.userMark," / ",o.mark)),(0,r.createElement)("li",{className:"result-statistic-field result-questions"},(0,r.createElement)("span",null,(0,u.__)("Questions","learnpress")),(0,r.createElement)("p",null,o.questionCount)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-correct"},(0,r.createElement)("span",null,(0,u.__)("Correct","learnpress")),(0,r.createElement)("p",null,o.questionCorrect)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-wrong"},(0,r.createElement)("span",null,(0,u.__)("Wrong","learnpress")),(0,r.createElement)("p",null,o.questionWrong)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-skipped"},(0,r.createElement)("span",null,(0,u.__)("Skipped","learnpress")),(0,r.createElement)("p",null,o.questionEmpty))))};const U=jQuery,{debounce:$}=lodash;var j=()=>{const{submitQuiz:e}=(0,a.dispatch)("learnpress/quiz");(0,r.useEffect)((()=>{const e=U("#popup-content");if(!e.length)return;const t=e.find(".content-item-scrollable:eq(1)"),s=e.find(".content-item-wrap"),n=e.find(".quiz-status"),r=n.offset().top-92;let i=!1,o="-"+s.css("margin-left");U(window).on("resize.refresh-quiz-stauts-bar",$((function(){o="-"+s.css("margin-left"),n.css({"margin-left":o,"margin-right":o})}),100)).trigger("resize.refresh-quiz-stauts-bar"),t.on("scroll",(()=>{if(t.scrollTop()>=r){if(i)return;i=!0}else{if(!i)return;i=!1}i?e.addClass("fixed-quiz-status"):e.removeClass("fixed-quiz-status")}))}),[]);const t=()=>{const{confirm:s}=(0,a.select)("learnpress/modal");"no"!==s((0,u.__)("Are you sure to submit the quiz?","learnpress"),t)&&e()},{getData:s,getUserMark:n}=(0,a.select)("learnpress/quiz"),i=s("currentPage"),o=s("questionsPerPage"),l=s("questionIds").length,c=s("submitting"),d=(s("duration"),n()),p=["quiz-status"],m=(i-1)*o+1;let h=m+o-1,g="";return h=Math.min(h,l),c&&p.push("submitting"),g=h<l?o>1?(0,u.sprintf)((0,u.__)("Question <span>%d to %d of %d</span>","learnpress"),m,h,l):(0,u.sprintf)((0,u.__)("Question <span>%d of %d</span>","learnpress"),m,l):(0,u.sprintf)((0,u.__)("Question <span>%d to %d</span>","learnpress"),m,h),(0,r.createElement)("div",{className:p.join(" ")},(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"questions-index",dangerouslySetInnerHTML:{__html:g}}),(0,r.createElement)("div",{className:"current-point"},(0,u.sprintf)((0,u.__)("Earned Point: %s","learnpress"),d)),(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"submit-quiz"},(0,r.createElement)("button",{className:"lp-button",id:"button-submit-quiz",onClick:t},c?(0,u.__)("Submitting...","learnpress"):(0,u.__)("Finish Quiz","learnpress"))),(0,r.createElement)(T,null))))};const{omit:B,flow:J,isArray:G,chunk:K}=lodash,{camelCaseDashObjectKeys:W}=LP,{get:Z,set:Y}=LP.localStorage,V={},X=(e,t)=>{const{answered:s,id:n}=e,r={...s[t.questionId]||{},answered:t.answers,temp:!0};return n&&localStorage.setItem(`LP_Quiz_${n}_Answered`,JSON.stringify({...e.answered,[t.questionId]:r})),{...e,answered:{...e.answered,[t.questionId]:r}}},ee=(e,t)=>{const{questionsRendered:s}=e;return G(s)?(s.push(t.questionId),{...e,questionsRendered:[...s]}):{...e,questionsRendered:[t.questionId]}},te=(e,t)=>(t.currentPage&&Y(`Q${e.id}.currentPage`,t.currentPage),{...e,...t}),se=(e,t)=>{const s=e.questions.map((e=>e.id==t.questionId?{...e,showHint:t.showHint}:e));return{...e,questions:[...s]}},ne=(e,t)=>{const s=e.questions.map((e=>{if(e.id!==t.questionId)return e;const s={explanation:t.explanation};return t.options&&(s.options=t.options),{...e,...s}})),n={...e.answered,[t.questionId]:t.result};let r=localStorage.getItem(`LP_Quiz_${e.id}_Answered`);return r&&(r={...JSON.parse(r),...n},localStorage.setItem(`LP_Quiz_${e.id}_Answered`,JSON.stringify(r))),{...e,questions:[...s],answered:n,checkedQuestions:[...e.checkedQuestions,t.questionId]}},re=(e,t)=>{localStorage.removeItem(`LP_Quiz_${e.id}_Answered`);const s=e.questions.map((s=>{const n={};var r,i;return e.reviewQuestions&&(null!==(r=t.results.questions[s.id])&&void 0!==r&&r.explanation&&(n.explanation=t.results.questions[s.id].explanation),null!==(i=t.results.questions[s.id])&&void 0!==i&&i.options&&(n.options=t.results.questions[s.id].options)),{...s,...n}}));return te(e,{submitting:!1,currentPage:1,...t.results,questions:[...s]})},ie=(e,t)=>{const s=void 0!==t.results.success&&t.results.success,n=t.results.message||!1;return te(e,{checkedQuestions:[],hintedQuestions:[],mode:"",currentPage:1,...t.results.results,successResponse:s,messageResponse:n})},oe=J(a.combineReducers,(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)))({a(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{a:1}},b(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{b:2}}});var ae=(0,a.combineReducers)({blocks:oe,userQuiz:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_QUIZ_DATA":1>t.data.questionsPerPage&&(t.data.questionsPerPage=1);const s=K(e.questionIds||t.data.questionIds,t.data.questionsPerPage);return t.data.numPages=s.length,t.data.pages=s,{...e,...t.data,currentPage:Z(`Q${t.data.id}.currentPage`)||t.data.currentPage};case"SUBMIT_QUIZ":return{...e,submitting:!0};case"START_QUIZ":case"START_QUIZ_SUCCESS":return ie(e,t);case"SET_CURRENT_QUESTION":return Y(`Q${e.id}.currentQuestion`,t.questionId),{...e,currentQuestion:t.questionId};case"SET_CURRENT_PAGE":return Y(`Q${e.id}.currentPage`,t.currentPage),{...e,currentPage:t.currentPage};case"SUBMIT_QUIZ_SUCCESS":return re(e,t);case"UPDATE_USER_QUESTION_ANSWERS":return"started"===e.status?X(e,t):e;case"MARK_QUESTION_RENDERED":return ee(e,t);case"SET_QUIZ_MODE":return"reviewing"==t.mode?te(e,{mode:t.mode}):{...e,mode:t.mode};case"SET_QUESTION_HINT":return se(e,t);case"CHECK_ANSWER":return ne(e,t);case"SEND_KEY":return{...e,keyPressed:t.keyPressed}}return e}}),ue=window.LP.dataControls;function le(){const e=[].slice.call(arguments,2),t=(0,a.dispatch)(arguments[0]),s=arguments[1];t[s](...e)}const{camelCaseDashObjectKeys:ce,Hook:de}=LP;function pe(e,t){return{type:"SET_QUIZ_DATA",data:ce(t="string"==typeof e?{[e]:t}:e)}}function me(e){return{type:"SET_CURRENT_QUESTION",questionId:e}}function he(e){return{type:"SET_CURRENT_PAGE",currentPage:e}}function ge(e,t,s){return{type:"BEFORE_START_QUIZ"}}function fe(e,t,s,n){return de.doAction("quiz-started",e,t,s,n),{type:"START_QUIZ_SUCCESS",quizId:t,courseId:s,userId:n,results:e}}const _e=function*(){const{itemId:e,courseId:t}=(0,a.select)("learnpress/quiz").getDefaultRestArgs();if(!0!==de.applyFilters("before-start-quiz",!0,e,t))return;let s=yield(0,ue.apiFetch)({path:"lp/v1/users/start-quiz",method:"POST",data:{item_id:e,course_id:t}});const n=document.querySelector(".lp-button.start");if("error"!==s.status){if(s=de.applyFilters("request-start-quiz-response",s,e,t),1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id;window.localStorage.removeItem(e);const t={endTime:Date.now()+1e3*s.results.duration,status:s.results.status};window.localStorage.setItem(e,JSON.stringify(t));const n="quiz_off_retaken_"+lpQuizSettings.id;let r=window.localStorage.getItem(n);null===r?r=0:r++,window.localStorage.setItem(n,r)}yield le("learnpress/quiz","__requestStartQuizSuccess",ce(s),e,t)}else{const e=document.querySelector(".quiz-buttons"),t=`<div class="learn-press-message error">${s.message}</div>`;e.insertAdjacentHTML("afterend",t),n.classList.remove("loading")}};function qe(){return{type:"SUBMIT_QUIZ"}}function we(e,t,s){return de.doAction("quiz-submitted",e,t,s),{type:"SUBMIT_QUIZ_SUCCESS",results:e}}function*ve(){const{getDefaultRestArgs:e,getQuestionsSelectedAnswers:t}=(0,a.select)("learnpress/quiz"),{itemId:s,courseId:n}=e();if(!0!==de.applyFilters("before-submit-quiz",!0))return;const r=t();if(1===lpQuizSettings.checkNorequizenroll){const e=`LP_Quiz_${s}_Answered`,t=localStorage.getItem(e);if(null!==t){const e=JSON.parse(t);for(const[t,s]of Object.entries(e))r[t]=s.answered}}let i=0;const o=document.querySelector("input[name=lp-quiz-time-spend]");o&&(i=o.value);let u=yield(0,ue.apiFetch)({path:"lp/v1/users/submit-quiz",method:"POST",data:{item_id:s,course_id:n,answered:r,time_spend:i}});if(u=de.applyFilters("request-submit-quiz-response",u,s,n),"success"===u.status){if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,t=window.localStorage.getItem(e);if(null!==t){const s=JSON.parse(t);s.status=u.results.status,s.results=u.results.results,window.localStorage.setItem(e,JSON.stringify(s)),window.localStorage.removeItem("LP_Quiz_"+lpQuizSettings.id+"_Answered")}}yield le("learnpress/quiz","__requestSubmitQuizSuccess",ce(u.results),s,n)}}function Se(e,t,s){return{type:"UPDATE_USER_QUESTION_ANSWERS",questionId:e,answers:t}}function ye(e,t){return{type:"SET_QUESTION_HINT",questionId:e,showHint:t}}function*Ee(e,t){yield le("learnpress/quiz","__requestShowHintSuccess",e,t)}function ze(e,t){return{type:"CHECK_ANSWER",questionId:e,...t}}function*ke(e){const{getDefaultRestArgs:t,getQuestionAnswered:s}=(0,a.select)("learnpress/quiz"),{itemId:n,courseId:r}=t(),i=yield(0,ue.apiFetch)({path:"lp/v1/users/check-answer",method:"POST",data:{item_id:n,course_id:r,question_id:e,answered:s(e)||""}});if("success"===i.status){if(1===lpQuizSettings.checkNorequizenroll){const t="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(t);if(null!==s){const n=JSON.parse(s),r=i.options;void 0===n.checked_questions?(n.checked_questions=[],n.checked_questions.push(e)):-1===n.checked_questions.indexOf(e)&&n.checked_questions.push(e),void 0===n.question_options?(n.question_options={},n.question_options[e]=r):void 0===n.question_options[e]&&(n.question_options[e]=r),window.localStorage.setItem(t,JSON.stringify(n))}}yield le("learnpress/quiz","__requestCheckAnswerSuccess",e,ce(i))}}function be(e){return{type:"MARK_QUESTION_RENDERED",questionId:e}}function Pe(e){return{type:"SET_QUIZ_MODE",mode:e}}function Qe(e){return setTimeout((()=>{le("learnpress/quiz","sendKey","")}),300),{type:"SEND_KEY",keyPressed:e}}const{get:Ne,isArray:Ie}=lodash,Ce=function(e,t){console.time("parseOptions");let s=Ue(e,t).options;return s=Ie(s)?s:JSON.parse(CryptoJS.AES.decrypt(s.data,s.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),s=Ie(s)?s:JSON.parse(s),console.timeEnd("parseOptions"),s};function Ae(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.status"):""}function Te(e,t,s){return e[t]||s}function Re(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.attempts"):[]}function Oe(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.answered",{}):{}}function Le(e){const{userQuiz:t}=e,s=Ne(t,"questions");return s?Object.values(s):[]}function xe(e,t){const{userQuiz:s}=e;return t?Ne(s,t):s}function De(e){const{userQuiz:t}=e;return{itemId:t.id,courseId:t.courseId}}function Me(e,t){const{userQuiz:s}=e;return Ne(s,`answered.${t}.answered`)||void 0}function He(e,t){const{userQuiz:s}=e;return Ne(s,`answered.${t}.mark`)||void 0}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=Ne(e,"userQuiz.questionsPerPage")||1;if(s>1)return!1;const n=Ne(e,"userQuiz.currentPage")||1;return Ne(e,"object"===t?`userQuiz.questions[${n-1}]`:`userQuiz.questionIds[${n-1}]`)}const Ue=function(e,t){const{userQuiz:s}=e;return(0,a.select)("learnpress/quiz").getQuestions().find((e=>e.id==t))};function $e(e,t){return-1!==(Ne(e,"userQuiz.checkedQuestions")||[]).indexOf(t)}function je(e,t){}const Be=function(e,t){const s=Ne(e,"userQuiz.answered"),n={};for(const e in s)if(s.hasOwnProperty(e)&&(s[e].temp||s[e].blanks)){if(t&&e===t)return s[e].answered;n[e]=s[e].answered}return n};function Je(e){const t=e.userQuiz||{},{answered:s,negativeMarking:n,questions:r,checkedQuestions:i}=t;let o=0;for(let e in s){if(!s.hasOwnProperty(e))continue;e=parseInt(e);const t=s[e],a=t.questionMark?t.questionMark:function(){const t=r.find((t=>t.id===e));return t?t.point:0}();i.indexOf(e),t.temp||(n?t.answered&&(o=t.correct?o+t.mark:o-a):t.answered&&t.correct&&(o+=t.mark))}return o>0?o:0}var Ge=s(965),Ke=s.n(Ge);const We={ENROLL_COURSE_X:(e,t)=>{}};const{controls:Ze}=LP.dataControls;!function(e){let t=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:e.getState,dispatch:function(){return t(...arguments)}};t=Ke()(We)(s)(e.dispatch),e.dispatch=t}((0,a.registerStore)("learnpress/quiz",{reducer:ae,selectors:t,actions:e,controls:{...Ze}}));const{chunk:Ye}=lodash;class Ve extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{this.props.startQuiz()})),this.state={currentPage:1,numPages:0,pages:[]}}componentDidMount(){const{settings:e,setQuizData:t}=this.props,{question_ids:s,questions_per_page:n}=e,r=Ye(s,n);e.currentPage=1,e.numPages=r.length,e.pages=r;const i=!!e.id&&localStorage.getItem(`LP_Quiz_${e.id}_Answered`);i&&(e.answered=JSON.parse(i)),t(e)}componentDidUpdate(e,t,s){const{status:n}=e,r=document.querySelector(".quiz-content");void 0!==n&&r&&(r.style.display="none")}render(){const{status:e,isReviewing:t}=this.props,s=-1!==["","completed","viewed"].indexOf(e)||!e,n=-1!==["","viewed",void 0].indexOf(e)||!e;return void 0!==e&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,!t&&"completed"===e&&(0,r.createElement)(F,null),!t&&n&&(0,r.createElement)(d,null),"started"===e&&(0,r.createElement)(j,null),(-1!==["completed","started"].indexOf(e)||t)&&(0,r.createElement)(C,null),(0,r.createElement)(h,null),s&&!t&&(0,r.createElement)(A,null)))}}var Xe=(0,o.compose)([(0,a.withSelect)((e=>{const{getQuestions:t,getData:s}=e("learnpress/quiz");return{questions:t(),status:s("status"),store:s(),answered:s("answered"),isReviewing:"reviewing"===s("mode"),questionIds:s("questionIds"),checkCount:s("instantCheck"),questionsPerPage:s("questionsPerPage")||1}})),(0,a.withDispatch)((e=>{const{setQuizData:t,startQuiz:s}=e("learnpress/quiz");return{setQuizData:t,startQuiz:s}}))])(Ve);s(605);const{modal:{default:et}}=LP;var tt=Xe;const st=(e,t)=>{if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(e);if(null!==s){const e=JSON.parse(s);if(t.status=e.status,"started"===e.status){const s=Date.now();t.total_time=Math.floor((e.endTime-s)/1e3)}else"completed"===e.status&&(t.results=e.results,t.answered=e.results.answered,t.questions=e.results.questions);if(void 0!==e.checked_questions&&(t.checked_questions=e.checked_questions),void 0!==e.question_options)for(const s in t.questions){let n=t.questions[s];void 0!==e.question_options[n.id]&&(n.options=e.question_options[n.id]),t.questions[s]=n}}}wp.element.render((0,r.createElement)(et,null,(0,r.createElement)(Xe,{settings:t})),[...document.querySelectorAll(e)][0]),LP.Hook.doAction("lp-quiz-compatible-builder")}}(),(window.LP=window.LP||{}).quiz=n}();
assets/js/dist/frontend/single-course.js CHANGED
@@ -365,8 +365,6 @@ __webpack_require__.r(__webpack_exports__);
365
 
366
  function courseCurriculumSkeleton() {
367
  let courseID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
368
- let isLoadingItems = false;
369
- let isLoadingSections = false;
370
 
371
  const Sekeleton = () => {
372
  const elementCurriculum = document.querySelector('.learnpress-course-curriculum');
@@ -548,7 +546,6 @@ function courseCurriculumSkeleton() {
548
  }
549
  }
550
 
551
- isLoadingItems = false;
552
  return {
553
  data3: returnData,
554
  pages3: pages || data.pages,
@@ -592,7 +589,6 @@ function courseCurriculumSkeleton() {
592
  }
593
  }
594
 
595
- isLoadingSections = false;
596
  return {
597
  data2: returnData,
598
  pages2: pages || data.pages,
@@ -606,8 +602,7 @@ function courseCurriculumSkeleton() {
606
  document.addEventListener('click', e => {
607
  const sectionBtns = document.querySelectorAll('.section-item__loadmore');
608
  [...sectionBtns].map(async sectionBtn => {
609
- if (sectionBtn.contains(e.target) && !isLoadingItems) {
610
- isLoadingItems = true;
611
  const sectionItem = sectionBtn.parentNode;
612
  const sectionId = sectionItem.getAttribute('data-section-id');
613
  const sectionContent = sectionItem.querySelector('.section-content');
@@ -645,8 +640,7 @@ function courseCurriculumSkeleton() {
645
 
646
  const moreSections = document.querySelectorAll('.curriculum-more__button');
647
  [...moreSections].map(async moreSection => {
648
- if (moreSection.contains(e.target) && !isLoadingSections) {
649
- isLoadingSections = true;
650
  const paged = parseInt(moreSection.dataset.page);
651
  const sections = moreSection.parentNode.parentNode.querySelector('.curriculum-sections');
652
 
365
 
366
  function courseCurriculumSkeleton() {
367
  let courseID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
 
 
368
 
369
  const Sekeleton = () => {
370
  const elementCurriculum = document.querySelector('.learnpress-course-curriculum');
546
  }
547
  }
548
 
 
549
  return {
550
  data3: returnData,
551
  pages3: pages || data.pages,
589
  }
590
  }
591
 
 
592
  return {
593
  data2: returnData,
594
  pages2: pages || data.pages,
602
  document.addEventListener('click', e => {
603
  const sectionBtns = document.querySelectorAll('.section-item__loadmore');
604
  [...sectionBtns].map(async sectionBtn => {
605
+ if (sectionBtn.contains(e.target)) {
 
606
  const sectionItem = sectionBtn.parentNode;
607
  const sectionId = sectionItem.getAttribute('data-section-id');
608
  const sectionContent = sectionItem.querySelector('.section-content');
640
 
641
  const moreSections = document.querySelectorAll('.curriculum-more__button');
642
  [...moreSections].map(async moreSection => {
643
+ if (moreSection.contains(e.target)) {
 
644
  const paged = parseInt(moreSection.dataset.page);
645
  const sections = moreSection.parentNode.parentNode.querySelector('.curriculum-sections');
646
 
assets/js/dist/frontend/single-curriculum.js CHANGED
@@ -607,8 +607,6 @@ __webpack_require__.r(__webpack_exports__);
607
 
608
  function courseCurriculumSkeleton() {
609
  let courseID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
610
- let isLoadingItems = false;
611
- let isLoadingSections = false;
612
 
613
  const Sekeleton = () => {
614
  const elementCurriculum = document.querySelector('.learnpress-course-curriculum');
@@ -790,7 +788,6 @@ function courseCurriculumSkeleton() {
790
  }
791
  }
792
 
793
- isLoadingItems = false;
794
  return {
795
  data3: returnData,
796
  pages3: pages || data.pages,
@@ -834,7 +831,6 @@ function courseCurriculumSkeleton() {
834
  }
835
  }
836
 
837
- isLoadingSections = false;
838
  return {
839
  data2: returnData,
840
  pages2: pages || data.pages,
@@ -848,8 +844,7 @@ function courseCurriculumSkeleton() {
848
  document.addEventListener('click', e => {
849
  const sectionBtns = document.querySelectorAll('.section-item__loadmore');
850
  [...sectionBtns].map(async sectionBtn => {
851
- if (sectionBtn.contains(e.target) && !isLoadingItems) {
852
- isLoadingItems = true;
853
  const sectionItem = sectionBtn.parentNode;
854
  const sectionId = sectionItem.getAttribute('data-section-id');
855
  const sectionContent = sectionItem.querySelector('.section-content');
@@ -887,8 +882,7 @@ function courseCurriculumSkeleton() {
887
 
888
  const moreSections = document.querySelectorAll('.curriculum-more__button');
889
  [...moreSections].map(async moreSection => {
890
- if (moreSection.contains(e.target) && !isLoadingSections) {
891
- isLoadingSections = true;
892
  const paged = parseInt(moreSection.dataset.page);
893
  const sections = moreSection.parentNode.parentNode.querySelector('.curriculum-sections');
894
 
607
 
608
  function courseCurriculumSkeleton() {
609
  let courseID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
 
 
610
 
611
  const Sekeleton = () => {
612
  const elementCurriculum = document.querySelector('.learnpress-course-curriculum');
788
  }
789
  }
790
 
 
791
  return {
792
  data3: returnData,
793
  pages3: pages || data.pages,
831
  }
832
  }
833
 
 
834
  return {
835
  data2: returnData,
836
  pages2: pages || data.pages,
844
  document.addEventListener('click', e => {
845
  const sectionBtns = document.querySelectorAll('.section-item__loadmore');
846
  [...sectionBtns].map(async sectionBtn => {
847
+ if (sectionBtn.contains(e.target)) {
 
848
  const sectionItem = sectionBtn.parentNode;
849
  const sectionId = sectionItem.getAttribute('data-section-id');
850
  const sectionContent = sectionItem.querySelector('.section-content');
882
 
883
  const moreSections = document.querySelectorAll('.curriculum-more__button');
884
  [...moreSections].map(async moreSection => {
885
+ if (moreSection.contains(e.target)) {
 
886
  const paged = parseInt(moreSection.dataset.page);
887
  const sections = moreSection.parentNode.parentNode.querySelector('.curriculum-sections');
888
 
assets/src/apps/js/admin/pages/tools/database/upgrade.js CHANGED
@@ -103,6 +103,10 @@ const upgradeDB = () => {
103
  const scrollToStepCurrent = ( stepCurrent ) => {
104
  elItemStepCurrent = elGroupStep.find( 'input[value=' + stepCurrent + ']' ).closest( '.lp-item-step' );
105
 
 
 
 
 
106
  const offset = elItemStepCurrent.offset().top - lpModalOverlay.elMainContent.offset().top +
107
  lpModalOverlay.elMainContent.scrollTop();
108
 
103
  const scrollToStepCurrent = ( stepCurrent ) => {
104
  elItemStepCurrent = elGroupStep.find( 'input[value=' + stepCurrent + ']' ).closest( '.lp-item-step' );
105
 
106
+ if ( ! elItemStepCurrent.length ) {
107
+ return;
108
+ }
109
+
110
  const offset = elItemStepCurrent.offset().top - lpModalOverlay.elMainContent.offset().top +
111
  lpModalOverlay.elMainContent.scrollTop();
112
 
assets/src/apps/js/blocks/template/edit.js CHANGED
@@ -30,7 +30,7 @@ export default function Edit( { attributes } ) {
30
  { sprintf(
31
  /* translators: %s is the template title */
32
  __(
33
- 'This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your course image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.',
34
  'learnpress'
35
  ),
36
  templateTitle
30
  { sprintf(
31
  /* translators: %s is the template title */
32
  __(
33
+ 'This is an editor placeholder for the %s. This will be replaced by the template in your store and displayed with your course image(s), title, price, and so on. You can move this placeholder around and add further blocks around it to extend the template.',
34
  'learnpress'
35
  ),
36
  templateTitle
assets/src/apps/js/frontend/profile/avatar.js CHANGED
@@ -128,9 +128,9 @@ export default function Avatar() {
128
 
129
  let error = '';
130
  if ( parseInt( fileUpload.size ) > 2097152 ) {
131
- error = __( 'File size too large. You need to upload a file < 2MB', 'learnpress' );
132
  } else if ( img.naturalWidth < width || img.naturalHeight < height ) {
133
- error = sprintf( __( 'Image size must be greater than or equal to %1$sx%2$spx', 'learnpress' ), width, height );
134
  }
135
 
136
  if ( error ) {
128
 
129
  let error = '';
130
  if ( parseInt( fileUpload.size ) > 2097152 ) {
131
+ error = __( 'The file size is too large. You need to upload a file < 2MB.', 'learnpress' );
132
  } else if ( img.naturalWidth < width || img.naturalHeight < height ) {
133
+ error = sprintf( __( 'The image size must be greater than or equal to %1$sx%2$spx', 'learnpress' ), width, height );
134
  }
135
 
136
  if ( error ) {
assets/src/apps/js/frontend/question-types/components/question-base/index.js CHANGED
@@ -144,7 +144,7 @@ class QuestionBase extends Component {
144
  };
145
 
146
  getWarningMessage = () => {
147
- return <>{ __( 'Render function should be overwritten from base.', 'learnpress' ) }</>;
148
  };
149
 
150
  getOptionClass = ( option ) => {
144
  };
145
 
146
  getWarningMessage = () => {
147
+ return <>{ __( 'The render function should be overwritten from the base.', 'learnpress' ) }</>;
148
  };
149
 
150
  getOptionClass = ( option ) => {
assets/src/apps/js/frontend/quiz/components/attempts/index.js CHANGED
@@ -12,7 +12,7 @@ const Attempts = () => {
12
  return (
13
  ! hasAttempts ? false : <>
14
  <div className="quiz-attempts">
15
- <h4 className="attempts-heading">{ __( 'Last Attempted', 'learnpress' ) }</h4>
16
 
17
  { hasAttempts && (
18
  <table>
12
  return (
13
  ! hasAttempts ? false : <>
14
  <div className="quiz-attempts">
15
+ <h4 className="attempts-heading">{ __( 'Last Attempt', 'learnpress' ) }</h4>
16
 
17
  { hasAttempts && (
18
  <table>
assets/src/apps/js/frontend/quiz/components/buttons/button-check.js CHANGED
@@ -37,10 +37,10 @@ class ButtonCheck extends Component {
37
  } ) } onClick={ this.checkAnswer }
38
  >
39
  <span className="instant-check__icon" />
40
- { __( 'Check answer', 'learnpress' ) }
41
 
42
  { ! answered && (
43
- <div className="instant-check__info" dangerouslySetInnerHTML={ { __html: __( 'You need to answer the question before check answer.', 'learnpress' ) } } />
44
  ) }
45
  </button>
46
  </>
37
  } ) } onClick={ this.checkAnswer }
38
  >
39
  <span className="instant-check__icon" />
40
+ { __( 'Check answers', 'learnpress' ) }
41
 
42
  { ! answered && (
43
+ <div className="instant-check__info" dangerouslySetInnerHTML={ { __html: __( 'You need to answer the question before checking the answer key.', 'learnpress' ) } } />
44
  ) }
45
  </button>
46
  </>
assets/src/apps/js/frontend/quiz/components/buttons/index.js CHANGED
@@ -14,7 +14,7 @@ class Buttons extends Component {
14
  if ( status === 'completed' ) {
15
  const { confirm, isOpen } = select( 'learnpress/modal' );
16
 
17
- if ( 'no' === confirm( __( 'Are you sure you want to retake quiz?', 'learnpress' ), this.startQuiz ) ) {
18
  ! isOpen() && btn && btn.removeAttribute( 'disabled' );
19
  return;
20
  }
@@ -102,7 +102,7 @@ class Buttons extends Component {
102
 
103
  const { confirm } = select( 'learnpress/modal' );
104
 
105
- if ( 'no' === confirm( __( 'Are you sure to submit quiz?', 'learnpress' ), this.submit ) ) {
106
  return;
107
  }
108
  submitQuiz();
14
  if ( status === 'completed' ) {
15
  const { confirm, isOpen } = select( 'learnpress/modal' );
16
 
17
+ if ( 'no' === confirm( __( 'Are you sure you want to retake the quiz?', 'learnpress' ), this.startQuiz ) ) {
18
  ! isOpen() && btn && btn.removeAttribute( 'disabled' );
19
  return;
20
  }
102
 
103
  const { confirm } = select( 'learnpress/modal' );
104
 
105
+ if ( 'no' === confirm( __( 'Are you sure to submit the quiz?', 'learnpress' ), this.submit ) ) {
106
  return;
107
  }
108
  submitQuiz();
assets/src/apps/js/frontend/quiz/components/status/index.js CHANGED
@@ -64,7 +64,7 @@ const Status = () => {
64
  const submit = () => {
65
  const { confirm } = select( 'learnpress/modal' );
66
 
67
- if ( 'no' === confirm( __( 'Are you sure to submit quiz?', 'learnpress' ), submit ) ) {
68
  return;
69
  }
70
 
64
  const submit = () => {
65
  const { confirm } = select( 'learnpress/modal' );
66
 
67
+ if ( 'no' === confirm( __( 'Are you sure to submit the quiz?', 'learnpress' ), submit ) ) {
68
  return;
69
  }
70
 
assets/src/apps/js/frontend/quiz/store/reducer.js CHANGED
@@ -127,13 +127,12 @@ const submitQuiz = ( state, action ) => {
127
 
128
  const questions = state.questions.map( ( question ) => {
129
  const newArgs = {};
130
-
131
  if ( state.reviewQuestions ) {
132
- if ( action.results.questions[ question.id ].explanation ) {
133
  newArgs.explanation = action.results.questions[ question.id ].explanation;
134
  }
135
 
136
- if ( action.results.questions[ question.id ].options ) {
137
  newArgs.options = action.results.questions[ question.id ].options;
138
  }
139
  }
127
 
128
  const questions = state.questions.map( ( question ) => {
129
  const newArgs = {};
 
130
  if ( state.reviewQuestions ) {
131
+ if ( action.results.questions[ question.id ]?.explanation ) {
132
  newArgs.explanation = action.results.questions[ question.id ].explanation;
133
  }
134
 
135
+ if ( action.results.questions[ question.id ]?.options ) {
136
  newArgs.options = action.results.questions[ question.id ].options;
137
  }
138
  }
assets/src/apps/js/frontend/single-course/student-list.js DELETED
@@ -1,96 +0,0 @@
1
-
2
- const studentListCourse = () => {
3
- const elementStudentList = document.querySelector( '.learnpress-course-student-list' );
4
-
5
- if ( ! elementStudentList ) {
6
- return;
7
- }
8
-
9
- const skeleton = elementStudentList.querySelector( '.lp-skeleton-animation' );
10
- const eleParents = elementStudentList.querySelector( '.content-student-list' );
11
-
12
- const Sekeleton = () => {
13
- const extraQuery = {
14
- status: '',
15
- paged: 1,
16
- };
17
-
18
- getResponse( eleParents, extraQuery );
19
-
20
- const select = document.querySelector( '.students-list-filter' );
21
-
22
- if ( select != null ) {
23
- select.addEventListener( 'change', function() {
24
- eleParents.innerHTML = '';
25
- skeleton.style.display = 'block';
26
- extraQuery.status = this.value;
27
- getResponse( eleParents, extraQuery );
28
- } );
29
- }
30
- };
31
-
32
- const getResponse = async ( ele, extraQuery, append = false, viewMoreEle ) => {
33
- const courseID = ele.dataset.id;
34
- const statusFilter = extraQuery?.status || '';
35
- const paged = extraQuery?.paged || 1;
36
-
37
- try {
38
- const response = await wp.apiFetch( {
39
- path: addQueryArgs( 'lp/v1/lazy-load/student-list', {
40
- courseId: courseID || lpGlobalSettings.post_id || '',
41
- status: statusFilter,
42
- paged,
43
- } ),
44
- method: 'GET',
45
- } );
46
-
47
- const { data, status, message } = response;
48
-
49
- if ( status === 'error' ) {
50
- throw new Error( message || 'Error' );
51
- }
52
-
53
- if ( append ) {
54
- ele.innerHTML += data.content;
55
- } else {
56
- ele.innerHTML = data.content;
57
- }
58
-
59
- if ( viewMoreEle ) {
60
- viewMoreEle.classList.remove( 'loading' );
61
-
62
- const paged = viewMoreEle.dataset.paged;
63
- const numberPage = viewMoreEle.dataset.number;
64
-
65
- if ( numberPage <= paged ) {
66
- viewMoreEle.remove();
67
- }
68
-
69
- viewMoreEle.dataset.paged = parseInt( paged ) + 1;
70
- }
71
- viewMoreStudentList( ele, extraQuery );
72
- } catch ( error ) {
73
- ele.insertAdjacentHTML( 'beforeend', `<div class="learn-press-message error" style="display:block">${ error.message || 'Error: Query lp/v1/lazy-load/course-student-list' }</div>` );
74
- }
75
-
76
- skeleton.style.display = 'none';
77
- };
78
-
79
- const viewMoreStudentList = ( ele, extraQuery ) => {
80
- const viewMoreEle = ele.querySelector( '.lp_student_list_button button.lp-button' );
81
-
82
- if ( viewMoreEle ) {
83
- viewMoreEle.addEventListener( 'click', ( e ) => {
84
- e.preventDefault();
85
-
86
- const paged = viewMoreEle && viewMoreEle.dataset.paged;
87
-
88
- viewMoreEle.classList.add( 'loading' );
89
-
90
- getResponse( ele.querySelector( 'ul.students' ), { ...extraQuery, ...{ paged } }, true, viewMoreEle );
91
- } );
92
- }
93
- };
94
-
95
- Sekeleton();
96
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
config/settings/course.php CHANGED
@@ -5,7 +5,7 @@
5
  $generate_course_thumbnail = get_option( 'learn_press_generate_course_thumbnail', 'no' );
6
  $des_option_redirect_finish_course = wp_sprintf(
7
  '%s<br>%s',
8
- esc_html__( 'The site will be redirected to the URL added after clicking finish course button.', 'learnpress' ),
9
  esc_html__( 'Set blank, the site will be redirected to the single course page', 'learnpress' )
10
  );
11
 
@@ -21,7 +21,7 @@ return apply_filters(
21
  ),
22
  array(
23
  'title' => esc_html__( 'Review courses', 'learnpress' ),
24
- 'desc' => esc_html__( 'Courses created by instructors will be pending in review first.', 'learnpress' ),
25
  'id' => 'required_review',
26
  'default' => 'yes',
27
  'type' => 'checkbox',
@@ -31,18 +31,18 @@ return apply_filters(
31
  'id' => 'auto_enroll',
32
  'default' => 'yes',
33
  'type' => 'checkbox',
34
- 'desc' => esc_html__( 'Students will get started courses immediately after successfully purchased.', 'learnpress' ),
35
  ),
36
  array(
37
- 'title' => __( 'Enable confirmation popup finish course, complete item', 'learnpress' ),
38
- 'desc' => __( 'Show confirmation popup before finishing course or completing item.', 'learnpress' ),
39
  'id' => 'enable_popup_confirm_finish',
40
  'default' => 'yes',
41
  'type' => 'checkbox',
42
  ),
43
  array(
44
  'title' => esc_html__( 'Archive page layout', 'learnpress' ),
45
- 'desc' => esc_html__( 'Type display list course on Course Archive page', 'learnpress' ),
46
  'id' => 'archive_courses_layout',
47
  'default' => 'list',
48
  'type' => 'select',
@@ -50,7 +50,7 @@ return apply_filters(
50
  ),
51
  array(
52
  'title' => esc_html__( 'Courses per page', 'learnpress' ),
53
- 'desc' => esc_html__( 'Number of courses displayed per page.', 'learnpress' ),
54
  'id' => 'archive_course_limit',
55
  'default' => '8',
56
  'type' => 'number',
@@ -60,15 +60,15 @@ return apply_filters(
60
  'css' => 'min-width: 50px; width: 50px;',
61
  ),
62
  array(
63
- 'title' => esc_html__( 'Enable loading ajax Courses on the Course Archive page', 'learnpress' ),
64
- 'desc' => __( 'On/Off <i>loading ajax Courses</i>', 'learnpress' ),
65
  'id' => 'courses_load_ajax',
66
  'default' => 'yes',
67
  'type' => 'checkbox',
68
  ),
69
  array(
70
- 'title' => esc_html__( 'Not run Ajax when reloading Course Archive page', 'learnpress' ),
71
- 'desc' => esc_html__( 'Ajax is only applied when selecting pagination, filtering, searching and sorting. Not applicable when reloading Course Archive page.', 'learnpress' ),
72
  'id' => 'courses_first_no_ajax',
73
  'default' => 'no',
74
  'type' => 'checkbox',
@@ -81,7 +81,7 @@ return apply_filters(
81
  'type' => 'image-dimensions',
82
  ),
83
  array(
84
- 'title' => esc_html__( 'Redirect when finish course', 'learnpress' ),
85
  'id' => 'course_finish_redirect',
86
  'default' => '',
87
  'type' => 'url',
@@ -106,14 +106,14 @@ return apply_filters(
106
  'id' => 'section_per_page',
107
  'default' => 1,
108
  'type' => 'number',
109
- 'desc' => esc_html__( 'Number of sections displayed per page ( Enter -1 for display all sections).', 'learnpress' ),
110
  ),
111
  array(
112
  'title' => esc_html__( 'Course Item Per Page', 'learnpress' ),
113
  'id' => 'course_item_per_page',
114
  'default' => 10,
115
  'type' => 'number',
116
- 'desc' => esc_html__( 'Number of course items displayed per page in section ( Enter -1 for display all course items).', 'learnpress' ),
117
  ),
118
  array(
119
  'type' => 'sectionend',
5
  $generate_course_thumbnail = get_option( 'learn_press_generate_course_thumbnail', 'no' );
6
  $des_option_redirect_finish_course = wp_sprintf(
7
  '%s<br>%s',
8
+ esc_html__( 'The site will be redirected to the URL added after clicking the finish course button.', 'learnpress' ),
9
  esc_html__( 'Set blank, the site will be redirected to the single course page', 'learnpress' )
10
  );
11
 
21
  ),
22
  array(
23
  'title' => esc_html__( 'Review courses', 'learnpress' ),
24
+ 'desc' => esc_html__( 'Courses created by instructors will be pending review first.', 'learnpress' ),
25
  'id' => 'required_review',
26
  'default' => 'yes',
27
  'type' => 'checkbox',
31
  'id' => 'auto_enroll',
32
  'default' => 'yes',
33
  'type' => 'checkbox',
34
+ 'desc' => esc_html__( 'Students will get started on courses immediately after successfully purchasing them.', 'learnpress' ),
35
  ),
36
  array(
37
+ 'title' => __( 'Confirmation popup', 'learnpress' ),
38
+ 'desc' => __( 'Show a confirmation popup before finishing the course or completing the item.', 'learnpress' ),
39
  'id' => 'enable_popup_confirm_finish',
40
  'default' => 'yes',
41
  'type' => 'checkbox',
42
  ),
43
  array(
44
  'title' => esc_html__( 'Archive page layout', 'learnpress' ),
45
+ 'desc' => esc_html__( 'Display the List course type on the Course Archive page.', 'learnpress' ),
46
  'id' => 'archive_courses_layout',
47
  'default' => 'list',
48
  'type' => 'select',
50
  ),
51
  array(
52
  'title' => esc_html__( 'Courses per page', 'learnpress' ),
53
+ 'desc' => esc_html__( 'The number of displayed courses per page.', 'learnpress' ),
54
  'id' => 'archive_course_limit',
55
  'default' => '8',
56
  'type' => 'number',
60
  'css' => 'min-width: 50px; width: 50px;',
61
  ),
62
  array(
63
+ 'title' => esc_html__( 'Loading ajax Courses', 'learnpress' ),
64
+ 'desc' => __( 'On/Off <i>loading ajax courses on the Course Archive page </i>.', 'learnpress' ),
65
  'id' => 'courses_load_ajax',
66
  'default' => 'yes',
67
  'type' => 'checkbox',
68
  ),
69
  array(
70
+ 'title' => esc_html__( 'Do not run Ajax when reloading the Course Archive page', 'learnpress' ),
71
+ 'desc' => esc_html__( 'Ajax is only applied when selecting pagination, filtering, searching, and sorting. Not applicable when reloading the Course Archive page.', 'learnpress' ),
72
  'id' => 'courses_first_no_ajax',
73
  'default' => 'no',
74
  'type' => 'checkbox',
81
  'type' => 'image-dimensions',
82
  ),
83
  array(
84
+ 'title' => esc_html__( 'Redirect when finishing the course', 'learnpress' ),
85
  'id' => 'course_finish_redirect',
86
  'default' => '',
87
  'type' => 'url',
106
  'id' => 'section_per_page',
107
  'default' => 1,
108
  'type' => 'number',
109
+ 'desc' => esc_html__( 'The number of displayed sections per page (Enter -1 to display all sections).', 'learnpress' ),
110
  ),
111
  array(
112
  'title' => esc_html__( 'Course Item Per Page', 'learnpress' ),
113
  'id' => 'course_item_per_page',
114
  'default' => 10,
115
  'type' => 'number',
116
+ 'desc' => esc_html__( 'The number of displayed course items per page in a section (Enter -1 to display all course items).', 'learnpress' ),
117
  ),
118
  array(
119
  'type' => 'sectionend',
config/settings/general.php CHANGED
@@ -48,7 +48,7 @@ return apply_filters(
48
  'id' => 'logout_redirect_page_id',
49
  'default' => '',
50
  'type' => 'pages-dropdown',
51
- 'desc' => __( 'The page where user will be redirected to after logging out.', 'learnpress' ),
52
  ),
53
  array(
54
  'type' => 'sectionend',
@@ -76,14 +76,14 @@ return apply_filters(
76
  ),
77
  array(
78
  'title' => esc_html__( 'Thousands separator', 'learnpress' ),
79
- 'desc_tip' => esc_html__( 'This sets the thousand separator of displayed prices.', 'learnpress' ),
80
  'id' => 'thousands_separator',
81
  'default' => ',',
82
  'type' => 'text',
83
  'css' => 'min-width: 50px; width: 50px;',
84
  ),
85
  array(
86
- 'title' => esc_html__( 'Decimals separator', 'learnpress' ),
87
  'desc_tip' => esc_html__( 'This sets the decimal separator of displayed prices.', 'learnpress' ),
88
  'id' => 'decimals_separator',
89
  'default' => '.',
@@ -91,8 +91,8 @@ return apply_filters(
91
  'css' => 'min-width: 50px; width: 50px;',
92
  ),
93
  array(
94
- 'title' => esc_html__( 'Number of decimals', 'learnpress' ),
95
- 'desc_tip' => esc_html__( 'This sets the number of decimal points shown in displayed prices.', 'learnpress' ),
96
  'id' => 'number_of_decimals',
97
  'default' => '2',
98
  'type' => 'number',
@@ -110,8 +110,8 @@ return apply_filters(
110
  'id' => 'publish_profile',
111
  'default' => 'no',
112
  'type' => 'checkbox',
113
- 'desc_tip' => esc_html__( 'This option will add a sub-item "Privacy" under Setting tab on the Profile page. If users want to publish or hide their course, quiz tab when other users visit their profile page, they need to enable/disable that option in the Privacy section.', 'learnpress' ),
114
- 'desc' => __( 'Public all user profile page (Overview tab only).', 'learnpress' ),
115
  ),
116
  array(
117
  'title' => esc_html__( 'Instructor registration', 'learnpress' ),
48
  'id' => 'logout_redirect_page_id',
49
  'default' => '',
50
  'type' => 'pages-dropdown',
51
+ 'desc' => __( 'The page where the user will be redirected to after logging out.', 'learnpress' ),
52
  ),
53
  array(
54
  'type' => 'sectionend',
76
  ),
77
  array(
78
  'title' => esc_html__( 'Thousands separator', 'learnpress' ),
79
+ 'desc_tip' => esc_html__( 'This sets the thousands separator of displayed prices.', 'learnpress' ),
80
  'id' => 'thousands_separator',
81
  'default' => ',',
82
  'type' => 'text',
83
  'css' => 'min-width: 50px; width: 50px;',
84
  ),
85
  array(
86
+ 'title' => esc_html__( 'Decimal separator', 'learnpress' ),
87
  'desc_tip' => esc_html__( 'This sets the decimal separator of displayed prices.', 'learnpress' ),
88
  'id' => 'decimals_separator',
89
  'default' => '.',
91
  'css' => 'min-width: 50px; width: 50px;',
92
  ),
93
  array(
94
+ 'title' => esc_html__( 'The number of decimals', 'learnpress' ),
95
+ 'desc_tip' => esc_html__( 'This sets the number of decimal points shown in the displayed prices.', 'learnpress' ),
96
  'id' => 'number_of_decimals',
97
  'default' => '2',
98
  'type' => 'number',
110
  'id' => 'publish_profile',
111
  'default' => 'no',
112
  'type' => 'checkbox',
113
+ 'desc_tip' => esc_html__( 'This option will add a sub-item \"Privacy\" under the Setting tab on the Profile page. If users want to publish or hide their course, or quiz tab when other users visit their profile page, they need to enable/disable that option in the Privacy section.', 'learnpress' ),
114
+ 'desc' => __( 'Public all user profile pages (only the overview tab).', 'learnpress' ),
115
  ),
116
  array(
117
  'title' => esc_html__( 'Instructor registration', 'learnpress' ),
inc/abstract-settings.php CHANGED
@@ -86,7 +86,7 @@ abstract class LP_Abstract_Settings {
86
  if ( $settings ) {
87
  LP_Meta_Box_Helper::output_fields( $settings );
88
  } else {
89
- echo esc_html__( 'No setting available.', 'learnpress' );
90
  }
91
  }
92
 
86
  if ( $settings ) {
87
  LP_Meta_Box_Helper::output_fields( $settings );
88
  } else {
89
+ echo esc_html__( 'No settings available.', 'learnpress' );
90
  }
91
  }
92
 
inc/abstracts/abstract-addon.php CHANGED
@@ -314,6 +314,10 @@ class LP_Addon {
314
  * Load text domain
315
  */
316
  public function load_text_domain() {
 
 
 
 
317
  $plugin_path = dirname( $this->plugin_file );
318
  $plugin_folder = basename( $plugin_path );
319
  $text_domain = empty( $this->text_domain ) ? $plugin_folder : $this->text_domain;
314
  * Load text domain
315
  */
316
  public function load_text_domain() {
317
+ if ( empty( $this->plugin_file ) ) {
318
+ return;
319
+ }
320
+
321
  $plugin_path = dirname( $this->plugin_file );
322
  $plugin_folder = basename( $plugin_path );
323
  $text_domain = empty( $this->text_domain ) ? $plugin_folder : $this->text_domain;
inc/abstracts/abstract-object-data.php CHANGED
@@ -15,7 +15,6 @@ if ( ! class_exists( 'LP_Abstract_Object_Data' ) ) {
15
  * Class LP_Abstract_Object_Data
16
  */
17
  abstract class LP_Abstract_Object_Data {
18
-
19
  /**
20
  * @var int
21
  */
@@ -246,12 +245,6 @@ if ( ! class_exists( 'LP_Abstract_Object_Data' ) ) {
246
  $this->_set_data( $key, $value, $extra );
247
  }
248
  } elseif ( $key_or_data ) {
249
- $data = $extra ? $this->_extra_data : $this->_data;
250
- $changes = $extra ? $this->_extra_data_changes : $this->_changes;
251
-
252
- if ( $key_or_data === 'total' ) {
253
- }
254
-
255
  if ( $extra ) {
256
  // Do not allow to add extra data with the same key in data
257
  if ( ! array_key_exists( $key_or_data, $this->_data ) ) {
@@ -262,16 +255,15 @@ if ( ! class_exists( 'LP_Abstract_Object_Data' ) ) {
262
  if ( ! is_string( $key_or_data ) && ! is_numeric( $key_or_data ) ) {
263
  throw new Exception( 'error' );
264
  }
 
265
  // Only change the data is already existed
266
- if ( array_key_exists( $key_or_data, $this->_data ) ) {
267
  $this->_data[ $key_or_data ] = $value;
268
- } else {
269
- $this->_extra_data[ $key_or_data ] = $value;
270
- }
271
- } catch ( Exception $ex ) {
272
- print_r( $key_or_data );
273
- print_r( $ex->getMessage() );
274
- die( __FILE__ . '::' . __FUNCTION__ );
275
  }
276
  }
277
  }
@@ -281,39 +273,50 @@ if ( ! class_exists( 'LP_Abstract_Object_Data' ) ) {
281
  * Set extra data
282
  *
283
  * @param array|string $key_or_data
284
- * @param string $value
285
  * @return $this
286
  */
287
  public function set_data( $key_or_data, $value = '' ) {
288
- $this->_set_data( $key_or_data, $value, true );
289
  return $this;
290
  }
291
 
292
  /**
 
 
 
293
  * @param $key
294
  * @param $value
 
 
 
295
  */
296
- public function set_data_date( $key, $value ) {
297
- if ( ! $value instanceof LP_Datetime ) {
298
- $value = new LP_Datetime( $value );
 
299
  }
300
 
301
- $this->_set_data( $key, $value, true );
 
 
302
  }
303
 
304
  /**
305
  * @param $key
306
  * @param $value
 
307
  */
308
  protected function _set_data_date( $key, $value, $extra = false ) {
309
- if ( ! $value instanceof LP_Datetime ) {
310
- $value = new LP_Datetime( $value );
311
- }
312
-
313
- $this->_set_data( $key, $value, $extra );
314
  }
315
 
 
 
 
316
  public function set_data_null_date( $key ) {
 
317
  $this->_set_data( $key, LP_Datetime::getSqlNullDate() );
318
  }
319
 
@@ -341,7 +344,7 @@ if ( ! class_exists( 'LP_Abstract_Object_Data' ) ) {
341
  // If there is at least one method failed
342
  if ( $errors ) {
343
  $errors = array_map( array( $this, 'prefix_set_method' ), $errors );
344
- throw new Exception( sprintf( __( 'The following these functions %1$s do not exists in %2$s', 'learnpress' ), join( ',', $errors ), get_class( $this ) ) );
345
  }
346
  }
347
 
@@ -421,24 +424,28 @@ if ( ! class_exists( 'LP_Abstract_Object_Data' ) ) {
421
  * Get all features are supported by question.
422
  *
423
  * @return array
 
424
  */
425
  public function get_supports() {
 
426
  return LP_Global::get_object_supports( $this->object_type );
427
  }
428
 
429
  /**
430
  * @param $value
 
431
  */
432
- public function set_no_cache( $value ) {
433
  $this->_no_cache = $value;
434
- }
435
 
436
  /**
437
  * @return bool
 
438
  */
439
- public function get_no_cache() {
440
  return $this->_no_cache;
441
- }
442
 
443
  /**
444
  * Read all metas and set to object
15
  * Class LP_Abstract_Object_Data
16
  */
17
  abstract class LP_Abstract_Object_Data {
 
18
  /**
19
  * @var int
20
  */
245
  $this->_set_data( $key, $value, $extra );
246
  }
247
  } elseif ( $key_or_data ) {
 
 
 
 
 
 
248
  if ( $extra ) {
249
  // Do not allow to add extra data with the same key in data
250
  if ( ! array_key_exists( $key_or_data, $this->_data ) ) {
255
  if ( ! is_string( $key_or_data ) && ! is_numeric( $key_or_data ) ) {
256
  throw new Exception( 'error' );
257
  }
258
+
259
  // Only change the data is already existed
260
+ // if ( array_key_exists( $key_or_data, $this->_data ) ) {
261
  $this->_data[ $key_or_data ] = $value;
262
+ // } else {
263
+ // $this->_extra_data[ $key_or_data ] = $value;
264
+ // }
265
+ } catch ( Throwable $ex ) {
266
+ error_log( $ex->getMessage() );
 
 
267
  }
268
  }
269
  }
273
  * Set extra data
274
  *
275
  * @param array|string $key_or_data
276
+ * @param string|mixed $value
277
  * @return $this
278
  */
279
  public function set_data( $key_or_data, $value = '' ) {
280
+ $this->_set_data( $key_or_data, $value );
281
  return $this;
282
  }
283
 
284
  /**
285
+ * Set data datetime
286
+ * if $value is empty, not set is LP_Datetime object
287
+ *
288
  * @param $key
289
  * @param $value
290
+ *
291
+ * @version 4.0.1
292
+ * @return LP_Abstract_Object_Data
293
  */
294
+ public function set_data_date( $key, $value ): LP_Abstract_Object_Data {
295
+ $lp_date = '';
296
+ if ( ! empty( $value ) ) {
297
+ $lp_date = new LP_Datetime( $value );
298
  }
299
 
300
+ $this->set_data( $key, $lp_date );
301
+
302
+ return $this;
303
  }
304
 
305
  /**
306
  * @param $key
307
  * @param $value
308
+ * @deprecated 4.1.7.3
309
  */
310
  protected function _set_data_date( $key, $value, $extra = false ) {
311
+ _deprecated_function( __FUNCTION__, '4.1.7.3', 'set_data_date' );
312
+ $this->set_data_date( $key, $value );
 
 
 
313
  }
314
 
315
+ /**
316
+ * @deprecated 4.1.7.3
317
+ */
318
  public function set_data_null_date( $key ) {
319
+ _deprecated_function( __METHOD__, '4.1.7.3' );
320
  $this->_set_data( $key, LP_Datetime::getSqlNullDate() );
321
  }
322
 
344
  // If there is at least one method failed
345
  if ( $errors ) {
346
  $errors = array_map( array( $this, 'prefix_set_method' ), $errors );
347
+ throw new Exception( sprintf( __( 'The following functions %1$s do not exist in %2$s', 'learnpress' ), join( ',', $errors ), get_class( $this ) ) );
348
  }
349
  }
350
 
424
  * Get all features are supported by question.
425
  *
426
  * @return array
427
+ * @deprecated 4.1.7.3
428
  */
429
  public function get_supports() {
430
+ _deprecated_function( __FUNCTION__, '4.1.7.3' );
431
  return LP_Global::get_object_supports( $this->object_type );
432
  }
433
 
434
  /**
435
  * @param $value
436
+ * @deprecated 4.1.7.3
437
  */
438
+ /*public function set_no_cache( $value ) {
439
  $this->_no_cache = $value;
440
+ }*/
441
 
442
  /**
443
  * @return bool
444
+ * @deprecated 4.1.7.3
445
  */
446
+ /*public function get_no_cache() {
447
  return $this->_no_cache;
448
+ }*/
449
 
450
  /**
451
  * Read all metas and set to object
inc/abstracts/abstract-rest-api.php CHANGED
@@ -47,7 +47,7 @@ abstract class LP_Abstract_API {
47
  }
48
 
49
  public function rest_api_includes() {
50
- // include_once realpath( LP_PLUGIN_PATH . 'inc/rest-api/class-lp-rest-authentication.php' );
51
  }
52
 
53
  /**
47
  }
48
 
49
  public function rest_api_includes() {
50
+
51
  }
52
 
53
  /**
inc/admin/class-lp-admin-ajax.php CHANGED
@@ -216,7 +216,7 @@ if ( ! class_exists( 'LP_Admin_Ajax' ) ) {
216
  $post_type = learn_press_get_post_type( $post_id );
217
 
218
  if ( ! $post_id ) {
219
- learn_press_send_json_error( __( 'Ops! ID not found', 'learnpress' ) );
220
  } else {
221
 
222
  $new_item_id = '';
@@ -259,7 +259,7 @@ if ( ! class_exists( 'LP_Admin_Ajax' ) ) {
259
  }
260
 
261
  if ( is_wp_error( $new_item_id ) ) {
262
- learn_press_send_json_error( __( 'Duplicate post fail, please try again', 'learnpress' ) );
263
  } else {
264
  learn_press_send_json_success( admin_url( 'post.php?post=' . $new_item_id . '&action=edit' ) );
265
  }
@@ -408,7 +408,7 @@ if ( ! class_exists( 'LP_Admin_Ajax' ) ) {
408
  // verify nonce
409
  $nonce = learn_press_get_request( 'remove_nonce' );
410
  if ( ! wp_verify_nonce( $nonce, 'remove_order_item' ) ) {
411
- die( __( 'Check nonce failed', 'learnpress' ) );
412
  }
413
 
414
  // validate order
@@ -516,7 +516,7 @@ if ( ! class_exists( 'LP_Admin_Ajax' ) ) {
516
  * @param mixed $params (Optional) List of keys want to get from payload.
517
  *
518
  * @return array|bool|mixed|object
519
- * @depecated 4.1.6.9
520
  */
521
  /*public static function get_php_input( $params = '' ) {
522
  static $data = false;
@@ -547,7 +547,7 @@ if ( ! class_exists( 'LP_Admin_Ajax' ) ) {
547
  * Normally, parse and assign to $_POST or $_GET.
548
  *
549
  * @param $var
550
- * @depecated 4.1.6.9
551
  */
552
  /*public static function parsePhpInput( &$var ) {
553
  $data = self::get_php_input();
216
  $post_type = learn_press_get_post_type( $post_id );
217
 
218
  if ( ! $post_id ) {
219
+ learn_press_send_json_error( __( 'Oops! ID not found', 'learnpress' ) );
220
  } else {
221
 
222
  $new_item_id = '';
259
  }
260
 
261
  if ( is_wp_error( $new_item_id ) ) {
262
+ learn_press_send_json_error( __( 'Duplicate post failed. Please try again', 'learnpress' ) );
263
  } else {
264
  learn_press_send_json_success( admin_url( 'post.php?post=' . $new_item_id . '&action=edit' ) );
265
  }
408
  // verify nonce
409
  $nonce = learn_press_get_request( 'remove_nonce' );
410
  if ( ! wp_verify_nonce( $nonce, 'remove_order_item' ) ) {
411
+ die( __( 'Nonce check failed', 'learnpress' ) );
412
  }
413
 
414
  // validate order
516
  * @param mixed $params (Optional) List of keys want to get from payload.
517
  *
518
  * @return array|bool|mixed|object
519
+ * @deprecated 4.1.6.9
520
  */
521
  /*public static function get_php_input( $params = '' ) {
522
  static $data = false;
547
  * Normally, parse and assign to $_POST or $_GET.
548
  *
549
  * @param $var
550
+ * @deprecated 4.1.6.9
551
  */
552
  /*public static function parsePhpInput( &$var ) {
553
  $data = self::get_php_input();
inc/admin/class-lp-admin-assets.php CHANGED
@@ -29,7 +29,7 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
29
  'learn-press-meta-box-order' => apply_filters(
30
  'learn-press/meta-box-order/script-data',
31
  array(
32
- 'i18n_error' => esc_html__( 'Ooops! Error.', 'learnpress' ),
33
  'i18n_guest' => esc_html__( 'Guest', 'learnpress' ),
34
  )
35
  ),
@@ -37,7 +37,7 @@ class LP_Admin_Assets extends LP_Abstract_Assets {
37
  'learn-press/upgrade/script-data',
38
  array(
39
  'i18n_confirm' => esc_html__(
40
- 'Before taking this action, we strongly recommend you should backup your site first before proceeding. Should any issues come at hand, do not hesitate to contact our Support team. Are you sure to proceed the update protocol?',
41
  'learnpress'
42
  ),
43
  )
29
  'learn-press-meta-box-order' => apply_filters(
30
  'learn-press/meta-box-order/script-data',
31
  array(
32
+ 'i18n_error' => esc_html__( 'Oops! Error.', 'learnpress' ),
33
  'i18n_guest' => esc_html__( 'Guest', 'learnpress' ),
34
  )
35
  ),
37
  'learn-press/upgrade/script-data',
38
  array(
39
  'i18n_confirm' => esc_html__(
40
+ 'Before taking this action, we strongly recommend you backup your site first before proceeding. If you encounter any problems, please do not hesitate to contact our support team. Are you sure to proceed with the update protocol?',
41
  'learnpress'
42
  ),
43
  )
inc/admin/class-lp-admin-menu.php CHANGED
@@ -33,7 +33,6 @@ class LP_Admin_Menu {
33
  */
34
  public function __construct() {
35
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
36
- //add_action( 'admin_menu', array( $this, 'notify_new_course' ) );
37
 
38
  if ( apply_filters( 'learn_press_show_admin_bar_courses_page', true ) ) {
39
  add_action( 'admin_bar_menu', array( $this, 'admin_bar_menus' ), 50 );
@@ -46,19 +45,19 @@ class LP_Admin_Menu {
46
  include_once 'sub-menus/abstract-submenu.php';
47
  }
48
 
 
 
 
 
 
 
 
49
  public function admin_bar_menus( $wp_admin_bar ) {
50
  if ( ! is_admin() || ! is_user_logged_in() ) {
51
  return;
52
  }
53
 
54
- if ( ! is_user_member_of_blog() && ! is_super_admin() ) {
55
- return;
56
- }
57
-
58
- if ( get_option( 'page_on_front' ) == learn_press_get_page_id( 'courses' ) ) {
59
- return;
60
- }
61
-
62
  $wp_admin_bar->add_node(
63
  array(
64
  'parent' => 'site-name',
@@ -67,6 +66,16 @@ class LP_Admin_Menu {
67
  'href' => learn_press_get_page_link( 'courses' ),
68
  )
69
  );
 
 
 
 
 
 
 
 
 
 
70
  }
71
 
72
  /**
@@ -94,23 +103,37 @@ class LP_Admin_Menu {
94
  );
95
 
96
  // Default submenu items
97
- $menu_items = array();
98
- $menu_items['statistic'] = include_once 'sub-menus/class-lp-submenu-statistics.php';
99
- $menu_items['addons'] = include_once 'sub-menus/class-lp-submenu-addons.php';
100
- $menu_items['settings'] = include_once 'sub-menus/class-lp-submenu-settings.php';
101
- $menu_items['tools'] = include_once 'sub-menus/class-lp-submenu-tools.php';
102
-
103
- // Deprecated hooks
104
- $menu_items = apply_filters( 'learn_press_menu_items', $menu_items );
105
 
106
  $menu_items = apply_filters( 'learn-press/admin/menu-items', $menu_items );
107
 
108
  // Sort menu items by it's priority
109
- // uasort( $menu_items, array( $this, 'sort_menu_items' ) );
110
  uasort( $menu_items, 'learn_press_sort_list_by_priority_callback' );
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  if ( $menu_items ) {
113
- foreach ( $menu_items as $item ) {
114
  if ( is_string( $item ) && class_exists( $item ) ) {
115
  $item = new $item();
116
  }
@@ -119,15 +142,20 @@ class LP_Admin_Menu {
119
  continue;
120
  }
121
 
 
 
 
 
 
 
122
  add_submenu_page(
123
  'learn_press',
124
  $item->get_page_title(),
125
  $item->get_menu_title(),
126
  $item->get_capability(),
127
  $item->get_id(),
128
- array( $item, 'display' )
129
  );
130
-
131
  }
132
  $this->menu_items = $menu_items;
133
  }
@@ -151,22 +179,6 @@ class LP_Admin_Menu {
151
  return $this->menu_items;
152
  }
153
 
154
- /*
155
- * Notify an administrator with pending courses
156
- */
157
- public function notify_new_course() {
158
- global $menu;
159
-
160
- $current_user = wp_get_current_user();
161
- if ( ! in_array( 'administrator', $current_user->roles ) ) {
162
- return;
163
- }
164
-
165
- $count_courses = wp_count_posts( LP_COURSE_CPT );
166
- $awaiting_mod = $count_courses->pending;
167
- $menu['3.14'][0] .= " <span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n( $awaiting_mod ) . '</span></span>';
168
- }
169
-
170
  public static function instance() {
171
  static $instance = false;
172
 
33
  */
34
  public function __construct() {
35
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
 
36
 
37
  if ( apply_filters( 'learn_press_show_admin_bar_courses_page', true ) ) {
38
  add_action( 'admin_bar_menu', array( $this, 'admin_bar_menus' ), 50 );
45
  include_once 'sub-menus/abstract-submenu.php';
46
  }
47
 
48
+ /**
49
+ * Admin bar menu.
50
+ *
51
+ * @param WP_Admin_Bar $wp_admin_bar
52
+ *
53
+ * @return void
54
+ */
55
  public function admin_bar_menus( $wp_admin_bar ) {
56
  if ( ! is_admin() || ! is_user_logged_in() ) {
57
  return;
58
  }
59
 
60
+ // Add link view archive courses.
 
 
 
 
 
 
 
61
  $wp_admin_bar->add_node(
62
  array(
63
  'parent' => 'site-name',
66
  'href' => learn_press_get_page_link( 'courses' ),
67
  )
68
  );
69
+
70
+ // Ad link view profile.
71
+ $wp_admin_bar->add_node(
72
+ array(
73
+ 'id' => 'course_profile',
74
+ 'parent' => 'user-actions',
75
+ 'title' => esc_html__( 'View Profile', 'learnpress' ),
76
+ 'href' => learn_press_get_page_link( 'profile' ),
77
+ )
78
+ );
79
  }
80
 
81
  /**
103
  );
104
 
105
  // Default submenu items
106
+ $menu_items = array();
107
+ $menu_items['statistic'] = include_once 'sub-menus/class-lp-submenu-statistics.php';
108
+ $menu_items['addons'] = include_once 'sub-menus/class-lp-submenu-addons.php';
109
+ $menu_items['settings'] = include_once 'sub-menus/class-lp-submenu-settings.php';
110
+ $menu_items['tools'] = include_once 'sub-menus/class-lp-submenu-tools.php';
111
+ $menu_items['categories'] = include_once 'sub-menus/class-lp-submenu-categories.php';
112
+ $menu_items['tags'] = include_once 'sub-menus/class-lp-submenu-tags.php';
 
113
 
114
  $menu_items = apply_filters( 'learn-press/admin/menu-items', $menu_items );
115
 
116
  // Sort menu items by it's priority
 
117
  uasort( $menu_items, 'learn_press_sort_list_by_priority_callback' );
118
 
119
+ add_action(
120
+ 'parent_file',
121
+ function( $parent_file ) {
122
+ global $current_screen;
123
+
124
+ $taxonomy = $current_screen->taxonomy;
125
+ if ( $taxonomy == 'course_tag' ) {
126
+ $parent_file = 'learn_press';
127
+ } elseif ( $taxonomy == 'course_category' ) {
128
+ $parent_file = 'learn_press';
129
+ }
130
+
131
+ return $parent_file;
132
+ }
133
+ );
134
+
135
  if ( $menu_items ) {
136
+ foreach ( $menu_items as $k => $item ) {
137
  if ( is_string( $item ) && class_exists( $item ) ) {
138
  $item = new $item();
139
  }
142
  continue;
143
  }
144
 
145
+ if ( in_array( $k, [ 'tags', 'categories' ] ) ) {
146
+ $callback = false;
147
+ } else {
148
+ $callback = $item->get_callback();
149
+ }
150
+
151
  add_submenu_page(
152
  'learn_press',
153
  $item->get_page_title(),
154
  $item->get_menu_title(),
155
  $item->get_capability(),
156
  $item->get_id(),
157
+ $callback
158
  );
 
159
  }
160
  $this->menu_items = $menu_items;
161
  }
179
  return $this->menu_items;
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  public static function instance() {
183
  static $instance = false;
184
 
inc/admin/class-lp-admin.php CHANGED
@@ -28,13 +28,8 @@ if ( ! class_exists( 'LP_Admin' ) ) {
28
  add_action( 'delete_user', array( $this, 'delete_user_data' ) );
29
  add_action( 'delete_user_form', array( $this, 'delete_user_form' ) );
30
  add_action( 'wp_ajax_learn_press_rated', array( $this, 'rated' ) );
31
- add_action( 'admin_notices', array( $this, 'notice_outdated_templates' ) );
32
- add_action( 'admin_notices', array( $this, 'notice_required_permalink' ) );
33
- add_action( 'admin_notices', array( $this, 'admin_notices' ), 1 );
34
- //add_action( 'admin_head', array( $this, 'admin_colors' ) );
35
- // add_action( 'admin_init', array( $this, 'admin_redirect' ) );
36
  add_action( 'admin_enqueue_scripts', array( $this, 'load_modal' ) );
37
-
38
  add_filter( 'admin_body_class', array( $this, 'body_class' ) );
39
  add_filter( 'manage_users_custom_column', array( $this, 'users_custom_column' ), 10, 3 );
40
  add_filter( 'manage_pages_columns', array( $this, 'page_columns_head' ) );
@@ -540,60 +535,6 @@ if ( ! class_exists( 'LP_Admin' ) ) {
540
  return $views;
541
  }
542
 
543
- /**
544
- * Display admin notices
545
- */
546
- public function admin_notices() {
547
- if ( ! current_user_can( ADMIN_ROLE ) ) {
548
- return;
549
- }
550
-
551
- if ( ! get_option( 'learn_press_setup_wizard_completed', false ) ) {
552
- learn_press_admin_view( 'setup/notice-setup' );
553
- }
554
-
555
- $action = LP_Request::get( 'lp-action' );
556
- $user_id = LP_Request::get_int( 'user_id' );
557
-
558
- if ( ( in_array(
559
- $action,
560
- array( 'accepted-request', 'denied-request' )
561
- ) ) && ( $user_id ) && get_user_by(
562
- 'id',
563
- $user_id
564
- ) ) {
565
- if ( ! current_user_can( 'promote_user', $user_id ) ) {
566
- wp_die( __( 'Sorry, you are not allowed to edit this user.', 'learnpress' ) );
567
- }
568
- ?>
569
-
570
- <div class="updated notice">
571
- <p>
572
- <?php
573
- echo sprintf(
574
- __( 'User has %s to become a teacher.', 'learnpress' ),
575
- $action == 'accepted-request' ? 'accepted' : 'denied'
576
- );
577
- ?>
578
- </p>
579
- </div>
580
-
581
- <?php
582
- }
583
- }
584
-
585
- /**
586
- * Redirect to setup page if we have just activated LP
587
- * @depecated 4.1.6.4
588
- */
589
- /*public function admin_redirect() {
590
- if ( 'yes' === get_transient( 'lp_activation_redirect' ) && current_user_can( 'install_plugins' ) ) {
591
- delete_transient( 'lp_activation_redirect' );
592
-
593
- exit( wp_safe_redirect( admin_url( 'index.php?page=lp-setup' ) ) );
594
- }
595
- }*/
596
-
597
  /**
598
  * Custom admin body classes.
599
  *
@@ -620,41 +561,67 @@ if ( ! class_exists( 'LP_Admin' ) ) {
620
  return $classes;
621
  }
622
 
623
- public function notice_required_permalink() {
624
- if ( current_user_can( 'manage_options' ) ) {
625
- if ( ! get_option( 'permalink_structure' ) ) {
626
- ?>
627
- <div class="notice notice-error">
628
- <p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629
  <?php
630
  echo sprintf(
631
  'LearnPress requires permalink option <strong>Post name</strong> is enabled. Please enable it <a href="%s">here</a> to ensure that all functions work properly.',
632
  admin_url( 'options-permalink.php' )
633
  )
634
  ?>
635
- </p>
636
- </div>
637
- <?php
638
- }
639
  }
640
- }
641
 
642
- /**
643
- * Notices outdated templates.
644
- */
645
- public function notice_outdated_templates() {
646
- if ( current_user_can( 'manage_options' ) ) {
647
- $page = LP_Helper::sanitize_params_submitted( $_REQUEST['page'] ?? '' );
648
- $tab = LP_Helper::sanitize_params_submitted( $_REQUEST['tab'] ?? '' );
649
-
650
- if ( $page == 'learn-press-tools' && $tab == 'templates' ) {
651
- return;
652
- }
653
 
654
- if ( LP_Outdated_Template_Helper::detect_outdated_template() ) {
655
- learn_press_admin_view( 'html-admin-notice-templates' );
656
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  }
 
 
 
 
 
658
  }
659
 
660
  /**
@@ -683,7 +650,7 @@ if ( ! class_exists( 'LP_Admin' ) ) {
683
  if ( ! get_option( 'learn_press_message_user_rated' ) ) {
684
  $footer_text = sprintf(
685
  __(
686
- 'If you like <strong>LearnPress</strong> please leave us a %1$s&#9733;&#9733;&#9733;&#9733;&#9733;%2$s rating. A huge thanks from LearnPress team for your generous.',
687
  'learnpress'
688
  ),
689
  '<a href="https://wordpress.org/support/plugin/learnpress/reviews/?filter=5#postform" target="_blank" class="lp-rating-link" data-rated="' . esc_attr__(
@@ -755,7 +722,7 @@ if ( ! class_exists( 'LP_Admin' ) ) {
755
 
756
  $user = learn_press_get_current_user();
757
  if ( ! $user || $user->get_email() == '' ) {
758
- $data['error'] = __( 'Fail while joining newsletter! Please try again!', 'learnpress' );
759
  }
760
 
761
  $url = 'https://thimpress.com/mailster/subscribe';
@@ -784,7 +751,7 @@ if ( ! class_exists( 'LP_Admin' ) ) {
784
  $data['message'] = __( 'Something went wrong: ', 'learnpress' ) . $error_message;
785
  } else {
786
  $data['message'] = __(
787
- 'Thank you for subscribing! Please check and click the confirmation link from the email we\'ve just sent to your mail box.',
788
  'learnpress'
789
  );
790
  }
@@ -906,7 +873,7 @@ if ( ! class_exists( 'LP_Admin' ) ) {
906
  } else {
907
  // $post_link_preview = sprintf( '<a class="button" href="%s" target="_blank">%s</a>', learn_press_get_preview_url( $post_id ), __( 'Preview', 'learnpress' ) );
908
  $post_link_message = '<span>' . __(
909
- 'Permalink only available if the item is already assigned to a course.',
910
  'learnpress'
911
  ) . '</span>';
912
  $post_link = sprintf( '<div id="learn-press-box-edit-slug">%s</div>', $post_link_message );
28
  add_action( 'delete_user', array( $this, 'delete_user_data' ) );
29
  add_action( 'delete_user_form', array( $this, 'delete_user_form' ) );
30
  add_action( 'wp_ajax_learn_press_rated', array( $this, 'rated' ) );
31
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
 
 
 
 
32
  add_action( 'admin_enqueue_scripts', array( $this, 'load_modal' ) );
 
33
  add_filter( 'admin_body_class', array( $this, 'body_class' ) );
34
  add_filter( 'manage_users_custom_column', array( $this, 'users_custom_column' ), 10, 3 );
35
  add_filter( 'manage_pages_columns', array( $this, 'page_columns_head' ) );
535
  return $views;
536
  }
537
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
  /**
539
  * Custom admin body classes.
540
  *
561
  return $classes;
562
  }
563
 
564
+ /**
565
+ * Display notices on Backend.
566
+ */
567
+ public function admin_notices() {
568
+ if ( ! current_user_can( ADMIN_ROLE ) ) {
569
+ return;
570
+ }
571
+
572
+ // Show template file templates override.
573
+ $page = LP_Request::get_param( 'page' );
574
+ $tab = LP_Request::get_param( 'tab' );
575
+ if ( $page == 'learn-press-tools' && $tab == 'templates' ) {
576
+ if ( LP_Outdated_Template_Helper::detect_outdated_template() ) {
577
+ learn_press_admin_view( 'html-admin-notice-templates' );
578
+ }
579
+ }
580
+
581
+ // Show notice permalink structure wrong.
582
+ if ( ! get_option( 'permalink_structure' ) ) {
583
+ ?>
584
+ <div class="notice notice-error">
585
+ <p>
586
  <?php
587
  echo sprintf(
588
  'LearnPress requires permalink option <strong>Post name</strong> is enabled. Please enable it <a href="%s">here</a> to ensure that all functions work properly.',
589
  admin_url( 'options-permalink.php' )
590
  )
591
  ?>
592
+ </p>
593
+ </div>
594
+ <?php
 
595
  }
 
596
 
597
+ // Show notice setup wizard.
598
+ if ( ! get_option( 'learn_press_setup_wizard_completed', false ) ) {
599
+ learn_press_admin_view( 'setup/notice-setup' );
600
+ }
 
 
 
 
 
 
 
601
 
602
+ // Request accept/denied user can become a teacher.
603
+ $action_become_teacher = LP_Request::get_param( 'lp-action' );
604
+ $user_id = LP_Request::get_param( 'user_id', 0, 'int' );
605
+ $type_action_become_teacher = array( 'accepted-request', 'denied-request' );
606
+ if ( in_array( $action_become_teacher, $type_action_become_teacher ) && $user_id && get_user_by( 'id', $user_id ) ) {
607
+ ?>
608
+ <div class="updated notice">
609
+ <p>
610
+ <?php
611
+ echo sprintf(
612
+ __( 'A user has %s to become a teacher.', 'learnpress' ),
613
+ $action_become_teacher == 'accepted-request' ? 'accepted' : 'denied'
614
+ );
615
+ ?>
616
+ </p>
617
+ </div>
618
+ <?php
619
  }
620
+
621
+ // Show notice check wp_remote_post (background) runs.
622
+ ?>
623
+ <div class="notice-check-run-background-available"></div>
624
+ <?php
625
  }
626
 
627
  /**
650
  if ( ! get_option( 'learn_press_message_user_rated' ) ) {
651
  $footer_text = sprintf(
652
  __(
653
+ 'If you like <strong>LearnPress</strong> please leave us a %1$s&#9733;&#9733;&#9733;&#9733;&#9733;%2$s rating. A huge thanks from the LearnPress team for your generosity.',
654
  'learnpress'
655
  ),
656
  '<a href="https://wordpress.org/support/plugin/learnpress/reviews/?filter=5#postform" target="_blank" class="lp-rating-link" data-rated="' . esc_attr__(
722
 
723
  $user = learn_press_get_current_user();
724
  if ( ! $user || $user->get_email() == '' ) {
725
+ $data['error'] = __( 'Failed while joining the newsletter! Please try again!', 'learnpress' );
726
  }
727
 
728
  $url = 'https://thimpress.com/mailster/subscribe';
751
  $data['message'] = __( 'Something went wrong: ', 'learnpress' ) . $error_message;
752
  } else {
753
  $data['message'] = __(
754
+ 'Thank you for subscribing! Please check and click the confirmation link from the email that we\'ve just sent to your inbox.',
755
  'learnpress'
756
  );
757
  }
873
  } else {
874
  // $post_link_preview = sprintf( '<a class="button" href="%s" target="_blank">%s</a>', learn_press_get_preview_url( $post_id ), __( 'Preview', 'learnpress' ) );
875
  $post_link_message = '<span>' . __(
876
+ 'Permalink is only available if the item is already assigned to a course.',
877
  'learnpress'
878
  ) . '</span>';
879
  $post_link = sprintf( '<div id="learn-press-box-edit-slug">%s</div>', $post_link_message );
inc/admin/class-lp-install-sample-data.php CHANGED
@@ -65,8 +65,8 @@ class LP_Install_Sample_Data {
65
  }
66
 
67
  $i18n = array(
68
- 'confirm_install_sample_data' => esc_html__( 'Are you sure you want to install sample course data?', 'learnpress' ),
69
- 'confirm_uninstall_sample_data' => esc_html__( 'Are you sure you want to delete sample course data?', 'learnpress' ),
70
  );
71
 
72
  if ( empty( $data['i18n'] ) ) {
@@ -155,7 +155,7 @@ class LP_Install_Sample_Data {
155
  ?>
156
 
157
  <div class="lp-install-sample__response success">
158
- <?php printf( __( 'Course "%s" has been created', 'learnpress' ), get_the_title( $course_id ) ); ?>
159
  <a href="<?php echo esc_url_raw( get_the_permalink( $course_id ) ); ?>" target="_blank"><?php esc_html_e( 'View', 'learnpress' ); ?></a>
160
  |
161
  <a href="<?php echo esc_url_raw( admin_url( 'post.php?post=' . $course_id . '&action=edit' ) ); ?>" target="_blank"><?php esc_html_e( 'Edit', 'learnpress' ); ?></a>
@@ -205,7 +205,7 @@ class LP_Install_Sample_Data {
205
  ?>
206
 
207
  <div class="lp-install-sample__response success">
208
- <?php esc_html_e( 'Delete sample data successfully!', 'learnpress' ); ?>
209
  </div>
210
 
211
  <?php
65
  }
66
 
67
  $i18n = array(
68
+ 'confirm_install_sample_data' => esc_html__( 'Are you sure you want to install the sample course data?', 'learnpress' ),
69
+ 'confirm_uninstall_sample_data' => esc_html__( 'Are you sure you want to delete the sample course data?', 'learnpress' ),
70
  );
71
 
72
  if ( empty( $data['i18n'] ) ) {
155
  ?>
156
 
157
  <div class="lp-install-sample__response success">
158
+ <?php printf( __( 'The Course "%s" has been created', 'learnpress' ), get_the_title( $course_id ) ); ?>
159
  <a href="<?php echo esc_url_raw( get_the_permalink( $course_id ) ); ?>" target="_blank"><?php esc_html_e( 'View', 'learnpress' ); ?></a>
160
  |
161
  <a href="<?php echo esc_url_raw( admin_url( 'post.php?post=' . $course_id . '&action=edit' ) ); ?>" target="_blank"><?php esc_html_e( 'Edit', 'learnpress' ); ?></a>
205
  ?>
206
 
207
  <div class="lp-install-sample__response success">
208
+ <?php esc_html_e( 'The sample data was successfully deleted!', 'learnpress' ); ?>
209
  </div>
210
 
211
  <?php
inc/admin/class-lp-reset-data.php CHANGED
@@ -100,7 +100,7 @@ class LP_Reset_Data {
100
  }
101
  }
102
 
103
- echo __( 'Item progress deleted', 'learnpress' );
104
  } else {
105
  echo __( 'No data found', 'learnpress' );
106
  }
@@ -187,13 +187,16 @@ class LP_Reset_Data {
187
  }
188
  if ( $course_id && $object_reset == 'single' ) {
189
  $user_course_data = $user->get_course_data( $course_id );
 
 
 
190
 
191
- // Set status, start_time, end_time of course to enrolled.
192
  $user_course_data->set_status( LP_COURSE_ENROLLED )
193
- ->set_start_time( current_time( 'mysql', true ) )
194
- ->set_end_time( '' )
195
- ->set_graduation( 'in-progress' )
196
- ->update();
197
  // Remove items' course user learned.
198
  $filter_remove = new LP_User_Items_Filter();
199
  $filter_remove->parent_id = $user_course_data->get_user_item_id();
@@ -216,13 +219,16 @@ class LP_Reset_Data {
216
  foreach ( $user_item_ids as $user_item_id ) {
217
  $course_id = $user_item_id;
218
  $user_course_data = $user->get_course_data( $course_id );
 
 
 
219
 
220
  // Set status, start_time, end_time of course to enrolled.
221
  $user_course_data->set_status( LP_COURSE_ENROLLED )
222
- ->set_start_time( current_time( 'mysql', true ) )
223
- ->set_end_time( '' )
224
- ->set_graduation( 'in-progress' )
225
- ->update();
226
  // Remove items' course user learned.
227
  $filter_remove = new LP_User_Items_Filter();
228
  $filter_remove->parent_id = $user_course_data->get_user_item_id();
100
  }
101
  }
102
 
103
+ echo __( 'Item progress is deleted', 'learnpress' );
104
  } else {
105
  echo __( 'No data found', 'learnpress' );
106
  }
187
  }
188
  if ( $course_id && $object_reset == 'single' ) {
189
  $user_course_data = $user->get_course_data( $course_id );
190
+ if ( ! $user_course_data ) {
191
+ return;
192
+ }
193
 
194
+ // Set status, start_time, end_time of course to enrol.
195
  $user_course_data->set_status( LP_COURSE_ENROLLED )
196
+ ->set_start_time( time() )
197
+ ->set_end_time()
198
+ ->set_graduation( LP_COURSE_GRADUATION_IN_PROGRESS )
199
+ ->update();
200
  // Remove items' course user learned.
201
  $filter_remove = new LP_User_Items_Filter();
202
  $filter_remove->parent_id = $user_course_data->get_user_item_id();
219
  foreach ( $user_item_ids as $user_item_id ) {
220
  $course_id = $user_item_id;
221
  $user_course_data = $user->get_course_data( $course_id );
222
+ if ( ! $user_course_data ) {
223
+ continue;
224
+ }
225
 
226
  // Set status, start_time, end_time of course to enrolled.
227
  $user_course_data->set_status( LP_COURSE_ENROLLED )
228
+ ->set_start_time( time() )
229
+ ->set_end_time()
230
+ ->set_graduation( LP_COURSE_GRADUATION_IN_PROGRESS )
231
+ ->update();
232
  // Remove items' course user learned.
233
  $filter_remove = new LP_User_Items_Filter();
234
  $filter_remove->parent_id = $user_course_data->get_user_item_id();
inc/admin/class-lp-setup-wizard.php CHANGED
@@ -73,7 +73,7 @@ class LP_Setup_Wizard {
73
  'courses_page_id' => _x( 'LP Courses', 'static-page', 'learnpress' ),
74
  'profile_page_id' => _x( 'LP Profile', 'static-page', 'learnpress' ),
75
  'checkout_page_id' => _x( 'LP Checkout', 'static-page', 'learnpress' ),
76
- 'become_a_teacher_page_id' => _x( 'LP Become Teacher', 'static-page', 'learnpress' ),
77
  'term_conditions_page_id' => _x( 'LP Terms and Conditions', 'static-page', 'learnpress' ),
78
  );
79
 
73
  'courses_page_id' => _x( 'LP Courses', 'static-page', 'learnpress' ),
74
  'profile_page_id' => _x( 'LP Profile', 'static-page', 'learnpress' ),
75
  'checkout_page_id' => _x( 'LP Checkout', 'static-page', 'learnpress' ),
76
+ 'become_a_teacher_page_id' => _x( 'LP Become a Teacher', 'static-page', 'learnpress' ),
77
  'term_conditions_page_id' => _x( 'LP Terms and Conditions', 'static-page', 'learnpress' ),
78
  );
79
 
inc/admin/class-lp-updater.php CHANGED
@@ -55,18 +55,18 @@ class LP_Updater {
55
  return false;
56
  }
57
 
58
- $db_current_version = (int) get_option( LP_KEY_DB_VERSION, false );
59
- if ( ! $db_current_version ) {
60
  return false;
61
- }
62
 
63
  $db_require_version = LearnPress::instance()->db_version;
64
- if ( $db_require_version <= $db_current_version ) {
65
  return false;
66
  }
67
 
68
  if ( array_key_exists( $db_current_version, $this->db_map_version ) ) {
69
- return $this->db_map_version[ $db_current_version ];
70
  }
71
 
72
  /**
55
  return false;
56
  }
57
 
58
+ $db_current_version = (int) get_option( LP_KEY_DB_VERSION, 0 );
59
+ /*if ( ! $db_current_version ) {
60
  return false;
61
+ }*/
62
 
63
  $db_require_version = LearnPress::instance()->db_version;
64
+ if ( version_compare( $db_require_version, $db_current_version, '<=' ) ) {
65
  return false;
66
  }
67
 
68
  if ( array_key_exists( $db_current_version, $this->db_map_version ) ) {
69
+ return $this->db_map_version[ $db_current_version . '' ];
70
  }
71
 
72
  /**
inc/admin/editor/class-lp-admin-editor-quiz.php CHANGED
@@ -175,14 +175,16 @@ class LP_Admin_Editor_Quiz extends LP_Admin_Editor {
175
  $new_question = $this->question_curd->create( $args );
176
 
177
  if ( ! is_wp_error( $new_question ) ) {
178
-
179
  // update hidden questions in quiz meta
180
  $quiz = LP_Quiz::get_quiz( $quiz_id );
181
- $hidden_questions = $quiz->get_questions();
182
 
183
  if ( $hidden_questions ) {
184
- unset( $hidden_questions[ $new_question->get_id() ] );
185
- $hidden_questions = array_keys( $hidden_questions );
 
 
 
186
  }
187
 
188
  update_post_meta( $quiz_id, '_lp_hidden_questions', $hidden_questions );
175
  $new_question = $this->question_curd->create( $args );
176
 
177
  if ( ! is_wp_error( $new_question ) ) {
 
178
  // update hidden questions in quiz meta
179
  $quiz = LP_Quiz::get_quiz( $quiz_id );
180
+ $hidden_questions = $quiz->get_question_ids();
181
 
182
  if ( $hidden_questions ) {
183
+ $index = array_search( $new_question->get_id(), $hidden_questions );
184
+ if ( $index !== false ) {
185
+ unset( $hidden_questions[ $index ] );
186
+ }
187
+ //$hidden_questions = array_keys( $hidden_questions );
188
  }
189
 
190
  update_post_meta( $quiz_id, '_lp_hidden_questions', $hidden_questions );
inc/admin/lp-admin-actions.php CHANGED
@@ -218,12 +218,12 @@ function learn_press_admin_course_tabs() {
218
  'id' => 'edit-lp_course',
219
  ),
220
  20 => array(
221
- 'link' => 'edit-tags.php?taxonomy=course_category&post_type=lp_course',
222
  'name' => esc_html__( 'Categories', 'learnpress' ),
223
  'id' => 'edit-course_category',
224
  ),
225
  30 => array(
226
- 'link' => 'edit-tags.php?taxonomy=course_tag&post_type=lp_course',
227
  'name' => esc_html__( 'Tags', 'learnpress' ),
228
  'id' => 'edit-course_tag',
229
  ),
@@ -302,9 +302,3 @@ if ( ! function_exists( 'lp_remove_admin_warning' ) ) {
302
  }
303
  add_action( 'wp_ajax_lp_remove_admin_warning', 'lp_remove_admin_warning' );
304
 
305
- // 3.3.0
306
- function learn_press_fill_in_blanks_admin_editor( $question ) {
307
- learn_press_admin_view( 'question/fill-in-blanks', array( 'question' => $question ) );
308
- }
309
- add_action( 'learn-press/question-admin-editor', 'learn_press_fill_in_blanks_admin_editor' );
310
-
218
  'id' => 'edit-lp_course',
219
  ),
220
  20 => array(
221
+ 'link' => 'edit-tags.php?taxonomy=course_category',
222
  'name' => esc_html__( 'Categories', 'learnpress' ),
223
  'id' => 'edit-course_category',
224
  ),
225
  30 => array(
226
+ 'link' => 'edit-tags.php?taxonomy=course_tag',
227
  'name' => esc_html__( 'Tags', 'learnpress' ),
228
  'id' => 'edit-course_tag',
229
  ),
302
  }
303
  add_action( 'wp_ajax_lp_remove_admin_warning', 'lp_remove_admin_warning' );
304
 
 
 
 
 
 
 
inc/admin/lp-admin-functions.php CHANGED
@@ -106,27 +106,6 @@ if ( ! function_exists( 'learn_press_add_row_action_link' ) ) {
106
  add_filter( 'page_row_actions', 'learn_press_add_row_action_link' );
107
  }
108
 
109
- if ( ! function_exists( 'learn_press_settings_tabs_array' ) ) {
110
- /**
111
- * Default admin settings pages
112
- *
113
- * @return mixed
114
- * @depecated 4.1.6.4
115
- */
116
- /*function learn_press_settings_tabs_array() {
117
- $tabs = array(
118
- 'general' => include_once LP_PLUGIN_PATH . 'inc/admin/settings/class-lp-settings-general.php',
119
- 'courses' => include_once LP_PLUGIN_PATH . 'inc/admin/settings/class-lp-settings-courses.php',
120
- 'profile' => include_once LP_PLUGIN_PATH . 'inc/admin/settings/class-lp-settings-profile.php',
121
- 'payments' => include_once LP_PLUGIN_PATH . 'inc/admin/settings/class-lp-settings-payments.php',
122
- 'emails' => include_once LP_PLUGIN_PATH . 'inc/admin/settings/class-lp-settings-emails.php',
123
- 'advanced' => include_once LP_PLUGIN_PATH . 'inc/admin/settings/class-lp-settings-advanced.php',
124
- );
125
-
126
- return apply_filters( 'learn-press/admin/settings-tabs-array', $tabs );
127
- }*/
128
- }
129
-
130
  function learn_press_is_hidden_post_box( $id, $user_id = 0 ) {
131
  if ( ! $user_id ) {
132
  $user_id = get_current_user_id();
@@ -288,7 +267,7 @@ function learn_press_pages_dropdown( $name, $selected = false, $args = array() )
288
  if ( $allow_create ) {
289
  ob_start(); ?>
290
 
291
- <?php echo esc_html( _x( 'or', 'drop down pages', 'learnpress' ) ); ?>
292
 
293
  <button class="button button-quick-add-page" data-id="<?php echo esc_attr( $id ); ?>" type="button">
294
  <?php esc_html_e( 'Create new', 'learnpress' ); ?>
@@ -868,7 +847,7 @@ function learn_press_get_chart_students( $from = null, $by = null, $time_ago = 0
868
  $datasets = array();
869
 
870
  if ( is_null( $from ) ) {
871
- $from = current_time( 'mysql' );
872
  }
873
 
874
  if ( is_null( $by ) ) {
@@ -922,7 +901,7 @@ function learn_press_get_chart_users( $from = null, $by = null, $time_ago = 0 )
922
  $datasets = array();
923
 
924
  if ( is_null( $from ) ) {
925
- $from = current_time( 'mysql' );
926
  }
927
 
928
  if ( is_null( $by ) ) {
@@ -1074,7 +1053,7 @@ function learn_press_get_chart_courses( $from = null, $by = null, $time_ago = 0
1074
  $datasets = array();
1075
 
1076
  if ( is_null( $from ) ) {
1077
- $from = current_time( 'mysql' );
1078
  }
1079
 
1080
  if ( is_null( $by ) ) {
@@ -1282,7 +1261,7 @@ function learn_press_get_chart_orders( $from = null, $by = null, $time_ago = 0 )
1282
  $labels = array();
1283
  $datasets = array();
1284
  if ( is_null( $from ) ) {
1285
- $from = current_time( 'mysql' );
1286
  }
1287
  if ( is_null( $by ) ) {
1288
  $by = 'days';
@@ -1474,8 +1453,8 @@ function learn_press_get_chart_orders( $from = null, $by = null, $time_ago = 0 )
1474
  */
1475
  function learn_press_get_chart_courses2() {
1476
  $labels = array(
1477
- __( 'Pending Courses / Publish Courses', 'learnpress' ),
1478
- __( 'Free Courses / Priced Courses', 'learnpress' ),
1479
  );
1480
 
1481
  $datasets = array();
@@ -1855,7 +1834,7 @@ if ( ! function_exists( 'learn_press_duplicate_post' ) ) {
1855
  'post_parent' => $post->post_parent,
1856
  'post_password' => $post->post_password,
1857
  'post_status' => 'draft',
1858
- 'post_title' => $post->post_title . __( ' Copy', 'learnpress' ),
1859
  'post_type' => $post->post_type,
1860
  'to_ping' => $post->to_ping,
1861
  'menu_order' => $post->menu_order,
@@ -2049,10 +2028,13 @@ if ( ! function_exists( 'learn_press_duplicate_quiz' ) ) {
2049
 
2050
  $new_quiz_id = learn_press_duplicate_post( $quiz_id, $args, true );
2051
  $quiz = LP_Quiz::get_quiz( $quiz_id );
2052
- $questions = $quiz->get_questions();
 
 
 
 
2053
 
2054
  if ( $questions ) {
2055
- $questions = array_keys( $questions );
2056
  foreach ( $questions as $question_id ) {
2057
  $new_question_id = learn_press_duplicate_post( $question_id );
2058
 
@@ -2134,7 +2116,7 @@ function learn_press_get_chart_general( $from = null, $by = null, $time_ago = 0
2134
  $datasets = array();
2135
 
2136
  if ( is_null( $from ) ) {
2137
- $from = current_time( 'mysql' );
2138
  }
2139
 
2140
  if ( is_null( $by ) ) {
106
  add_filter( 'page_row_actions', 'learn_press_add_row_action_link' );
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  function learn_press_is_hidden_post_box( $id, $user_id = 0 ) {
110
  if ( ! $user_id ) {
111
  $user_id = get_current_user_id();
267
  if ( $allow_create ) {
268
  ob_start(); ?>
269
 
270
+ <?php echo esc_html( _x( 'or', 'dropdown pages', 'learnpress' ) ); ?>
271
 
272
  <button class="button button-quick-add-page" data-id="<?php echo esc_attr( $id ); ?>" type="button">
273
  <?php esc_html_e( 'Create new', 'learnpress' ); ?>
847
  $datasets = array();
848
 
849
  if ( is_null( $from ) ) {
850
+ $from = current_time( 'mysql', 1 );
851
  }
852
 
853
  if ( is_null( $by ) ) {
901
  $datasets = array();
902
 
903
  if ( is_null( $from ) ) {
904
+ $from = current_time( 'mysql', 1 );
905
  }
906
 
907
  if ( is_null( $by ) ) {
1053
  $datasets = array();
1054
 
1055
  if ( is_null( $from ) ) {
1056
+ $from = current_time( 'mysql', 1 );
1057
  }
1058
 
1059
  if ( is_null( $by ) ) {
1261
  $labels = array();
1262
  $datasets = array();
1263
  if ( is_null( $from ) ) {
1264
+ $from = current_time( 'mysql', 1 );
1265
  }
1266
  if ( is_null( $by ) ) {
1267
  $by = 'days';
1453
  */
1454
  function learn_press_get_chart_courses2() {
1455
  $labels = array(
1456
+ __( 'Pending Courses/Publish Courses', 'learnpress' ),
1457
+ __( 'Free Courses/Paid Courses', 'learnpress' ),
1458
  );
1459
 
1460
  $datasets = array();
1834
  'post_parent' => $post->post_parent,
1835
  'post_password' => $post->post_password,
1836
  'post_status' => 'draft',
1837
+ 'post_title' => $post->post_title . __( 'Copy', 'learnpress' ),
1838
  'post_type' => $post->post_type,
1839
  'to_ping' => $post->to_ping,
1840
  'menu_order' => $post->menu_order,
2028
 
2029
  $new_quiz_id = learn_press_duplicate_post( $quiz_id, $args, true );
2030
  $quiz = LP_Quiz::get_quiz( $quiz_id );
2031
+ if ( ! $quiz ) {
2032
+ return 0;
2033
+ }
2034
+
2035
+ $questions = $quiz->get_question_ids();
2036
 
2037
  if ( $questions ) {
 
2038
  foreach ( $questions as $question_id ) {
2039
  $new_question_id = learn_press_duplicate_post( $question_id );
2040
 
2116
  $datasets = array();
2117
 
2118
  if ( is_null( $from ) ) {
2119
+ $from = current_time( 'mysql', 1 );
2120
  }
2121
 
2122
  if ( is_null( $by ) ) {
inc/admin/meta-box/fields/email-content.php CHANGED
@@ -42,7 +42,7 @@ $email_format = $meta['format'];
42
  'name' => $value['id'] . '[format]',
43
  'class' => 'lp-email-format',
44
  'selected' => $email_format,
45
- 'option_none' => array( '' => esc_html__( 'General Setting', 'learnpress' ) ),
46
  )
47
  );
48
  ?>
@@ -132,7 +132,7 @@ $email_format = $meta['format'];
132
  </ol>
133
 
134
  <p class="description">
135
- <?php esc_html_e( 'Click on any variables above to insert them to the email.', 'learnpress' ); ?>
136
  </p>
137
  <?php endif; ?>
138
  <?php endif; ?>
42
  'name' => $value['id'] . '[format]',
43
  'class' => 'lp-email-format',
44
  'selected' => $email_format,
45
+ 'option_none' => array( '' => esc_html__( 'General Settings', 'learnpress' ) ),
46
  )
47
  );
48
  ?>
132
  </ol>
133
 
134
  <p class="description">
135
+ <?php esc_html_e( 'Click on any variables above to insert them into the email.', 'learnpress' ); ?>
136
  </p>
137
  <?php endif; ?>
138
  <?php endif; ?>
inc/admin/meta-box/fields/image-advanced.php CHANGED
@@ -35,7 +35,7 @@
35
  <input type="hidden" id="lp-gallery-images-ids" name="<?php echo esc_attr( $value['id'] ); ?>" value="<?php echo esc_attr( implode( ',', $updated_gallery_ids ) ); ?>" />
36
 
37
  <p class="lp-metabox-field__image-advanced-upload hide-if-no-js">
38
- <a href="#" data-choose="<?php esc_attr_e( 'Add images', 'learnpress' ); ?>" data-update="<?php esc_attr_e( 'Add to gallery', 'learnpress' ); ?>" data-delete="<?php esc_attr_e( 'Delete image', 'learnpress' ); ?>" data-text="<?php esc_attr_e( 'Delete', 'learnpress' ); ?>"><?php esc_html_e( 'Add images', 'learnpress' ); ?></a>
39
  </p>
40
  </td>
41
  </tr>
35
  <input type="hidden" id="lp-gallery-images-ids" name="<?php echo esc_attr( $value['id'] ); ?>" value="<?php echo esc_attr( implode( ',', $updated_gallery_ids ) ); ?>" />
36
 
37
  <p class="lp-metabox-field__image-advanced-upload hide-if-no-js">
38
+ <a href="#" data-choose="<?php esc_attr_e( 'Add images', 'learnpress' ); ?>" data-update="<?php esc_attr_e( 'Add to gallery', 'learnpress' ); ?>" data-delete="<?php esc_attr_e( 'Delete images', 'learnpress' ); ?>" data-text="<?php esc_attr_e( 'Delete', 'learnpress' ); ?>"><?php esc_html_e( 'Add images', 'learnpress' ); ?></a>
39
  </p>
40
  </td>
41
  </tr>
inc/admin/settings/class-lp-settings-advanced.php CHANGED
@@ -90,7 +90,7 @@ class LP_Settings_Advanced extends LP_Abstract_Settings_Page {
90
  'id' => 'debug',
91
  'default' => 'no',
92
  'type' => 'checkbox',
93
- 'desc' => esc_html__( 'Enable debug mode for developer.', 'learnpress' ),
94
  ),
95
  // array(
96
  // 'title' => esc_html__( 'Enable Jwt Rest API', 'learnpress' ),
@@ -111,7 +111,7 @@ class LP_Settings_Advanced extends LP_Abstract_Settings_Page {
111
  'id' => 'navigation_position',
112
  'default' => 'yes',
113
  'type' => 'checkbox',
114
- 'desc' => esc_html__( 'Question navigation position is sticky, if not right below the quiz content', 'learnpress' ),
115
  ),
116
  array(
117
  'type' => 'sectionend',
90
  'id' => 'debug',
91
  'default' => 'no',
92
  'type' => 'checkbox',
93
+ 'desc' => esc_html__( 'Enable debug mode for the developer.', 'learnpress' ),
94
  ),
95
  // array(
96
  // 'title' => esc_html__( 'Enable Jwt Rest API', 'learnpress' ),
111
  'id' => 'navigation_position',
112
  'default' => 'yes',
113
  'type' => 'checkbox',
114
+ 'desc' => esc_html__( 'The question\'s navigation position is sticky. If this option is disabled, the question navigation position will be below the quiz content', 'learnpress' ),
115
  ),
116
  array(
117
  'type' => 'sectionend',
inc/admin/settings/class-lp-settings-payments.php CHANGED
@@ -82,21 +82,21 @@ class LP_Settings_Payments extends LP_Abstract_Settings_Page {
82
  'id' => 'guest_checkout',
83
  'default' => 'no',
84
  'type' => 'checkbox',
85
- 'desc' => esc_html__( 'Enable guest checkout', 'learnpress' ),
86
  ),
87
  array(
88
  'title' => esc_html__( 'Account login', 'learnpress' ),
89
  'id' => 'enable_login_checkout',
90
  'default' => 'yes',
91
  'type' => 'checkbox',
92
- 'desc' => esc_html__( 'Enable login form in checkout', 'learnpress' ),
93
  ),
94
  array(
95
  'title' => esc_html__( 'Account creation', 'learnpress' ),
96
  'id' => 'enable_registration_checkout',
97
  'default' => 'yes',
98
  'type' => 'checkbox',
99
- 'desc' => esc_html__( 'Enable register form in checkout', 'learnpress' ),
100
  ),
101
  )
102
  );
82
  'id' => 'guest_checkout',
83
  'default' => 'no',
84
  'type' => 'checkbox',
85
+ 'desc' => esc_html__( 'Enable guest checkout.', 'learnpress' ),
86
  ),
87
  array(
88
  'title' => esc_html__( 'Account login', 'learnpress' ),
89
  'id' => 'enable_login_checkout',
90
  'default' => 'yes',
91
  'type' => 'checkbox',
92
+ 'desc' => esc_html__( 'Enable the login form in the checkout.', 'learnpress' ),
93
  ),
94
  array(
95
  'title' => esc_html__( 'Account creation', 'learnpress' ),
96
  'id' => 'enable_registration_checkout',
97
  'default' => 'yes',
98
  'type' => 'checkbox',
99
+ 'desc' => esc_html__( 'Enable the register form in the checkout.', 'learnpress' ),
100
  ),
101
  )
102
  );
inc/admin/settings/class-lp-settings-profile.php CHANGED
@@ -71,14 +71,14 @@ class LP_Settings_Profile extends LP_Abstract_Settings_Page {
71
  'id' => 'enable_login_profile',
72
  'default' => 'no',
73
  'type' => 'checkbox',
74
- 'desc' => esc_html__( 'Enable login from profile if the user is not logged in.', 'learnpress' ),
75
  ),
76
  array(
77
  'title' => esc_html__( 'Enable register form', 'learnpress' ),
78
  'id' => 'enable_register_profile',
79
  'default' => 'no',
80
  'type' => 'checkbox',
81
- 'desc' => esc_html__( 'Enable register from profile if the user is not logged in.', 'learnpress' ),
82
  ),
83
  array(
84
  'title' => esc_html__( 'Enable default fields', 'learnpress' ),
@@ -130,7 +130,7 @@ class LP_Settings_Profile extends LP_Abstract_Settings_Page {
130
  'type' => 'checkbox',
131
  ),
132
  ),
133
- 'desc' => esc_html__( 'Custom fields for form register.', 'learnpress' ),
134
  ),
135
  array(
136
  'type' => 'sectionend',
71
  'id' => 'enable_login_profile',
72
  'default' => 'no',
73
  'type' => 'checkbox',
74
+ 'desc' => esc_html__( 'If the user is not logged in, enable login from profile.', 'learnpress' ),
75
  ),
76
  array(
77
  'title' => esc_html__( 'Enable register form', 'learnpress' ),
78
  'id' => 'enable_register_profile',
79
  'default' => 'no',
80
  'type' => 'checkbox',
81
+ 'desc' => esc_html__( 'If the user is not logged in, enable register from profile.', 'learnpress' ),
82
  ),
83
  array(
84
  'title' => esc_html__( 'Enable default fields', 'learnpress' ),
130
  'type' => 'checkbox',
131
  ),
132
  ),
133
+ 'desc' => esc_html__( 'Custom fields to the registration form.', 'learnpress' ),
134
  ),
135
  array(
136
  'type' => 'sectionend',
inc/admin/sub-menus/abstract-submenu.php CHANGED
@@ -290,6 +290,15 @@ abstract class LP_Abstract_Submenu {
290
  return $section;
291
  }
292
 
 
 
 
 
 
 
 
 
 
293
  /**
294
  * Display menu content
295
  */
290
  return $section;
291
  }
292
 
293
+ /**
294
+ * Callback return template.
295
+ *
296
+ * @return bool|array|mixed
297
+ */
298
+ public function get_callback() {
299
+ return $this->callback;
300
+ }
301
+
302
  /**
303
  * Display menu content
304
  */
inc/admin/sub-menus/class-lp-submenu-addons.php CHANGED
@@ -14,6 +14,7 @@ class LP_Submenu_Addons extends LP_Abstract_Submenu {
14
  $this->menu_title = __( 'Add-ons', 'learnpress' );
15
  $this->page_title = __( 'LearnPress Add-ons', 'learnpress' );
16
  $this->priority = 20;
 
17
 
18
  $this->add_ons_tabs();
19
 
@@ -23,8 +24,8 @@ class LP_Submenu_Addons extends LP_Abstract_Submenu {
23
  public function add_ons_tabs() {
24
  // Check is page addons
25
  $current_page = LP_Helper::getUrlCurrent();
26
- $pattern = '/.*page=learn-press-addons.*/';
27
- $match = preg_match( $pattern, $current_page, $matches );
28
  if ( ! $match ) {
29
  return;
30
  }
14
  $this->menu_title = __( 'Add-ons', 'learnpress' );
15
  $this->page_title = __( 'LearnPress Add-ons', 'learnpress' );
16
  $this->priority = 20;
17
+ $this->callback = [ $this, 'display' ];
18
 
19
  $this->add_ons_tabs();
20
 
24
  public function add_ons_tabs() {
25
  // Check is page addons
26
  $current_page = LP_Helper::getUrlCurrent();
27
+ $pattern = '/.*page=learn-press-addons.*/';
28
+ $match = preg_match( $pattern, $current_page, $matches );
29
  if ( ! $match ) {
30
  return;
31
  }
inc/admin/sub-menus/class-lp-submenu-categories.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class LP_Submenu_Tools
4
+ */
5
+ class LP_Submenu_Categories extends LP_Abstract_Submenu {
6
+ /**
7
+ * LP_Submenu_Tools constructor.
8
+ */
9
+ public function __construct() {
10
+ $this->id = 'edit-tags.php?taxonomy=course_category';
11
+ $this->menu_title = __( 'Categories', 'learnpress' );
12
+ $this->page_title = __( 'Categories', 'learnpress' );
13
+ $this->priority = 1;
14
+ }
15
+ }
16
+
17
+ return new LP_Submenu_Categories();
inc/admin/sub-menus/class-lp-submenu-settings.php CHANGED
@@ -18,6 +18,7 @@ class LP_Submenu_Settings extends LP_Abstract_Submenu {
18
  $this->menu_title = esc_html__( 'Settings', 'learnpress' );
19
  $this->page_title = esc_html__( 'LearnPress Settings', 'learnpress' );
20
  $this->priority = 30;
 
21
 
22
  $this->tabs = apply_filters(
23
  'learn-press/admin/settings-tabs-array',
18
  $this->menu_title = esc_html__( 'Settings', 'learnpress' );
19
  $this->page_title = esc_html__( 'LearnPress Settings', 'learnpress' );
20
  $this->priority = 30;
21
+ $this->callback = [ $this, 'display' ];
22
 
23
  $this->tabs = apply_filters(
24
  'learn-press/admin/settings-tabs-array',
inc/admin/sub-menus/class-lp-submenu-statistics.php CHANGED
@@ -6,7 +6,6 @@
6
  * @since 3.0.0
7
  */
8
  class LP_Submenu_Statistics extends LP_Abstract_Submenu {
9
-
10
  /**
11
  * LP_Submenu_Statistics constructor.
12
  */
@@ -15,6 +14,7 @@ class LP_Submenu_Statistics extends LP_Abstract_Submenu {
15
  $this->menu_title = __( 'Statistics', 'learnpress' );
16
  $this->page_title = __( 'LearnPress Statistics', 'learnpress' );
17
  $this->priority = 10;
 
18
 
19
  if ( current_user_can( LP_TEACHER_ROLE ) ) {
20
  $tabs = array(
6
  * @since 3.0.0
7
  */
8
  class LP_Submenu_Statistics extends LP_Abstract_Submenu {
 
9
  /**
10
  * LP_Submenu_Statistics constructor.
11
  */
14
  $this->menu_title = __( 'Statistics', 'learnpress' );
15
  $this->page_title = __( 'LearnPress Statistics', 'learnpress' );
16
  $this->priority = 10;
17
+ $this->callback = [ $this, 'display' ];
18
 
19
  if ( current_user_can( LP_TEACHER_ROLE ) ) {
20
  $tabs = array(
inc/admin/sub-menus/class-lp-submenu-tags.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class LP_Submenu_Tools
4
+ */
5
+ class LP_Submenu_Tags extends LP_Abstract_Submenu {
6
+ /**
7
+ * LP_Submenu_Tools constructor.
8
+ */
9
+ public function __construct() {
10
+ $this->id = 'edit-tags.php?taxonomy=course_tag';
11
+ $this->menu_title = __( 'Tags', 'learnpress' );
12
+ $this->page_title = __( 'Tags', 'learnpress' );
13
+ $this->priority = 2;
14
+ }
15
+ }
16
+
17
+ return new LP_Submenu_Tags();
inc/admin/sub-menus/class-lp-submenu-tools.php CHANGED
@@ -12,6 +12,7 @@ class LP_Submenu_Tools extends LP_Abstract_Submenu {
12
  $this->menu_title = __( 'Tools', 'learnpress' );
13
  $this->page_title = __( 'LearnPress Tools', 'learnpress' );
14
  $this->priority = 40;
 
15
 
16
  $this->tabs = apply_filters(
17
  'learn-press/admin/tools-tabs',
@@ -19,22 +20,19 @@ class LP_Submenu_Tools extends LP_Abstract_Submenu {
19
  'course' => __( 'Course Data', 'learnpress' ),
20
  'database' => __( 'Database', 'learnpress' ),
21
  'template' => __( 'Templates', 'learnpress' ),
22
- //'cron' => __( 'Cron Jobs', 'learnpress' ),
23
- //'cache' => __( 'Caches', 'learnpress' ),
24
  )
25
  );
26
 
27
  parent::__construct();
28
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
29
- $this->_process_actions();
30
- }
31
-
32
- public function admin_scripts() {
33
- learn_press_admin_assets()->enqueue_script( 'lp-update' );
34
  }
35
 
 
 
 
36
  protected function _process_actions() {
37
- $has_action = true;
 
38
  switch ( LP_Request::get( 'page' ) ) {
39
  default:
40
  $has_action = false;
@@ -53,7 +51,7 @@ class LP_Submenu_Tools extends LP_Abstract_Submenu {
53
 
54
  if ( $has_action ) {
55
  die();
56
- }
57
  }
58
 
59
  public function page_content_database() {
@@ -64,18 +62,10 @@ class LP_Submenu_Tools extends LP_Abstract_Submenu {
64
  learn_press_admin_view( 'tools/html-template' );
65
  }
66
 
67
- /*public function page_content_cache() {
68
- learn_press_admin_view( 'tools/html-cache' );
69
- }*/
70
-
71
  public function page_content_course() {
72
  learn_press_admin_view( 'tools/html-course' );
73
  }
74
 
75
- /*public function page_content_cron() {
76
- learn_press_admin_view( 'tools/html-cron' );
77
- }*/
78
-
79
  /**
80
  * Display page
81
  */
12
  $this->menu_title = __( 'Tools', 'learnpress' );
13
  $this->page_title = __( 'LearnPress Tools', 'learnpress' );
14
  $this->priority = 40;
15
+ $this->callback = [ $this, 'display' ];
16
 
17
  $this->tabs = apply_filters(
18
  'learn-press/admin/tools-tabs',
20
  'course' => __( 'Course Data', 'learnpress' ),
21
  'database' => __( 'Database', 'learnpress' ),
22
  'template' => __( 'Templates', 'learnpress' ),
 
 
23
  )
24
  );
25
 
26
  parent::__construct();
27
+ //$this->_process_actions();
 
 
 
 
 
28
  }
29
 
30
+ /**
31
+ * @deprecated 4.1.7.3
32
+ */
33
  protected function _process_actions() {
34
+ _deprecated_function( __METHOD__, '4.1.7.3' );
35
+ /*$has_action = true;
36
  switch ( LP_Request::get( 'page' ) ) {
37
  default:
38
  $has_action = false;
51
 
52
  if ( $has_action ) {
53
  die();
54
+ }*/
55
  }
56
 
57
  public function page_content_database() {
62
  learn_press_admin_view( 'tools/html-template' );
63
  }
64
 
 
 
 
 
65
  public function page_content_course() {
66
  learn_press_admin_view( 'tools/html-course' );
67
  }
68
 
 
 
 
 
69
  /**
70
  * Display page
71
  */
inc/admin/views/addons/html-plugins-more.php CHANGED
@@ -15,7 +15,7 @@ $wp_plugins = LP_Plugins_Helper::get_plugins( 'free' );
15
  $tp_plugins = LP_Plugins_Helper::get_plugins( 'premium' );
16
 
17
  if ( ! ( $wp_plugins || $tp_plugins ) ) {
18
- _e( 'There is no available add-ons.', 'learnpress' );
19
 
20
  return;
21
  }
15
  $tp_plugins = LP_Plugins_Helper::get_plugins( 'premium' );
16
 
17
  if ( ! ( $wp_plugins || $tp_plugins ) ) {
18
+ _e( 'There are no add-ons available.', 'learnpress' );
19
 
20
  return;
21
  }
inc/admin/views/course/editor.php CHANGED
@@ -38,7 +38,7 @@ learn_press_admin_view( 'course/modal-choose-items' );
38
  <div v-else>
39
  <div class="lp-place-holder">
40
  <?php learn_press_admin_view( 'placeholder-animation' ); ?>
41
- <div class="notify-reload"><?php esc_html_e( 'Something went wrong! Please reload to continue editing curriculum.', 'learnpress' ); ?></div>
42
  </div>
43
  </div>
44
  </div>
38
  <div v-else>
39
  <div class="lp-place-holder">
40
  <?php learn_press_admin_view( 'placeholder-animation' ); ?>
41
+ <div class="notify-reload"><?php esc_html_e( 'Something went wrong! Please reload to continue editing the curriculum.', 'learnpress' ); ?></div>
42
  </div>
43
  </div>
44
  </div>
inc/admin/views/course/modal-choose-items.php CHANGED
@@ -68,7 +68,7 @@ learn_press_admin_view( 'course/pagination' );
68
  </div>
69
  <div class="main">
70
  <form class="search" @submit.prevent="">
71
- <input type="text" class="modal-search-input" placeholder="<?php esc_attr_e( 'Type here to search item', 'learnpress' ); ?>" title="search" @input="onChangeQuery" v-model="query">
72
  </form>
73
 
74
  <ul class="list-items">
68
  </div>
69
  <div class="main">
70
  <form class="search" @submit.prevent="">
71
+ <input type="text" class="modal-search-input" placeholder="<?php esc_attr_e( 'Type here to search for an item', 'learnpress' ); ?>" title="search" @input="onChangeQuery" v-model="query">
72
  </form>
73
 
74
  <ul class="list-items">
inc/admin/views/course/section-item.php CHANGED
@@ -24,14 +24,14 @@
24
  <div class="action preview-item lp-title-attr-tip" data-content-tip="<?php esc_attr_e( 'Enable/Disable Preview', 'learnpress' ); ?>">
25
  <a class="lp-btn-icon dashicons" :class="previewClass" @click="togglePreview"></a>
26
  </div>
27
- <div class="action edit-item lp-title-attr-tip" data-content-tip="<?php esc_attr_e( 'Edit item', 'learnpress' ); ?>">
28
  <a :href="url" target="_blank" class="lp-btn-icon dashicons dashicons-edit"></a>
29
  </div>
30
  <div class="action delete-item" v-if="!disableCurriculum">
31
  <a class="lp-btn-icon dashicons dashicons-trash" @click.prevent="remove"></a>
32
  <ul>
33
  <li>
34
- <a @click.prevent="remove"><?php esc_html_e( 'Remove from course', 'learnpress' ); ?></a>
35
  </li>
36
  <li>
37
  <a @click.prevent="deletePermanently" class="delete-permanently"><?php esc_html_e( 'Move to trash', 'learnpress' ); ?></a>
24
  <div class="action preview-item lp-title-attr-tip" data-content-tip="<?php esc_attr_e( 'Enable/Disable Preview', 'learnpress' ); ?>">
25
  <a class="lp-btn-icon dashicons" :class="previewClass" @click="togglePreview"></a>
26
  </div>
27
+ <div class="action edit-item lp-title-attr-tip" data-content-tip="<?php esc_attr_e( 'Edit an item', 'learnpress' ); ?>">
28
  <a :href="url" target="_blank" class="lp-btn-icon dashicons dashicons-edit"></a>
29
  </div>
30
  <div class="action delete-item" v-if="!disableCurriculum">
31
  <a class="lp-btn-icon dashicons dashicons-trash" @click.prevent="remove"></a>
32
  <ul>
33
  <li>
34
+ <a @click.prevent="remove"><?php esc_html_e( 'Remove from the course', 'learnpress' ); ?></a>
35
  </li>
36
  <li>
37
  <a @click.prevent="deletePermanently" class="delete-permanently"><?php esc_html_e( 'Move to trash', 'learnpress' ); ?></a>
inc/admin/views/dashboard/plugin-status/html-results.php CHANGED
@@ -20,7 +20,7 @@ if ( ! isset( $plugin_data ) || is_wp_error( $plugin_data ) ) {
20
  printf( '<span><strong>%s</strong></span>: %s', esc_html__( 'Downloaded', 'learnpress' ), number_format( $plugin_data->downloaded ) );
21
  }
22
  ?>
23
- <?php printf( '<span><strong>%s</strong></span>: %s', esc_html__( 'Active Installed', 'learnpress' ), number_format( $plugin_data->active_installs ) ); ?>
24
  </li>
25
  </ul>
26
  </div>
20
  printf( '<span><strong>%s</strong></span>: %s', esc_html__( 'Downloaded', 'learnpress' ), number_format( $plugin_data->downloaded ) );
21
  }
22
  ?>
23
+ <?php printf( '<span><strong>%s</strong></span>: %s', esc_html__( 'Active Installation', 'learnpress' ), number_format( $plugin_data->active_installs ) ); ?>
24
  </li>
25
  </ul>
26
  </div>
inc/admin/views/html-admin-notice-templates.php CHANGED
@@ -36,12 +36,12 @@ $readmore = 'https://thimpress.com/knowledge-base/outdated-template-fix/';
36
  ?>
37
 
38
  <div id="message" class="learn-press-notice notice-warning notice">
39
- <p><?php printf( wp_kses( __( 'There is a new update of LearnPress. You may need to update your theme <strong>(%s)</strong> to avoid outdated template files.', 'learnpress' ), array( 'strong' => array() ) ), $theme_name ); ?></p>
40
  <p class="outdated-readmore-link">
41
  <?php
42
  echo sprintf(
43
  wp_kses(
44
- __( 'This is not a bug, don\'t worry. Read more about Outdated template files notice <a href="%s" target="_blank">here</a>.', 'learnpress' ),
45
  array(
46
  'a' => array(
47
  'href' => array(),
@@ -55,7 +55,7 @@ $readmore = 'https://thimpress.com/knowledge-base/outdated-template-fix/';
55
  </p>
56
  <p>
57
  <a class="button" href="<?php echo admin_url( 'admin.php?page=learn-press-tools&amp;tab=template' ); ?>">
58
- <?php esc_html_e( 'View list of outdated templates', 'learnpress' ); ?>
59
  </a>
60
  <a href="" onclick="LP.dismissMessage(this, {expired: 3600}); return false;" data-name="outdated-template" data-value="yes" data-el="#message" data-instant="yes">
61
  <?php esc_html_e( 'Dismiss', 'learnpress' ); ?>
36
  ?>
37
 
38
  <div id="message" class="learn-press-notice notice-warning notice">
39
+ <p><?php printf( wp_kses( __( 'There is a new update on LearnPress. You may need to update your theme <strong>(%s)</strong> to avoid outdated template files.', 'learnpress' ), array( 'strong' => array() ) ), $theme_name ); ?></p>
40
  <p class="outdated-readmore-link">
41
  <?php
42
  echo sprintf(
43
  wp_kses(
44
+ __( 'This is not a bug, don\'t worry. Read more about the outdated template files notice <a href=\"%s\" target=\"_blank\">here</a>.', 'learnpress' ),
45
  array(
46
  'a' => array(
47
  'href' => array(),
55
  </p>
56
  <p>
57
  <a class="button" href="<?php echo admin_url( 'admin.php?page=learn-press-tools&amp;tab=template' ); ?>">
58
+ <?php esc_html_e( 'View the list of outdated templates', 'learnpress' ); ?>
59
  </a>
60
  <a href="" onclick="LP.dismissMessage(this, {expired: 3600}); return false;" data-name="outdated-template" data-value="yes" data-el="#message" data-instant="yes">
61
  <?php esc_html_e( 'Dismiss', 'learnpress' ); ?>
inc/admin/views/meta-boxes/course/settings.php CHANGED
@@ -73,7 +73,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
73
  array(
74
  '_lp_duration' => new LP_Meta_Box_Duration_Field(
75
  esc_html__( 'Duration', 'learnpress' ),
76
- esc_html__( 'Set 0 for lifetime access.', 'learnpress' ),
77
  '10',
78
  array(
79
  'default_time' => 'week',
@@ -85,17 +85,17 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
85
  ),
86
  '_lp_block_expire_duration' => new LP_Meta_Box_Checkbox_Field(
87
  esc_html__( 'Block content', 'learnpress' ),
88
- esc_html__( 'Block course when duration expires.', 'learnpress' ),
89
  'no'
90
  ),
91
  '_lp_block_finished' => new LP_Meta_Box_Checkbox_Field(
92
  '',
93
- esc_html__( 'Block course after student finished this course.', 'learnpress' ),
94
  'yes'
95
  ),
96
  '_lp_allow_course_repurchase' => new LP_Meta_Box_Checkbox_Field(
97
  __( 'Allow Repurchase', 'learnpress' ),
98
- esc_html__( 'Allow users to repurchase this course after course finished or blocked ( Do not apply to free courses ).', 'learnpress' ),
99
  'no'
100
  ),
101
  '_lp_course_repurchase_option' => new LP_Meta_Box_Select_Field(
@@ -121,7 +121,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
121
  ),
122
  '_lp_students' => new LP_Meta_Box_Text_Field(
123
  esc_html__( 'Fake Students Enrolled', 'learnpress' ),
124
- esc_html__( 'How many students have taken this course', 'learnpress' ),
125
  0,
126
  array(
127
  'type_input' => 'number',
@@ -134,7 +134,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
134
  ),
135
  '_lp_max_students' => new LP_Meta_Box_Text_Field(
136
  esc_html__( 'Max student', 'learnpress' ),
137
- esc_html__( 'Maximum students can join the course. Set 0 for unlimited.', 'learnpress' ),
138
  0,
139
  array(
140
  'type_input' => 'number',
@@ -147,7 +147,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
147
  ),
148
  '_lp_retake_count' => new LP_Meta_Box_Text_Field(
149
  esc_html__( 'Re-take Course', 'learnpress' ),
150
- esc_html__( 'The number of times a user can learn again this course. Set 0 to disable.', 'learnpress' ),
151
  0,
152
  array(
153
  'type_input' => 'number',
@@ -160,12 +160,12 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
160
  ),
161
  '_lp_has_finish' => new LP_Meta_Box_Checkbox_Field(
162
  esc_html__( 'Finish button', 'learnpress' ),
163
- esc_html__( 'Allow show finish button when the student has completed all items but has not passed the course assessment.', 'learnpress' ),
164
  'yes'
165
  ),
166
  '_lp_featured' => new LP_Meta_Box_Checkbox_Field(
167
  esc_html__( 'Featured list', 'learnpress' ),
168
- esc_html__( 'Add the course to Featured List.', 'learnpress' ),
169
  'no'
170
  ),
171
  '_lp_featured_review' => new LP_Meta_Box_Textarea_Field(
@@ -174,7 +174,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
174
  ),
175
  '_lp_external_link_buy_course' => new LP_Meta_Box_Text_Field(
176
  esc_html__( 'External link', 'learnpress' ),
177
- esc_html__( 'Normally use for offline classes, Ex: link to a contact page. Format: https://google.com', 'learnpress' ),
178
  '',
179
  array(
180
  'desc_tip' => 'You can apply for case: user register form.<br> You accept for user can learn courses by add manual order on backend',
@@ -208,7 +208,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
208
  sprintf( __( 'Set a regular price (<strong>%s</strong>). Leave it blank for <strong>Free</strong>.', 'learnpress' ), learn_press_get_currency() ),
209
  $regular_price,
210
  array(
211
- 'type_input' => 'number',
212
  'custom_attributes' => array(
213
  'min' => '0',
214
  'step' => '0.01',
@@ -222,7 +222,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
222
  '<a href="#" class="lp_sale_price_schedule">' . esc_html__( 'Schedule', 'learnpress' ) . '</a>',
223
  $sale_price,
224
  array(
225
- 'type_input' => 'number',
226
  'custom_attributes' => array(
227
  'min' => '0',
228
  'step' => '0.01',
@@ -251,8 +251,8 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
251
  )
252
  ),
253
  '_lp_no_required_enroll' => new LP_Meta_Box_Checkbox_Field(
254
- esc_html__( 'No enroll requirement', 'learnpress' ),
255
- esc_html__( 'Students can see the content of all course items and do the quiz without login.', 'learnpress' ),
256
  'no'
257
  ),
258
  )
@@ -301,10 +301,10 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
301
  $course_result_desc = '';
302
  $course_results = get_post_meta( $thepostid, '_lp_course_result', true );
303
 
304
- $course_result_desc .= __( 'The method to assess the result of a student for a course.', 'learnpress' );
305
 
306
  if ( $course_results == 'evaluate_final_quiz' && ! get_post_meta( $thepostid, '_lp_final_quiz', true ) ) {
307
- $course_result_desc .= __( '<br /><strong>Note! </strong>No final quiz in course, please add a final quiz', 'learnpress' );
308
  }
309
 
310
  $final_quizz_passing = '';
@@ -346,7 +346,7 @@ class LP_Meta_Box_Course extends LP_Meta_Box {
346
  ),
347
  '_lp_passing_condition' => new LP_Meta_Box_Text_Field(
348
  esc_html__( 'Passing Grade(%)', 'learnpress' ),
349
- esc_html__( 'The condition that must be achieved to finish the course.', 'learnpress' ),
350
  '80',
351
  array(
352
  'type_input' => 'number',
73
  array(
74
  '_lp_duration' => new LP_Meta_Box_Duration_Field(
75
  esc_html__( 'Duration', 'learnpress' ),
76
+ esc_html__( 'Set to 0 for the lifetime access.', 'learnpress' ),
77
  '10',
78
  array(
79
  'default_time' => 'week',
85
  ),
86
  '_lp_block_expire_duration' => new LP_Meta_Box_Checkbox_Field(
87
  esc_html__( 'Block content', 'learnpress' ),
88
+ esc_html__( 'When the duration expires, the course is blocked.', 'learnpress' ),
89
  'no'
90
  ),
91
  '_lp_block_finished' => new LP_Meta_Box_Checkbox_Field(
92
  '',
93
+ esc_html__( 'Block the course after the student finished this course.', 'learnpress' ),
94
  'yes'
95
  ),
96
  '_lp_allow_course_repurchase' => new LP_Meta_Box_Checkbox_Field(
97
  __( 'Allow Repurchase', 'learnpress' ),
98
+ esc_html__( 'Allow users to repurchase this course after it has been finished or blocked (Do not apply to free courses).', 'learnpress' ),
99
  'no'
100
  ),
101
  '_lp_course_repurchase_option' => new LP_Meta_Box_Select_Field(
121
  ),
122
  '_lp_students' => new LP_Meta_Box_Text_Field(
123
  esc_html__( 'Fake Students Enrolled', 'learnpress' ),
124
+ esc_html__( 'How many students have taken this course?', 'learnpress' ),
125
  0,
126
  array(
127
  'type_input' => 'number',
134
  ),
135
  '_lp_max_students' => new LP_Meta_Box_Text_Field(
136
  esc_html__( 'Max student', 'learnpress' ),
137
+ esc_html__( 'The maximum number of students that can join a course. Set 0 for unlimited.', 'learnpress' ),
138
  0,
139
  array(
140
  'type_input' => 'number',
147
  ),
148
  '_lp_retake_count' => new LP_Meta_Box_Text_Field(
149
  esc_html__( 'Re-take Course', 'learnpress' ),
150
+ esc_html__( 'The number of times a user can learn again from this course. To disable, set to 0.', 'learnpress' ),
151
  0,
152
  array(
153
  'type_input' => 'number',
160
  ),
161
  '_lp_has_finish' => new LP_Meta_Box_Checkbox_Field(
162
  esc_html__( 'Finish button', 'learnpress' ),
163
+ esc_html__( 'Allow showing the finish button when the student has completed all items but has not passed the course assessment yet.', 'learnpress' ),
164
  'yes'
165
  ),
166
  '_lp_featured' => new LP_Meta_Box_Checkbox_Field(
167
  esc_html__( 'Featured list', 'learnpress' ),
168
+ esc_html__( 'Add the course to the Featured List.', 'learnpress' ),
169
  'no'
170
  ),
171
  '_lp_featured_review' => new LP_Meta_Box_Textarea_Field(
174
  ),
175
  '_lp_external_link_buy_course' => new LP_Meta_Box_Text_Field(
176
  esc_html__( 'External link', 'learnpress' ),
177
+ esc_html__( 'Normally used for offline classes. Ex: link to a contact page. Format: https://google.com', 'learnpress' ),
178
  '',
179
  array(
180
  'desc_tip' => 'You can apply for case: user register form.<br> You accept for user can learn courses by add manual order on backend',
208
  sprintf( __( 'Set a regular price (<strong>%s</strong>). Leave it blank for <strong>Free</strong>.', 'learnpress' ), learn_press_get_currency() ),
209
  $regular_price,
210
  array(
211
+ 'type_input' => 'text',
212
  'custom_attributes' => array(
213
  'min' => '0',
214
  'step' => '0.01',
222
  '<a href="#" class="lp_sale_price_schedule">' . esc_html__( 'Schedule', 'learnpress' ) . '</a>',
223
  $sale_price,
224
  array(
225
+ 'type_input' => 'text',
226
  'custom_attributes' => array(
227
  'min' => '0',
228
  'step' => '0.01',
251
  )
252
  ),
253
  '_lp_no_required_enroll' => new LP_Meta_Box_Checkbox_Field(
254
+ esc_html__( 'There is no enrollment requirement', 'learnpress' ),
255
+ esc_html__( 'Students can see the content of all course items and take the quiz without logging in.', 'learnpress' ),
256
  'no'
257
  ),
258
  )
301
  $course_result_desc = '';
302
  $course_results = get_post_meta( $thepostid, '_lp_course_result', true );
303
 
304
+ $course_result_desc .= __( 'The method of evaluating a student\'s performance in a course.', 'learnpress' );
305
 
306
  if ( $course_results == 'evaluate_final_quiz' && ! get_post_meta( $thepostid, '_lp_final_quiz', true ) ) {
307
+ $course_result_desc .= __( '<br /><strong>Note! </strong>There is no final quiz in the course. Please add a final quiz.', 'learnpress' );
308
  }
309
 
310
  $final_quizz_passing = '';
346
  ),
347
  '_lp_passing_condition' => new LP_Meta_Box_Text_Field(
348
  esc_html__( 'Passing Grade(%)', 'learnpress' ),
349
+ esc_html__( 'The conditions that must be achieved to finish the course.', 'learnpress' ),
350
  '80',
351
  array(
352
  'type_input' => 'number',
inc/admin/views/meta-boxes/fields/autocomplete.php CHANGED
@@ -19,6 +19,9 @@ class LP_Meta_Box_Autocomplete_Field extends LP_Meta_Box_Field {
19
  }
20
 
21
  public function output( $thepostid ) {
 
 
 
22
  if ( empty( $this->id ) ) {
23
  return;
24
  }
19
  }
20
 
21
  public function output( $thepostid ) {
22
+ // Enqueue scripts here for future use everywhere called.
23
+ wp_enqueue_script( 'lp-admin-learnpress' );
24
+
25
  if ( empty( $this->id ) ) {
26
  return;
27
  }
inc/admin/views/meta-boxes/order/actions.php CHANGED
@@ -17,7 +17,7 @@ global $post;
17
  <div class="misc-pub-section">
18
  <select name="trigger-order-action">
19
  <option value=""><?php esc_html_e( 'Choose an action', 'learnpress' ); ?></option>
20
- <option value="current-status"><?php esc_html_e( 'Trigger action of current order status', 'learnpress' ); ?></option>
21
  </select>
22
  </div>
23
  </div>
17
  <div class="misc-pub-section">
18
  <select name="trigger-order-action">
19
  <option value=""><?php esc_html_e( 'Choose an action', 'learnpress' ); ?></option>
20
+ <option value="current-status"><?php esc_html_e( 'Trigger action of the current order status', 'learnpress' ); ?></option>
21
  </select>
22
  </div>
23
  </div>
inc/admin/views/meta-boxes/order/details.php CHANGED
@@ -71,7 +71,7 @@ $user_ip = $order->get_user_ip_address();
71
  <div>
72
  <div style="padding: 10px 18px; margin-top: 10px; border: 2px solid #d80000; border-radius: 4px; display: inline-block;">
73
  <span class="dashicons dashicons-warning" style="color:#d80000"></span>
74
- <?php esc_html_e( 'When change Status to "Pending", "Cancelled" or "Failed" will delete all course, lesson, quiz... progress!', 'learnpress' ); ?>
75
  </div>
76
  </div>
77
  <?php endif; ?>
@@ -85,7 +85,7 @@ $user_ip = $order->get_user_ip_address();
85
  </ul>
86
 
87
  <?php if ( 'pending' === $order->get_status() ) : ?>
88
- <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multi users', 'learnpress' ); ?></a>
89
  <?php endif; ?>
90
 
91
  <?php else : ?>
@@ -115,7 +115,7 @@ $user_ip = $order->get_user_ip_address();
115
 
116
  <?php if ( $order->get_post_status() == 'auto-draft' ) : ?>
117
  <?php esc_html_e( '- Or -', 'learnpress' ); ?>
118
- <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multi users', 'learnpress' ); ?></a>
119
  <?php endif; ?>
120
 
121
  <?php
@@ -169,7 +169,7 @@ $user_ip = $order->get_user_ip_address();
169
  <?php endif; ?>
170
 
171
  <tr class="no-order-items<?php echo esc_attr( $items ? ' hide-if-js' : '' ); ?>">
172
- <td colspan="4"><?php esc_html_e( 'No order items', 'learnpress' ); ?></td>
173
  </tr>
174
  </tbody>
175
 
@@ -238,7 +238,7 @@ $user_ip = $order->get_user_ip_address();
238
  <div class="order-users">
239
  <ul id="list-users" class="advanced-list <?php echo esc_attr( $order->get_status() === 'completed' ? 'locked' : '' ); ?>"></ul>
240
  </div>
241
- <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multi users', 'learnpress' ); ?></a>
242
  </div>
243
  <# } #>
244
  </script>
@@ -262,7 +262,7 @@ wp_enqueue_style( 'jquery-ui' );
262
  <script type="text/html" id="tmpl-learn-press-modal-add-order-courses">
263
  <div id="learn-press-modal-add-order-courses" class="lp-modal-search" data-nonce="<?php echo wp_create_nonce( 'add_item_to_order' ); ?>">
264
  <div class="lp-search-items">
265
- <input type="text" id="learn-press-search-item-term" data-nonce="<?php echo wp_create_nonce( 'search_item_term' ); ?>" name="lp-item-name" placeholder="<?php esc_html_e( 'Type here to search the course', 'learnpress' ); ?>"/>
266
  </div>
267
  <ul id="learn-press-courses-result">
268
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php esc_html_e( 'No results', 'learnpress' ); ?></li>
71
  <div>
72
  <div style="padding: 10px 18px; margin-top: 10px; border: 2px solid #d80000; border-radius: 4px; display: inline-block;">
73
  <span class="dashicons dashicons-warning" style="color:#d80000"></span>
74
+ <?php esc_html_e( 'When the Status is changed to "Pending", "Cancelled", or "Failed" all courses, lessons, quizzes, and other progress are deleted!', 'learnpress' ); ?>
75
  </div>
76
  </div>
77
  <?php endif; ?>
85
  </ul>
86
 
87
  <?php if ( 'pending' === $order->get_status() ) : ?>
88
+ <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multiple users', 'learnpress' ); ?></a>
89
  <?php endif; ?>
90
 
91
  <?php else : ?>
115
 
116
  <?php if ( $order->get_post_status() == 'auto-draft' ) : ?>
117
  <?php esc_html_e( '- Or -', 'learnpress' ); ?>
118
+ <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multiple users', 'learnpress' ); ?></a>
119
  <?php endif; ?>
120
 
121
  <?php
169
  <?php endif; ?>
170
 
171
  <tr class="no-order-items<?php echo esc_attr( $items ? ' hide-if-js' : '' ); ?>">
172
+ <td colspan="4"><?php esc_html_e( 'There are no order items', 'learnpress' ); ?></td>
173
  </tr>
174
  </tbody>
175
 
238
  <div class="order-users">
239
  <ul id="list-users" class="advanced-list <?php echo esc_attr( $order->get_status() === 'completed' ? 'locked' : '' ); ?>"></ul>
240
  </div>
241
+ <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multiple users', 'learnpress' ); ?></a>
242
  </div>
243
  <# } #>
244
  </script>
262
  <script type="text/html" id="tmpl-learn-press-modal-add-order-courses">
263
  <div id="learn-press-modal-add-order-courses" class="lp-modal-search" data-nonce="<?php echo wp_create_nonce( 'add_item_to_order' ); ?>">
264
  <div class="lp-search-items">
265
+ <input type="text" id="learn-press-search-item-term" data-nonce="<?php echo wp_create_nonce( 'search_item_term' ); ?>" name="lp-item-name" placeholder="<?php esc_html_e( 'Type here to search for the course', 'learnpress' ); ?>"/>
266
  </div>
267
  <ul id="learn-press-courses-result">
268
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php esc_html_e( 'No results', 'learnpress' ); ?></li>
inc/admin/views/meta-boxes/question/settings.php CHANGED
@@ -28,12 +28,12 @@ class LP_Meta_Box_Question extends LP_Meta_Box {
28
  ),
29
  '_lp_hint' => new LP_Meta_Box_Textarea_Field(
30
  esc_html__( 'Hint', 'learnpress' ),
31
- esc_html__( 'Instruction for user to select the right answer. The text will be shown when users click the \'Hint\' button.', 'learnpress' ),
32
  ''
33
  ),
34
  '_lp_explanation' => new LP_Meta_Box_Textarea_Field(
35
  esc_html__( 'Explanation', 'learnpress' ),
36
- esc_html__( 'Explanation will be displayed when students click button "Check Answer".', 'learnpress' ),
37
  ''
38
  ),
39
  )
28
  ),
29
  '_lp_hint' => new LP_Meta_Box_Textarea_Field(
30
  esc_html__( 'Hint', 'learnpress' ),
31
+ esc_html__( 'The instructions for the user to select the right answer. The text will be shown when users click the \'Hint\' button.', 'learnpress' ),
32
  ''
33
  ),
34
  '_lp_explanation' => new LP_Meta_Box_Textarea_Field(
35
  esc_html__( 'Explanation', 'learnpress' ),
36
+ esc_html__( 'The explanation will be displayed when students click the "Check Answer" button.', 'learnpress' ),
37
  ''
38
  ),
39
  )
inc/admin/views/meta-boxes/quiz/settings.php CHANGED
@@ -15,7 +15,7 @@ class LP_Meta_Box_Quiz extends LP_Meta_Box {
15
  array(
16
  '_lp_duration' => new LP_Meta_Box_Duration_Field(
17
  esc_html__( 'Duration', 'learnpress' ),
18
- esc_html__( 'Set 0 for no limit, larger than 0 for limit', 'learnpress' ),
19
  '0',
20
  array(
21
  'default_time' => 'minute',
@@ -27,7 +27,7 @@ class LP_Meta_Box_Quiz extends LP_Meta_Box {
27
  ),
28
  '_lp_passing_grade' => new LP_Meta_Box_Text_Field(
29
  esc_html__( 'Passing Grade(%)', 'learnpress' ),
30
- esc_html__( 'The condition that must be achieved in order to be passed the quiz.', 'learnpress' ),
31
  '80',
32
  array(
33
  'type_input' => 'number',
@@ -46,17 +46,17 @@ class LP_Meta_Box_Quiz extends LP_Meta_Box {
46
  ),
47
  '_lp_negative_marking' => new LP_Meta_Box_Checkbox_Field(
48
  esc_html__( 'Negative Marking', 'learnpress' ),
49
- esc_html__( 'For each question which students answer wrongly, the total point is deducted exactly the question\'s point', 'learnpress' ),
50
  'no'
51
  ),
52
  '_lp_minus_skip_questions' => new LP_Meta_Box_Checkbox_Field(
53
  esc_html__( 'Minus for skip', 'learnpress' ),
54
- esc_html__( 'For each question which students answer skip, the total point is deducted exactly the question\'s point', 'learnpress' ),
55
  'no'
56
  ),
57
  '_lp_retake_count' => new LP_Meta_Box_Text_Field(
58
  esc_html__( 'Retake', 'learnpress' ),
59
- esc_html__( 'How many times the user can re-take this quiz. Set 0 to disable. Set -1 to infinite.', 'learnpress' ),
60
  '',
61
  array(
62
  'type_input' => 'number',
@@ -69,7 +69,7 @@ class LP_Meta_Box_Quiz extends LP_Meta_Box {
69
  ),
70
  '_lp_pagination' => new LP_Meta_Box_Text_Field(
71
  esc_html__( 'Pagination', 'learnpress' ),
72
- esc_html__( 'The number of questions displayed on each page.', 'learnpress' ),
73
  '1',
74
  array(
75
  'type_input' => 'number',
@@ -87,8 +87,8 @@ class LP_Meta_Box_Quiz extends LP_Meta_Box {
87
  'yes'
88
  ),
89
  '_lp_show_correct_review' => new LP_Meta_Box_Checkbox_Field(
90
- esc_html__( 'Show correct answer', 'learnpress' ),
91
- esc_html__( 'Allow students view correct answer question in review this quiz.', 'learnpress' ),
92
  'yes'
93
  ),
94
  ),
15
  array(
16
  '_lp_duration' => new LP_Meta_Box_Duration_Field(
17
  esc_html__( 'Duration', 'learnpress' ),
18
+ esc_html__( 'Set to 0 for no limit, greater than 0 for a limit.', 'learnpress' ),
19
  '0',
20
  array(
21
  'default_time' => 'minute',
27
  ),
28
  '_lp_passing_grade' => new LP_Meta_Box_Text_Field(
29
  esc_html__( 'Passing Grade(%)', 'learnpress' ),
30
+ esc_html__( 'The conditions that must be achieved in order to pass the quiz.', 'learnpress' ),
31
  '80',
32
  array(
33
  'type_input' => 'number',
46
  ),
47
  '_lp_negative_marking' => new LP_Meta_Box_Checkbox_Field(
48
  esc_html__( 'Negative Marking', 'learnpress' ),
49
+ esc_html__( 'For each question that students answer wrongly, the total point is deducted exactly from the question\'s point.', 'learnpress' ),
50
  'no'
51
  ),
52
  '_lp_minus_skip_questions' => new LP_Meta_Box_Checkbox_Field(
53
  esc_html__( 'Minus for skip', 'learnpress' ),
54
+ esc_html__( 'For each question that students answer skip, the total point is deducted exactly from the question\'s point.', 'learnpress' ),
55
  'no'
56
  ),
57
  '_lp_retake_count' => new LP_Meta_Box_Text_Field(
58
  esc_html__( 'Retake', 'learnpress' ),
59
+ esc_html__( 'How many times can the user re-take this quiz? Set 0 to disable. Set -1 to infinite.', 'learnpress' ),
60
  '',
61
  array(
62
  'type_input' => 'number',
69
  ),
70
  '_lp_pagination' => new LP_Meta_Box_Text_Field(
71
  esc_html__( 'Pagination', 'learnpress' ),
72
+ esc_html__( 'The number of displayed questions on each page.', 'learnpress' ),
73
  '1',
74
  array(
75
  'type_input' => 'number',
87
  'yes'
88
  ),
89
  '_lp_show_correct_review' => new LP_Meta_Box_Checkbox_Field(
90
+ esc_html__( 'Show the correct answer', 'learnpress' ),
91
+ esc_html__( 'Allow students to view the correct answer to the question in reviewing this quiz.', 'learnpress' ),
92
  'yes'
93
  ),
94
  ),
inc/admin/views/question/answer.php CHANGED
@@ -24,7 +24,7 @@ learn_press_admin_view( 'question/option' );
24
  </tbody>
25
  </table>
26
  <p class="add-answer" v-if="addable">
27
- <button class="button add-question-option-button" type="button" @click="newAnswer"><?php esc_html_e( 'Add new Answer', 'learnpress' ); ?></button>
28
  </p>
29
  </div>
30
  </script>
24
  </tbody>
25
  </table>
26
  <p class="add-answer" v-if="addable">
27
+ <button class="button add-question-option-button" type="button" @click="newAnswer"><?php esc_html_e( 'Add a new Answer', 'learnpress' ); ?></button>
28
  </p>
29
  </div>
30
  </script>
inc/admin/views/question/fib-answer-editor.php CHANGED
@@ -2,11 +2,11 @@
2
  <div class="learn-press-question">
3
  <div class="content-editable" contenteditable="true" @mouseup="canInsertBlank" @mousedown="activeBlank" @keyup="updateAnswer"></div>
4
  <div class="description">
5
- <p><?php _e( 'Select a word in passage above and click <strong>\'Insert new blank\'</strong> to make that word is a blank for filling.', 'learnpress' ); ?></p>
6
  </div>
7
  <p>
8
- <button class="button" type="button" @click="insertBlank" :disabled="!canInsertNewBlank"><?php esc_html_e( 'Insert new blank', 'learnpress' ); ?></button>
9
- <button class="button" type="button" @click="clearBlanks" :disabled="blanks.length == 0"><?php esc_html_e( 'Clear all blanks', 'learnpress' ); ?></button>
10
  <button class="button" type="button" @click="clearContent"><?php esc_html_e( 'Clear content', 'learnpress' ); ?></button>
11
  </p>
12
 
@@ -45,13 +45,13 @@
45
  <label>
46
  <input type="radio" value="range" v-model="blank.comparison" @click="updateAnswerBlank($event, blank)">
47
  <?php esc_html_e( 'Range', 'learnpress' ); ?></label>
48
- <p class="description"><?php _e( 'Match any number in a range. Use <code>100, 200</code> will match any value from 100 to 200.', 'learnpress' ); ?></p>
49
  </li>
50
  <li>
51
  <label>
52
  <input type="radio" value="any" v-model="blank.comparison" @click="updateAnswerBlank($event, blank)">
53
  <?php esc_html_e( 'Any', 'learnpress' ); ?></label>
54
- <p class="description"><?php _e( 'Match any value in a set of words. Use <code>fill, blank, question</code> will match any value in the set.', 'learnpress' ); ?></p>
55
  </li>
56
  </ul>
57
  </td>
2
  <div class="learn-press-question">
3
  <div class="content-editable" contenteditable="true" @mouseup="canInsertBlank" @mousedown="activeBlank" @keyup="updateAnswer"></div>
4
  <div class="description">
5
+ <p><?php _e( 'Select a word in the passage above and click <strong>\'Insert a new blank\'</strong> to make that word a blank for filling.', 'learnpress' ); ?></p>
6
  </div>
7
  <p>
8
+ <button class="button" type="button" @click="insertBlank" :disabled="!canInsertNewBlank"><?php esc_html_e( 'Insert a new blank', 'learnpress' ); ?></button>
9
+ <button class="button" type="button" @click="clearBlanks" :disabled="blanks.length == 0"><?php esc_html_e( 'Remove all blanks', 'learnpress' ); ?></button>
10
  <button class="button" type="button" @click="clearContent"><?php esc_html_e( 'Clear content', 'learnpress' ); ?></button>
11
  </p>
12
 
45
  <label>
46
  <input type="radio" value="range" v-model="blank.comparison" @click="updateAnswerBlank($event, blank)">
47
  <?php esc_html_e( 'Range', 'learnpress' ); ?></label>
48
+ <p class="description"><?php _e( 'Match any number in a range. Use <code>100, 200</code> to match any value from 100 to 200.', 'learnpress' ); ?></p>
49
  </li>
50
  <li>
51
  <label>
52
  <input type="radio" value="any" v-model="blank.comparison" @click="updateAnswerBlank($event, blank)">
53
  <?php esc_html_e( 'Any', 'learnpress' ); ?></label>
54
+ <p class="description"><?php _e( 'Match any value in a set of words. Use <code>fill, blank, or question</code> to match any value in the set.', 'learnpress' ); ?></p>
55
  </li>
56
  </ul>
57
  </td>
inc/admin/views/quiz/modal-choose-items.php CHANGED
@@ -61,7 +61,7 @@ learn_press_admin_view( 'quiz/pagination' );
61
 
62
  <div class="main">
63
  <form class="search" @submit.prevent="">
64
- <input type="text" class="modal-search-input" placeholder="<?php esc_attr_e( 'Type here to search question', 'learnpress' ); ?>" @input="onChangeQuery" v-model="query">
65
  </form>
66
 
67
  <ul class="list-items">
61
 
62
  <div class="main">
63
  <form class="search" @submit.prevent="">
64
+ <input type="text" class="modal-search-input" placeholder="<?php esc_attr_e( 'Type here to search for the question', 'learnpress' ); ?>" @input="onChangeQuery" v-model="query">
65
  </form>
66
 
67
  <ul class="list-items">
inc/admin/views/quiz/question-actions.php CHANGED
@@ -28,14 +28,14 @@
28
  <div class="lp-toolbar-btn lp-title-attr-tip" v-if="!disableUpdateList" data-content-tip="<?php esc_attr_e( 'Duplicate', 'learnpress' ); ?>">
29
  <a href="" class="lp-btn-icon dashicons dashicons-admin-page" @click.prevent="clone"></a>
30
  </div>
31
- <div class="lp-toolbar-btn lp-title-attr-tip" data-content-tip="<?php esc_attr_e( 'Edit item', 'learnpress' ); ?>">
32
  <a :href="url" target="_blank" class="lp-btn-icon dashicons dashicons-edit"></a>
33
  </div>
34
  <div class="lp-toolbar-btn lp-btn-remove lp-toolbar-btn-dropdown" v-if="!disableUpdateList">
35
  <a class="lp-btn-icon dashicons dashicons-trash" @click.prevent="remove"></a>
36
  <ul>
37
  <li>
38
- <a @click.prevent="remove" class="remove"><?php esc_html_e( 'Remove from quiz', 'learnpress' ); ?></a>
39
  </li>
40
  <li>
41
  <a @click.prevent="deletePermanently" class="delete"><?php esc_html_e( 'Move to trash', 'learnpress' ); ?></a>
28
  <div class="lp-toolbar-btn lp-title-attr-tip" v-if="!disableUpdateList" data-content-tip="<?php esc_attr_e( 'Duplicate', 'learnpress' ); ?>">
29
  <a href="" class="lp-btn-icon dashicons dashicons-admin-page" @click.prevent="clone"></a>
30
  </div>
31
+ <div class="lp-toolbar-btn lp-title-attr-tip" data-content-tip="<?php esc_attr_e( 'Edit an item', 'learnpress' ); ?>">
32
  <a :href="url" target="_blank" class="lp-btn-icon dashicons dashicons-edit"></a>
33
  </div>
34
  <div class="lp-toolbar-btn lp-btn-remove lp-toolbar-btn-dropdown" v-if="!disableUpdateList">
35
  <a class="lp-btn-icon dashicons dashicons-trash" @click.prevent="remove"></a>
36
  <ul>
37
  <li>
38
+ <a @click.prevent="remove" class="remove"><?php esc_html_e( 'Removed from the quiz', 'learnpress' ); ?></a>
39
  </li>
40
  <li>
41
  <a @click.prevent="deletePermanently" class="delete"><?php esc_html_e( 'Move to trash', 'learnpress' ); ?></a>
inc/admin/views/quiz/question-meta.php CHANGED
@@ -41,7 +41,7 @@
41
  <div class="lp-quiz-editor__detail-input">
42
  <div>
43
  <textarea name="hint" :id="'hint-'+question.id" cols="60" rows="3" class="rlp-quiz-editor__detail-textarea large-text" @change="updateMeta" v-model="question.settings.hint"></textarea>
44
- <p class="description"><?php esc_html_e( 'Instruction for user to select the right answer. The text will be shown when users click the \'Hint\' button.', 'learnpress' ); ?></p>
45
  </div>
46
  </div>
47
  </div>
@@ -52,7 +52,7 @@
52
  <div class="lp-quiz-editor__detail-input">
53
  <div>
54
  <textarea name="explanation" :id="'explanation-'+question.id" cols="60" rows="3" class="lp-quiz-editor__detail-textarea large-text" @change="updateMeta" v-model="question.settings.explanation"></textarea>
55
- <p class="description"><?php esc_html_e( 'Explanation will be displayed when students click button "Check Answer".', 'learnpress' ); ?></p>
56
  </div>
57
  </div>
58
  </div>
41
  <div class="lp-quiz-editor__detail-input">
42
  <div>
43
  <textarea name="hint" :id="'hint-'+question.id" cols="60" rows="3" class="rlp-quiz-editor__detail-textarea large-text" @change="updateMeta" v-model="question.settings.hint"></textarea>
44
+ <p class="description"><?php esc_html_e( 'The instructions for the user to select the right answer. The text will be shown when users click the \'Hint\' button.', 'learnpress' ); ?></p>
45
  </div>
46
  </div>
47
  </div>
52
  <div class="lp-quiz-editor__detail-input">
53
  <div>
54
  <textarea name="explanation" :id="'explanation-'+question.id" cols="60" rows="3" class="lp-quiz-editor__detail-textarea large-text" @change="updateMeta" v-model="question.settings.explanation"></textarea>
55
+ <p class="description"><?php esc_html_e( 'The explanation will be displayed when students click the "Check Answer" button.', 'learnpress' ); ?></p>
56
  </div>
57
  </div>
58
  </div>
inc/admin/views/setup/setup-paypal.php CHANGED
@@ -19,7 +19,7 @@ $settings = LP_Settings::instance();
19
  <input class="regular-text" type="email" name="settings[paypal][paypal_email]" id="settings-paypal-email"
20
  value="<?php echo esc_attr( $settings->get( 'paypal.paypal_email', '' ) ); ?>">
21
  <p class="description">
22
- <?php _e( 'Your Paypal email in live mode.', 'learnpress' ); ?>
23
  </p>
24
  <input type="hidden" name="settings[paypal][enable]" value="yes"/>
25
  </td>
19
  <input class="regular-text" type="email" name="settings[paypal][paypal_email]" id="settings-paypal-email"
20
  value="<?php echo esc_attr( $settings->get( 'paypal.paypal_email', '' ) ); ?>">
21
  <p class="description">
22
+ <?php _e( 'Your Paypal email is in live mode.', 'learnpress' ); ?>
23
  </p>
24
  <input type="hidden" name="settings[paypal][enable]" value="yes"/>
25
  </td>
inc/admin/views/setup/steps/currency.php CHANGED
@@ -61,14 +61,14 @@ $preview_price = '';
61
  </td>
62
  </tr>
63
  <tr>
64
- <th><?php _e( 'Decimals Separator', 'learnpress' ); ?></th>
65
  <td>
66
  <input id="decimals-separator" type="text" name="settings[currency][decimals_separator]"
67
  value="<?php echo esc_attr( $settings->get( 'decimals_separator', '.' ) ); ?>">
68
  </td>
69
  </tr>
70
  <tr>
71
- <th><?php _e( 'Number of Decimals', 'learnpress' ); ?></th>
72
  <td>
73
  <input id="number-of-decimals" type="text" name="settings[currency][number_of_decimals]"
74
  value="<?php echo esc_attr( $settings->get( 'number_of_decimals', '2' ) ); ?>">
61
  </td>
62
  </tr>
63
  <tr>
64
+ <th><?php _e( 'Decimal separator', 'learnpress' ); ?></th>
65
  <td>
66
  <input id="decimals-separator" type="text" name="settings[currency][decimals_separator]"
67
  value="<?php echo esc_attr( $settings->get( 'decimals_separator', '.' ) ); ?>">
68
  </td>
69
  </tr>
70
  <tr>
71
+ <th><?php _e( 'The number of decimals', 'learnpress' ); ?></th>
72
  <td>
73
  <input id="number-of-decimals" type="text" name="settings[currency][number_of_decimals]"
74
  value="<?php echo esc_attr( $settings->get( 'number_of_decimals', '2' ) ); ?>">
inc/admin/views/setup/steps/emails.php CHANGED
@@ -12,9 +12,9 @@ defined( 'ABSPATH' ) or exit;
12
  <h2><?php _e( 'Emails system', 'learnpress' ); ?></h2>
13
 
14
  <p><?php _e( 'Emails are sent to users or teachers for each particular action.', 'learnpress' ); ?></p>
15
- <p><?php _e( 'You can enable/disable each email in LearnPress settings later.', 'learnpress' ); ?></p>
16
- <p><?php _e( 'But in right now, you can enable all emails to see how emails work.', 'learnpress' ); ?></p>
17
- <p><?php _e( 'You can skip to next step if you don’t want to.', 'learnpress' ); ?></p>
18
 
19
  <p>
20
  <label>
12
  <h2><?php _e( 'Emails system', 'learnpress' ); ?></h2>
13
 
14
  <p><?php _e( 'Emails are sent to users or teachers for each particular action.', 'learnpress' ); ?></p>
15
+ <p><?php _e( 'You can enable/disable each email in your LearnPress settings later.', 'learnpress' ); ?></p>
16
+ <p><?php _e( 'But right now, you can enable all emails to see how emails work.', 'learnpress' ); ?></p>
17
+ <p><?php _e( 'You can skip to the next step if you don’t want to.', 'learnpress' ); ?></p>
18
 
19
  <p>
20
  <label>
inc/admin/views/setup/steps/pages.php CHANGED
@@ -13,13 +13,13 @@ $settings = LP_Settings::instance();
13
  ?>
14
  <h2><?php _e( 'Static Pages', 'learnpress' ); ?></h2>
15
 
16
- <p><?php _e( 'The pages will display content of LP\'s necessary pages, such as: Courses, Checkout, Profile', 'learnpress' ); ?></p>
17
  <p><?php printf( __( 'If you are not sure, click <a href="%s" id="create-pages">here</a> to create pages automatically.', 'learnpress' ), wp_nonce_url( admin_url( 'index.php?page=lp-setup&step=pages&auto-create' ) ), 'setup-create-pages' ); ?></p>
18
 
19
  <table class="form-field">
20
  <tr>
21
  <th>
22
- <?php _e( 'Page: show list Courses', 'learnpress' ); ?>
23
  </th>
24
  <td>
25
  <?php learn_press_pages_dropdown( 'settings[pages][courses_page_id]', $settings->get( 'courses_page_id' ) ); ?>
13
  ?>
14
  <h2><?php _e( 'Static Pages', 'learnpress' ); ?></h2>
15
 
16
+ <p><?php _e( 'The pages will display the content of LP\'s necessary pages, such as Courses, Checkout, and Profile', 'learnpress' ); ?></p>
17
  <p><?php printf( __( 'If you are not sure, click <a href="%s" id="create-pages">here</a> to create pages automatically.', 'learnpress' ), wp_nonce_url( admin_url( 'index.php?page=lp-setup&step=pages&auto-create' ) ), 'setup-create-pages' ); ?></p>
18
 
19
  <table class="form-field">
20
  <tr>
21
  <th>
22
+ <?php _e( 'Page: Show a list of courses', 'learnpress' ); ?>
23
  </th>
24
  <td>
25
  <?php learn_press_pages_dropdown( 'settings[pages][courses_page_id]', $settings->get( 'courses_page_id' ) ); ?>
inc/admin/views/statistics/general.php CHANGED
@@ -14,7 +14,7 @@ $sections_count = sizeof( $sections );
14
  $count = 0;
15
 
16
  gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );
17
- $now = current_time( 'timestamp' );
18
  $now_mysql = current_time( 'mysql' );
19
  $last_sunday = strtotime( 'Last Sunday', $now );
20
 
14
  $count = 0;
15
 
16
  gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );
17
+ $now = time();
18
  $now_mysql = current_time( 'mysql' );
19
  $last_sunday = strtotime( 'Last Sunday', $now );
20
 
inc/admin/views/tools/database/html-upgrade-database.php CHANGED
@@ -88,5 +88,5 @@ if ( ! $check_lp_need_upgrade_db ) {
88
  <?php lp_skeleton_animation_html( 7 ); ?>
89
  </div>
90
  <input type="hidden" name="message-when-upgrading"
91
- value="<?php esc_html_e( 'Please don\'t close this tab until the completed upgrade', 'learnpress' ); ?>"/>
92
  </div>
88
  <?php lp_skeleton_animation_html( 7 ); ?>
89
  </div>
90
  <input type="hidden" name="message-when-upgrading"
91
+ value="<?php esc_html_e( 'Please don\'t close this tab until the completed upgrade', 'learnpress' ); ?>"/>
92
  </div>
inc/admin/views/tools/html-cron.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * Template for displaying outdated template files in theme/child-themes
4
- *
5
- * @author ThimPress
6
- * @package LearnPress/Admin/Views
7
- * @version 3.0.0
8
- */
9
-
10
- defined( 'ABSPATH' ) or die();
11
-
12
- ?>
13
- <table class="form-table">
14
- <tr>
15
- <th><?php esc_attr_e( 'Cron url', 'learnpress' ); ?></th>
16
- <td>
17
- <input type="text" class="widefat" value="<?php echo esc_attr( learn_press_get_cron_url() ); ?>">
18
- <p class="description"><?php esc_html_e( 'Use this url to setup cronjob on your server.', 'learnpress' ); ?></p>
19
- <br/>
20
- <a class="button" href="<?php echo wp_nonce_url( esc_url_raw( add_query_arg( 'generate-cron-url', '1' ) ) ); ?>"><?php esc_html_e( 'Generate new url', 'learnpress' ); ?></a>
21
- </td>
22
- </tr>
23
-
24
- <!-- <tr>-->
25
- <!-- <th>--><?php // esc_attr_e( 'Schedule', 'learnpress' ); ?><!--</th>-->
26
- <!-- <td>-->
27
- <!-- <input type="text" class="widefat" value="--><?php // echo esc_attr( learn_press_get_cron_url() ); ?><!--">-->
28
- <!-- <p class="description">--><?php // esc_html_e( 'Enable .', 'learnpress' ); ?><!--</p>-->
29
- <!-- <br/>-->
30
- <!-- <a class="button"-->
31
- <!-- href="--><?php // echo wp_nonce_url( add_query_arg( 'generate-cron-url', '1' ) ); ?><!--">--><?php // esc_html_e( 'Generate new url', 'learnpress' ); ?><!--</a>-->
32
- <!-- </td>-->
33
- <!-- </tr>-->
34
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/views/updates/html-updated-latest-message.php CHANGED
@@ -13,5 +13,5 @@ LearnPress::instance()->session->remove( 'do-update-learnpress', true );
13
  ?>
14
 
15
  <div class="updated notice">
16
- <p><?php esc_html_e( 'LearnPress has just updated to latest version.', 'learnpress' ); ?></p>
17
  </div>
13
  ?>
14
 
15
  <div class="updated notice">
16
+ <p><?php esc_html_e( 'LearnPress has just updated to the latest version.', 'learnpress' ); ?></p>
17
  </div>
inc/admin/views/updates/html-updating-message.php CHANGED
@@ -12,7 +12,7 @@ defined( 'ABSPATH' ) || exit;
12
 
13
  <div class="notice notice-warning lp-notice-update-database do-updating">
14
  <p>
15
- <?php _e( '<strong>LearnPress update</strong> – We are running updater to upgrade your database to the latest version.', 'learnpress' ); ?>
16
  </p>
17
  </div>
18
 
12
 
13
  <div class="notice notice-warning lp-notice-update-database do-updating">
14
  <p>
15
+ <?php _e( '<strong>LearnPress update</strong> – We are running an update to upgrade your database to the latest version.', 'learnpress' ); ?>
16
  </p>
17
  </div>
18
 
inc/admin/views/user/courses.php CHANGED
@@ -19,6 +19,6 @@ $slug_profile_courses = LP_Settings::instance()->get( 'profile_endpoints.courses
19
  $link_user_profile = add_query_arg( [ 'tab' => 'enrolled' ], learn_press_user_profile_link( $user_id ) . $slug_profile_courses );
20
  ?>
21
  <p>
22
- <b><?php _e( 'Course list of user enrolled', 'learnpress' ); ?></b>
23
  <a href="<?php echo esc_url_raw( $link_user_profile ); ?>" target="_blank"><?php _e( 'View', 'learnpress' ); ?></a>
24
  </p>
19
  $link_user_profile = add_query_arg( [ 'tab' => 'enrolled' ], learn_press_user_profile_link( $user_id ) . $slug_profile_courses );
20
  ?>
21
  <p>
22
+ <b><?php _e( 'The course list of enrolled users', 'learnpress' ); ?></b>
23
  <a href="<?php echo esc_url_raw( $link_user_profile ); ?>" target="_blank"><?php _e( 'View', 'learnpress' ); ?></a>
24
  </p>
inc/background-process/class-lp-background-query-items.php CHANGED
@@ -125,7 +125,7 @@ if ( ! class_exists( 'LP_Background_Query_Items' ) ) {
125
  );
126
  $plugins = array();
127
 
128
- set_transient( 'lp_plugins_wp', __( 'There is no items found!', 'learnpress' ), $this->transient_time );
129
 
130
  try {
131
  $api = plugins_api( 'query_plugins', $query_args );
@@ -179,7 +179,7 @@ if ( ! class_exists( 'LP_Background_Query_Items' ) ) {
179
  $url = 'https://thimpress.com/?thimpress_get_addons=premium';
180
  $response = wp_remote_get( esc_url_raw( $url ), array( 'decompress' => false ) );
181
 
182
- set_transient( 'lp_plugins_tp', __( 'There is no items found!', 'learnpress' ), $this->transient_time );
183
 
184
  if ( is_wp_error( $response ) ) {
185
  return false;
@@ -229,7 +229,7 @@ if ( ! class_exists( 'LP_Background_Query_Items' ) ) {
229
  */
230
  public function query_related_themes() {
231
 
232
- set_transient( 'lp_related_themes', __( 'There is no item found!', 'learnpress' ), $this->transient_time );
233
 
234
  $themes = array();
235
  $url = 'https://api.envato.com/v1/discovery/search/search/item?site=themeforest.net&username=thimpress';
125
  );
126
  $plugins = array();
127
 
128
+ set_transient( 'lp_plugins_wp', __( 'No items found!', 'learnpress' ), $this->transient_time );
129
 
130
  try {
131
  $api = plugins_api( 'query_plugins', $query_args );
179
  $url = 'https://thimpress.com/?thimpress_get_addons=premium';
180
  $response = wp_remote_get( esc_url_raw( $url ), array( 'decompress' => false ) );
181
 
182
+ set_transient( 'lp_plugins_tp', __( 'No items found!', 'learnpress' ), $this->transient_time );
183
 
184
  if ( is_wp_error( $response ) ) {
185
  return false;
229
  */
230
  public function query_related_themes() {
231
 
232
+ set_transient( 'lp_related_themes', __( 'No item found!', 'learnpress' ), $this->transient_time );
233
 
234
  $themes = array();
235
  $url = 'https://api.envato.com/v1/discovery/search/search/item?site=themeforest.net&username=thimpress';
inc/background-process/class-lp-background-single-course.php CHANGED
@@ -239,7 +239,7 @@ if ( ! class_exists( 'LP_Background_Single_Course' ) ) {
239
  $user = learn_press_get_current_user();
240
  $required_review = LP_Settings::get_option( 'required_review', 'yes' ) === 'yes';
241
 
242
- if ( $user->is_instructor() && $required_review ) {
243
  wp_update_post(
244
  array(
245
  'ID' => $lp_course->get_id(),
239
  $user = learn_press_get_current_user();
240
  $required_review = LP_Settings::get_option( 'required_review', 'yes' ) === 'yes';
241
 
242
+ if ( $user->is_instructor() && $required_review && $lp_course->get_status() === 'publish' ) {
243
  wp_update_post(
244
  array(
245
  'ID' => $lp_course->get_id(),
inc/cart/class-lp-cart.php CHANGED
@@ -84,7 +84,7 @@ class LP_Cart {
84
  }
85
 
86
  /**
87
- * @depecated 4.1.7.2
88
  */
89
  public function maybe_set_cart_cookies() {
90
 
@@ -164,7 +164,7 @@ class LP_Cart {
164
  }
165
 
166
  if ( ! $course->is_in_stock() ) {
167
- throw new Exception( __( 'Sorry! The number of enrolled students has reached limit', 'learnpress' ) );
168
  }
169
 
170
  $item_data['data'] = $course;
@@ -461,60 +461,6 @@ class LP_Cart {
461
  return apply_filters( 'learn_press_cart_needs_payment', $this->total > 0, $this );
462
  }
463
 
464
- /**
465
- * Process action for purchase course button
466
- *
467
- * @param $course_id
468
- * @depecated 4.1.6.8
469
- */
470
- public function purchase_course_handler( $course_id ) {
471
- _deprecated_function( __FUNCTION__, '4.1.6.8' );
472
- do_action( 'learn_press_before_purchase_course_handler', $course_id, $this );
473
-
474
- if ( apply_filters( 'learn_press_purchase_single_course', true ) ) {
475
- $this->empty_cart();
476
- }
477
-
478
- $this->add_to_cart( $course_id, 1, $_POST );
479
- $redirect = learn_press_get_checkout_url();
480
- $has_checkout = $redirect ? true : false;
481
- $need_checkout = $this->needs_payment();
482
-
483
- // In case the course is FREE and "No checkout free course" is turn off
484
- if ( ! $need_checkout ) {
485
- $user = learn_press_get_current_user();
486
- if ( ! $user->has_purchased_course( $course_id )/* || $user->has_finished_course( $course_id ) */ ) {
487
- require_once LP_PLUGIN_PATH . '/inc/gateways/class-lp-gateway-none.php';
488
- $checkout = learn_press_get_checkout( array( 'payment_method' => new LP_Gateway_None() ) );
489
-
490
- /**
491
- * + Auto enroll
492
- */
493
- // add_filter( 'learn_press_checkout_success_result', '_learn_press_checkout_success_result', 10, 2 );
494
- $checkout->process_checkout();
495
- // remove_filter( 'learn_press_checkout_success_result', '_learn_press_checkout_success_result', 10 );
496
- }/*
497
- else {
498
- if ( $user->has_finished_course( $course_id ) ) {
499
- learn_press_add_message( __( 'You have already finished course', 'learnpress' ) );
500
- } else {
501
- learn_press_add_message( __( 'You have already enrolled course', 'learnpress' ) );
502
- }
503
- }*/
504
- } else {
505
-
506
- // Checkout page is not setting up
507
- if ( ! $has_checkout ) {
508
- learn_press_add_message( __( 'Checkout page hasn\'t been setup', 'learnpress' ), 'error' );
509
- } else {
510
- wp_redirect( apply_filters( 'learn_press_checkout_redirect', $redirect ) );
511
- exit();
512
- }
513
- }
514
-
515
- return;
516
- }
517
-
518
  /**
519
  * Destroy cart instance
520
  */
84
  }
85
 
86
  /**
87
+ * @deprecated 4.1.7.2
88
  */
89
  public function maybe_set_cart_cookies() {
90
 
164
  }
165
 
166
  if ( ! $course->is_in_stock() ) {
167
+ throw new Exception( __( 'Sorry! The number of enrolled students has reached its limit', 'learnpress' ) );
168
  }
169
 
170
  $item_data['data'] = $course;
461
  return apply_filters( 'learn_press_cart_needs_payment', $this->total > 0, $this );
462
  }
463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  /**
465
  * Destroy cart instance
466
  */
inc/class-lp-ajax.php CHANGED
@@ -111,14 +111,14 @@ if ( ! class_exists( 'LP_AJAX' ) ) {
111
  if ( email_exists( $email ) ) {
112
  $response['exists'] = $email;
113
  $output = '<div class="lp-guest-checkout-output">' . __(
114
- 'Your email is already exists. Continue with this email?',
115
  'learnpress'
116
  ) . '</div>';
117
  } else {
118
  $output = '<label class="lp-guest-checkout-output">
119
  <input type="checkbox" name="checkout-email-option" value="new-account">
120
  ' . __(
121
- 'Create new account with this email? Account information will be sent to this email.',
122
  'learnpress'
123
  ) . '
124
  </label>';
111
  if ( email_exists( $email ) ) {
112
  $response['exists'] = $email;
113
  $output = '<div class="lp-guest-checkout-output">' . __(
114
+ 'Your email already exists. Do you want to continue with this email?',
115
  'learnpress'
116
  ) . '</div>';
117
  } else {
118
  $output = '<label class="lp-guest-checkout-output">
119
  <input type="checkbox" name="checkout-email-option" value="new-account">
120
  ' . __(
121
+ 'Create a new account with this email. The account information will be sent with this email.',
122
  'learnpress'
123
  ) . '
124
  </label>';
inc/class-lp-backward-plugins.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Backward_Addons
5
- *
6
- * @since 3.0.0
7
- * @depecated 4.1.6.4
8
- */
9
- class LP_Backward_Addons {
10
-
11
- /**
12
- * LP_Backward_Addons constructor.
13
- */
14
- public function __construct() {
15
- add_action( 'plugins_loaded', array( $this, 'deactivate_old_addons' ), - 100 );
16
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
17
- }
18
-
19
- public function admin_notices() {
20
- $invalid_plugins = get_transient( 'lp-deactivated-addons' );
21
- delete_transient( 'lp-deactivated-addons' );
22
-
23
- if ( ! $invalid_plugins ) {
24
- return;
25
- }
26
-
27
- $plugin_names = array();
28
-
29
- foreach ( $invalid_plugins as $plugin ) {
30
- if ( ! file_exists( $plugin['path'] ) ) {
31
- continue;
32
- }
33
-
34
- if ( get_plugin_data( $plugin['path'] ) ) {
35
- $plugin_data = get_plugin_data( $plugin['path'] );
36
- $plugin_names[] = $plugin_data['Name'];
37
- }
38
- }
39
- ?>
40
- <div class="notice notice-warning">
41
- <p>
42
- <?php
43
- echo sprintf(
44
- __( 'There are some add-ons had gone outdated and might conflict with <strong>LearnPress</strong> that need to be deactivated. Please upgrade them to the newest version to ensure stability and performance of your site.', 'learnpress' ),
45
- LEARNPRESS_VERSION
46
- );
47
- ?>
48
- </p>
49
- <p><?php echo '<strong>' . join( '</strong>, <strong>', $plugin_names ) . '</strong>'; ?>.</p>
50
- </div>
51
- <?php
52
- }
53
-
54
- /**
55
- * Hooked to plugins_loaded in highest priority and check if an addon
56
- * is not valid with new structure present in LP 3 then remove it
57
- * from activated plugins array
58
- */
59
- public function deactivate_old_addons() {
60
- $valid_plugins = wp_get_active_and_valid_plugins();
61
- $active_plugins = get_option( 'active_plugins' );
62
- $invalid_plugins = array();
63
- $invalid_slug = false;
64
-
65
- foreach ( $valid_plugins as $file ) {
66
- $base_name = plugin_basename( $file );
67
-
68
- if ( strpos( $base_name, 'learnpress-' ) !== 0 ) {
69
- continue;
70
- }
71
-
72
- $path = dirname( $file );
73
-
74
- // LP 3 addons usually have a file load.php in inc/incs folder
75
- if ( file_exists( "$path/inc/load.php" ) || file_exists( "$path/incs/load.php" ) ) {
76
- continue;
77
- }
78
-
79
- // Remove addon from activated plugins
80
- if ( false !== ( $at = array_search( $base_name, $active_plugins ) ) ) { // phpcs:ignore
81
- unset( $active_plugins[ $at ] );
82
- $invalid_plugins[] = array(
83
- 'slug' => $base_name,
84
- 'path' => $file,
85
- );
86
-
87
- if ( preg_match( '!learnpress-(.*)/learnpress.php!', $base_name ) ) {
88
- $invalid_slug = $base_name;
89
- break;
90
- }
91
- }
92
- }
93
-
94
- if ( sizeof( $invalid_plugins ) ) {
95
- // Re-update
96
- update_option( 'active_plugins', $active_plugins );
97
-
98
- if ( $invalid_slug ) {
99
- wp_die(
100
- sprintf(
101
- __( 'LearnPress plugin slug should be <strong>%1$s</strong> to make sure it works properly. Currently, it is <strong>%2$s</strong>. Please correct it\'s name and active again. <a href="%3$s">Back</a>', 'learnpress' ),
102
- 'learnpress/learnpress.php',
103
- $invalid_slug,
104
- admin_url( 'plugins.php' )
105
- )
106
- );
107
- }
108
-
109
- set_transient( 'lp-deactivated-addons', $invalid_plugins );
110
-
111
- wp_redirect( esc_url_raw( remove_query_arg( 'activate' ) ) );
112
- exit();
113
- }
114
- }
115
- }
116
-
117
- new LP_Backward_Addons();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-lp-checkout.php CHANGED
@@ -546,7 +546,7 @@ class LP_Checkout {
546
  }
547
 
548
  if ( ! username_exists( $_POST['username'] ) && ! email_exists( $_POST['username'] ) ) {
549
- return new WP_Error( 'username_exists', sprintf( __( '%s is not exists.', 'learnpress' ), $field ) );
550
  }
551
  } elseif ( $name === 'password' ) {
552
  if ( empty( $_POST['password'] ) ) {
@@ -560,7 +560,7 @@ class LP_Checkout {
560
  if ( empty( $_POST['guest_email'] ) ) {
561
  return new WP_Error( 'email_empty', sprintf( __( '%s is required field.', 'learnpress' ), $field ) );
562
  } elseif ( ! is_email( $_POST['guest_email'] ) ) {
563
- return new WP_Error( 'email_invalid', __( 'Your email is not a valid.', 'learnpress' ) );
564
  }
565
 
566
  $this->guest_email = LP_Helper::maybe_unserialize( $_POST[ $name ] );
546
  }
547
 
548
  if ( ! username_exists( $_POST['username'] ) && ! email_exists( $_POST['username'] ) ) {
549
+ return new WP_Error( 'username_exists', sprintf( __( '%s is not exist.', 'learnpress' ), $field ) );
550
  }
551
  } elseif ( $name === 'password' ) {
552
  if ( empty( $_POST['password'] ) ) {
560
  if ( empty( $_POST['guest_email'] ) ) {
561
  return new WP_Error( 'email_empty', sprintf( __( '%s is required field.', 'learnpress' ), $field ) );
562
  } elseif ( ! is_email( $_POST['guest_email'] ) ) {
563
+ return new WP_Error( 'email_invalid', __( 'Your email is not valid.', 'learnpress' ) );
564
  }
565
 
566
  $this->guest_email = LP_Helper::maybe_unserialize( $_POST[ $name ] );
inc/class-lp-datetime.php CHANGED
@@ -5,25 +5,30 @@
5
  */
6
  class LP_Datetime extends DateTime {
7
  /**
8
- * @var string
9
  */
10
  public static $format = 'Y-m-d H:i:s';
11
 
12
  /**
13
- * @var object
14
  */
15
  protected static $gmt;
16
 
17
  /**
18
- * @var object
19
  */
20
  protected static $stz;
21
 
22
  /**
23
- * @var DateTimeZone
24
  */
25
  protected $tz;
26
 
 
 
 
 
 
27
  protected $raw_date = null;
28
 
29
  protected static $def_timezone = null;
@@ -37,36 +42,18 @@ class LP_Datetime extends DateTime {
37
  * @throws
38
  */
39
  public function __construct( $date = '', $tz = null ) {
40
- if ( empty( self::$gmt ) || empty( self::$stz ) ) {
41
- self::$gmt = new DateTimeZone( 'GMT' );
42
- self::$stz = new DateTimeZone( @date_default_timezone_get() ); // phpcs:ignore
43
- }
44
-
45
  if ( $date instanceof LP_Datetime ) {
46
  $this->raw_date = $date->get_raw_date();
47
  } else {
48
- $this->raw_date = is_numeric( $date ) ? gmdate( 'Y-m-d H:i:s', $date ) : $date;
49
- }
50
-
51
- if ( empty( $date ) ) {
52
- $date = current_time( 'mysql' );
53
- }
54
-
55
- if ( ! ( $tz instanceof DateTimeZone ) ) {
56
- $tz = self::get_default_timezone( $tz );
57
  }
58
 
59
- if ( ! $tz ) {
60
- $tz = null;
61
  }
62
 
63
- date_default_timezone_set( 'UTC' );
64
-
65
- parent::__construct( $this->raw_date, $tz );
66
-
67
- date_default_timezone_set( self::$stz->getName() ); // phpcs:ignore
68
-
69
- $this->tz = $tz;
70
  }
71
 
72
  /**
@@ -75,8 +62,10 @@ class LP_Datetime extends DateTime {
75
  * @param mixed $tz
76
  *
77
  * @return DateTimeZone|null|string
 
78
  */
79
  public static function get_default_timezone( $tz ) {
 
80
  if ( empty( self::$def_timezone ) ) {
81
  if ( $tz === null ) {
82
  $tz = wp_timezone();
@@ -91,6 +80,8 @@ class LP_Datetime extends DateTime {
91
 
92
  /**
93
  * Check if time is exceeded with current time
 
 
94
  */
95
  public function is_exceeded( $interval = 0 ) {
96
  return $this->getTimestamp() >= current_time( 'timestamp' ) + $interval; // phpcs:ignore
@@ -108,9 +99,11 @@ class LP_Datetime extends DateTime {
108
  * @param string $name The name of the property.
109
  *
110
  * @return mixed
 
111
  */
112
  public function __get( $name ) {
113
- $value = null;
 
114
 
115
  switch ( $name ) {
116
  case 'daysinmonth':
@@ -164,7 +157,7 @@ class LP_Datetime extends DateTime {
164
  default:
165
  }
166
 
167
- return $value;
168
  }
169
 
170
  /**
@@ -201,7 +194,6 @@ class LP_Datetime extends DateTime {
201
  $return = $this->getTimestamp( $local );
202
  break;
203
  case 'human':
204
- $time = $this->getTimestamp( true );// mysql2date( 'G', $date->format('Y-m-d H:i:s') );
205
  $time1 = $this->getTimestamp( false );// mysql2date( 'G', $date->format('Y-m-d H:i:s') );
206
  $time_diff = ( time() ) - $time1;
207
 
@@ -213,20 +205,22 @@ class LP_Datetime extends DateTime {
213
  $return = $this->format( 'Y-m-d H:i:s', $local );
214
  break;
215
  default:
216
- if ( ! $local && ! empty( self::$gmt ) ) {
217
- parent::setTimezone( self::$gmt );
218
- }
219
-
220
  $return = parent::format( $format );
221
-
222
- if ( ! $local && ! empty( $this->tz ) ) {
223
- parent::setTimezone( $this->tz );
224
- }
225
  }
226
 
227
  return $return;
228
  }
229
 
 
 
 
 
 
 
 
 
 
 
230
  /**
231
  * @param boolean $hours True to return the value in hours.
232
  *
@@ -240,20 +234,24 @@ class LP_Datetime extends DateTime {
240
  * @param DateTimeZone $tz The new DateTimeZone object.
241
  *
242
  * @return void
 
243
  */
244
- public function setTimezone( $tz ) {
 
245
  $this->tz = $tz;
246
 
247
  parent::setTimezone( $tz );
248
- }
249
 
250
  /**
251
  * @param boolean $local True to return the date string in the local time zone, false to return it in GMT.
252
  *
253
  * @return string
 
254
  */
255
  public function toISO8601( $local = true ) {
256
- return $this->format( DateTime::RFC3339, $local );
 
257
  }
258
 
259
  /**
@@ -275,8 +273,10 @@ class LP_Datetime extends DateTime {
275
  *
276
  * @return int|string
277
  * @since 4.0.0
 
278
  */
279
  public function toLocal( $format = 'Y-m-d H:i:s' ) {
 
280
  $time = $this->getTimestamp() + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
281
 
282
  if ( $format ) {
@@ -302,15 +302,15 @@ class LP_Datetime extends DateTime {
302
  * Gets the date as UNIX time stamp.
303
  *
304
  * @return integer The date as a UNIX timestamp.
 
305
  */
306
  public function toUnix() {
 
307
  return (int) parent::format( 'U' );
308
  }
309
 
310
  public function getTimestamp( $local = true ) {
311
- $this->setGMT( $local );
312
  $timestamp = parent::getTimestamp();
313
- $this->setGMT( $local, false );
314
 
315
  if ( $local ) {
316
  $timestamp += $this->getOffset();
@@ -319,8 +319,12 @@ class LP_Datetime extends DateTime {
319
  return $timestamp;
320
  }
321
 
 
 
 
322
  protected function setGMT( $local = false, $gmt = true ) {
323
- if ( $gmt ) {
 
324
  if ( $local == false && ! empty( self::$gmt ) ) {
325
  parent::setTimezone( self::$gmt );
326
  }
@@ -328,10 +332,14 @@ class LP_Datetime extends DateTime {
328
  if ( $local == false && ! empty( $this->tz ) ) {
329
  parent::setTimezone( $this->tz );
330
  }
331
- }
332
  }
333
 
 
 
 
334
  public static function getSqlNullDate() {
 
335
  return '0000-00-00 00:00:00';
336
  }
337
 
@@ -343,8 +351,10 @@ class LP_Datetime extends DateTime {
343
  * @throws
344
  *
345
  * @since 3.3.0
 
346
  */
347
  public function addDuration( $seconds ) {
 
348
  $timestamp = $this->getTimestamp();
349
  parent::__construct( date( 'Y-m-d H:i:s', $timestamp + $seconds ), $this->tz ); // phpcs:ignore
350
  }
5
  */
6
  class LP_Datetime extends DateTime {
7
  /**
8
+ * @var string $format.
9
  */
10
  public static $format = 'Y-m-d H:i:s';
11
 
12
  /**
13
+ * @var object
14
  */
15
  protected static $gmt;
16
 
17
  /**
18
+ * @var object
19
  */
20
  protected static $stz;
21
 
22
  /**
23
+ * @var DateTimeZone
24
  */
25
  protected $tz;
26
 
27
+ /**
28
+ * String date time.
29
+ *
30
+ * @var string $raw_date.
31
+ */
32
  protected $raw_date = null;
33
 
34
  protected static $def_timezone = null;
42
  * @throws
43
  */
44
  public function __construct( $date = '', $tz = null ) {
 
 
 
 
 
45
  if ( $date instanceof LP_Datetime ) {
46
  $this->raw_date = $date->get_raw_date();
47
  } else {
48
+ $this->raw_date = is_numeric( $date ) ? gmdate( self::$format, $date ) : $date;
 
 
 
 
 
 
 
 
49
  }
50
 
51
+ if ( empty( $this->raw_date ) ) {
52
+ $this->raw_date = current_time( 'mysql', 1 );
53
  }
54
 
55
+ //date_default_timezone_set( 'UTC' );
56
+ parent::__construct( $this->raw_date );
 
 
 
 
 
57
  }
58
 
59
  /**
62
  * @param mixed $tz
63
  *
64
  * @return DateTimeZone|null|string
65
+ * @deprecated 4.1.7.3
66
  */
67
  public static function get_default_timezone( $tz ) {
68
+ _deprecated_function( __METHOD__, '4.1.7.3' );
69
  if ( empty( self::$def_timezone ) ) {
70
  if ( $tz === null ) {
71
  $tz = wp_timezone();
80
 
81
  /**
82
  * Check if time is exceeded with current time
83
+ *
84
+ * using by Addon Content Drip.
85
  */
86
  public function is_exceeded( $interval = 0 ) {
87
  return $this->getTimestamp() >= current_time( 'timestamp' ) + $interval; // phpcs:ignore
99
  * @param string $name The name of the property.
100
  *
101
  * @return mixed
102
+ * @deprecated 4.1.7.3
103
  */
104
  public function __get( $name ) {
105
+ _deprecated_function( __METHOD__, '4.1.7.3' );
106
+ /*$value = null;
107
 
108
  switch ( $name ) {
109
  case 'daysinmonth':
157
  default:
158
  }
159
 
160
+ return $value;*/
161
  }
162
 
163
  /**
194
  $return = $this->getTimestamp( $local );
195
  break;
196
  case 'human':
 
197
  $time1 = $this->getTimestamp( false );// mysql2date( 'G', $date->format('Y-m-d H:i:s') );
198
  $time_diff = ( time() ) - $time1;
199
 
205
  $return = $this->format( 'Y-m-d H:i:s', $local );
206
  break;
207
  default:
 
 
 
 
208
  $return = parent::format( $format );
 
 
 
 
209
  }
210
 
211
  return $return;
212
  }
213
 
214
+ /**
215
+ * Get format date time by settings of WP
216
+ *
217
+ * @since 4.1.7.3
218
+ * @return void
219
+ */
220
+ public function get_local_date_time() {
221
+
222
+ }
223
+
224
  /**
225
  * @param boolean $hours True to return the value in hours.
226
  *
234
  * @param DateTimeZone $tz The new DateTimeZone object.
235
  *
236
  * @return void
237
+ * @deprecated 4.1.7.3
238
  */
239
+ /*public function setTimezone( $tz ) {
240
+ _deprecated_function( __METHOD__, '4.1.7.3' );
241
  $this->tz = $tz;
242
 
243
  parent::setTimezone( $tz );
244
+ }*/
245
 
246
  /**
247
  * @param boolean $local True to return the date string in the local time zone, false to return it in GMT.
248
  *
249
  * @return string
250
+ * @deprecated 4.1.7.3
251
  */
252
  public function toISO8601( $local = true ) {
253
+ _deprecated_function( __METHOD__, '4.1.7.3' );
254
+ //return $this->format( DateTime::RFC3339, $local );
255
  }
256
 
257
  /**
273
  *
274
  * @return int|string
275
  * @since 4.0.0
276
+ * @deprecated 4.1.7.3
277
  */
278
  public function toLocal( $format = 'Y-m-d H:i:s' ) {
279
+ _deprecated_function( __METHOD__, '4.1.7.3' );
280
  $time = $this->getTimestamp() + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
281
 
282
  if ( $format ) {
302
  * Gets the date as UNIX time stamp.
303
  *
304
  * @return integer The date as a UNIX timestamp.
305
+ * @deprecated 4.1.7.3
306
  */
307
  public function toUnix() {
308
+ _deprecated_function( __METHOD__, '4.1.7.3' );
309
  return (int) parent::format( 'U' );
310
  }
311
 
312
  public function getTimestamp( $local = true ) {
 
313
  $timestamp = parent::getTimestamp();
 
314
 
315
  if ( $local ) {
316
  $timestamp += $this->getOffset();
319
  return $timestamp;
320
  }
321
 
322
+ /**
323
+ * @deprecated 4.1.7.3
324
+ */
325
  protected function setGMT( $local = false, $gmt = true ) {
326
+ _deprecated_function( __METHOD__, '4.1.7.3' );
327
+ /*if ( $gmt ) {
328
  if ( $local == false && ! empty( self::$gmt ) ) {
329
  parent::setTimezone( self::$gmt );
330
  }
332
  if ( $local == false && ! empty( $this->tz ) ) {
333
  parent::setTimezone( $this->tz );
334
  }
335
+ }*/
336
  }
337
 
338
+ /**
339
+ * @deprecated 4.1.7.3
340
+ */
341
  public static function getSqlNullDate() {
342
+ _deprecated_function( __METHOD__, '4.1.7.3' );
343
  return '0000-00-00 00:00:00';
344
  }
345
 
351
  * @throws
352
  *
353
  * @since 3.3.0
354
+ * @deprecated 4.1.7.3
355
  */
356
  public function addDuration( $seconds ) {
357
+ _deprecated_function( __METHOD__, '4.1.7.3' );
358
  $timestamp = $this->getTimestamp();
359
  parent::__construct( date( 'Y-m-d H:i:s', $timestamp + $seconds ), $this->tz ); // phpcs:ignore
360
  }
inc/class-lp-factory.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @depecated 4.1.6.4
5
- */
6
- class LP_Factory {
7
- /**
8
- * @return LP_User_CURD
9
- */
10
- public static function get_user_factory() {
11
- return LP_Object_Data_CURD::get( 'user' );
12
- }
13
-
14
- /**
15
- * @return LP_Order_CURD
16
- */
17
- public static function get_order_factory() {
18
- return LP_Object_Data_CURD::get( 'order' );
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-lp-forms-handler.php CHANGED
@@ -77,7 +77,7 @@ class LP_Forms_Handler {
77
  $remember = LP_Request::get_string( 'rememberme' );
78
 
79
  if ( empty( $username ) ) {
80
- throw new Exception( '<strong>' . __( 'Error:', 'learnpress' ) . '</strong> ' . __( 'Username is required', 'learnpress' ) );
81
  }
82
 
83
  // On multisite, ensure user exists on current site, if not add them before allowing login.
@@ -168,7 +168,7 @@ class LP_Forms_Handler {
168
  array(
169
  'bat_email' => $email,
170
  'bat_phone' => '',
171
- 'bat_message' => apply_filters( 'learnpress_become_instructor_message', esc_html__( 'I need become an instructor', 'learnpress' ) ),
172
  )
173
  );
174
 
@@ -186,7 +186,7 @@ class LP_Forms_Handler {
186
  $message_success = $username . __( ' was successfully created!', 'learnpress' );
187
 
188
  if ( $is_become_a_teacher ) {
189
- $message_success .= '<br/>' . __( 'Your request become an instructor has been sent. We will get back to you soon!', 'learnpress' );
190
  }
191
 
192
  learn_press_add_message( $message_success, 'success' );
@@ -219,21 +219,24 @@ class LP_Forms_Handler {
219
  public static function learnpress_create_new_customer( $email = '', $username = '', $password = '', $confirm_password = '', $args = array(), $update_meta = array() ) {
220
  try {
221
  if ( empty( $email ) || ! is_email( $email ) ) {
222
- throw new Exception( __( 'Please provide a valid email address.', 'learnpress' ) );
223
  }
224
 
225
  if ( email_exists( $email ) ) {
226
- throw new Exception( __( 'An account is already registered with your email address.', 'learnpress' ) );
227
  }
228
 
229
  $username = sanitize_user( $username );
230
 
231
  if ( empty( $username ) || ! validate_username( $username ) ) {
232
- throw new Exception( __( 'Please enter a valid account username.', 'learnpress' ) );
233
  }
234
 
235
  if ( username_exists( $username ) ) {
236
- throw new Exception( __( 'An account is already registered with that username. Please choose another.', 'learnpress' ) );
 
 
 
237
  }
238
 
239
  if ( apply_filters( 'learnpress_registration_generate_password', false ) ) {
@@ -241,31 +244,30 @@ class LP_Forms_Handler {
241
  }
242
 
243
  if ( empty( $password ) ) {
244
- throw new Exception( __( 'Please enter an account password.', 'learnpress' ) );
245
  }
246
 
247
  if ( strlen( $password ) < 6 ) {
248
- throw new Exception( __( 'Password is too short!', 'learnpress' ) );
249
  }
250
 
251
  if ( preg_match( '#\s+#', $password ) ) {
252
- throw new Exception( __( 'Password can not have spacing!', 'learnpress' ) );
253
  }
254
 
255
  if ( empty( $confirm_password ) ) {
256
- throw new Exception( __( 'Please enter confirm password.', 'learnpress' ) );
257
  }
258
 
259
  if ( $password !== $confirm_password ) {
260
- throw new Exception( __( 'Confirmation password incorrect!.', 'learnpress' ) );
261
  }
262
 
263
  $custom_fields = LP_Settings::get_option( 'register_profile_fields', [] );
264
-
265
  if ( $custom_fields && ! empty( $update_meta ) ) {
266
  foreach ( $custom_fields as $field ) {
267
  if ( $field['required'] === 'yes' && empty( $update_meta[ $field['id'] ] ) ) {
268
- throw new Exception( $field['name'] . __( ' is required field.', 'learnpress' ) );
269
  }
270
  }
271
  }
@@ -299,7 +301,39 @@ class LP_Forms_Handler {
299
  wp_new_user_notification( $customer_id, null, 'both' );
300
  }
301
  } catch ( Throwable $e ) {
302
- return new WP_Error( 'lp/create-new-customer/error', $e->getMessage() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
 
305
  return $customer_id;
@@ -318,11 +352,11 @@ class LP_Forms_Handler {
318
  }
319
 
320
  if ( is_email( $update_data['display_name'] ) ) {
321
- return new WP_Error( 'error_display_name', esc_html__( 'Display name cannot be changed to email address due to privacy concern.', 'learnpress' ) );
322
  }
323
 
324
  if ( ! is_email( $update_data['user_email'] ) ) {
325
- return new WP_Error( 'error_email', esc_html__( 'Display name cannot be changed to email address due to privacy concern.', 'learnpress' ) );
326
  } elseif ( email_exists( $update_data['user_email'] ) && $update_data['user_email'] !== $current_user->user_email ) {
327
  return new WP_Error( 'error_email', esc_html__( 'This email address is already registered.', 'learnpress' ) );
328
  }
77
  $remember = LP_Request::get_string( 'rememberme' );
78
 
79
  if ( empty( $username ) ) {
80
+ throw new Exception( '<strong>' . __( 'Error:', 'learnpress' ) . '</strong> ' . __( 'A username is required', 'learnpress' ) );
81
  }
82
 
83
  // On multisite, ensure user exists on current site, if not add them before allowing login.
168
  array(
169
  'bat_email' => $email,
170
  'bat_phone' => '',
171
+ 'bat_message' => apply_filters( 'learnpress_become_instructor_message', esc_html__( 'I need to become an instructor', 'learnpress' ) ),
172
  )
173
  );
174
 
186
  $message_success = $username . __( ' was successfully created!', 'learnpress' );
187
 
188
  if ( $is_become_a_teacher ) {
189
+ $message_success .= '<br/>' . __( 'Your request to become an instructor has been sent. We will get back to you soon!', 'learnpress' );
190
  }
191
 
192
  learn_press_add_message( $message_success, 'success' );
219
  public static function learnpress_create_new_customer( $email = '', $username = '', $password = '', $confirm_password = '', $args = array(), $update_meta = array() ) {
220
  try {
221
  if ( empty( $email ) || ! is_email( $email ) ) {
222
+ throw new Exception( __( 'Please provide a valid email address.', 'learnpress' ), 101 );
223
  }
224
 
225
  if ( email_exists( $email ) ) {
226
+ throw new Exception( __( 'An account is already registered with your email address.', 'learnpress' ), 102 );
227
  }
228
 
229
  $username = sanitize_user( $username );
230
 
231
  if ( empty( $username ) || ! validate_username( $username ) ) {
232
+ throw new Exception( __( 'Please enter a valid account username.', 'learnpress' ), 103 );
233
  }
234
 
235
  if ( username_exists( $username ) ) {
236
+ throw new Exception(
237
+ __( 'An account is already registered with that username. Please choose another one.', 'learnpress' ),
238
+ 104
239
+ );
240
  }
241
 
242
  if ( apply_filters( 'learnpress_registration_generate_password', false ) ) {
244
  }
245
 
246
  if ( empty( $password ) ) {
247
+ throw new Exception( __( 'Please enter an account password.', 'learnpress' ), 105 );
248
  }
249
 
250
  if ( strlen( $password ) < 6 ) {
251
+ throw new Exception( __( 'Password is too short!', 'learnpress' ), 106 );
252
  }
253
 
254
  if ( preg_match( '#\s+#', $password ) ) {
255
+ throw new Exception( __( 'Password can not contain spaces!', 'learnpress' ), 107 );
256
  }
257
 
258
  if ( empty( $confirm_password ) ) {
259
+ throw new Exception( __( 'Please enter confirm password.', 'learnpress' ), 108 );
260
  }
261
 
262
  if ( $password !== $confirm_password ) {
263
+ throw new Exception( __( 'Password and Confirm Password does not match!', 'learnpress' ), 108 );
264
  }
265
 
266
  $custom_fields = LP_Settings::get_option( 'register_profile_fields', [] );
 
267
  if ( $custom_fields && ! empty( $update_meta ) ) {
268
  foreach ( $custom_fields as $field ) {
269
  if ( $field['required'] === 'yes' && empty( $update_meta[ $field['id'] ] ) ) {
270
+ throw new Exception( $field['name'] . __( ' is required field.', 'learnpress' ), 109 );
271
  }
272
  }
273
  }
301
  wp_new_user_notification( $customer_id, null, 'both' );
302
  }
303
  } catch ( Throwable $e ) {
304
+ $code_str = '';
305
+ switch ( $e->getCode() ) {
306
+ case 101:
307
+ $code_str = 'registration-error-invalid-email';
308
+ break;
309
+ case 102:
310
+ $code_str = 'registration-error-email-exists';
311
+ break;
312
+ case 103:
313
+ $code_str = 'registration-error-invalid-username';
314
+ break;
315
+ case 104:
316
+ $code_str = 'registration-error-username-exists';
317
+ break;
318
+ case 105:
319
+ $code_str = 'registration-error-missing-password';
320
+ break;
321
+ case 106:
322
+ $code_str = 'registration-error-short-password';
323
+ break;
324
+ case 107:
325
+ $code_str = 'registration-error-spacing-password';
326
+ break;
327
+ case 108:
328
+ $code_str = 'registration-error-confirm-password';
329
+ break;
330
+ case 109:
331
+ $code_str = 'registration-custom-required-field';
332
+ break;
333
+ default:
334
+ break;
335
+ }
336
+ return new WP_Error( $code_str, $e->getMessage() );
337
  }
338
 
339
  return $customer_id;
352
  }
353
 
354
  if ( is_email( $update_data['display_name'] ) ) {
355
+ return new WP_Error( 'error_display_name', esc_html__( 'Due to privacy concerns, the display name cannot be changed to an email address.', 'learnpress' ) );
356
  }
357
 
358
  if ( ! is_email( $update_data['user_email'] ) ) {
359
+ return new WP_Error( 'error_email', esc_html__( 'Due to privacy concerns, the display name cannot be changed to an email address.', 'learnpress' ) );
360
  } elseif ( email_exists( $update_data['user_email'] ) && $update_data['user_email'] !== $current_user->user_email ) {
361
  return new WP_Error( 'error_email', esc_html__( 'This email address is already registered.', 'learnpress' ) );
362
  }
inc/class-lp-global.php CHANGED
@@ -86,8 +86,9 @@ class LP_Global {
86
  * @param string $type
87
  *
88
  * @return bool
 
89
  */
90
- public static function is_course_item_type( $type ) {
91
  $item = self::course_item();
92
 
93
  if ( $item ) {
@@ -95,7 +96,7 @@ class LP_Global {
95
  }
96
 
97
  return false;
98
- }
99
 
100
  /**
101
  * @param bool $get_only_id
@@ -122,7 +123,11 @@ class LP_Global {
122
  }
123
  }
124
 
 
 
 
125
  public static function set_course( $course ) {
 
126
  global $lp_course;
127
 
128
  if ( self::$_course === false ) {
@@ -143,23 +148,6 @@ class LP_Global {
143
  return $lp_user;
144
  }
145
 
146
- /**
147
- * Set global user
148
- *
149
- * @param LP_User $user
150
- */
151
- // public static function set_user( $user = null ) {
152
- // global $lp_user;
153
- //
154
- // var_dump(debug_backtrace());
155
- //
156
- // if ( false === self::$_user ) {
157
- // self::$_user = $lp_user;
158
- // }
159
- //
160
- // $lp_user = $user;
161
- // }
162
-
163
  /**
164
  * Alias of course item for highlighting in dev
165
  *
@@ -182,8 +170,10 @@ class LP_Global {
182
 
183
  /**
184
  * Reset global variables to default
 
185
  */
186
  public static function reset() {
 
187
  global $lp_user, $lp_course, $lp_course_item, $lp_quiz_question;
188
 
189
  if ( self::$_user ) {
@@ -208,28 +198,7 @@ class LP_Global {
208
  public static function profile( $global = false, $reset = false ) {
209
  global $profile;
210
 
211
- if ( ! $profile ) {
212
- //self::$_profile = $profile = LP_Profile::instance( get_current_user_id() );
213
- }
214
-
215
  return LP_Profile::instance();
216
-
217
- /**
218
- * Get origin global $profile (stored in class) if $global = TRUE
219
- */
220
- if ( $global ) {
221
-
222
- /**
223
- * If $reset = TRUE then set global $profile to origin global $profile (stored in class)
224
- */
225
- if ( ! $reset ) {
226
- return self::$_profile;
227
- }
228
-
229
- $profile = self::$_profile;
230
- }
231
-
232
- return $profile;
233
  }
234
 
235
  public static function init() {
@@ -349,14 +318,4 @@ class LP_Global {
349
 
350
  return self::$object_support_features[ $object_type ];
351
  }
352
-
353
- /**
354
- * @param $user
355
- *
356
- * @return false
357
- * @deprecated 4.0.0
358
- */
359
- public function set_user( $user ) {
360
- return false;
361
- }
362
  }
86
  * @param string $type
87
  *
88
  * @return bool
89
+ * @deprecated 4.1.7.3
90
  */
91
+ /*public static function is_course_item_type( $type ) {
92
  $item = self::course_item();
93
 
94
  if ( $item ) {
96
  }
97
 
98
  return false;
99
+ }*/
100
 
101
  /**
102
  * @param bool $get_only_id
123
  }
124
  }
125
 
126
+ /**
127
+ * @deprecated 4.1.7.3
128
+ */
129
  public static function set_course( $course ) {
130
+ _deprecated_function( __FUNCTION__, '4.1.7.3' );
131
  global $lp_course;
132
 
133
  if ( self::$_course === false ) {
148
  return $lp_user;
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  /**
152
  * Alias of course item for highlighting in dev
153
  *
170
 
171
  /**
172
  * Reset global variables to default
173
+ * @deprecated 4.1.7.3
174
  */
175
  public static function reset() {
176
+ _deprecated_function( __FUNCTION__, '4.1.7.3' );
177
  global $lp_user, $lp_course, $lp_course_item, $lp_quiz_question;
178
 
179
  if ( self::$_user ) {
198
  public static function profile( $global = false, $reset = false ) {
199
  global $profile;
200
 
 
 
 
 
201
  return LP_Profile::instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  }
203
 
204
  public static function init() {
318
 
319
  return self::$object_support_features[ $object_type ];
320
  }
 
 
 
 
 
 
 
 
 
 
321
  }
inc/class-lp-helper.php CHANGED
@@ -94,7 +94,7 @@ class LP_Helper {
94
  *
95
  * @param array|int $ids
96
  * @Todo: tungnx - need to review code
97
- * @depecated 4.1.6.9
98
  */
99
  public static function cache_posts( $ids ) {
100
  //_deprecated_function( __FUNCTION__, '4.1.6.9' );
@@ -403,10 +403,11 @@ class LP_Helper {
403
  * @author tungnx
404
  */
405
  public static function getUrlCurrent(): string {
406
- $schema = is_ssl() ? 'https://' : 'http://';
407
- $http_host = $_SERVER['HTTP_HOST'] ?? '';
 
408
 
409
- return $schema . $http_host . untrailingslashit( esc_url_raw( $_SERVER['REQUEST_URI'] ?? '' ) );
410
  }
411
 
412
  /**
94
  *
95
  * @param array|int $ids
96
  * @Todo: tungnx - need to review code
97
+ * @deprecated 4.1.6.9
98
  */
99
  public static function cache_posts( $ids ) {
100
  //_deprecated_function( __FUNCTION__, '4.1.6.9' );
403
  * @author tungnx
404
  */
405
  public static function getUrlCurrent(): string {
406
+ $schema = is_ssl() ? 'https://' : 'http://';
407
+ $http_host = LP_Helper::sanitize_params_submitted( filter_input( INPUT_SERVER, 'HTTP_HOST' ) ?? '' );
408
+ $request_uri = LP_Helper::sanitize_params_submitted( filter_input( INPUT_SERVER, 'REQUEST_URI' ) ?? '' );
409
 
410
+ return $schema . untrailingslashit( esc_url_raw( $http_host . $request_uri ) );
411
  }
412
 
413
  /**
inc/class-lp-install.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThimPress
6
  * @package LearnPress/Classes
7
- * @version 3.0.0
8
  */
9
 
10
  use LP\Helpers\Config;
@@ -47,8 +47,6 @@ if ( ! function_exists( 'LP_Install' ) ) {
47
  * @since 4.0.0
48
  */
49
  public function on_activate() {
50
- // update_option( 'learn_press_status', 'activated' );
51
-
52
  $this->create_tables();
53
 
54
  if ( ! self::tables_install_done() ) {
@@ -76,58 +74,6 @@ if ( ! function_exists( 'LP_Install' ) ) {
76
  }
77
  }
78
 
79
- /**
80
- * Check to run installer in the first-time LP installed.
81
- *
82
- * @since 3.x.x
83
- */
84
- public static function do_install() {
85
- if ( ! current_user_can( 'manage_options' ) ) {
86
- return;
87
- }
88
-
89
- $status = get_option( 'learn_press_status' );
90
-
91
- switch ( $status ) {
92
- case 'activated':
93
- self::install();
94
- update_option( 'learn_press_status', 'installed' );
95
- }
96
- }
97
-
98
- /**
99
- * Run installation after LearnPress is activated.
100
- *
101
- * @depecated 4.1.6.4
102
- */
103
- public static function install() {
104
- _deprecated_function( __FUNCTION__, '4.1.6.4' );
105
- /*self::create_options();
106
- self::_create_pages();
107
- self::_create_cron_jobs();
108
- self::_delete_transients();
109
- //self::_create_log_path();
110
- self::_clear_backgrounds();
111
-
112
- $current_version = get_option( 'learnpress_version', null );
113
- $current_db_version = get_option( 'learnpress_db_version', null );
114
-
115
- // Fresh installation .
116
- if ( is_null( $current_db_version ) ) {
117
- update_option( 'learn_press_install', 'yes' );
118
- set_transient( 'lp_activation_redirect', 'yes', 60 );
119
- }
120
-
121
- // Force to show notice outdated template .
122
- learn_press_delete_user_option( 'hide-notice-template-files' );
123
-
124
- LP_Admin_Notice::instance()->remove_dismissed_notice( array( 'outdated-template' ) );
125
-
126
- //if ( ! get_option( 'learnpress_db_version' ) ) {
127
- update_option( 'learnpress_db_version', (int) LEARNPRESS_VERSION );
128
- //}*/
129
- }
130
-
131
  /**
132
  * Create tables required for LP
133
  */
4
  *
5
  * @author ThimPress
6
  * @package LearnPress/Classes
7
+ * @version 3.0.1
8
  */
9
 
10
  use LP\Helpers\Config;
47
  * @since 4.0.0
48
  */
49
  public function on_activate() {
 
 
50
  $this->create_tables();
51
 
52
  if ( ! self::tables_install_done() ) {
74
  }
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * Create tables required for LP
79
  */
inc/class-lp-nonce-helper.php CHANGED
@@ -39,7 +39,7 @@ class LP_Nonce_Helper {
39
  * @since 3.0.0
40
  *
41
  * @return bool
42
- * @depecated 4.1.6.9
43
  */
44
  /*public static function verify_course( $nonce, $action, $course_id = 0, $user_id = 0 ) {
45
  if ( ! $course_id ) {
@@ -67,7 +67,7 @@ class LP_Nonce_Helper {
67
  }
68
 
69
  /**
70
- * @depecated 4.1.6.9
71
  */
72
  /*public static function verify_quiz_action( $action, $nonce = '', $quiz_id = 0, $course_id = 0 ) {
73
  if ( ! $nonce ) {
39
  * @since 3.0.0
40
  *
41
  * @return bool
42
+ * @deprecated 4.1.6.9
43
  */
44
  /*public static function verify_course( $nonce, $action, $course_id = 0, $user_id = 0 ) {
45
  if ( ! $course_id ) {
67
  }
68
 
69
  /**
70
+ * @deprecated 4.1.6.9
71
  */
72
  /*public static function verify_quiz_action( $action, $nonce = '', $quiz_id = 0, $course_id = 0 ) {
73
  if ( ! $nonce ) {
inc/class-lp-page-controller.php CHANGED
@@ -49,7 +49,7 @@ class LP_Page_Controller {
49
  add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 2 );
50
 
51
  // Set link profile to admin menu
52
- add_action( 'admin_bar_menu', array( $this, 'learn_press_edit_admin_bar' ) );
53
 
54
  // Web hook detected PayPal request.
55
  add_action( 'init', [ $this, 'check_webhook_paypal_ipn' ] );
@@ -621,7 +621,7 @@ class LP_Page_Controller {
621
  *
622
  * @return array
623
  * @since 3.x.x
624
- * @depecated 4.1.6.9.2
625
  */
626
  /*public function page_template_hierarchy( $templates ) {
627
  $templates = array_merge( $templates, array( 'singular.php' ) );
@@ -882,7 +882,7 @@ class LP_Page_Controller {
882
  }
883
 
884
  /**
885
- * @depecated 4.1.6.9.2
886
  */
887
  /*public function the_content_callback( $content ) {
888
  if ( $this->_archive_contents ) {
@@ -970,6 +970,7 @@ class LP_Page_Controller {
970
  * @editor tungnx
971
  * @version 1.0.1
972
  * @since 3.0.0
 
973
  */
974
  public function learn_press_edit_admin_bar() {
975
  global $wp_admin_bar;
@@ -981,7 +982,6 @@ class LP_Page_Controller {
981
  }
982
 
983
  $page_profile_id = learn_press_get_page_id( 'profile' );
984
-
985
  if ( $page_profile_id && get_post_status( $page_profile_id ) != 'trash' ) {
986
  $user_id = $current_user->ID;
987
 
49
  add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 2 );
50
 
51
  // Set link profile to admin menu
52
+ //add_action( 'admin_bar_menu', array( $this, 'learn_press_edit_admin_bar' ) );
53
 
54
  // Web hook detected PayPal request.
55
  add_action( 'init', [ $this, 'check_webhook_paypal_ipn' ] );
621
  *
622
  * @return array
623
  * @since 3.x.x
624
+ * @deprecated 4.1.6.9.2
625
  */
626
  /*public function page_template_hierarchy( $templates ) {
627
  $templates = array_merge( $templates, array( 'singular.php' ) );
882
  }
883
 
884
  /**
885
+ * @deprecated 4.1.6.9.2
886
  */
887
  /*public function the_content_callback( $content ) {
888
  if ( $this->_archive_contents ) {
970
  * @editor tungnx
971
  * @version 1.0.1
972
  * @since 3.0.0
973
+ * @deprecated 4.1.7.3
974
  */
975
  public function learn_press_edit_admin_bar() {
976
  global $wp_admin_bar;
982
  }
983
 
984
  $page_profile_id = learn_press_get_page_id( 'profile' );
 
985
  if ( $page_profile_id && get_post_status( $page_profile_id ) != 'trash' ) {
986
  $user_id = $current_user->ID;
987
 
inc/class-lp-query-search.php DELETED
@@ -1,107 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Query_Search
5
- *
6
- * @depecated 4.1.6.6
7
- */
8
- class LP_Query_Search {
9
- /**
10
- * Search posts.
11
- *
12
- * @param mixed $args
13
- *
14
- * @return mixed
15
- */
16
- public static function search_items( $args = '' ) {
17
- global $wpdb;
18
-
19
- $args = wp_parse_args(
20
- $args,
21
- array(
22
- 'term' => '',
23
- 'type' => '',
24
- 'context' => '',
25
- 'context_id' => 0,
26
- 'include' => '',
27
- 'exclude' => '',
28
- 'fields' => array(),
29
- 'limit' => - 1,
30
- 'paged' => 0,
31
- )
32
- );
33
-
34
- $user = learn_press_get_current_user();
35
- $term = $args['term'];
36
- $type = $args['type'];
37
- $context = $args['context'];
38
- $context_id = absint( $args['context_id'] );
39
- $include = array();
40
- $exclude = array();
41
- $authors = array();
42
-
43
- if ( ! empty( $args['exclude'] ) ) {
44
- if ( is_string( $args['exclude'] ) ) {
45
- $args['exclude'] = explode( ',', $args['exclude'] );
46
- }
47
- $exclude = array_map( 'intval', $args['exclude'] );
48
- }
49
-
50
- if ( ! empty( $args['include'] ) ) {
51
- if ( is_string( $args['include'] ) ) {
52
- $args['eincludexclude'] = explode( ',', $args['include'] );
53
- }
54
- $include = array_map( 'intval', $args['include'] );
55
- }
56
-
57
- $exclude = apply_filters( 'learn-press/search-items/exclude', $exclude, $type, $context, $context_id );
58
- $include = apply_filters( 'learn-press/search-items/include', $include, $type, $context, $context_id );
59
-
60
- if ( ! $user->is_admin() ) {
61
- $authors[] = $user->get_id();
62
- }
63
-
64
- if ( $context && $context_id ) {
65
- if ( get_post_type( $context_id ) == $context ) {
66
- $post_author = get_post_field( 'post_author', $context_id );
67
- $authors[] = $post_author;
68
-
69
- if ( $post_author != $user->get_id() ) {
70
- $authors[] = $user->get_id();
71
- }
72
- }
73
- }
74
-
75
- $query_args = array(
76
- 'post_type' => array( $type ),
77
- 'posts_per_page' => $args['limit'],
78
- 'post_status' => 'publish',
79
- 'order' => 'ASC',
80
- 'orderby' => 'parent title',
81
- 'post__not_in' => $exclude,
82
- 'include' => $include,
83
- 'author' => $authors,
84
- );
85
-
86
- if ( $term ) {
87
- $query_args['s'] = $term;
88
- }
89
-
90
- if ( $args['paged'] ) {
91
- $query_args['offset'] = ( $args['paged'] - 1 ) * $args['limit'];
92
- }
93
-
94
- $query_args = apply_filters( 'learn-press/search-items/args', $query_args, $type, $context, $context_id );
95
-
96
- global $wp_query, $wpdb;
97
-
98
- $posts = get_posts( $query_args );
99
- $q = new WP_Query( $query_args );
100
-
101
- return array(
102
- 'items' => $posts,
103
- 'total' => $q->found_posts,
104
- 'pages' => $q->max_num_pages,
105
- );
106
- }
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-lp-request-handler.php CHANGED
@@ -49,6 +49,8 @@ class LP_Request {
49
  * @param string $sanitize_type
50
  * @param string $method
51
  *
 
 
52
  * @return array|float|int|string
53
  */
54
  public static function get_param( string $key, $default = '', string $sanitize_type = 'text', string $method = '' ) {
49
  * @param string $sanitize_type
50
  * @param string $method
51
  *
52
+ * @since 4.1.7.2
53
+ * @version 1.0.0
54
  * @return array|float|int|string
55
  */
56
  public static function get_param( string $key, $default = '', string $sanitize_type = 'text', string $method = '' ) {
inc/class-lp-shortcodes.php CHANGED
@@ -217,7 +217,7 @@ if ( ! class_exists( 'LP_Shortcodes' ) ) {
217
  <p>
218
  <a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e( 'Forgot password?', 'learnpress' ); ?></a>
219
  &nbsp;|&nbsp;
220
- <a href="<?php echo wp_registration_url(); ?>"><?php esc_html_e( 'Create new account', 'learnpress' ); ?></a>
221
  </p>
222
  <?php
223
  $html .= ob_get_clean();
217
  <p>
218
  <a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e( 'Forgot password?', 'learnpress' ); ?></a>
219
  &nbsp;|&nbsp;
220
+ <a href="<?php echo wp_registration_url(); ?>"><?php esc_html_e( 'Create a new account', 'learnpress' ); ?></a>
221
  </p>
222
  <?php
223
  $html .= ob_get_clean();
inc/class-lp-strings.php CHANGED
@@ -19,12 +19,12 @@ class LP_Strings {
19
  $strings = apply_filters(
20
  'learnpress/strings',
21
  array(
22
- 'you_have_completed_quiz' => __( 'You\'ve already completed quiz.', 'learnpress' ),
23
- 'confirm-redo-quiz' => __( 'Do you want to redo quiz "%s"?', 'learnpress' ),
24
- 'confirm-complete-quiz' => __( 'Do you want to complete quiz "%s"?', 'learnpress' ),
25
- 'confirm-complete-lesson' => __( 'Do you want to complete lesson "%s"?', 'learnpress' ),
26
- 'confirm-finish-course' => __( 'Do you want to finish course "%s"?', 'learnpress' ),
27
- 'confirm-retake-course' => __( 'Do you want to retake course "%s"?', 'learnpress' ),
28
  )
29
  );
30
 
19
  $strings = apply_filters(
20
  'learnpress/strings',
21
  array(
22
+ 'you_have_completed_quiz' => __( 'You\'ve already completed the quiz.', 'learnpress' ),
23
+ 'confirm-redo-quiz' => __( 'Do you want to redo the quiz "%s"?', 'learnpress' ),
24
+ 'confirm-complete-quiz' => __( 'Do you want to complete the quiz "%s"?', 'learnpress' ),
25
+ 'confirm-complete-lesson' => __( 'Do you want to complete the lesson "%s"?', 'learnpress' ),
26
+ 'confirm-finish-course' => __( 'Do you want to finish the course "%s"?', 'learnpress' ),
27
+ 'confirm-retake-course' => __( 'Do you want to retake the course "%s"?', 'learnpress' ),
28
  )
29
  );
30
 
inc/class-lp-template.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @since 3.3.0
7
  */
8
- class LP_Template implements ArrayAccess {
9
  /**
10
  * @var LP_Template
11
  */
@@ -17,17 +17,30 @@ class LP_Template implements ArrayAccess {
17
  * LP_Template constructor.
18
  */
19
  protected function __construct() {
 
 
 
 
 
20
  $this->templates = apply_filters(
21
  'learn-press/templates-classes',
22
  array(
23
- 'general' => include_once 'templates/class-lp-template-general.php',
24
- 'course' => include_once 'templates/class-lp-template-course.php',
25
- 'checkout' => include_once 'templates/class-lp-template-checkout.php',
26
- 'profile' => include_once 'templates/class-lp-template-profile.php',
27
  )
28
  );
29
  }
30
 
 
 
 
 
 
 
 
 
31
  public function has_content( $where ) {
32
  return has_action( $where );
33
  }
5
  *
6
  * @since 3.3.0
7
  */
8
+ class LP_Template {
9
  /**
10
  * @var LP_Template
11
  */
17
  * LP_Template constructor.
18
  */
19
  protected function __construct() {
20
+ include_once 'templates/class-lp-template-general.php';
21
+ include_once 'templates/class-lp-template-course.php';
22
+ include_once 'templates/class-lp-template-checkout.php';
23
+ include_once 'templates/class-lp-template-profile.php';
24
+
25
  $this->templates = apply_filters(
26
  'learn-press/templates-classes',
27
  array(
28
+ 'general' => new LP_Template_General(),
29
+ 'course' => new LP_Template_Course(),
30
+ 'checkout' => new LP_Template_Checkout(),
31
+ 'profile' => new LP_Template_Profile(),
32
  )
33
  );
34
  }
35
 
36
+ public function get_templates() {
37
+ return $this->templates;
38
+ }
39
+
40
+ public function get_template( $name ) {
41
+ return $this->templates[ $name ] ?? '';
42
+ }
43
+
44
  public function has_content( $where ) {
45
  return has_action( $where );
46
  }
inc/class-lp-widget.php CHANGED
@@ -244,7 +244,7 @@ class LP_Widget extends WP_Widget {
244
  */
245
  public function form( $instance ) {
246
  if ( empty( $this->settings ) ) {
247
- echo '<p>' . esc_html_e( 'There is no options for this widget.', 'learnpress' ) . '</p>';
248
  return;
249
  }
250
 
244
  */
245
  public function form( $instance ) {
246
  if ( empty( $this->settings ) ) {
247
+ echo '<p>' . esc_html_e( 'There are no options for this widget.', 'learnpress' ) . '</p>';
248
  return;
249
  }
250
 
inc/course/abstract-course.php CHANGED
@@ -200,7 +200,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
200
  /**
201
  * Load course curriculum.
202
  *
203
- * @depecated 4.1.6.9
204
  */
205
  public function load_curriculum() {
206
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
@@ -332,17 +332,14 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
332
  }
333
 
334
  /**
335
- * Check if this course is required enroll or not.
336
- *
337
- * @param mixed
338
  *
339
  * @return bool
340
- * @depecated 4.0.0
341
  */
342
- public function is_required_enroll() {
343
- //_deprecated_function( __FUNCTION__, '4.1.7.2', 'is_no_required_enroll' );
344
  return ! $this->is_no_required_enroll();
345
  }
 
346
  /**
347
  * Check if this course is required enroll or not.
348
  *
@@ -360,15 +357,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
360
  }
361
 
362
  /**
363
- * @return mixed
364
- * @deprecated
365
- */
366
- public function is_require_enrollment() {
367
- return ! $this->is_no_required_enroll();
368
- }
369
-
370
- /**
371
- * @depecated 4.1.6.9
372
  */
373
  /*public function get_item_types( $group = false ) {
374
  $cache_key = $group ? 'course-item-group-types' : 'course-item-types';
@@ -443,7 +432,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
443
  * Get item is viewing in single course.
444
  *
445
  * @return LP_Course_Item
446
- * @depecated 4.1.6.9
447
  */
448
  public function get_viewing_item() {
449
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
@@ -1044,7 +1033,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
1044
  * @param LP_Course_Item|LP_User_Item|int $item
1045
  *
1046
  * @return mixed
1047
- * @depecated 4.1.6.9
1048
  */
1049
  /*public function get_item_position( $item ) {
1050
  $items = $this->get_items();
@@ -1254,7 +1243,7 @@ if ( ! function_exists( 'LP_Abstract_Course' ) ) {
1254
  if ( $start_time + $duration > $now ) {
1255
  $remain = $start_time + $duration - $now;
1256
  $remain = learn_press_seconds_to_weeks( $remain );
1257
- $html = sprintf( __( 'This course will end within next %s', 'learnpress' ), $remain );
1258
  }
1259
  }
1260
 
200
  /**
201
  * Load course curriculum.
202
  *
203
+ * @deprecated 4.1.6.9
204
  */
205
  public function load_curriculum() {
206
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
332
  }
333
 
334
  /**
335
+ * Check this course is required enroll.
 
 
336
  *
337
  * @return bool
 
338
  */
339
+ public function is_required_enroll(): bool {
 
340
  return ! $this->is_no_required_enroll();
341
  }
342
+
343
  /**
344
  * Check if this course is required enroll or not.
345
  *
357
  }
358
 
359
  /**
360
+ * @deprecated 4.1.6.9
 
 
 
 
 
 
 
 
361
  */
362
  /*public function get_item_types( $group = false ) {
363
  $cache_key = $group ? 'course-item-group-types' : 'course-item-types';
432
  * Get item is viewing in single course.
433
  *
434
  * @return LP_Course_Item
435
+ * @deprecated 4.1.6.9
436
  */
437
  public function get_viewing_item() {
438
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
1033
  * @param LP_Course_Item|LP_User_Item|int $item
1034
  *
1035
  * @return mixed
1036
+ * @deprecated 4.1.6.9
1037
  */
1038
  /*public function get_item_position( $item ) {
1039
  $items = $this->get_items();
1243
  if ( $start_time + $duration > $now ) {
1244
  $remain = $start_time + $duration - $now;
1245
  $remain = learn_press_seconds_to_weeks( $remain );
1246
+ $html = sprintf( __( 'This course will end within the next %s', 'learnpress' ), $remain );
1247
  }
1248
  }
1249
 
inc/course/class-lp-course-item.php CHANGED
@@ -542,7 +542,7 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
542
  * @param int $question_id
543
  *
544
  * @return mixed
545
- * @depecated 4.1.7.2
546
  */
547
  /*public function is_viewing_question( $question_id = 0 ) {
548
  global $lp_quiz_question;
@@ -560,7 +560,7 @@ if ( ! class_exists( 'LP_Course_Item' ) ) {
560
  * @param int $course_id
561
  *
562
  * @return mixed
563
- * @depecated 4.1.7.2
564
  */
565
  /*public function get_status_classes( $user_id = 0, $course_id = 0 ) {
566
  $status_classes = array();
542
  * @param int $question_id
543
  *
544
  * @return mixed
545
+ * @deprecated 4.1.7.2
546
  */
547
  /*public function is_viewing_question( $question_id = 0 ) {
548
  global $lp_quiz_question;
560
  * @param int $course_id
561
  *
562
  * @return mixed
563
+ * @deprecated 4.1.7.2
564
  */
565
  /*public function get_status_classes( $user_id = 0, $course_id = 0 ) {
566
  $status_classes = array();
inc/course/class-lp-course-no-required-enroll.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'LP_Course' ) ) {
25
  /**
26
  * Get result do quiz
27
  *
28
- * @param $quiz
29
  * @param null $answered
30
  *
31
  * @return array
@@ -48,7 +48,7 @@ if ( ! class_exists( 'LP_Course' ) ) {
48
  'pass' => 0,
49
  );
50
 
51
- $question_ids = $quiz->get_questions();
52
  $result['question_count'] = count( $question_ids );
53
 
54
  $questions = learn_press_rest_prepare_user_questions( $question_ids );
25
  /**
26
  * Get result do quiz
27
  *
28
+ * @param LP_Quiz $quiz
29
  * @param null $answered
30
  *
31
  * @return array
48
  'pass' => 0,
49
  );
50
 
51
+ $question_ids = $quiz->get_question_ids();
52
  $result['question_count'] = count( $question_ids );
53
 
54
  $questions = learn_press_rest_prepare_user_questions( $question_ids );
inc/course/class-lp-course-section.php CHANGED
@@ -103,7 +103,7 @@ class LP_Course_Section extends LP_Abstract_Object_Data {
103
  * @param array $item
104
  *
105
  * @return bool|LP_Course_Item
106
- * @depecated 4.1.6.9
107
  */
108
  /*protected function get_item( $item ) {
109
  if ( ! is_numeric( $item ) ) {
103
  * @param array $item
104
  *
105
  * @return bool|LP_Course_Item
106
+ * @deprecated 4.1.6.9
107
  */
108
  /*protected function get_item( $item ) {
109
  if ( ! is_numeric( $item ) ) {
inc/course/class-lp-course-utils.php DELETED
@@ -1,107 +0,0 @@
1
- <?php
2
- /**
3
- * Class LP_Course_Utils
4
- *
5
- * @depecated 4.1.6.9
6
- */
7
- class LP_Course_Utils {
8
-
9
- /**
10
- * Get section data from cache.
11
- *
12
- * @param int $course_id
13
- * @param string $return
14
- *
15
- * @return false|mixed
16
- * @since 4.0.0
17
- */
18
- public static function get_cached_db_sections( $course_id, $return = '' ) {
19
- if ( $return === 'ids' ) {
20
- return LP_Object_Cache::get( $course_id, 'learn-press/course-sections-ids' );
21
-
22
- }
23
-
24
- return LP_Object_Cache::get( 'course-' . $course_id, 'learn-press/course-sections' );
25
- }
26
-
27
- /**
28
- * Set section data to cache.
29
- *
30
- * @param $course_id
31
- * @param $sections
32
- *
33
- * @return bool
34
- * @since 4.0.0
35
- */
36
- public static function set_cache_db_sections( $course_id, $sections ) {
37
- if ( ! $sections ) {
38
- LP_Object_Cache::delete( $course_id, 'learn-press/course-sections' );
39
- LP_Object_Cache::delete( $course_id, 'learn-press/course-sections-ids' );
40
-
41
- return false;
42
- }
43
-
44
- LP_Object_Cache::set( 'course-' . $course_id, $sections, 'learn-press/course-sections' );
45
- LP_Object_Cache::set( $course_id, wp_list_pluck( $sections, 'section_id' ), 'learn-press/course-sections-ids' );
46
-
47
- return true;
48
- }
49
-
50
- public static function get_cached_section( $section_id ) {
51
- return LP_Object_Cache::get( $section_id, 'learn-press/course-sections-objects' );
52
- }
53
-
54
- public static function set_cached_section( $section_id, $section_object ) {
55
- if ( $section_object === false ) {
56
- return LP_Object_Cache::delete( $section_id, 'learn-press/course-sections-objects' );
57
- }
58
- LP_Object_Cache::set( $section_id, $section_object, 'learn-press/course-sections-objects' );
59
-
60
- return true;
61
- }
62
-
63
- /**
64
- * Return ids of all items inside a course from cache.
65
- *
66
- * @param int $course_id
67
- *
68
- * @return false|mixed
69
- */
70
- public static function get_course_items( $course_id ) {
71
- return LP_Object_Cache::get( $course_id, 'learn-press/course-item-ids' );
72
- }
73
-
74
- /**
75
- * Set ids of all items read from db of a course to cache.
76
- *
77
- * @param int $course_id
78
- * @param array $items
79
- */
80
- public static function set_course_items( $course_id, $items ) {
81
- LP_Object_Cache::set( $course_id, $items, 'learn-press/course-item-ids' );
82
- }
83
-
84
- public static function set_course_item_types( $course_id, $items ) {
85
- LP_Object_Cache::set( 'course-' . $course_id, $items, 'learn-press/course-item-types' );
86
- }
87
-
88
- public static function get_course_item_types( $course_id ) {
89
- return LP_Object_Cache::get( 'course-' . $course_id, 'learn-press/course-item-types' );
90
- }
91
-
92
- public static function set_course_items_group_types( $course_id, $items ) {
93
- LP_Object_Cache::set( 'course-' . $course_id, $items, 'learn-press/course-item-group-types' );
94
- }
95
-
96
- public static function get_course_items_group_types( $course_id ) {
97
- return LP_Object_Cache::set( 'course-' . $course_id, 'learn-press/course-item-group-types' );
98
- }
99
-
100
- public static function set_section_items( $section_id, $items ) {
101
- LP_Object_Cache::set( 'section-' . $section_id, $items, 'learn-press/section-items' );
102
- }
103
-
104
- public static function get_section_items( $section_id ) {
105
- return LP_Object_Cache::set( 'section-' . $section_id, 'learn-press/section-items' );
106
- }
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/course/class-lp-course.php CHANGED
@@ -215,7 +215,7 @@ if ( ! class_exists( 'LP_Course' ) ) {
215
  $course_start_time = $course_item_data->get_start_time()->get_raw_date();
216
  $duration = $this->get_data( 'duration' );
217
  $timestamp_expire = strtotime( $course_start_time . ' +' . $duration );
218
- $timestamp_current = strtotime( current_time( 'mysql' ) );
219
  $timestamp_remaining = $timestamp_expire - $timestamp_current;
220
 
221
  if ( $timestamp_remaining < 0 ) {
215
  $course_start_time = $course_item_data->get_start_time()->get_raw_date();
216
  $duration = $this->get_data( 'duration' );
217
  $timestamp_expire = strtotime( $course_start_time . ' +' . $duration );
218
+ $timestamp_current = time();
219
  $timestamp_remaining = $timestamp_expire - $timestamp_current;
220
 
221
  if ( $timestamp_remaining < 0 ) {
inc/course/lp-course-functions.php CHANGED
@@ -52,7 +52,7 @@ function learn_press_get_course( $the_course = 0 ) {
52
  *
53
  * @return string
54
  * @since 3.0.0
55
- * @depecated 4.1.6.9
56
  */
57
  /*function learn_press_create_course_action_nonce( $action, $course_id = 0, $user_id = 0 ) {
58
  return LP_Nonce_Helper::create_course( $action, $course_id, $user_id );
@@ -68,7 +68,7 @@ function learn_press_get_course( $the_course = 0 ) {
68
  *
69
  * @return bool
70
  * @since 3.0.0
71
- * @depecated 4.1.6.9
72
  */
73
  /*function learn_press_verify_course_action_nonce( $nonce, $action, $course_id = 0, $user_id = 0 ) {
74
  return LP_Nonce_Helper::verify_course( $nonce, $action, $course_id, $user_id );
@@ -656,7 +656,7 @@ add_filter( 'get_comment_link', 'learn_press_item_comment_link', 100, 4 );
656
  * @param string $status
657
  *
658
  * @since 3.0.10
659
- * @depecated 4.1.6.9
660
  *
661
  */
662
  /*function learn_press_force_refresh_course( $comment_id, $status ) {
@@ -674,35 +674,7 @@ add_filter( 'get_comment_link', 'learn_press_item_comment_link', 100, 4 );
674
  add_action( 'comment_post', 'learn_press_force_refresh_course', 1000, 2 );*/
675
 
676
  /**
677
- * @editor tungnx | comment code
678
- * @deprecated 3.2.7.5
679
- */
680
- /*if ( ! function_exists( 'learn_press_get_sample_link_course_item_url' ) ) {
681
-
682
- function learn_press_get_sample_link_course_item_url( $item_id = null ) {
683
-
684
- if ( ! $item_id ) {
685
- return;
686
- }
687
-
688
-
689
- $permalink = get_the_permalink( $item_id );
690
- $post_name = get_post_field( 'post_name', $item_id );
691
-
692
- if ( '' != get_option( 'permalink_structure' ) ) {
693
- $permalink = $post_name;
694
- } else {
695
- $key = preg_replace( '!lp_!', '', learn_press_get_post_type( $item_id ) );
696
- $permalink = add_query_arg( array( $key => $post_name ), $permalink );
697
- }
698
-
699
- return $permalink;
700
-
701
- }
702
- }*/
703
-
704
- /**
705
- * @depecated 4.1.6.9
706
  */
707
  /*if ( ! function_exists( 'learn_press_get_nav_course_item_url' ) ) {
708
  function learn_press_get_nav_course_item_url( $course_id = null, $item_id = null, $content_only = false ) {
@@ -771,7 +743,7 @@ if ( ! function_exists( 'learn_press_edit_item_link' ) ) {
771
  /**
772
  * Get course id of an item by id
773
  *
774
- * @depecated 4.1.6.9
775
  */
776
 
777
  if ( ! function_exists( 'learn_press_get_item_course_id' ) ) {
@@ -1052,19 +1024,19 @@ function learn_press_translate_course_result_required( $course ) {
1052
  $evaluate_type = $course->get_data( 'course_result', 'evaluate_lesson' );
1053
  switch ( $evaluate_type ) {
1054
  case 'evaluate_lesson':
1055
- $label = esc_html__( 'lessons completed per total number of lessons.', 'learnpress' );
1056
  break;
1057
  case 'evaluate_quiz':
1058
- $label = esc_html__( 'quizzes passed per total number of quizzes.', 'learnpress' );
1059
  break;
1060
  case 'evaluate_final_quiz':
1061
  $label = esc_html__( 'Final Quiz', 'learnpress' );
1062
  break;
1063
  case 'evaluate_questions':
1064
- $label = esc_html__( 'correct answers per total number of questions.', 'learnpress' );
1065
  break;
1066
  case 'evaluate_mark':
1067
- $label = esc_html__( 'score achieved per total score of the questions.', 'learnpress' );
1068
  break;
1069
  default:
1070
  $label = apply_filters( 'learnpress/message/evaluate/' . $evaluate_type, $evaluate_type );
52
  *
53
  * @return string
54
  * @since 3.0.0
55
+ * @deprecated 4.1.6.9
56
  */
57
  /*function learn_press_create_course_action_nonce( $action, $course_id = 0, $user_id = 0 ) {
58
  return LP_Nonce_Helper::create_course( $action, $course_id, $user_id );
68
  *
69
  * @return bool
70
  * @since 3.0.0
71
+ * @deprecated 4.1.6.9
72
  */
73
  /*function learn_press_verify_course_action_nonce( $nonce, $action, $course_id = 0, $user_id = 0 ) {
74
  return LP_Nonce_Helper::verify_course( $nonce, $action, $course_id, $user_id );
656
  * @param string $status
657
  *
658
  * @since 3.0.10
659
+ * @deprecated 4.1.6.9
660
  *
661
  */
662
  /*function learn_press_force_refresh_course( $comment_id, $status ) {
674
  add_action( 'comment_post', 'learn_press_force_refresh_course', 1000, 2 );*/
675
 
676
  /**
677
+ * @deprecated 4.1.6.9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
  */
679
  /*if ( ! function_exists( 'learn_press_get_nav_course_item_url' ) ) {
680
  function learn_press_get_nav_course_item_url( $course_id = null, $item_id = null, $content_only = false ) {
743
  /**
744
  * Get course id of an item by id
745
  *
746
+ * @deprecated 4.1.6.9
747
  */
748
 
749
  if ( ! function_exists( 'learn_press_get_item_course_id' ) ) {
1024
  $evaluate_type = $course->get_data( 'course_result', 'evaluate_lesson' );
1025
  switch ( $evaluate_type ) {
1026
  case 'evaluate_lesson':
1027
+ $label = esc_html__( 'completed lessons per the total number of lessons.', 'learnpress' );
1028
  break;
1029
  case 'evaluate_quiz':
1030
+ $label = esc_html__( 'passed quizzes per the total number of quizzes.', 'learnpress' );
1031
  break;
1032
  case 'evaluate_final_quiz':
1033
  $label = esc_html__( 'Final Quiz', 'learnpress' );
1034
  break;
1035
  case 'evaluate_questions':
1036
+ $label = esc_html__( 'correct answers per the total number of questions.', 'learnpress' );
1037
  break;
1038
  case 'evaluate_mark':
1039
+ $label = esc_html__( 'score achieved per the total score of the questions.', 'learnpress' );
1040
  break;
1041
  default:
1042
  $label = apply_filters( 'learnpress/message/evaluate/' . $evaluate_type, $evaluate_type );
inc/curds/class-lp-course-curd.php CHANGED
@@ -24,7 +24,7 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
24
  */
25
  public function __construct() {
26
  $this->_error_messages = array(
27
- 'COURSE_NOT_EXISTS' => __( 'Course does not exist.', 'learnpress' ),
28
  );
29
  }
30
 
@@ -138,7 +138,7 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
138
 
139
  $course_origin = learn_press_get_course( $course_id );
140
  if ( ! $course_origin ) {
141
- throw new Exception( 'Course is invalid' );
142
  }
143
 
144
  $course_id_new = learn_press_duplicate_post( $course_id, $args );
@@ -279,7 +279,7 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
279
  * @param bool $publish_only
280
  *
281
  * @return array
282
- * @depecated 4.1.6.9
283
  */
284
  /*public function read_course_items( $course_id, $publish_only = true, $section_ids = array() ) {
285
  global $wpdb;
@@ -384,7 +384,7 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
384
  }
385
 
386
  /**
387
- * @depecated 4.1.6.9
388
  */
389
  /*public static function update_items_format( $item ) {
390
 
@@ -554,7 +554,7 @@ if ( ! class_exists( 'LP_Course_CURD' ) ) {
554
  *
555
  * @return mixed|array
556
  * @version 4.0.0
557
- * @depecated 4.1.6.9
558
  */
559
  /*public function read_course_sections( $course_id ) {
560
  global $wpdb;
24
  */
25
  public function __construct() {
26
  $this->_error_messages = array(
27
+ 'COURSE_NOT_EXISTS' => __( 'The course does not exist.', 'learnpress' ),
28
  );
29
  }
30
 
138
 
139
  $course_origin = learn_press_get_course( $course_id );
140
  if ( ! $course_origin ) {
141
+ throw new Exception( 'The course is invalid!' );
142
  }
143
 
144
  $course_id_new = learn_press_duplicate_post( $course_id, $args );
279
  * @param bool $publish_only
280
  *
281
  * @return array
282
+ * @deprecated 4.1.6.9
283
  */
284
  /*public function read_course_items( $course_id, $publish_only = true, $section_ids = array() ) {
285
  global $wpdb;
384
  }
385
 
386
  /**
387
+ * @deprecated 4.1.6.9
388
  */
389
  /*public static function update_items_format( $item ) {
390
 
554
  *
555
  * @return mixed|array
556
  * @version 4.0.0
557
+ * @deprecated 4.1.6.9
558
  */
559
  /*public function read_course_sections( $course_id ) {
560
  global $wpdb;
inc/curds/class-lp-lesson-curd.php CHANGED
@@ -97,7 +97,7 @@ if ( ! class_exists( 'LP_Lesson_CURD' ) ) {
97
  */
98
  public function duplicate( &$lesson_id, $args = array() ) {
99
  if ( ! $lesson_id ) {
100
- return new WP_Error( '0', 'Op! ID not found' );
101
  }
102
 
103
  if ( get_post_type( $lesson_id ) != LP_LESSON_CPT ) {
97
  */
98
  public function duplicate( &$lesson_id, $args = array() ) {
99
  if ( ! $lesson_id ) {
100
+ return new WP_Error( '0', 'Oops! ID not found' );
101
  }
102
 
103
  if ( get_post_type( $lesson_id ) != LP_LESSON_CPT ) {
inc/curds/class-lp-order-curd.php CHANGED
@@ -29,7 +29,7 @@ class LP_Order_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
29
  return false;
30
  }
31
 
32
- $order->set_order_date( current_time( 'mysql' ) );
33
  $order->set_order_key( learn_press_generate_order_key() );
34
 
35
  $order_data = array(
@@ -503,11 +503,11 @@ class LP_Order_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
503
  $user = learn_press_get_user( $user_id );
504
 
505
  if ( ! $user || $user instanceof LP_User_Guest ) {
506
- throw new Exception( esc_html__( 'User invalid!.', 'learnpress' ) );
507
  }
508
 
509
  if ( $order->get_checkout_email() !== $user->get_email() ) {
510
- throw new Exception( esc_html__( 'Order key invalid with Email!', 'learnpress' ) );
511
  }
512
 
513
  // Set user to order and update
29
  return false;
30
  }
31
 
32
+ $order->set_order_date( time() );
33
  $order->set_order_key( learn_press_generate_order_key() );
34
 
35
  $order_data = array(
503
  $user = learn_press_get_user( $user_id );
504
 
505
  if ( ! $user || $user instanceof LP_User_Guest ) {
506
+ throw new Exception( esc_html__( 'Invalid User!', 'learnpress' ) );
507
  }
508
 
509
  if ( $order->get_checkout_email() !== $user->get_email() ) {
510
+ throw new Exception( esc_html__( 'Invalid order key with Email!', 'learnpress' ) );
511
  }
512
 
513
  // Set user to order and update
inc/curds/class-lp-question-curd.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'LP_Question_CURD' ) ) {
25
  */
26
  public function __construct() {
27
  $this->_error_messages = array(
28
- 'QUESTION_NOT_EXISTS' => __( 'Question does not exist.', 'learnpress' ),
29
  );
30
  }
31
 
@@ -147,7 +147,7 @@ if ( ! class_exists( 'LP_Question_CURD' ) ) {
147
  */
148
  public function duplicate( &$question_id, $args = array() ) {
149
  if ( ! $question_id ) {
150
- return new WP_Error( 'lp/question/curd/duplicate/err', 'Op! ID not found' );
151
  }
152
 
153
  if ( learn_press_get_post_type( $question_id ) != LP_QUESTION_CPT ) {
@@ -166,7 +166,7 @@ if ( ! class_exists( 'LP_Question_CURD' ) ) {
166
  $new_question_id = learn_press_duplicate_post( $question_id, array( 'post_status' => 'publish' ) );
167
 
168
  if ( ! $new_question_id || is_wp_error( $new_question_id ) ) {
169
- return new WP_Error( 'lp/question/curd/duplicate/err', 'Sorry! Failed to duplicate question!' );
170
  } else {
171
 
172
  // init new question
@@ -973,7 +973,7 @@ if ( ! class_exists( 'LP_Question_CURD' ) ) {
973
  * Otherwise, load from database and put to cache.
974
  *
975
  * @param $question LP_Question
976
- * @depecated 4.1.7
977
  */
978
  /*protected function _load_answer_options( &$question ) {
979
  $id = $question->get_id();
@@ -1044,7 +1044,7 @@ if ( ! class_exists( 'LP_Question_CURD' ) ) {
1044
  * @param array $answer_options
1045
  *
1046
  * @return mixed;
1047
- * @depecated 4.1.7
1048
  */
1049
  /*protected function _load_answer_option_meta( &$answer_options ) {
1050
  if ( ! $answer_options ) {
25
  */
26
  public function __construct() {
27
  $this->_error_messages = array(
28
+ 'QUESTION_NOT_EXISTS' => __( 'The question does not exist.', 'learnpress' ),
29
  );
30
  }
31
 
147
  */
148
  public function duplicate( &$question_id, $args = array() ) {
149
  if ( ! $question_id ) {
150
+ return new WP_Error( 'lp/question/curd/duplicate/err', 'Oops! ID not found' );
151
  }
152
 
153
  if ( learn_press_get_post_type( $question_id ) != LP_QUESTION_CPT ) {
166
  $new_question_id = learn_press_duplicate_post( $question_id, array( 'post_status' => 'publish' ) );
167
 
168
  if ( ! $new_question_id || is_wp_error( $new_question_id ) ) {
169
+ return new WP_Error( 'lp/question/curd/duplicate/err', 'Sorry! Failed to duplicate the question!' );
170
  } else {
171
 
172
  // init new question
973
  * Otherwise, load from database and put to cache.
974
  *
975
  * @param $question LP_Question
976
+ * @deprecated 4.1.7
977
  */
978
  /*protected function _load_answer_options( &$question ) {
979
  $id = $question->get_id();
1044
  * @param array $answer_options
1045
  *
1046
  * @return mixed;
1047
+ * @deprecated 4.1.7
1048
  */
1049
  /*protected function _load_answer_option_meta( &$answer_options ) {
1050
  if ( ! $answer_options ) {
inc/curds/class-lp-quiz-curd.php CHANGED
@@ -26,7 +26,7 @@ if ( ! function_exists( 'LP_Quiz_CURD' ) ) {
26
  */
27
  public function __construct() {
28
  $this->_error_messages = array(
29
- 'QUIZ_NOT_EXISTS' => __( 'Quiz does not exist.', 'learnpress' ),
30
  );
31
  }
32
 
@@ -202,7 +202,7 @@ if ( ! function_exists( 'LP_Quiz_CURD' ) ) {
202
  return;
203
  }
204
 
205
- $questions_origin = $quiz_origin->get_questions();
206
 
207
  foreach ( $questions_origin as $question_id_origin ) {
208
  $can_clone = true;
@@ -231,7 +231,7 @@ if ( ! function_exists( 'LP_Quiz_CURD' ) ) {
231
  /**
232
  * @param LP_Quiz $quiz
233
  *
234
- * @depecated 4.1.7
235
  */
236
  /*protected function _load_questions( &$quiz ) {
237
  $id = $quiz->get_id();
@@ -267,32 +267,37 @@ if ( ! function_exists( 'LP_Quiz_CURD' ) ) {
267
  * @param string $context
268
  *
269
  * @return array
270
- * @throws Exception
271
  */
272
- public function read_question_ids( int $quiz_id = 0, string $context = 'display' ) :array {
273
- $quiz = learn_press_get_quiz( $quiz_id );
 
274
 
275
- if ( ! $quiz ) {
276
- return array();
277
- }
 
 
278
 
279
- $lp_question_db = LP_Question_DB::getInstance();
 
 
 
 
280
 
281
- if ( $context === 'display' ) {
282
- $statuses = array( 'publish' );
283
- } else {
284
- $statuses = array( 'publish', 'draft', 'auto-draft' );
285
- }
286
 
287
- $filter = new LP_Question_Filter();
288
- $filter->quiz_id = $quiz_id;
289
- $filter->statues = $statuses;
 
290
 
291
- return $lp_question_db->get_list_question_ids_of_quiz( $filter );
292
  }
293
 
294
  /**
295
- * @depecated 4.1.7
296
  */
297
  /*public function update_question_ids( $quiz_id ) {
298
  wp_cache_delete( 'quiz-' . $quiz_id, 'quiz-questions' );
@@ -377,54 +382,6 @@ if ( ! function_exists( 'LP_Quiz_CURD' ) ) {
377
  $question_factory->load_answer_options( $question_ids );
378
  }
379
 
380
- /**
381
- * @param LP_Quiz $quiz
382
- * @depecated 4.1.6.4
383
- */
384
- protected function _update_meta_cache( &$quiz ) {
385
- _deprecated_function( __FUNCTION__, '4.1.6.4' );
386
- $meta_ids = LP_Object_Cache::get( 'questions-' . $quiz->get_id(), 'learn-press/quizzes' );
387
-
388
- if ( false === $meta_ids ) {
389
- $meta_ids = array( $quiz->get_id() );
390
- } else {
391
- $meta_ids[] = $quiz->get_id();
392
- }
393
- // LP_Helper_CURD::update_meta_cache( $meta_ids );
394
- }
395
-
396
- /**
397
- * @depecated 4.1.6.4
398
- */
399
- protected function _load_question_answer_meta( $meta_ids ) {
400
- global $wpdb;
401
-
402
- $format = array_fill( 0, sizeof( $meta_ids ), '%d' );
403
- $query = $wpdb->prepare(
404
- "
405
- SELECT *
406
- FROM {$wpdb->learnpress_question_answermeta}
407
- WHERE learnpress_question_answer_id IN(" . join( ',', $format ) . ')
408
- ',
409
- $meta_ids
410
- );
411
-
412
- $metas = $wpdb->get_results( $query );
413
-
414
- if ( $metas ) {
415
- foreach ( $metas as $meta ) {
416
- $key = $meta->meta_key;
417
- $option_key = $meta->learnpress_question_answer_id;
418
- if ( ! empty( $answer_options[ $option_key ] ) ) {
419
- if ( $key == 'checked' ) {
420
- $key = 'is_true';
421
- }
422
- $answer_options[ $option_key ][ $key ] = $meta->meta_value;
423
- }
424
- }
425
- }
426
- }
427
-
428
  /**
429
  * Sort questions by order.
430
  * Check in an array of questions if there is a key 'order'.
26
  */
27
  public function __construct() {
28
  $this->_error_messages = array(
29
+ 'QUIZ_NOT_EXISTS' => __( 'The quiz does not exist.', 'learnpress' ),
30
  );
31
  }
32
 
202
  return;
203
  }
204
 
205
+ $questions_origin = $quiz_origin->get_question_ids();
206
 
207
  foreach ( $questions_origin as $question_id_origin ) {
208
  $can_clone = true;
231
  /**
232
  * @param LP_Quiz $quiz
233
  *
234
+ * @deprecated 4.1.7
235
  */
236
  /*protected function _load_questions( &$quiz ) {
237
  $id = $quiz->get_id();
267
  * @param string $context
268
  *
269
  * @return array
 
270
  */
271
+ public function read_question_ids( int $quiz_id = 0, string $context = 'display' ): array {
272
+ $lp_question_db = LP_Question_DB::getInstance();
273
+ $question_ids = [];
274
 
275
+ try {
276
+ $quiz = learn_press_get_quiz( $quiz_id );
277
+ if ( ! $quiz ) {
278
+ return array();
279
+ }
280
 
281
+ if ( $context === 'display' ) {
282
+ $statuses = array( 'publish' );
283
+ } else {
284
+ $statuses = array( 'publish', 'draft', 'auto-draft' );
285
+ }
286
 
287
+ $filter = new LP_Question_Filter();
288
+ $filter->quiz_id = $quiz_id;
289
+ $filter->statues = $statuses;
 
 
290
 
291
+ $question_ids = $lp_question_db->get_list_question_ids_of_quiz( $filter );
292
+ } catch ( Throwable $e ) {
293
+ error_log( $e->getMessage() );
294
+ }
295
 
296
+ return $question_ids;
297
  }
298
 
299
  /**
300
+ * @deprecated 4.1.7
301
  */
302
  /*public function update_question_ids( $quiz_id ) {
303
  wp_cache_delete( 'quiz-' . $quiz_id, 'quiz-questions' );
382
  $question_factory->load_answer_options( $question_ids );
383
  }
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  /**
386
  * Sort questions by order.
387
  * Check in an array of questions if there is a key 'order'.
inc/curds/class-lp-section-curd.php CHANGED
@@ -235,7 +235,7 @@ class LP_Section_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
235
  * @param int $section_id
236
  *
237
  * @return array
238
- * @depecated 4.1.6.9 Remove when release Addon Frontend Editor 4.0.1
239
  */
240
  public function read_items( $section_id ) {
241
  global $wpdb;
@@ -561,7 +561,7 @@ class LP_Section_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
561
  *
562
  * @return bool
563
  * @version 4.0.0
564
- * @depecated 4.1.6.9
565
  */
566
  public function update_final_item() {
567
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
235
  * @param int $section_id
236
  *
237
  * @return array
238
+ * @deprecated 4.1.6.9 Remove when release Addon Frontend Editor 4.0.1
239
  */
240
  public function read_items( $section_id ) {
241
  global $wpdb;
561
  *
562
  * @return bool
563
  * @version 4.0.0
564
+ * @deprecated 4.1.6.9
565
  */
566
  public function update_final_item() {
567
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
inc/curds/class-lp-user-curd.php CHANGED
@@ -883,7 +883,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
883
  * @param int $course_id
884
  *
885
  * @return mixed
886
- * @depecated 4.1.6.9.1
887
  */
888
  /*public function get_user_items( $user_id, $course_id ) {
889
  if ( false === ( $course_data = LP_Object_Cache::get(
@@ -897,7 +897,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
897
  }*/
898
 
899
  /**
900
- * @depecated 4.1.6.9.1
901
  */
902
  /*public function get_user_completed_items( $user_id, $course_id ) {
903
  if ( ! $items = $this->get_user_items( $user_id, $course_id ) ) {
@@ -950,7 +950,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
950
  * @param int $course_id
951
  *
952
  * @return mixed
953
- * @depecated 4.1.6.9
954
  */
955
  // public function update_user_item( $user_id, $item_id, $item_data = array(), $course_id = 0 ) {
956
  // global $wpdb;
@@ -1114,7 +1114,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
1114
  * @param bool $last
1115
  *
1116
  * @return bool|mixed
1117
- * @depecated 4.1.7.2
1118
  */
1119
  /*public function get_user_item( $user_id, $item_id, $course_id = 0, $last = true ) {
1120
  $num_args = func_num_args();
@@ -1162,7 +1162,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
1162
  * @param int $user_item_id
1163
  *
1164
  * @return bool|LP_User_Item_Course
1165
- * @depecated 4.1.6.9
1166
  */
1167
  /*public function get_user_item_course( $user_item_id ) {
1168
  if ( $item = $this->get_user_item_by_id( $user_item_id, LP_COURSE_CPT ) ) {
@@ -1173,14 +1173,14 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
1173
  }*/
1174
 
1175
  /**
1176
- * @depecated 4.1.6.9
1177
  */
1178
  /*public function get_user_item_meta( $user_item_id, $meta_key, $single = true ) {
1179
  return learn_press_get_user_item_meta( $user_item_id, $meta_key, $single );
1180
  }*/
1181
 
1182
  /**
1183
- * @depecated 4.1.6.9
1184
  */
1185
  /*public function update_user_item_meta( $user_item_id, $meta_key, $meta_value, $prev = '' ) {
1186
  return learn_press_update_user_item_meta( $user_item_id, $meta_key, $meta_value, $prev );
@@ -1928,7 +1928,7 @@ class LP_User_CURD extends LP_Object_Data_CURD implements LP_Interface_CURD {
1928
 
1929
  try {
1930
  if ( ! $orders ) {
1931
- throw new Exception( __( 'No item in Order', 'learnpress' ), 0 );
1932
  }
1933
 
1934
  $course_ids = array_keys( $orders );
@@ -2139,7 +2139,7 @@ ORDER BY MAX(user_item_id) DESC";
2139
  }
2140
 
2141
  if ( username_exists( $username ) ) {
2142
- return new WP_Error( 'registration-error-username-exists', __( 'An account is already registered with that username. Please choose another.', 'learnpress' ) );
2143
  }
2144
 
2145
  $new_user = wp_insert_user(
@@ -2151,7 +2151,7 @@ ORDER BY MAX(user_item_id) DESC";
2151
  );
2152
 
2153
  if ( is_wp_error( $new_user ) ) {
2154
- return new WP_Error( 'registration-error', __( 'Failed to create user', 'learnpress' ) );
2155
  }
2156
 
2157
  return $new_user;
883
  * @param int $course_id
884
  *
885
  * @return mixed
886
+ * @deprecated 4.1.6.9.1
887
  */
888
  /*public function get_user_items( $user_id, $course_id ) {
889
  if ( false === ( $course_data = LP_Object_Cache::get(
897
  }*/
898
 
899
  /**
900
+ * @deprecated 4.1.6.9.1
901
  */
902
  /*public function get_user_completed_items( $user_id, $course_id ) {
903
  if ( ! $items = $this->get_user_items( $user_id, $course_id ) ) {
950
  * @param int $course_id
951
  *
952
  * @return mixed
953
+ * @deprecated 4.1.6.9
954
  */
955
  // public function update_user_item( $user_id, $item_id, $item_data = array(), $course_id = 0 ) {
956
  // global $wpdb;
1114
  * @param bool $last
1115
  *
1116
  * @return bool|mixed
1117
+ * @deprecated 4.1.7.2
1118
  */
1119
  /*public function get_user_item( $user_id, $item_id, $course_id = 0, $last = true ) {
1120
  $num_args = func_num_args();
1162
  * @param int $user_item_id
1163
  *
1164
  * @return bool|LP_User_Item_Course
1165
+ * @deprecated 4.1.6.9
1166
  */
1167
  /*public function get_user_item_course( $user_item_id ) {
1168
  if ( $item = $this->get_user_item_by_id( $user_item_id, LP_COURSE_CPT ) ) {
1173
  }*/
1174
 
1175
  /**
1176
+ * @deprecated 4.1.6.9
1177
  */
1178
  /*public function get_user_item_meta( $user_item_id, $meta_key, $single = true ) {
1179
  return learn_press_get_user_item_meta( $user_item_id, $meta_key, $single );
1180
  }*/
1181
 
1182
  /**
1183
+ * @deprecated 4.1.6.9
1184
  */
1185
  /*public function update_user_item_meta( $user_item_id, $meta_key, $meta_value, $prev = '' ) {
1186
  return learn_press_update_user_item_meta( $user_item_id, $meta_key, $meta_value, $prev );
1928
 
1929
  try {
1930
  if ( ! $orders ) {
1931
+ throw new Exception( __( 'There are no items in the order', 'learnpress' ), 0 );
1932
  }
1933
 
1934
  $course_ids = array_keys( $orders );
2139
  }
2140
 
2141
  if ( username_exists( $username ) ) {
2142
+ return new WP_Error( 'registration-error-username-exists', __( 'An account is already registered with that username. Please choose another one.', 'learnpress' ) );
2143
  }
2144
 
2145
  $new_user = wp_insert_user(
2151
  );
2152
 
2153
  if ( is_wp_error( $new_user ) ) {
2154
+ return new WP_Error( 'registration-error', __( 'Failed to create the user', 'learnpress' ) );
2155
  }
2156
 
2157
  return $new_user;
inc/curds/class-lp-user-item-curd.php CHANGED
@@ -18,7 +18,7 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
18
  */
19
  public function __construct() {
20
  $this->_error_messages = array(
21
- 'QUIZ_NOT_EXISTS' => __( 'Quiz does not exists.', 'learnpress' ),
22
  );
23
  }
24
 
@@ -74,7 +74,7 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
74
  protected function _load_questions( &$quiz ) {
75
  $id = $quiz->get_id();
76
  $questions = LP_Object_Cache::get( 'questions-' . $id, 'learn-press/quizzes' );
77
- if ( false === $questions || $quiz->get_no_cache() ) {
78
  global $wpdb;
79
  $questions = array();
80
  $query = $wpdb->prepare(
@@ -108,7 +108,7 @@ class LP_User_Item_CURD implements LP_Interface_CURD {
108
  /**
109
  * @param LP_Quiz $quiz
110
  *
111
- * @depecated 4.1.6.4
112
  */
113
  protected function _update_meta_cache( &$quiz ) {
114
  _deprecated_function( __FUNCTION__, '4.1.6.4' );
18
  */
19
  public function __construct() {
20
  $this->_error_messages = array(
21
+ 'QUIZ_NOT_EXISTS' => __( 'The quiz does not exist.', 'learnpress' ),
22
  );
23
  }
24
 
74
  protected function _load_questions( &$quiz ) {
75
  $id = $quiz->get_id();
76
  $questions = LP_Object_Cache::get( 'questions-' . $id, 'learn-press/quizzes' );
77
+ if ( false === $questions ) {
78
  global $wpdb;
79
  $questions = array();
80
  $query = $wpdb->prepare(
108
  /**
109
  * @param LP_Quiz $quiz
110
  *
111
+ * @deprecated 4.1.6.4
112
  */
113
  protected function _update_meta_cache( &$quiz ) {
114
  _deprecated_function( __FUNCTION__, '4.1.6.4' );
inc/custom-post-types/abstract.php CHANGED
@@ -429,7 +429,7 @@ abstract class LP_Abstract_Post_Type {
429
 
430
  $course_id = $wpdb->get_var( $query );
431
  if ( $course_id ) {
432
- return __( 'This item has already assigned to course. It will be removed from course if it is not published.', 'learnpress' );
433
  }
434
  } elseif ( LP_QUESTION_CPT === $post_type ) {
435
  $query = $wpdb->prepare(
@@ -444,7 +444,7 @@ abstract class LP_Abstract_Post_Type {
444
 
445
  $quiz_id = $wpdb->get_var( $query );
446
  if ( $quiz_id ) {
447
- return __( 'This question has already assigned to quiz. It will be removed from quiz if it is not published.', 'learnpress' );
448
  }
449
  }
450
 
@@ -904,7 +904,7 @@ abstract class LP_Abstract_Post_Type {
904
  }
905
 
906
  /**
907
- * @depecated 4.1.6.9
908
  */
909
  public function updated_messages( $messages ) {
910
  $post = get_post();
@@ -920,7 +920,7 @@ abstract class LP_Abstract_Post_Type {
920
  3 => __( 'Custom field deleted.', 'learnpress' ),
921
  4 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'updated.', 'learnpress' ) ),
922
  /* translators: %s: date and time of the revision */
923
- 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Lesson restored to revision from %s', 'learnpress' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
924
  6 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'published.', 'learnpress' ) ),
925
  7 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'saved.', 'learnpress' ) ),
926
  8 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'submitted.', 'learnpress' ) ),
429
 
430
  $course_id = $wpdb->get_var( $query );
431
  if ( $course_id ) {
432
+ return __( 'This item has already been assigned to the course. It will be removed from the course if it is not published.', 'learnpress' );
433
  }
434
  } elseif ( LP_QUESTION_CPT === $post_type ) {
435
  $query = $wpdb->prepare(
444
 
445
  $quiz_id = $wpdb->get_var( $query );
446
  if ( $quiz_id ) {
447
+ return __( 'This question has already been assigned to the quiz. It will be removed from the quiz if it is not published.', 'learnpress' );
448
  }
449
  }
450
 
904
  }
905
 
906
  /**
907
+ * @deprecated 4.1.6.9
908
  */
909
  public function updated_messages( $messages ) {
910
  $post = get_post();
920
  3 => __( 'Custom field deleted.', 'learnpress' ),
921
  4 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'updated.', 'learnpress' ) ),
922
  /* translators: %s: date and time of the revision */
923
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'The lesson has been restored to revision from %s', 'learnpress' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
924
  6 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'published.', 'learnpress' ) ),
925
  7 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'saved.', 'learnpress' ) ),
926
  8 => sprintf( '%s %s', $post_type_object->labels->singular_name, __( 'submitted.', 'learnpress' ) ),
inc/custom-post-types/course.php CHANGED
@@ -72,15 +72,15 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
72
  'new_section_item' => __( 'Create a new', 'learnpress' ),
73
  'back' => __( 'Back', 'learnpress' ),
74
  'selected_items' => __( 'Selected items', 'learnpress' ),
75
- 'confirm_trash_item' => __( 'Do you want to remove item "{{ITEM_NAME}}" to trash?', 'learnpress' ),
76
  'item_labels' => array(
77
  'singular' => __( 'Item', 'learnpress' ),
78
  'plural' => __( 'Items', 'learnpress' ),
79
  ),
80
- 'notice_sale_price' => __( 'Course sale price must less than the regular price', 'learnpress' ),
81
- 'notice_price' => __( 'Course price must greater than the sale price', 'learnpress' ),
82
- 'notice_sale_start_date' => __( 'Sale start date must before sale end date', 'learnpress' ),
83
- 'notice_sale_end_date' => __( 'Sale end date must after sale start date', 'learnpress' ),
84
  'notice_invalid_date' => __( 'Invalid date', 'learnpress' ),
85
  ),
86
  'sections' => array(
@@ -106,13 +106,13 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
106
  'parent_item_colon' => __( 'Parent Item:', 'learnpress' ),
107
  'all_items' => __( 'Courses', 'learnpress' ),
108
  'view_item' => __( 'View Course', 'learnpress' ),
109
- 'add_new_item' => __( 'Add New Course', 'learnpress' ),
110
  'add_new' => __( 'Add New', 'learnpress' ),
111
  'edit_item' => __( 'Edit Course', 'learnpress' ),
112
  'update_item' => __( 'Update Course', 'learnpress' ),
113
  'search_items' => __( 'Search Courses', 'learnpress' ),
114
  'not_found' => sprintf( __( 'You haven\'t had any courses yet. Click <a href="%s">Add new</a> to start', 'learnpress' ), admin_url( 'post-new.php?post_type=lp_course' ) ),
115
- 'not_found_in_trash' => __( 'No course found in Trash', 'learnpress' ),
116
  );
117
  $course_base = $settings->get( 'course_base' );
118
  $course_permalink = empty( $course_base ) ? _x( 'courses', 'slug', 'learnpress' ) : $course_base;
@@ -163,7 +163,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
163
  'name' => __( 'Course Categories', 'learnpress' ),
164
  'menu_name' => __( 'Course Category', 'learnpress' ),
165
  'singular_name' => __( 'Category', 'learnpress' ),
166
- 'add_new_item' => __( 'Add New Course Category', 'learnpress' ),
167
  'all_items' => __( 'All Categories', 'learnpress' ),
168
  ),
169
  'query_var' => true,
@@ -199,7 +199,7 @@ if ( ! class_exists( 'LP_Course_Post_Type' ) ) {
199
  'parent_item_colon' => null,
200
  'edit_item' => __( 'Edit Course Tag', 'learnpress' ),
201
  'update_item' => __( 'Update Course Tag', 'learnpress' ),
202
- 'add_new_item' => __( 'Add New Course Tag', 'learnpress' ),
203
  'new_item_name' => __( 'New Course Tag Name', 'learnpress' ),
204
  'separate_items_with_commas' => __( 'Separate tags with commas', 'learnpress' ),
205
  'add_or_remove_items' => __( 'Add or remove tags', 'learnpress' ),
72
  'new_section_item' => __( 'Create a new', 'learnpress' ),
73
  'back' => __( 'Back', 'learnpress' ),
74
  'selected_items' => __( 'Selected items', 'learnpress' ),
75
+ 'confirm_trash_item' => __( 'Do you want to remove the "{{ITEM_NAME}}" item from the trash?', 'learnpress' ),
76
  'item_labels' => array(
77
  'singular' => __( 'Item', 'learnpress' ),
78
  'plural' => __( 'Items', 'learnpress' ),
79
  ),
80
+ 'notice_sale_price' => __( 'The course sale price must be less than the regular price', 'learnpress' ),
81
+ 'notice_price' => __( 'The course price must be greater than the sale price', 'learnpress' ),
82
+ 'notice_sale_start_date' => __( 'The sale start date must be before the sale end date', 'learnpress' ),
83
+ 'notice_sale_end_date' => __( 'The sale end date must be after the sale start date', 'learnpress' ),
84
  'notice_invalid_date' => __( 'Invalid date', 'learnpress' ),
85
  ),
86
  'sections' => array(
106
  'parent_item_colon' => __( 'Parent Item:', 'learnpress' ),
107
  'all_items' => __( 'Courses', 'learnpress' ),
108
  'view_item' => __( 'View Course', 'learnpress' ),
109
+ 'add_new_item' => __( 'Add a New Course', 'learnpress' ),
110
  'add_new' => __( 'Add New', 'learnpress' ),
111
  'edit_item' => __( 'Edit Course', 'learnpress' ),
112
  'update_item' => __( 'Update Course', 'learnpress' ),
113
  'search_items' => __( 'Search Courses', 'learnpress' ),
114
  'not_found' => sprintf( __( 'You haven\'t had any courses yet. Click <a href="%s">Add new</a> to start', 'learnpress' ), admin_url( 'post-new.php?post_type=lp_course' ) ),
115
+ 'not_found_in_trash' => __( 'There was no course found in the trash', 'learnpress' ),
116
  );
117
  $course_base = $settings->get( 'course_base' );
118
  $course_permalink = empty( $course_base ) ? _x( 'courses', 'slug', 'learnpress' ) : $course_base;
163
  'name' => __( 'Course Categories', 'learnpress' ),
164
  'menu_name' => __( 'Course Category', 'learnpress' ),
165
  'singular_name' => __( 'Category', 'learnpress' ),
166
+ 'add_new_item' => __( 'Add A New Course Category', 'learnpress' ),
167
  'all_items' => __( 'All Categories', 'learnpress' ),
168
  ),
169
  'query_var' => true,
199
  'parent_item_colon' => null,
200
  'edit_item' => __( 'Edit Course Tag', 'learnpress' ),
201
  'update_item' => __( 'Update Course Tag', 'learnpress' ),
202
+ 'add_new_item' => __( 'Add A New Course Tag', 'learnpress' ),
203
  'new_item_name' => __( 'New Course Tag Name', 'learnpress' ),
204
  'separate_items_with_commas' => __( 'Separate tags with commas', 'learnpress' ),
205
  'add_or_remove_items' => __( 'Add or remove tags', 'learnpress' ),
inc/custom-post-types/lesson.php CHANGED
@@ -156,7 +156,7 @@ if ( ! class_exists( 'LP_Lesson_Post_Type' ) ) {
156
  'name' => esc_html__( 'Lessons', 'learnpress' ),
157
  'menu_name' => esc_html__( 'Lessons', 'learnpress' ),
158
  'singular_name' => esc_html__( 'Lesson', 'learnpress' ),
159
- 'add_new_item' => esc_html__( 'Add New Lesson', 'learnpress' ),
160
  'all_items' => esc_html__( 'Lessons', 'learnpress' ),
161
  'view_item' => esc_html__( 'View Lesson', 'learnpress' ),
162
  'add_new' => esc_html__( 'Add New', 'learnpress' ),
@@ -164,7 +164,7 @@ if ( ! class_exists( 'LP_Lesson_Post_Type' ) ) {
164
  'update_item' => esc_html__( 'Update Lesson', 'learnpress' ),
165
  'search_items' => esc_html__( 'Search Lessons', 'learnpress' ),
166
  'not_found' => esc_html__( 'No lesson found', 'learnpress' ),
167
- 'not_found_in_trash' => esc_html__( 'No lesson found in Trash', 'learnpress' ),
168
  ),
169
  'public' => true,
170
  'query_var' => true,
156
  'name' => esc_html__( 'Lessons', 'learnpress' ),
157
  'menu_name' => esc_html__( 'Lessons', 'learnpress' ),
158
  'singular_name' => esc_html__( 'Lesson', 'learnpress' ),
159
+ 'add_new_item' => esc_html__( 'Add A New Lesson', 'learnpress' ),
160
  'all_items' => esc_html__( 'Lessons', 'learnpress' ),
161
  'view_item' => esc_html__( 'View Lesson', 'learnpress' ),
162
  'add_new' => esc_html__( 'Add New', 'learnpress' ),
164
  'update_item' => esc_html__( 'Update Lesson', 'learnpress' ),
165
  'search_items' => esc_html__( 'Search Lessons', 'learnpress' ),
166
  'not_found' => esc_html__( 'No lesson found', 'learnpress' ),
167
+ 'not_found_in_trash' => esc_html__( 'There was no lesson found in the trash', 'learnpress' ),
168
  ),
169
  'public' => true,
170
  'query_var' => true,
inc/custom-post-types/order.php CHANGED
@@ -379,7 +379,7 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
379
  <script type="text/javascript">
380
  jQuery(function ($) {
381
  $('#post-search-input').prop('placeholder',
382
- '<?php esc_attr_e( 'Order number, course name etc...', 'learnpress' ); ?>').css('width', 300)
383
  })
384
  </script>
385
  <?php
@@ -774,7 +774,7 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
774
 
775
  foreach ( $items as $item ) {
776
  if ( empty( $item['course_id'] ) || get_post_type( $item['course_id'] ) !== LP_COURSE_CPT ) {
777
- $links[] = apply_filters( 'learn-press/order-item-not-course-id', esc_html__( 'Course does not exist', 'learnpress' ), $item );
778
  } elseif ( get_post_status( $item['course_id'] ) !== 'publish' ) {
779
  $links[] = get_the_title( $item['course_id'] ) . sprintf( ' (#%d - %s)', $item['course_id'], esc_html__( 'Deleted', 'learnpress' ) );
780
  } else {
@@ -823,7 +823,7 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
823
  'name' => __( 'Orders', 'learnpress' ),
824
  'menu_name' => __( 'Orders', 'learnpress' ),
825
  'singular_name' => __( 'Order', 'learnpress' ),
826
- 'add_new_item' => __( 'Add New Order', 'learnpress' ),
827
  'edit_item' => __( 'Order Details', 'learnpress' ),
828
  'all_items' => __( 'Orders', 'learnpress' ),
829
  'view_item' => __( 'View Order', 'learnpress' ),
@@ -831,7 +831,7 @@ if ( ! class_exists( 'LP_Order_Post_Type' ) ) {
831
  'update_item' => __( 'Update Order', 'learnpress' ),
832
  'search_items' => __( 'Search Orders', 'learnpress' ),
833
  'not_found' => __( 'No order found', 'learnpress' ),
834
- 'not_found_in_trash' => __( 'No order found in Trash', 'learnpress' ),
835
  ),
836
  'public' => false,
837
  'show_ui' => true,
379
  <script type="text/javascript">
380
  jQuery(function ($) {
381
  $('#post-search-input').prop('placeholder',
382
+ '<?php esc_attr_e( 'Order number, course name, etc.', 'learnpress' ); ?>').css('width', 300)
383
  })
384
  </script>
385
  <?php
774
 
775
  foreach ( $items as $item ) {
776
  if ( empty( $item['course_id'] ) || get_post_type( $item['course_id'] ) !== LP_COURSE_CPT ) {
777
+ $links[] = apply_filters( 'learn-press/order-item-not-course-id', esc_html__( 'The course does not exist', 'learnpress' ), $item );
778
  } elseif ( get_post_status( $item['course_id'] ) !== 'publish' ) {
779
  $links[] = get_the_title( $item['course_id'] ) . sprintf( ' (#%d - %s)', $item['course_id'], esc_html__( 'Deleted', 'learnpress' ) );
780
  } else {
823
  'name' => __( 'Orders', 'learnpress' ),
824
  'menu_name' => __( 'Orders', 'learnpress' ),
825
  'singular_name' => __( 'Order', 'learnpress' ),
826
+ 'add_new_item' => __( 'Add A New Order', 'learnpress' ),
827
  'edit_item' => __( 'Order Details', 'learnpress' ),
828
  'all_items' => __( 'Orders', 'learnpress' ),
829
  'view_item' => __( 'View Order', 'learnpress' ),
831
  'update_item' => __( 'Update Order', 'learnpress' ),
832
  'search_items' => __( 'Search Orders', 'learnpress' ),
833
  'not_found' => __( 'No order found', 'learnpress' ),
834
+ 'not_found_in_trash' => __( 'There was no order found in the trash', 'learnpress' ),
835
  ),
836
  'public' => false,
837
  'show_ui' => true,
inc/custom-post-types/question.php CHANGED
@@ -163,7 +163,7 @@ if ( ! class_exists( 'LP_Question_Post_Type' ) ) {
163
  'learn-press/question-editor/i18n',
164
  array(
165
  'new_option_label' => esc_html__( 'New Option', 'learnpress' ),
166
- 'confirm_remove_blanks' => esc_html__( 'Are you sure to remove all blanks?', 'learnpress' ),
167
  )
168
  ),
169
  )
@@ -183,7 +183,7 @@ if ( ! class_exists( 'LP_Question_Post_Type' ) ) {
183
  'name' => esc_html__( 'Question Tag', 'learnpress' ),
184
  'menu_name' => esc_html__( 'Tag', 'learnpress' ),
185
  'singular_name' => esc_html__( 'Tag', 'learnpress' ),
186
- 'add_new_item' => esc_html__( 'Add New Tag', 'learnpress' ),
187
  'all_items' => esc_html__( 'All Tags', 'learnpress' ),
188
  ),
189
  'public' => true,
@@ -207,13 +207,13 @@ if ( ! class_exists( 'LP_Question_Post_Type' ) ) {
207
  'singular_name' => esc_html__( 'Question', 'learnpress' ),
208
  'all_items' => esc_html__( 'Questions', 'learnpress' ),
209
  'view_item' => esc_html__( 'View Question', 'learnpress' ),
210
- 'add_new_item' => esc_html__( 'Add New Question', 'learnpress' ),
211
  'add_new' => esc_html__( 'Add New', 'learnpress' ),
212
  'edit_item' => esc_html__( 'Edit Question', 'learnpress' ),
213
  'update_item' => esc_html__( 'Update Question', 'learnpress' ),
214
  'search_items' => esc_html__( 'Search Questions', 'learnpress' ),
215
  'not_found' => esc_html__( 'No questions found', 'learnpress' ),
216
- 'not_found_in_trash' => esc_html__( 'No questions found in trash', 'learnpress' ),
217
  ),
218
  'public' => true,
219
  'publicly_queryable' => true,
163
  'learn-press/question-editor/i18n',
164
  array(
165
  'new_option_label' => esc_html__( 'New Option', 'learnpress' ),
166
+ 'confirm_remove_blanks' => esc_html__( 'Are you sure to remove all the blanks?', 'learnpress' ),
167
  )
168
  ),
169
  )
183
  'name' => esc_html__( 'Question Tag', 'learnpress' ),
184
  'menu_name' => esc_html__( 'Tag', 'learnpress' ),
185
  'singular_name' => esc_html__( 'Tag', 'learnpress' ),
186
+ 'add_new_item' => esc_html__( 'Add A New Tag', 'learnpress' ),
187
  'all_items' => esc_html__( 'All Tags', 'learnpress' ),
188
  ),
189
  'public' => true,
207
  'singular_name' => esc_html__( 'Question', 'learnpress' ),
208
  'all_items' => esc_html__( 'Questions', 'learnpress' ),
209
  'view_item' => esc_html__( 'View Question', 'learnpress' ),
210
+ 'add_new_item' => esc_html__( 'Add A New Question', 'learnpress' ),
211
  'add_new' => esc_html__( 'Add New', 'learnpress' ),
212
  'edit_item' => esc_html__( 'Edit Question', 'learnpress' ),
213
  'update_item' => esc_html__( 'Update Question', 'learnpress' ),
214
  'search_items' => esc_html__( 'Search Questions', 'learnpress' ),
215
  'not_found' => esc_html__( 'No questions found', 'learnpress' ),
216
+ 'not_found_in_trash' => esc_html__( 'There was no questions found in the trash', 'learnpress' ),
217
  ),
218
  'public' => true,
219
  'publicly_queryable' => true,
inc/custom-post-types/quiz.php CHANGED
@@ -85,7 +85,7 @@ if ( ! class_exists( 'LP_Quiz_Post_Type' ) ) {
85
  'name' => esc_html__( 'Quizzes', 'learnpress' ),
86
  'menu_name' => esc_html__( 'Quizzes', 'learnpress' ),
87
  'singular_name' => esc_html__( 'Quiz', 'learnpress' ),
88
- 'add_new_item' => esc_html__( 'Add New Quiz', 'learnpress' ),
89
  'edit_item' => esc_html__( 'Edit Quiz', 'learnpress' ),
90
  'all_items' => esc_html__( 'Quizzes', 'learnpress' ),
91
  'view_item' => esc_html__( 'View Quiz', 'learnpress' ),
@@ -93,7 +93,7 @@ if ( ! class_exists( 'LP_Quiz_Post_Type' ) ) {
93
  'update_item' => esc_html__( 'Update Quiz', 'learnpress' ),
94
  'search_items' => esc_html__( 'Search Quizzes', 'learnpress' ),
95
  'not_found' => sprintf( __( 'You haven\'t had any quizzes yet. Click <a href="%s">Add new</a> to start', 'learnpress' ), admin_url( 'post-new.php?post_type=lp_quiz' ) ),
96
- 'not_found_in_trash' => esc_html__( 'No quiz found in Trash', 'learnpress' ),
97
  ),
98
  'public' => true,
99
  'publicly_queryable' => true,
@@ -169,12 +169,12 @@ if ( ! class_exists( 'LP_Quiz_Post_Type' ) ) {
169
  'back' => esc_html__( 'Back', 'learnpress' ),
170
  'selected_items' => esc_html__( 'Selected items', 'learnpress' ),
171
  'new_option' => esc_html__( 'New Option', 'learnpress' ),
172
- 'confirm_trash_question' => esc_html__( 'Do you want to move question "{{QUESTION_NAME}}" to trash?', 'learnpress' ),
173
  'question_labels' => array(
174
  'singular' => esc_html__( 'Question', 'learnpress' ),
175
  'plural' => esc_html__( 'Questions', 'learnpress' ),
176
  ),
177
- 'confirm_remove_blanks' => esc_html__( 'Are you sure to remove all blanks?', 'learnpress' ),
178
  )
179
  ),
180
  'listQuestions' => array(
85
  'name' => esc_html__( 'Quizzes', 'learnpress' ),
86
  'menu_name' => esc_html__( 'Quizzes', 'learnpress' ),
87
  'singular_name' => esc_html__( 'Quiz', 'learnpress' ),
88
+ 'add_new_item' => esc_html__( 'Add A New Quiz', 'learnpress' ),
89
  'edit_item' => esc_html__( 'Edit Quiz', 'learnpress' ),
90
  'all_items' => esc_html__( 'Quizzes', 'learnpress' ),
91
  'view_item' => esc_html__( 'View Quiz', 'learnpress' ),
93
  'update_item' => esc_html__( 'Update Quiz', 'learnpress' ),
94
  'search_items' => esc_html__( 'Search Quizzes', 'learnpress' ),
95
  'not_found' => sprintf( __( 'You haven\'t had any quizzes yet. Click <a href="%s">Add new</a> to start', 'learnpress' ), admin_url( 'post-new.php?post_type=lp_quiz' ) ),
96
+ 'not_found_in_trash' => esc_html__( 'There was no quiz found in the trash', 'learnpress' ),
97
  ),
98
  'public' => true,
99
  'publicly_queryable' => true,
169
  'back' => esc_html__( 'Back', 'learnpress' ),
170
  'selected_items' => esc_html__( 'Selected items', 'learnpress' ),
171
  'new_option' => esc_html__( 'New Option', 'learnpress' ),
172
+ 'confirm_trash_question' => esc_html__( 'Do you want to move the "{{QUESTION_NAME}}" question to the trash?', 'learnpress' ),
173
  'question_labels' => array(
174
  'singular' => esc_html__( 'Question', 'learnpress' ),
175
  'plural' => esc_html__( 'Questions', 'learnpress' ),
176
  ),
177
+ 'confirm_remove_blanks' => esc_html__( 'Are you sure to remove all the blanks?', 'learnpress' ),
178
  )
179
  ),
180
  'listQuestions' => array(
inc/databases/class-lp-course-db.php CHANGED
@@ -203,41 +203,6 @@ class LP_Course_DB extends LP_Database {
203
  return $first_item_id;
204
  }
205
 
206
- /**
207
- * Get popular courses.
208
- *
209
- * @param LP_Course_Filter $filter
210
- *
211
- * @return array
212
- * @author tungnx
213
- * @version 1.0.0
214
- * @depecated 4.1.6.4
215
- */
216
- /*public function get_popular_courses( LP_Course_Filter $filter ): array {
217
- $offset = ( absint( $filter->page ) - 1 ) * $filter->limit;
218
- $sql_limit = $this->wpdb->prepare( 'LIMIT %d, %d', $offset, $filter->limit );
219
-
220
- $query = apply_filters(
221
- 'learn-press/course-curd/query-popular-courses',
222
- $this->wpdb->prepare(
223
- "SELECT DISTINCT(item_id), COUNT(item_id) as total
224
- FROM $this->tb_lp_user_items
225
- WHERE item_type = %s
226
- AND ( status = %s OR status = %s OR status = %s )
227
- GROUP BY item_id
228
- ORDER BY total DESC
229
- {$sql_limit}
230
- ",
231
- LP_COURSE_CPT,
232
- LP_COURSE_ENROLLED,
233
- LP_COURSE_FINISHED,
234
- LP_COURSE_PURCHASED
235
- )
236
- );
237
-
238
- return $this->wpdb->get_col( $query );
239
- }*/
240
-
241
  public function get_recent_courses( LP_Course_Filter $filter ) : array {
242
  global $wpdb;
243
 
203
  return $first_item_id;
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  public function get_recent_courses( LP_Course_Filter $filter ) : array {
207
  global $wpdb;
208
 
inc/databases/class-lp-order-db.php CHANGED
@@ -94,7 +94,7 @@ class LP_Order_DB extends LP_Database {
94
  public function delete_order_item( LP_Order_Filter $filter ) {
95
  // Check valid user.
96
  if ( ! current_user_can( 'administrator' ) ) {
97
- throw new Exception( __( 'User invalid!', 'learnpress' ) );
98
  }
99
 
100
  if ( empty( $filter->order_item_ids ) ) {
@@ -128,7 +128,7 @@ class LP_Order_DB extends LP_Database {
128
  public function delete_order_itemmeta( LP_Order_Filter $filter ) {
129
  // Check valid user.
130
  if ( ! current_user_can( 'administrator' ) ) {
131
- throw new Exception( __( 'User invalid!', 'learnpress' ) );
132
  }
133
 
134
  if ( empty( $filter->order_item_ids ) ) {
94
  public function delete_order_item( LP_Order_Filter $filter ) {
95
  // Check valid user.
96
  if ( ! current_user_can( 'administrator' ) ) {
97
+ throw new Exception( __( 'Invalid user!', 'learnpress' ) );
98
  }
99
 
100
  if ( empty( $filter->order_item_ids ) ) {
128
  public function delete_order_itemmeta( LP_Order_Filter $filter ) {
129
  // Check valid user.
130
  if ( ! current_user_can( 'administrator' ) ) {
131
+ throw new Exception( __( 'Invalid user!', 'learnpress' ) );
132
  }
133
 
134
  if ( empty( $filter->order_item_ids ) ) {
inc/databases/class-lp-section-db.php CHANGED
@@ -89,7 +89,7 @@ class LP_Section_DB extends LP_Database {
89
  public function delete_section( LP_Section_Filter $filter ) {
90
  // Check valid user.
91
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->author_id_course ) ) {
92
- throw new Exception( __FUNCTION__ . ': User invalid!' );
93
  }
94
 
95
  if ( empty( $filter->section_ids ) ) {
@@ -122,7 +122,7 @@ class LP_Section_DB extends LP_Database {
122
  public function delete_section_items( LP_Section_Filter $filter ) {
123
  // Check valid user.
124
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->author_id_course ) ) {
125
- throw new Exception( __FUNCTION__ . ': User invalid!' );
126
  }
127
 
128
  if ( empty( $filter->section_ids ) ) {
89
  public function delete_section( LP_Section_Filter $filter ) {
90
  // Check valid user.
91
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->author_id_course ) ) {
92
+ throw new Exception( __FUNCTION__ . ': Invalid user!' );
93
  }
94
 
95
  if ( empty( $filter->section_ids ) ) {
122
  public function delete_section_items( LP_Section_Filter $filter ) {
123
  // Check valid user.
124
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->author_id_course ) ) {
125
+ throw new Exception( __FUNCTION__ . ': Invalid user!' );
126
  }
127
 
128
  if ( empty( $filter->section_ids ) ) {
inc/databases/class-lp-user-items-db.php CHANGED
@@ -108,7 +108,7 @@ class LP_User_Items_DB extends LP_Database {
108
 
109
  // Check valid user.
110
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->user_id ) ) {
111
- throw new Exception( __( 'User invalid!', 'learnpress' ) . ' | ' . __FUNCTION__ );
112
  }
113
 
114
  if ( - 1 < $filter->limit ) {
@@ -454,7 +454,7 @@ class LP_User_Items_DB extends LP_Database {
454
  try {
455
  // Check valid user.
456
  if ( ! is_user_logged_in() ) {
457
- throw new Exception( __( 'User invalid!', 'learnpress' ) . ' | ' . __FUNCTION__ );
458
  }
459
 
460
  $query = $this->wpdb->prepare(
@@ -644,7 +644,7 @@ class LP_User_Items_DB extends LP_Database {
644
  public function update_user_id_by_order( LP_User_Items_Filter $filter ) {
645
  // Check valid user.
646
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->user_id ) ) {
647
- throw new Exception( __FUNCTION__ . ': User invalid!' );
648
  }
649
 
650
  $query = $this->wpdb->prepare(
108
 
109
  // Check valid user.
110
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->user_id ) ) {
111
+ throw new Exception( __( 'Invalid user!', 'learnpress' ) . ' | ' . __FUNCTION__ );
112
  }
113
 
114
  if ( - 1 < $filter->limit ) {
454
  try {
455
  // Check valid user.
456
  if ( ! is_user_logged_in() ) {
457
+ throw new Exception( __( 'Invalid user!', 'learnpress' ) . ' | ' . __FUNCTION__ );
458
  }
459
 
460
  $query = $this->wpdb->prepare(
644
  public function update_user_id_by_order( LP_User_Items_Filter $filter ) {
645
  // Check valid user.
646
  if ( ! is_user_logged_in() || ( ! current_user_can( ADMIN_ROLE ) && get_current_user_id() != $filter->user_id ) ) {
647
+ throw new Exception( __FUNCTION__ . ': Invalid user!' );
648
  }
649
 
650
  $query = $this->wpdb->prepare(
inc/emails/admin/class-lp-email-cancelled-order-admin.php CHANGED
@@ -23,9 +23,9 @@ if ( ! class_exists( 'LP_Email_Cancelled_Order_Admin' ) ) {
23
  public function __construct() {
24
  $this->id = 'cancelled-order-admin';
25
  $this->title = __( 'Admin', 'learnpress' );
26
- $this->description = __( 'Send email to admin when order has been cancelled.', 'learnpress' );
27
- $this->default_subject = __( 'Order placed on {{order_date}} has been cancelled', 'learnpress' );
28
- $this->default_heading = __( 'User order has been cancelled', 'learnpress' );
29
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
30
 
31
  parent::__construct();
23
  public function __construct() {
24
  $this->id = 'cancelled-order-admin';
25
  $this->title = __( 'Admin', 'learnpress' );
26
+ $this->description = __( 'Send an email to admin when the order has been canceled.', 'learnpress' );
27
+ $this->default_subject = __( 'The order placed on {{order_date}} has been cancelled', 'learnpress' );
28
+ $this->default_heading = __( 'The user order has been cancelled', 'learnpress' );
29
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
30
 
31
  parent::__construct();
inc/emails/admin/class-lp-email-completed-order-admin.php CHANGED
@@ -24,9 +24,9 @@ if ( ! class_exists( 'LP_Email_Completed_Order_Admin' ) ) {
24
  public function __construct() {
25
  $this->id = 'completed-order-admin';
26
  $this->title = __( 'Admin', 'learnpress' );
27
- $this->description = __( 'Send email to admin when an order has been completed.', 'learnpress' );
28
- $this->default_subject = __( 'Order placed on {{order_date}} has been completed', 'learnpress' );
29
- $this->default_heading = __( 'User order has been completed', 'learnpress' );
30
  $this->recipients = get_option( 'admin_email' );
31
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
32
 
24
  public function __construct() {
25
  $this->id = 'completed-order-admin';
26
  $this->title = __( 'Admin', 'learnpress' );
27
+ $this->description = __( 'Send an email to admin when an order has been completed.', 'learnpress' );
28
+ $this->default_subject = __( 'The order placed on {{order_date}} has been completed', 'learnpress' );
29
+ $this->default_heading = __( 'The user order has been completed', 'learnpress' );
30
  $this->recipients = get_option( 'admin_email' );
31
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
32
 
inc/emails/admin/class-lp-email-enrolled-course-admin.php CHANGED
@@ -26,9 +26,9 @@ if ( ! class_exists( 'LP_Email_Enrolled_Course_Admin' ) ) {
26
  public function __construct() {
27
  $this->id = 'enrolled-course-admin';
28
  $this->title = __( 'Admin', 'learnpress' );
29
- $this->description = __( 'Send this email to admin when user has enrolled course.', 'learnpress' );
30
- $this->default_subject = __( '{{user_display_name}} has enrolled course', 'learnpress' );
31
- $this->default_heading = __( 'User has enrolled course', 'learnpress' );
32
 
33
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
34
 
26
  public function __construct() {
27
  $this->id = 'enrolled-course-admin';
28
  $this->title = __( 'Admin', 'learnpress' );
29
+ $this->description = __( 'Send an email to admin when the user has enrolled in the course.', 'learnpress' );
30
+ $this->default_subject = __( '{{user_display_name}} has enrolled in the course', 'learnpress' );
31
+ $this->default_heading = __( 'The user has enrolled in the course', 'learnpress' );
32
 
33
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
34
 
inc/emails/admin/class-lp-email-finished-course-admin.php CHANGED
@@ -24,9 +24,9 @@ if ( ! class_exists( 'LP_Email_Finished_Course_Admin' ) ) {
24
  public function __construct() {
25
  $this->id = 'finished-course-admin';
26
  $this->title = __( 'Admin', 'learnpress' );
27
- $this->description = __( 'Send this email to admin when user has finished course.', 'learnpress' );
28
- $this->default_subject = __( '{{user_display_name}} has finished course', 'learnpress' );
29
- $this->default_heading = __( 'User has finished course', 'learnpress' );
30
 
31
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
32
 
24
  public function __construct() {
25
  $this->id = 'finished-course-admin';
26
  $this->title = __( 'Admin', 'learnpress' );
27
+ $this->description = __( 'Send an email to admin when the user has finished the course.', 'learnpress' );
28
+ $this->default_subject = __( '{{user_display_name}} has completed the course.', 'learnpress' );
29
+ $this->default_heading = __( 'The user has completed the course.', 'learnpress' );
30
 
31
  $this->recipient = LP_Settings::instance()->get( 'emails_' . $this->id . '.recipients', $this->_get_admin_email() );
32
 
inc/emails/class-lp-email.php CHANGED
@@ -866,7 +866,7 @@ if ( ! class_exists( 'LP_Email' ) ) {
866
  'type' => 'text',
867
  'default' => get_option( 'admin_email' ),
868
  'id' => $this->get_field_name( 'recipients' ),
869
- 'desc' => esc_html__( 'Separate other recipients by comma.', 'learnpress' ),
870
  ),
871
  ) : array(),
872
  array(
866
  'type' => 'text',
867
  'default' => get_option( 'admin_email' ),
868
  'id' => $this->get_field_name( 'recipients' ),
869
+ 'desc' => esc_html__( 'Separate other recipients with commas.', 'learnpress' ),
870
  ),
871
  ) : array(),
872
  array(
inc/emails/guest/class-lp-email-cancelled-order-guest.php CHANGED
@@ -23,7 +23,7 @@ if ( ! class_exists( 'LP_Email_Cancelled_Order_Guest' ) ) {
23
  public function __construct() {
24
  $this->id = 'cancelled-order-guest';
25
  $this->title = __( 'Guest', 'learnpress' );
26
- $this->description = __( 'Send email to guest when order has been cancelled.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order on {{order_date}} has been cancelled', 'learnpress' );
29
  $this->default_heading = __( 'Your order has been cancelled', 'learnpress' );
23
  public function __construct() {
24
  $this->id = 'cancelled-order-guest';
25
  $this->title = __( 'Guest', 'learnpress' );
26
+ $this->description = __( 'Send an email to the guest when the order has been cancelled.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order on {{order_date}} has been cancelled', 'learnpress' );
29
  $this->default_heading = __( 'Your order has been cancelled', 'learnpress' );
inc/emails/guest/class-lp-email-completed-order-guest.php CHANGED
@@ -27,7 +27,7 @@ if ( ! class_exists( 'LP_Email_Completed_Order_Guest' ) ) {
27
  public function __construct() {
28
  $this->id = 'completed-order-guest';
29
  $this->title = __( 'Guest', 'learnpress' );
30
- $this->description = __( 'Send email to the user who has bought course as guest.', 'learnpress' );
31
 
32
  $this->default_subject = __( 'Your order on {{order_date}} has completed', 'learnpress' );
33
  $this->default_heading = __( 'Your order has completed', 'learnpress' );
27
  public function __construct() {
28
  $this->id = 'completed-order-guest';
29
  $this->title = __( 'Guest', 'learnpress' );
30
+ $this->description = __( 'Send an email to the user who has bought the course as a guest.', 'learnpress' );
31
 
32
  $this->default_subject = __( 'Your order on {{order_date}} has completed', 'learnpress' );
33
  $this->default_heading = __( 'Your order has completed', 'learnpress' );
inc/emails/guest/class-lp-email-new-order-guest.php CHANGED
@@ -23,7 +23,7 @@ if ( ! class_exists( 'LP_Email_New_Order_Guest' ) ) {
23
  public function __construct() {
24
  $this->id = 'new-order-guest';
25
  $this->title = __( 'Guest', 'learnpress' );
26
- $this->description = __( 'Send email to the user who has bought course as guest.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
29
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
23
  public function __construct() {
24
  $this->id = 'new-order-guest';
25
  $this->title = __( 'Guest', 'learnpress' );
26
+ $this->description = __( 'Send an email to the user who has bought the course as a guest.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
29
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
inc/emails/guest/class-lp-email-processing-order-guest.php CHANGED
@@ -20,7 +20,7 @@ if ( ! class_exists( 'LP_Email_Processing_Order_Guest' ) ) {
20
  public function __construct() {
21
  $this->id = 'processing-order-guest';
22
  $this->title = __( 'Guest', 'learnpress' );
23
- $this->description = __( 'Send email to user who has purchased course as a Guest when the order is processing.', 'learnpress' );
24
 
25
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
26
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
20
  public function __construct() {
21
  $this->id = 'processing-order-guest';
22
  $this->title = __( 'Guest', 'learnpress' );
23
+ $this->description = __( 'When the order is processed, send an email to the user who purchased the course as a guest.', 'learnpress' );
24
 
25
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
26
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
inc/emails/instructor/class-lp-email-cancelled-order-instructor.php CHANGED
@@ -23,10 +23,10 @@ if ( ! class_exists( 'LP_Email_Cancelled_Order_Instructor' ) ) {
23
  public function __construct() {
24
  $this->id = 'cancelled-order-instructor';
25
  $this->title = __( 'Instructor', 'learnpress' );
26
- $this->description = __( 'Send email to course instructor when order has been cancelled', 'learnpress' );
27
 
28
- $this->default_subject = __( 'Order placed on {{order_date}} has been cancelled', 'learnpress' );
29
- $this->default_heading = __( 'User order has been cancelled', 'learnpress' );
30
 
31
  parent::__construct();
32
  }
23
  public function __construct() {
24
  $this->id = 'cancelled-order-instructor';
25
  $this->title = __( 'Instructor', 'learnpress' );
26
+ $this->description = __( 'Send an email to the course instructor when the order has been cancelled.', 'learnpress' );
27
 
28
+ $this->default_subject = __( 'The order placed on {{order_date}} has been cancelled', 'learnpress' );
29
+ $this->default_heading = __( 'The user order has been cancelled', 'learnpress' );
30
 
31
  parent::__construct();
32
  }
inc/emails/instructor/class-lp-email-enrolled-course-instructor.php CHANGED
@@ -23,10 +23,10 @@ if ( ! class_exists( 'LP_Email_Enrolled_Course_Instructor' ) ) {
23
  public function __construct() {
24
  $this->id = 'enrolled-course-instructor';
25
  $this->title = __( 'Instructor', 'learnpress' );
26
- $this->description = __( 'Send this email to instructor when they have enrolled course.', 'learnpress' );
27
 
28
- $this->default_subject = __( '{{user_display_name}} has enrolled course', 'learnpress' );
29
- $this->default_heading = __( 'User has enrolled course', 'learnpress' );
30
 
31
  parent::__construct();
32
  }
23
  public function __construct() {
24
  $this->id = 'enrolled-course-instructor';
25
  $this->title = __( 'Instructor', 'learnpress' );
26
+ $this->description = __( 'Send this email to the instructor when they have enrolled in the course.', 'learnpress' );
27
 
28
+ $this->default_subject = __( '{{user_display_name}} has enrolled in the course', 'learnpress' );
29
+ $this->default_heading = __( 'The user has enrolled in the course', 'learnpress' );
30
 
31
  parent::__construct();
32
  }
inc/emails/instructor/class-lp-email-finished-course-instructor.php CHANGED
@@ -23,10 +23,10 @@ if ( ! class_exists( 'LP_Email_Finished_Course_Instructor' ) ) {
23
  public function __construct() {
24
  $this->id = 'finished-course-instructor';
25
  $this->title = __( 'Instructor', 'learnpress' );
26
- $this->description = __( 'Send this email to instructor when they have finished course.', 'learnpress' );
27
 
28
- $this->default_subject = __( '{{user_display_name}} has finished course', 'learnpress' );
29
- $this->default_heading = __( 'User has finished course', 'learnpress' );
30
 
31
  parent::__construct();
32
  }
23
  public function __construct() {
24
  $this->id = 'finished-course-instructor';
25
  $this->title = __( 'Instructor', 'learnpress' );
26
+ $this->description = __( 'Send this email to the instructor when they have finished the course.', 'learnpress' );
27
 
28
+ $this->default_subject = __( '{{user_display_name}} has completed the course.', 'learnpress' );
29
+ $this->default_heading = __( 'The user has completed the course.', 'learnpress' );
30
 
31
  parent::__construct();
32
  }
inc/emails/instructor/class-lp-email-instructor-accepted.php CHANGED
@@ -26,10 +26,10 @@ if ( ! class_exists( 'LP_Email_Instructor_Accepted' ) ) {
26
  public function __construct() {
27
  $this->id = 'instructor-accepted';
28
  $this->title = __( 'Accepted', 'learnpress' );
29
- $this->description = __( 'Become an instructor email accepted.', 'learnpress' );
30
 
31
- $this->default_subject = __( '[{{site_title}}] Your request to become an instructor accepted', 'learnpress' );
32
- $this->default_heading = __( 'Become an instructor accepted', 'learnpress' );
33
 
34
  parent::__construct();
35
  }
26
  public function __construct() {
27
  $this->id = 'instructor-accepted';
28
  $this->title = __( 'Accepted', 'learnpress' );
29
+ $this->description = __( 'Your email requesting to become an instructor has been accepted.', 'learnpress' );
30
 
31
+ $this->default_subject = __( '[{{site_title}}] Your request to become an instructor has been accepted', 'learnpress' );
32
+ $this->default_heading = __( 'Your email requesting to become an instructor has been accepted.', 'learnpress' );
33
 
34
  parent::__construct();
35
  }
inc/emails/instructor/class-lp-email-instructor-denied.php CHANGED
@@ -22,10 +22,10 @@ if ( ! class_exists( 'LP_Email_Instructor_Denied' ) ) {
22
  public function __construct() {
23
  $this->id = 'instructor-denied';
24
  $this->title = __( 'Denied', 'learnpress' );
25
- $this->description = __( 'Become an instructor email denied.', 'learnpress' );
26
 
27
- $this->default_subject = __( '[{{site_title}}] Your request to become an instructor denied', 'learnpress' );
28
- $this->default_heading = __( 'Become an instructor denied', 'learnpress' );
29
 
30
  parent::__construct();
31
  }
22
  public function __construct() {
23
  $this->id = 'instructor-denied';
24
  $this->title = __( 'Denied', 'learnpress' );
25
+ $this->description = __( 'Your email requesting to become an instructor has been denied.', 'learnpress' );
26
 
27
+ $this->default_subject = __( '[{{site_title}}] Your request to become an instructor has been denied', 'learnpress' );
28
+ $this->default_heading = __( 'Your request to become an instructor has been denied', 'learnpress' );
29
 
30
  parent::__construct();
31
  }
inc/emails/instructor/class-lp-email-new-order-instructor.php CHANGED
@@ -19,7 +19,7 @@ if ( ! class_exists( 'LP_Email_New_Order_Instructor' ) ) {
19
  public function __construct() {
20
  $this->id = 'new-order-instructor';
21
  $this->title = __( 'Instructor', 'learnpress' );
22
- $this->description = __( 'Notify instructors when a user enroll their courses.', 'learnpress' );
23
 
24
  $this->default_subject = __( 'New order placed on {{order_date}}', 'learnpress' );
25
  $this->default_heading = __( 'New user order', 'learnpress' );
19
  public function __construct() {
20
  $this->id = 'new-order-instructor';
21
  $this->title = __( 'Instructor', 'learnpress' );
22
+ $this->description = __( 'Notify instructors when a user enrolls in one of their courses.', 'learnpress' );
23
 
24
  $this->default_subject = __( 'New order placed on {{order_date}}', 'learnpress' );
25
  $this->default_heading = __( 'New user order', 'learnpress' );
inc/emails/student/class-lp-email-cancelled-order-user.php CHANGED
@@ -23,7 +23,7 @@ if ( ! class_exists( 'LP_Email_Cancelled_Order_User' ) ) {
23
  public function __construct() {
24
  $this->id = 'cancelled-order-user';
25
  $this->title = __( 'User', 'learnpress' );
26
- $this->description = __( 'Send email to user when order has been cancelled.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order on {{order_date}} has been cancelled', 'learnpress' );
29
  $this->default_heading = __( 'Your order has been cancelled', 'learnpress' );
23
  public function __construct() {
24
  $this->id = 'cancelled-order-user';
25
  $this->title = __( 'User', 'learnpress' );
26
+ $this->description = __( 'Send an email to the user when the order has been cancelled.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order on {{order_date}} has been cancelled', 'learnpress' );
29
  $this->default_heading = __( 'Your order has been cancelled', 'learnpress' );
inc/emails/student/class-lp-email-completed-order-user.php CHANGED
@@ -28,7 +28,7 @@ if ( ! class_exists( 'LP_Email_Completed_Order_User' ) ) {
28
  $this->id = 'completed-order-user';
29
  $this->title = __( 'User', 'learnpress' );
30
  $this->description = __(
31
- 'Send email to the user who has bought course when order is completed.',
32
  'learnpress'
33
  );
34
 
28
  $this->id = 'completed-order-user';
29
  $this->title = __( 'User', 'learnpress' );
30
  $this->description = __(
31
+ 'Send an email to the user who has bought the course when the order is completed.',
32
  'learnpress'
33
  );
34
 
inc/emails/student/class-lp-email-enrolled-course-user.php CHANGED
@@ -25,10 +25,10 @@ if ( ! class_exists( 'LP_Email_Enrolled_Course_User' ) ) {
25
  public function __construct() {
26
  $this->id = 'enrolled-course-user';
27
  $this->title = __( 'User', 'learnpress' );
28
- $this->description = __( 'Send this email to user when they have enrolled course.', 'learnpress' );
29
 
30
- $this->default_subject = __( '[{{site_title}}] You have enrolled in course', 'learnpress' );
31
- $this->default_heading = __( 'You have enrolled course', 'learnpress' );
32
 
33
  parent::__construct();
34
  }
25
  public function __construct() {
26
  $this->id = 'enrolled-course-user';
27
  $this->title = __( 'User', 'learnpress' );
28
+ $this->description = __( 'Send this email to the user when they have enrolled in the course.', 'learnpress' );
29
 
30
+ $this->default_subject = __( '[{{site_title}}] You have enrolled in the course', 'learnpress' );
31
+ $this->default_heading = __( 'You have enrolled in the course', 'learnpress' );
32
 
33
  parent::__construct();
34
  }
inc/emails/student/class-lp-email-finished-course-user.php CHANGED
@@ -24,10 +24,10 @@ if ( ! class_exists( 'LP_Email_Finished_Course_User' ) ) {
24
  public function __construct() {
25
  $this->id = 'finished-course-user';
26
  $this->title = __( 'User', 'learnpress' );
27
- $this->description = __( 'Send this email to user when they have finished course.', 'learnpress' );
28
 
29
- $this->default_subject = __( '[{{site_title}}] You have finished course', 'learnpress' );
30
- $this->default_heading = __( 'You have finished course', 'learnpress' );
31
 
32
  parent::__construct();
33
  }
24
  public function __construct() {
25
  $this->id = 'finished-course-user';
26
  $this->title = __( 'User', 'learnpress' );
27
+ $this->description = __( 'Send this email to the user when they have finished the course.', 'learnpress' );
28
 
29
+ $this->default_subject = __( '[{{site_title}}] You have finished the course', 'learnpress' );
30
+ $this->default_heading = __( 'You have finished the course', 'learnpress' );
31
 
32
  parent::__construct();
33
  }
inc/emails/student/class-lp-email-new-order-user.php CHANGED
@@ -23,7 +23,7 @@ if ( ! class_exists( 'LP_Email_New_Order_User' ) ) {
23
  public function __construct() {
24
  $this->id = 'new-order-user';
25
  $this->title = __( 'User', 'learnpress' );
26
- $this->description = __( 'Notify users when they successfully enroll a course.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
29
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
23
  public function __construct() {
24
  $this->id = 'new-order-user';
25
  $this->title = __( 'User', 'learnpress' );
26
+ $this->description = __( 'Notify users when they successfully enroll in a course.', 'learnpress' );
27
 
28
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
29
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
inc/emails/student/class-lp-email-processing-order-user.php CHANGED
@@ -20,7 +20,7 @@ if ( ! class_exists( 'LP_Email_Processing_Order_User' ) ) {
20
  public function __construct() {
21
  $this->id = 'processing-order-user';
22
  $this->title = __( 'User', 'learnpress' );
23
- $this->description = __( 'Notify users when their course orders are in processing.', 'learnpress' );
24
 
25
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
26
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
20
  public function __construct() {
21
  $this->id = 'processing-order-user';
22
  $this->title = __( 'User', 'learnpress' );
23
+ $this->description = __( 'Notify users when their course orders are being processed.', 'learnpress' );
24
 
25
  $this->default_subject = __( 'Your order placed on {{order_date}}', 'learnpress' );
26
  $this->default_heading = __( 'Thank you for your order', 'learnpress' );
inc/emails/types/class-lp-email-reset-password.php CHANGED
@@ -16,7 +16,7 @@ if ( ! class_exists( 'LP_Email_Reset_Password' ) ) {
16
  public function __construct() {
17
  $this->id = 'reset-password';
18
  $this->title = esc_html__( 'Reset Password', 'learnpress' );
19
- $this->description = esc_html__( 'Reset Password Email.', 'learnpress' );
20
 
21
  $this->default_subject = esc_html__( '[{{site_title}}] Reset Password', 'learnpress' );
22
  $this->default_heading = esc_html__( 'Reset Password', 'learnpress' );
16
  public function __construct() {
17
  $this->id = 'reset-password';
18
  $this->title = esc_html__( 'Reset Password', 'learnpress' );
19
+ $this->description = esc_html__( 'Password Reset Email.', 'learnpress' );
20
 
21
  $this->default_subject = esc_html__( '[{{site_title}}] Reset Password', 'learnpress' );
22
  $this->default_heading = esc_html__( 'Reset Password', 'learnpress' );
inc/emails/types/class-lp-email-type-finished-course.php CHANGED
@@ -115,12 +115,14 @@ class LP_Email_Type_Finished_Course extends LP_Email {
115
  public function set_data_content() {
116
  $course = learn_press_get_course( $this->course_id );
117
  $user = learn_press_get_user( $this->user_id );
118
-
119
  if ( ! $course || ! $user ) {
120
  return;
121
  }
122
 
123
  $user_course_data = $user->get_course_data( $this->course_id );
 
 
 
124
 
125
  $this->variables = apply_filters(
126
  'lp/email/type-finished-course/variables-mapper',
115
  public function set_data_content() {
116
  $course = learn_press_get_course( $this->course_id );
117
  $user = learn_press_get_user( $this->user_id );
 
118
  if ( ! $course || ! $user ) {
119
  return;
120
  }
121
 
122
  $user_course_data = $user->get_course_data( $this->course_id );
123
+ if ( ! $user_course_data ) {
124
+ return;
125
+ }
126
 
127
  $this->variables = apply_filters(
128
  'lp/email/type-finished-course/variables-mapper',
inc/external-plugin/elementor/widgets/become-a-teacher.php CHANGED
@@ -41,7 +41,7 @@ class LP_Elementor_Widget_Become_A_Teacher extends LP_Elementor_Widget_Base {
41
  array(
42
  'label' => esc_html__( 'Description', 'learnpress' ),
43
  'type' => Controls_Manager::TEXTAREA,
44
- 'default' => esc_html__( 'Fill in your information and send us to become a teacher.', 'learnpress' ),
45
  )
46
  );
47
 
41
  array(
42
  'label' => esc_html__( 'Description', 'learnpress' ),
43
  'type' => Controls_Manager::TEXTAREA,
44
+ 'default' => esc_html__( 'Fill in your information and send it to us to become a teacher.', 'learnpress' ),
45
  )
46
  );
47
 
inc/external-plugin/elementor/widgets/login-form.php CHANGED
@@ -28,7 +28,7 @@ class LP_Elementor_Widget_Login_Form extends LP_Elementor_Widget_Base {
28
 
29
  public function render() {
30
  if ( 'yes' !== \LP_Settings::get_option( 'enable_login_profile', 'no' ) ) {
31
- learn_press_display_message( __( 'Login form is disabled', 'learnpress' ), 'error' );
32
  }
33
 
34
  if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
28
 
29
  public function render() {
30
  if ( 'yes' !== \LP_Settings::get_option( 'enable_login_profile', 'no' ) ) {
31
+ learn_press_display_message( __( 'The login form is disabled', 'learnpress' ), 'error' );
32
  }
33
 
34
  if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
inc/external-plugin/elementor/widgets/register-form.php CHANGED
@@ -30,7 +30,7 @@ class LP_Elementor_Widget_Register_Form extends LP_Elementor_Widget_Base {
30
 
31
  public function render() {
32
  if ( 'yes' !== LP_Settings::get_option( 'enable_register_profile', 'no' ) ) {
33
- learn_press_display_message( __( 'Register form is disabled', 'learnpress' ), 'error' );
34
  }
35
 
36
  if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
30
 
31
  public function render() {
32
  if ( 'yes' !== LP_Settings::get_option( 'enable_register_profile', 'no' ) ) {
33
+ learn_press_display_message( __( 'The registration form is disabled', 'learnpress' ), 'error' );
34
  }
35
 
36
  if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
inc/gateways/offline-payment/class-lp-gateway-offline-payment.php CHANGED
@@ -163,7 +163,7 @@ if ( ! function_exists( 'LP_Gateway_Offline_Payment' ) ) {
163
  $default_status = 'completed';
164
  }
165
 
166
- $order->update_status( $default_status, __( 'Payment to be made upon delivery.', 'learnpress' ) );
167
 
168
  // Remove cart
169
  LearnPress::instance()->cart->empty_cart();
163
  $default_status = 'completed';
164
  }
165
 
166
+ $order->update_status( $default_status, __( 'Payment can be made upon delivery.', 'learnpress' ) );
167
 
168
  // Remove cart
169
  LearnPress::instance()->cart->empty_cart();
inc/gateways/paypal/class-lp-gateway-paypal.php CHANGED
@@ -90,7 +90,7 @@ if ( ! class_exists( 'LP_Gateway_Paypal' ) ) {
90
  $this->id = 'paypal';
91
 
92
  $this->method_title = esc_html__( 'PayPal', 'learnpress' );
93
- $this->method_description = esc_html__( 'Make payment via Paypal.', 'learnpress' );
94
  $this->icon = '';
95
 
96
  $this->title = esc_html__( 'PayPal', 'learnpress' );
90
  $this->id = 'paypal';
91
 
92
  $this->method_title = esc_html__( 'PayPal', 'learnpress' );
93
+ $this->method_description = esc_html__( 'Make a payment via Paypal.', 'learnpress' );
94
  $this->icon = '';
95
 
96
  $this->title = esc_html__( 'PayPal', 'learnpress' );
inc/handle-steps/class-lp-handle-steps.php CHANGED
@@ -23,12 +23,12 @@ class LP_Handle_Steps {
23
  $steps = $params['steps'] ?? array();
24
 
25
  if ( empty( $steps ) ) {
26
- throw new Exception( __( 'Steps invalid', 'learnpress' ) );
27
  }
28
 
29
  $step = $params['step'] ?? '';
30
  if ( empty( $step ) ) {
31
- throw new Exception( __( 'Step invalid', 'learnpress' ) );
32
  }
33
 
34
  $data = $params['data'] ?? array();
@@ -75,6 +75,6 @@ class LP_Handle_Steps {
75
  return call_user_func( $step_function, $data );
76
  }
77
 
78
- throw new Exception( __( 'Not found function', 'learnpress' ) . $step_function );
79
  }
80
  }
23
  $steps = $params['steps'] ?? array();
24
 
25
  if ( empty( $steps ) ) {
26
+ throw new Exception( __( 'Invalid steps', 'learnpress' ) );
27
  }
28
 
29
  $step = $params['step'] ?? '';
30
  if ( empty( $step ) ) {
31
+ throw new Exception( __( 'Invalid step', 'learnpress' ) );
32
  }
33
 
34
  $data = $params['data'] ?? array();
75
  return call_user_func( $step_function, $data );
76
  }
77
 
78
+ throw new Exception( __( 'Function not found', 'learnpress' ) . $step_function );
79
  }
80
  }
inc/jwt/includes/class-jwt-public.php CHANGED
@@ -333,7 +333,7 @@ class LP_Jwt_Public {
333
  if ( ! isset( $token->exp ) ) {
334
  return new WP_Error(
335
  'rest_authentication_missing_token_expiration',
336
- esc_html__( 'Token must have an expiration.', 'learnpress' ),
337
  array(
338
  'status' => 401,
339
  )
@@ -343,7 +343,7 @@ class LP_Jwt_Public {
343
  if ( time() > $token->exp ) {
344
  return new WP_Error(
345
  'rest_authentication_token_expired',
346
- esc_html__( 'Token has expired.', 'learnpress' ),
347
  array(
348
  'status' => 401,
349
  )
333
  if ( ! isset( $token->exp ) ) {
334
  return new WP_Error(
335
  'rest_authentication_missing_token_expiration',
336
+ esc_html__( 'The token must have an expiration date.', 'learnpress' ),
337
  array(
338
  'status' => 401,
339
  )
343
  if ( time() > $token->exp ) {
344
  return new WP_Error(
345
  'rest_authentication_token_expired',
346
+ esc_html__( 'The token has expired.', 'learnpress' ),
347
  array(
348
  'status' => 401,
349
  )
inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php CHANGED
@@ -35,7 +35,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
35
  array(
36
  'args' => array(
37
  'id' => array(
38
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
39
  'type' => 'integer',
40
  ),
41
  ),
@@ -61,7 +61,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
61
  array(
62
  'args' => array(
63
  'id' => array(
64
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
65
  'type' => 'integer',
66
  ),
67
  ),
@@ -86,7 +86,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
86
  array(
87
  'args' => array(
88
  'id' => array(
89
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
90
  'type' => 'integer',
91
  ),
92
  ),
@@ -111,7 +111,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
111
  array(
112
  'args' => array(
113
  'id' => array(
114
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
115
  'type' => 'integer',
116
  ),
117
  ),
@@ -259,7 +259,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
259
  $course_id = ! empty( $request['course-id'] ) ? absint( $request['course-id'] ) : 0;
260
 
261
  if ( empty( $password ) ) {
262
- throw new Exception( __( 'Secret key is empty.', 'learnpress' ) );
263
  }
264
 
265
  $url = LP_Settings::instance()->get( 'in_app_purchase_apple_sandbox' ) === 'yes' ? 'https://sandbox.itunes.apple.com/verifyReceipt' : 'https://buy.itunes.apple.com/verifyReceipt';
@@ -285,13 +285,13 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
285
  $body = json_decode( wp_remote_retrieve_body( $verify ) );
286
 
287
  if ( $body->status !== 0 ) {
288
- throw new Exception( __( 'Cannot verify receipt', 'learnpress' ) );
289
  }
290
 
291
  $latest_receipt_info = ! empty( $body->latest_receipt_info ) ? $body->latest_receipt_info : array();
292
 
293
  if ( empty( $latest_receipt_info ) ) {
294
- throw new Exception( __( 'Course id is invalid.', 'learnpress' ) );
295
  }
296
 
297
  $course_ids = array_map(
@@ -302,7 +302,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
302
  );
303
 
304
  if ( ! in_array( $course_id, $course_ids ) ) {
305
- throw new Exception( __( 'Course id is invalid.', 'learnpress' ) );
306
  }
307
  } else {
308
  $receipt = json_decode( $receipt, true );
@@ -311,7 +311,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
311
  $purchase_token = $receipt['purchaseToken'] ?? '';
312
 
313
  if ( ! function_exists( 'learnpress_in_app_purchase_get_access_token' ) ) {
314
- throw new Exception( __( 'Cannot verify receipt', 'learnpress' ) );
315
  }
316
 
317
  $access_token = learnpress_in_app_purchase_get_access_token();
@@ -328,7 +328,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
328
  $course = learn_press_get_course( $course_id );
329
 
330
  if ( ! $course ) {
331
- throw new Exception( __( 'Course is not exists.', 'learnpress' ) );
332
  }
333
  $user = learn_press_get_current_user();
334
 
@@ -344,7 +344,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
344
  $cart_id = $cart->add_to_cart( $course_id, 1, array() );
345
 
346
  if ( ! $cart_id ) {
347
- throw new Exception( esc_html__( 'Error: Can\'t add Course to cart.', 'learnpress' ) );
348
  }
349
 
350
  if ( is_user_logged_in() ) {
@@ -396,7 +396,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
396
  $check = $user->can_show_finish_course_btn( $course );
397
 
398
  if ( $check['status'] !== 'success' ) {
399
- throw new Exception( $check['message'] ?? esc_html__( 'Can not finish course.', 'learnpress' ) );
400
  }
401
 
402
  $finished = $user->finish_course( $course_id );
@@ -495,6 +495,8 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
495
  }
496
 
497
  /**
 
 
498
  * @throws Exception
499
  */
500
  protected function get_course_data( $course, $context = 'view' ) {
@@ -632,7 +634,6 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
632
  }
633
 
634
  $user_course_data = $user->get_course_data( $id );
635
-
636
  if ( ! $user_course_data ) {
637
  return 0;
638
  }
@@ -989,7 +990,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
989
  'type' => 'object',
990
  'properties' => array(
991
  'id' => array(
992
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
993
  'type' => 'integer',
994
  'context' => array( 'view', 'edit' ),
995
  'readonly' => true,
@@ -1046,7 +1047,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
1046
  'readonly' => true,
1047
  ),
1048
  'on_sale' => array(
1049
- 'description' => __( 'Shows if the course is on sale.', 'learnpress' ),
1050
  'type' => 'boolean',
1051
  'context' => array( 'view', 'edit' ),
1052
  'readonly' => true,
@@ -1059,7 +1060,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
1059
  'context' => array( 'view', 'edit' ),
1060
  ),
1061
  'content' => array(
1062
- 'description' => __( 'Content course.', 'learnpress' ),
1063
  'type' => 'string',
1064
  'context' => array( 'view', 'edit' ),
1065
  ),
@@ -1074,25 +1075,25 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
1074
  'context' => array( 'view' ),
1075
  ),
1076
  'count_students' => array(
1077
- 'description' => __( 'Count student enrolled', 'learnpress' ),
1078
  'type' => 'integer',
1079
  'context' => array( 'view' ),
1080
  'readonly' => true,
1081
  ),
1082
  'can_finish' => array(
1083
- 'description' => __( 'Can finish course', 'learnpress' ),
1084
  'type' => 'boolean',
1085
  'context' => array( 'view' ),
1086
  'readonly' => true,
1087
  ),
1088
  'can_retake' => array(
1089
- 'description' => __( 'Can retake course', 'learnpress' ),
1090
  'type' => 'boolean',
1091
  'context' => array( 'view' ),
1092
  'readonly' => true,
1093
  ),
1094
  'ratake_count' => array(
1095
- 'description' => __( 'Total retake', 'learnpress' ),
1096
  'type' => 'integer',
1097
  'context' => array( 'view' ),
1098
  'readonly' => true,
@@ -1365,13 +1366,13 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
1365
  $params['orderby']['enum'] = array_merge( $params['orderby']['enum'], array( 'menu_order', 'price' ) );
1366
 
1367
  $params['category'] = array(
1368
- 'description' => 'Limit result set to courses assigned a specific category ID.',
1369
  'type' => 'string',
1370
  'sanitize_callback' => 'wp_parse_id_list',
1371
  'validate_callback' => 'rest_validate_request_arg',
1372
  );
1373
  $params['tag'] = array(
1374
- 'description' => 'Limit result set to courses assigned a specific tag ID.',
1375
  'type' => 'string',
1376
  'sanitize_callback' => 'wp_parse_id_list',
1377
  'validate_callback' => 'rest_validate_request_arg',
@@ -1395,7 +1396,7 @@ class LP_Jwt_Courses_V1_Controller extends LP_REST_Jwt_Posts_Controller {
1395
  'validate_callback' => 'rest_validate_request_arg',
1396
  );
1397
  $params['optimize'] = array(
1398
- 'description' => 'Disable some fields schema.',
1399
  'type' => array( 'boolean', 'string' ),
1400
  'validate_callback' => 'wp_parse_id_list',
1401
  );
35
  array(
36
  'args' => array(
37
  'id' => array(
38
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
39
  'type' => 'integer',
40
  ),
41
  ),
61
  array(
62
  'args' => array(
63
  'id' => array(
64
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
65
  'type' => 'integer',
66
  ),
67
  ),
86
  array(
87
  'args' => array(
88
  'id' => array(
89
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
90
  'type' => 'integer',
91
  ),
92
  ),
111
  array(
112
  'args' => array(
113
  'id' => array(
114
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
115
  'type' => 'integer',
116
  ),
117
  ),
259
  $course_id = ! empty( $request['course-id'] ) ? absint( $request['course-id'] ) : 0;
260
 
261
  if ( empty( $password ) ) {
262
+ throw new Exception( __( 'The secret key is empty.', 'learnpress' ) );
263
  }
264
 
265
  $url = LP_Settings::instance()->get( 'in_app_purchase_apple_sandbox' ) === 'yes' ? 'https://sandbox.itunes.apple.com/verifyReceipt' : 'https://buy.itunes.apple.com/verifyReceipt';
285
  $body = json_decode( wp_remote_retrieve_body( $verify ) );
286
 
287
  if ( $body->status !== 0 ) {
288
+ throw new Exception( __( 'Cannot verify the receipt', 'learnpress' ) );
289
  }
290
 
291
  $latest_receipt_info = ! empty( $body->latest_receipt_info ) ? $body->latest_receipt_info : array();
292
 
293
  if ( empty( $latest_receipt_info ) ) {
294
+ throw new Exception( __( 'The course ID is invalid.', 'learnpress' ) );
295
  }
296
 
297
  $course_ids = array_map(
302
  );
303
 
304
  if ( ! in_array( $course_id, $course_ids ) ) {
305
+ throw new Exception( __( 'The course ID is invalid.', 'learnpress' ) );
306
  }
307
  } else {
308
  $receipt = json_decode( $receipt, true );
311
  $purchase_token = $receipt['purchaseToken'] ?? '';
312
 
313
  if ( ! function_exists( 'learnpress_in_app_purchase_get_access_token' ) ) {
314
+ throw new Exception( __( 'Cannot verify the receipt', 'learnpress' ) );
315
  }
316
 
317
  $access_token = learnpress_in_app_purchase_get_access_token();
328
  $course = learn_press_get_course( $course_id );
329
 
330
  if ( ! $course ) {
331
+ throw new Exception( __( 'The course ID is invalid.', 'learnpress' ) );
332
  }
333
  $user = learn_press_get_current_user();
334
 
344
  $cart_id = $cart->add_to_cart( $course_id, 1, array() );
345
 
346
  if ( ! $cart_id ) {
347
+ throw new Exception( esc_html__( 'Error: The course cannot be added to the cart.', 'learnpress' ) );
348
  }
349
 
350
  if ( is_user_logged_in() ) {
396
  $check = $user->can_show_finish_course_btn( $course );
397
 
398
  if ( $check['status'] !== 'success' ) {
399
+ throw new Exception( $check['message'] ?? esc_html__( 'Cannot finish this course.', 'learnpress' ) );
400
  }
401
 
402
  $finished = $user->finish_course( $course_id );
495
  }
496
 
497
  /**
498
+ * @param LP_Course $course
499
+ *
500
  * @throws Exception
501
  */
502
  protected function get_course_data( $course, $context = 'view' ) {
634
  }
635
 
636
  $user_course_data = $user->get_course_data( $id );
 
637
  if ( ! $user_course_data ) {
638
  return 0;
639
  }
990
  'type' => 'object',
991
  'properties' => array(
992
  'id' => array(
993
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
994
  'type' => 'integer',
995
  'context' => array( 'view', 'edit' ),
996
  'readonly' => true,
1047
  'readonly' => true,
1048
  ),
1049
  'on_sale' => array(
1050
+ 'description' => __( 'Display courses if they are on sale.', 'learnpress' ),
1051
  'type' => 'boolean',
1052
  'context' => array( 'view', 'edit' ),
1053
  'readonly' => true,
1060
  'context' => array( 'view', 'edit' ),
1061
  ),
1062
  'content' => array(
1063
+ 'description' => __( 'Course content.', 'learnpress' ),
1064
  'type' => 'string',
1065
  'context' => array( 'view', 'edit' ),
1066
  ),
1075
  'context' => array( 'view' ),
1076
  ),
1077
  'count_students' => array(
1078
+ 'description' => __( 'Count the number of enrolled students.', 'learnpress' ),
1079
  'type' => 'integer',
1080
  'context' => array( 'view' ),
1081
  'readonly' => true,
1082
  ),
1083
  'can_finish' => array(
1084
+ 'description' => __( 'Can finish the course', 'learnpress' ),
1085
  'type' => 'boolean',
1086
  'context' => array( 'view' ),
1087
  'readonly' => true,
1088
  ),
1089
  'can_retake' => array(
1090
+ 'description' => __( 'Can retake the course', 'learnpress' ),
1091
  'type' => 'boolean',
1092
  'context' => array( 'view' ),
1093
  'readonly' => true,
1094
  ),
1095
  'ratake_count' => array(
1096
+ 'description' => __( 'Total retakes', 'learnpress' ),
1097
  'type' => 'integer',
1098
  'context' => array( 'view' ),
1099
  'readonly' => true,
1366
  $params['orderby']['enum'] = array_merge( $params['orderby']['enum'], array( 'menu_order', 'price' ) );
1367
 
1368
  $params['category'] = array(
1369
+ 'description' => 'Limit the result set to courses assigned to a specific category ID.',
1370
  'type' => 'string',
1371
  'sanitize_callback' => 'wp_parse_id_list',
1372
  'validate_callback' => 'rest_validate_request_arg',
1373
  );
1374
  $params['tag'] = array(
1375
+ 'description' => 'Limit the result set to courses assigned to a specific tag ID.',
1376
  'type' => 'string',
1377
  'sanitize_callback' => 'wp_parse_id_list',
1378
  'validate_callback' => 'rest_validate_request_arg',
1396
  'validate_callback' => 'rest_validate_request_arg',
1397
  );
1398
  $params['optimize'] = array(
1399
+ 'description' => 'Disable some fields in the schema.',
1400
  'type' => array( 'boolean', 'string' ),
1401
  'validate_callback' => 'wp_parse_id_list',
1402
  );
inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php CHANGED
@@ -29,7 +29,7 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
29
  array(
30
  'args' => array(
31
  'id' => array(
32
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
33
  'type' => 'integer',
34
  ),
35
  ),
@@ -55,7 +55,7 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
55
  array(
56
  'args' => array(
57
  'id' => array(
58
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
59
  'type' => 'integer',
60
  ),
61
  ),
@@ -204,7 +204,7 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
204
  $course_id = $this->get_course_by_item_id( $id );
205
 
206
  if ( empty( $course_id ) ) {
207
- throw new Exception( esc_html__( 'Error: This lesson is not assign in Course.', 'learnpress' ) );
208
  }
209
 
210
  $course = learn_press_get_course( $course_id );
@@ -217,11 +217,11 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
217
  $result = $user->complete_lesson( $id, $course_id );
218
 
219
  if ( is_wp_error( $result ) ) {
220
- throw new Exception( $result->get_error_message() ?? esc_html__( 'Error: Cannot complete Lesson', 'learnpress' ) );
221
  }
222
 
223
  $response->status = 'success';
224
- $response->message = esc_html__( 'Congrats! You complete lesson is successfully', 'learnpress' );
225
  } catch ( \Throwable $th ) {
226
  $response->status = 'error';
227
  $response->message = $th->getMessage();
@@ -427,7 +427,7 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
427
  'type' => 'object',
428
  'properties' => array(
429
  'id' => array(
430
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
431
  'type' => 'integer',
432
  'context' => array( 'view', 'edit' ),
433
  'readonly' => true,
@@ -481,7 +481,7 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
481
  'context' => array( 'view', 'edit' ),
482
  ),
483
  'content' => array(
484
- 'description' => __( 'Content course.', 'learnpress' ),
485
  'type' => 'string',
486
  'context' => array( 'view', 'edit' ),
487
  ),
@@ -491,7 +491,7 @@ class LP_Jwt_Lessons_V1_Controller extends LP_REST_Jwt_Posts_Controller {
491
  'context' => array( 'view', 'edit' ),
492
  ),
493
  'can_finish_course' => array(
494
- 'description' => __( 'Can finish course', 'learnpress' ),
495
  'type' => 'boolean',
496
  'context' => array( 'view' ),
497
  'readonly' => true,
29
  array(
30
  'args' => array(
31
  'id' => array(
32
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
33
  'type' => 'integer',
34
  ),
35
  ),
55
  array(
56
  'args' => array(
57
  'id' => array(
58
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
59
  'type' => 'integer',
60
  ),
61
  ),
204
  $course_id = $this->get_course_by_item_id( $id );
205
 
206
  if ( empty( $course_id ) ) {
207
+ throw new Exception( esc_html__( 'Error: This lesson is not assigned in the Course.', 'learnpress' ) );
208
  }
209
 
210
  $course = learn_press_get_course( $course_id );
217
  $result = $user->complete_lesson( $id, $course_id );
218
 
219
  if ( is_wp_error( $result ) ) {
220
+ throw new Exception( $result->get_error_message() ?? esc_html__( 'Error: Cannot complete the Lesson', 'learnpress' ) );
221
  }
222
 
223
  $response->status = 'success';
224
+ $response->message = esc_html__( 'Congrats! You have completed the lesson successfully', 'learnpress' );
225
  } catch ( \Throwable $th ) {
226
  $response->status = 'error';
227
  $response->message = $th->getMessage();
427
  'type' => 'object',
428
  'properties' => array(
429
  'id' => array(
430
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
431
  'type' => 'integer',
432
  'context' => array( 'view', 'edit' ),
433
  'readonly' => true,
481
  'context' => array( 'view', 'edit' ),
482
  ),
483
  'content' => array(
484
+ 'description' => __( 'Course content.', 'learnpress' ),
485
  'type' => 'string',
486
  'context' => array( 'view', 'edit' ),
487
  ),
491
  'context' => array( 'view', 'edit' ),
492
  ),
493
  'can_finish_course' => array(
494
+ 'description' => __( 'Can finish the course', 'learnpress' ),
495
  'type' => 'boolean',
496
  'context' => array( 'view' ),
497
  'readonly' => true,
inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php CHANGED
@@ -11,7 +11,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
11
  protected $hierarchical = false;
12
 
13
  protected function get_object( $id ) {
14
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass.", 'learnpress' ), __METHOD__ ), array( 'status' => 405 ) );
15
  }
16
 
17
  public function get_items_permissions_check( $request ) {
@@ -472,7 +472,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
472
  }
473
 
474
  protected function prepare_object_for_response( $object, $request ) {
475
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass.", 'learnpress' ), __METHOD__ ), array( 'status' => 405 ) );
476
  }
477
 
478
  protected function prepare_items_query( $prepared_args = array(), $request = null ) {
@@ -503,7 +503,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
503
  $params['context']['default'] = 'view';
504
 
505
  $params['page'] = array(
506
- 'description' => __( 'Current page of the collection.', 'learnpress' ),
507
  'type' => 'integer',
508
  'default' => 1,
509
  'sanitize_callback' => 'absint',
@@ -511,7 +511,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
511
  'minimum' => 1,
512
  );
513
  $params['per_page'] = array(
514
- 'description' => __( 'Maximum number of items to be returned in result set.', 'learnpress' ),
515
  'type' => 'integer',
516
  'default' => 10,
517
  'minimum' => 1,
@@ -538,7 +538,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
538
  'validate_callback' => 'rest_validate_request_arg',
539
  );
540
  $params['exclude'] = array(
541
- 'description' => __( 'Ensure result set excludes specific IDs.', 'learnpress' ),
542
  'type' => 'array',
543
  'items' => array(
544
  'type' => 'integer',
@@ -547,7 +547,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
547
  'sanitize_callback' => 'wp_parse_id_list',
548
  );
549
  $params['include'] = array(
550
- 'description' => __( 'Limit result set to specific ids.', 'learnpress' ),
551
  'type' => 'array',
552
  'items' => array(
553
  'type' => 'integer',
@@ -562,14 +562,14 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
562
  'validate_callback' => 'rest_validate_request_arg',
563
  );
564
  $params['order'] = array(
565
- 'description' => __( 'Order sort attribute ascending or descending.', 'learnpress' ),
566
  'type' => 'string',
567
  'default' => 'desc',
568
  'enum' => array( 'asc', 'desc' ),
569
  'validate_callback' => 'rest_validate_request_arg',
570
  );
571
  $params['orderby'] = array(
572
- 'description' => __( 'Sort collection by object attribute.', 'learnpress' ),
573
  'type' => 'string',
574
  'default' => 'date',
575
  'enum' => array(
@@ -583,7 +583,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
583
  'validate_callback' => 'rest_validate_request_arg',
584
  );
585
  $params['author'] = array(
586
- 'description' => __( 'Limit result set to posts assigned to specific authors.', 'learnpress' ),
587
  'type' => 'array',
588
  'items' => array(
589
  'type' => 'integer',
@@ -591,7 +591,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
591
  'default' => array(),
592
  );
593
  $params['author_exclude'] = array(
594
- 'description' => __( 'Ensure result set excludes posts assigned to specific authors.', 'learnpress' ),
595
  'type' => 'array',
596
  'items' => array(
597
  'type' => 'integer',
@@ -599,7 +599,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
599
  'default' => array(),
600
  );
601
  $params['user'] = array(
602
- 'description' => __( 'Limit result set to posts assigned to specific authors.', 'learnpress' ),
603
  'type' => 'array',
604
  'items' => array(
605
  'type' => 'integer',
@@ -615,7 +615,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
615
 
616
  if ( $this->hierarchical ) {
617
  $params['parent'] = array(
618
- 'description' => __( 'Limit result set to those of particular parent IDs.', 'learnpress' ),
619
  'type' => 'array',
620
  'items' => array(
621
  'type' => 'integer',
@@ -624,7 +624,7 @@ abstract class LP_REST_Jwt_Posts_Controller extends LP_REST_Jwt_Controller {
624
  'default' => array(),
625
  );
626
  $params['parent_exclude'] = array(
627
- 'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'learnpress' ),
628
  'type' => 'array',
629
  'items' => array(
630
  'type' => 'integer',
11
  protected $hierarchical = false;
12
 
13
  protected function get_object( $id ) {
14
+ return new WP_Error( 'invalid-method', sprintf( __( "The method '%s' not implemented. It must be overridden in the subclass.", 'learnpress' ), __METHOD__ ), array( 'status' => 405 ) );
15
  }
16
 
17
  public function get_items_permissions_check( $request ) {
472
  }
473
 
474
  protected function prepare_object_for_response( $object, $request ) {
475
+ return new WP_Error( 'invalid-method', sprintf( __( "The method '%s' not implemented. It must be overridden in the subclass.", 'learnpress' ), __METHOD__ ), array( 'status' => 405 ) );
476
  }
477
 
478
  protected function prepare_items_query( $prepared_args = array(), $request = null ) {
503
  $params['context']['default'] = 'view';
504
 
505
  $params['page'] = array(
506
+ 'description' => __( 'The current page of the collection.', 'learnpress' ),
507
  'type' => 'integer',
508
  'default' => 1,
509
  'sanitize_callback' => 'absint',
511
  'minimum' => 1,
512
  );
513
  $params['per_page'] = array(
514
+ 'description' => __( 'The maximum number of items to be returned in the result set.', 'learnpress' ),
515
  'type' => 'integer',
516
  'default' => 10,
517
  'minimum' => 1,
538
  'validate_callback' => 'rest_validate_request_arg',
539
  );
540
  $params['exclude'] = array(
541
+ 'description' => __( 'Ensure the result set excludes specific IDs.', 'learnpress' ),
542
  'type' => 'array',
543
  'items' => array(
544
  'type' => 'integer',
547
  'sanitize_callback' => 'wp_parse_id_list',
548
  );
549
  $params['include'] = array(
550
+ 'description' => __( 'Limit the result set to specific IDs.', 'learnpress' ),
551
  'type' => 'array',
552
  'items' => array(
553
  'type' => 'integer',
562
  'validate_callback' => 'rest_validate_request_arg',
563
  );
564
  $params['order'] = array(
565
+ 'description' => __( 'Sorting attributes in ascending or descending order.', 'learnpress' ),
566
  'type' => 'string',
567
  'default' => 'desc',
568
  'enum' => array( 'asc', 'desc' ),
569
  'validate_callback' => 'rest_validate_request_arg',
570
  );
571
  $params['orderby'] = array(
572
+ 'description' => __( 'Sort collections by the object attribute.', 'learnpress' ),
573
  'type' => 'string',
574
  'default' => 'date',
575
  'enum' => array(
583
  'validate_callback' => 'rest_validate_request_arg',
584
  );
585
  $params['author'] = array(
586
+ 'description' => __( 'Limit the result set to posts assigned to specific authors.', 'learnpress' ),
587
  'type' => 'array',
588
  'items' => array(
589
  'type' => 'integer',
591
  'default' => array(),
592
  );
593
  $params['author_exclude'] = array(
594
+ 'description' => __( 'Ensure the result set excludes posts assigned to specific authors.', 'learnpress' ),
595
  'type' => 'array',
596
  'items' => array(
597
  'type' => 'integer',
599
  'default' => array(),
600
  );
601
  $params['user'] = array(
602
+ 'description' => __( 'Limit the result set to posts assigned to specific authors.', 'learnpress' ),
603
  'type' => 'array',
604
  'items' => array(
605
  'type' => 'integer',
615
 
616
  if ( $this->hierarchical ) {
617
  $params['parent'] = array(
618
+ 'description' => __( 'Limit the result set to those of particular parent IDs.', 'learnpress' ),
619
  'type' => 'array',
620
  'items' => array(
621
  'type' => 'integer',
624
  'default' => array(),
625
  );
626
  $params['parent_exclude'] = array(
627
+ 'description' => __( 'Limit the result set to all items except those of a particular parent ID.', 'learnpress' ),
628
  'type' => 'array',
629
  'items' => array(
630
  'type' => 'integer',
inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php CHANGED
@@ -29,7 +29,7 @@ class LP_Jwt_Questions_V1_Controller extends LP_REST_Jwt_Posts_Controller {
29
  array(
30
  'args' => array(
31
  'id' => array(
32
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
33
  'type' => 'integer',
34
  ),
35
  ),
@@ -194,7 +194,7 @@ class LP_Jwt_Questions_V1_Controller extends LP_REST_Jwt_Posts_Controller {
194
  'type' => 'object',
195
  'properties' => array(
196
  'id' => array(
197
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
198
  'type' => 'integer',
199
  'context' => array( 'view', 'edit' ),
200
  'readonly' => true,
@@ -248,7 +248,7 @@ class LP_Jwt_Questions_V1_Controller extends LP_REST_Jwt_Posts_Controller {
248
  'context' => array( 'view', 'edit' ),
249
  ),
250
  'content' => array(
251
- 'description' => __( 'Content course.', 'learnpress' ),
252
  'type' => 'string',
253
  'context' => array( 'view', 'edit' ),
254
  ),
29
  array(
30
  'args' => array(
31
  'id' => array(
32
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
33
  'type' => 'integer',
34
  ),
35
  ),
194
  'type' => 'object',
195
  'properties' => array(
196
  'id' => array(
197
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
198
  'type' => 'integer',
199
  'context' => array( 'view', 'edit' ),
200
  'readonly' => true,
248
  'context' => array( 'view', 'edit' ),
249
  ),
250
  'content' => array(
251
+ 'description' => __( 'Course content.', 'learnpress' ),
252
  'type' => 'string',
253
  'context' => array( 'view', 'edit' ),
254
  ),
inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php CHANGED
@@ -29,7 +29,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
29
  array(
30
  'args' => array(
31
  'id' => array(
32
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
33
  'type' => 'integer',
34
  ),
35
  ),
@@ -99,7 +99,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
99
  'type' => 'integer',
100
  ),
101
  'answered' => array(
102
- 'description' => esc_html__( 'Answer all question.', 'learnpress' ),
103
  'type' => 'object',
104
  ),
105
  ),
@@ -228,7 +228,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
228
 
229
  if ( empty( $quiz_id ) || empty( $course_id ) ) {
230
  $response->status = 'error';
231
- $response->message = esc_html__( 'No Quiz ID or Quiz is not assigned in Course.', 'learnpress' );
232
 
233
  return rest_ensure_response( $response );
234
  }
@@ -254,7 +254,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
254
 
255
  if ( empty( $quiz_id ) || empty( $course_id ) ) {
256
  $response->status = 'error';
257
- $response->message = esc_html__( 'No Quiz ID or Quiz is not assigned in Course.', 'learnpress' );
258
 
259
  return rest_ensure_response( $response );
260
  }
@@ -282,14 +282,14 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
282
 
283
  if ( empty( $quiz_id ) || empty( $course_id ) ) {
284
  $response->status = 'error';
285
- $response->message = esc_html__( 'No Quiz ID or Quiz is not assigned in Course.', 'learnpress' );
286
 
287
  return rest_ensure_response( $response );
288
  }
289
 
290
  if ( ! isset( $request['answered'] ) ) {
291
  $response->status = 'error';
292
- $response->message = esc_html__( 'No Answed param.', 'learnpress' );
293
 
294
  return rest_ensure_response( $response );
295
  }
@@ -563,7 +563,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
563
  'type' => 'object',
564
  'properties' => array(
565
  'id' => array(
566
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
567
  'type' => 'integer',
568
  'context' => array( 'view', 'edit' ),
569
  'readonly' => true,
@@ -617,7 +617,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
617
  'context' => array( 'view', 'edit' ),
618
  ),
619
  'content' => array(
620
- 'description' => __( 'Content course.', 'learnpress' ),
621
  'type' => 'string',
622
  'context' => array( 'view', 'edit' ),
623
  ),
@@ -627,7 +627,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
627
  'context' => array( 'view', 'edit' ),
628
  ),
629
  'can_finish_course' => array(
630
- 'description' => __( 'Can finish course', 'learnpress' ),
631
  'type' => 'boolean',
632
  'context' => array( 'view' ),
633
  'readonly' => true,
@@ -670,7 +670,7 @@ class LP_Jwt_Quiz_V1_Controller extends LP_REST_Jwt_Posts_Controller {
670
  ),
671
  ),
672
  'questions' => array(
673
- 'description' => __( 'List all Question in Quiz.', 'learnpress' ),
674
  'type' => 'array',
675
  'context' => array( 'view', 'edit' ),
676
  'items' => array(
29
  array(
30
  'args' => array(
31
  'id' => array(
32
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
33
  'type' => 'integer',
34
  ),
35
  ),
99
  'type' => 'integer',
100
  ),
101
  'answered' => array(
102
+ 'description' => esc_html__( 'Answer all questions.', 'learnpress' ),
103
  'type' => 'object',
104
  ),
105
  ),
228
 
229
  if ( empty( $quiz_id ) || empty( $course_id ) ) {
230
  $response->status = 'error';
231
+ $response->message = esc_html__( 'There is no Quiz ID or Quiz assigned in the course.', 'learnpress' );
232
 
233
  return rest_ensure_response( $response );
234
  }
254
 
255
  if ( empty( $quiz_id ) || empty( $course_id ) ) {
256
  $response->status = 'error';
257
+ $response->message = esc_html__( 'There is no Quiz ID or Quiz assigned in the course.', 'learnpress' );
258
 
259
  return rest_ensure_response( $response );
260
  }
282
 
283
  if ( empty( $quiz_id ) || empty( $course_id ) ) {
284
  $response->status = 'error';
285
+ $response->message = esc_html__( 'There is no Quiz ID or Quiz assigned in the course.', 'learnpress' );
286
 
287
  return rest_ensure_response( $response );
288
  }
289
 
290
  if ( ! isset( $request['answered'] ) ) {
291
  $response->status = 'error';
292
+ $response->message = esc_html__( 'No Answer param.', 'learnpress' );
293
 
294
  return rest_ensure_response( $response );
295
  }
563
  'type' => 'object',
564
  'properties' => array(
565
  'id' => array(
566
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
567
  'type' => 'integer',
568
  'context' => array( 'view', 'edit' ),
569
  'readonly' => true,
617
  'context' => array( 'view', 'edit' ),
618
  ),
619
  'content' => array(
620
+ 'description' => __( 'Course content.', 'learnpress' ),
621
  'type' => 'string',
622
  'context' => array( 'view', 'edit' ),
623
  ),
627
  'context' => array( 'view', 'edit' ),
628
  ),
629
  'can_finish_course' => array(
630
+ 'description' => __( 'Can finish the course', 'learnpress' ),
631
  'type' => 'boolean',
632
  'context' => array( 'view' ),
633
  'readonly' => true,
670
  ),
671
  ),
672
  'questions' => array(
673
+ 'description' => __( 'List all of the Quiz Questions.', 'learnpress' ),
674
  'type' => 'array',
675
  'context' => array( 'view', 'edit' ),
676
  'items' => array(
inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php CHANGED
@@ -34,14 +34,14 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
34
  $course_id = LP_Section_DB::getInstance()->get_course_id_by_section( $request['section_id'] );
35
 
36
  if ( ! $course_id ) {
37
- return new WP_Error( 'lp_section_not_course', __( 'Please assigned section to Course.', 'learnpress' ), array( 'status' => rest_authorization_required_code() ) );
38
  }
39
 
40
  $post = get_post( $course_id );
41
 
42
  $post_status_obj = get_post_status_object( $post->post_status );
43
  if ( ! $post_status_obj || ! $post_status_obj->public ) {
44
- return new WP_Error( 'lp_section_not_public', __( 'Course is not public', 'learnpress' ), array( 'status' => rest_authorization_required_code() ) );
45
  }
46
 
47
  return true;
@@ -210,7 +210,7 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
210
  'type' => 'object',
211
  'properties' => array(
212
  'id' => array(
213
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
214
  'type' => 'integer',
215
  'context' => array( 'view', 'edit' ),
216
  'readonly' => true,
@@ -312,7 +312,7 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
312
  $params['context']['default'] = 'view';
313
 
314
  $params['page'] = array(
315
- 'description' => __( 'Current page of the collection.', 'learnpress' ),
316
  'type' => 'integer',
317
  'default' => 1,
318
  'sanitize_callback' => 'absint',
@@ -320,7 +320,7 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
320
  'minimum' => 1,
321
  );
322
  $params['per_page'] = array(
323
- 'description' => __( 'Maximum number of items to be returned in result set.', 'learnpress' ),
324
  'type' => 'integer',
325
  'default' => 10,
326
  'minimum' => 1,
@@ -329,7 +329,7 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
329
  'validate_callback' => 'rest_validate_request_arg',
330
  );
331
  $params['order'] = array(
332
- 'description' => __( 'Order sort attribute ascending or descending.', 'learnpress' ),
333
  'type' => 'string',
334
  'default' => 'asc',
335
  'enum' => array( 'asc', 'desc' ),
@@ -342,7 +342,7 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
342
  'validate_callback' => 'rest_validate_request_arg',
343
  );
344
  $params['exclude'] = array(
345
- 'description' => __( 'Ensure result set excludes specific IDs.', 'learnpress' ),
346
  'type' => 'array',
347
  'items' => array(
348
  'type' => 'integer',
@@ -351,7 +351,7 @@ class LP_Jwt_Section_Items_V1_Controller extends LP_REST_Jwt_Controller {
351
  'sanitize_callback' => 'wp_parse_id_list',
352
  );
353
  $params['include'] = array(
354
- 'description' => __( 'Limit result set to specific ids.', 'learnpress' ),
355
  'type' => 'array',
356
  'items' => array(
357
  'type' => 'integer',
34
  $course_id = LP_Section_DB::getInstance()->get_course_id_by_section( $request['section_id'] );
35
 
36
  if ( ! $course_id ) {
37
+ return new WP_Error( 'lp_section_not_course', __( 'Please assign a section to the Course.', 'learnpress' ), array( 'status' => rest_authorization_required_code() ) );
38
  }
39
 
40
  $post = get_post( $course_id );
41
 
42
  $post_status_obj = get_post_status_object( $post->post_status );
43
  if ( ! $post_status_obj || ! $post_status_obj->public ) {
44
+ return new WP_Error( 'lp_section_not_public', __( 'The course is not public', 'learnpress' ), array( 'status' => rest_authorization_required_code() ) );
45
  }
46
 
47
  return true;
210
  'type' => 'object',
211
  'properties' => array(
212
  'id' => array(
213
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
214
  'type' => 'integer',
215
  'context' => array( 'view', 'edit' ),
216
  'readonly' => true,
312
  $params['context']['default'] = 'view';
313
 
314
  $params['page'] = array(
315
+ 'description' => __( 'The current page of the collection.', 'learnpress' ),
316
  'type' => 'integer',
317
  'default' => 1,
318
  'sanitize_callback' => 'absint',
320
  'minimum' => 1,
321
  );
322
  $params['per_page'] = array(
323
+ 'description' => __( 'The maximum number of items to be returned in the result set.', 'learnpress' ),
324
  'type' => 'integer',
325
  'default' => 10,
326
  'minimum' => 1,
329
  'validate_callback' => 'rest_validate_request_arg',
330
  );
331
  $params['order'] = array(
332
+ 'description' => __( 'Sorting attributes in ascending or descending order.', 'learnpress' ),
333
  'type' => 'string',
334
  'default' => 'asc',
335
  'enum' => array( 'asc', 'desc' ),
342
  'validate_callback' => 'rest_validate_request_arg',
343
  );
344
  $params['exclude'] = array(
345
+ 'description' => __( 'Ensure the result set excludes specific IDs.', 'learnpress' ),
346
  'type' => 'array',
347
  'items' => array(
348
  'type' => 'integer',
351
  'sanitize_callback' => 'wp_parse_id_list',
352
  );
353
  $params['include'] = array(
354
+ 'description' => __( 'Limit the result set to specific IDs.', 'learnpress' ),
355
  'type' => 'array',
356
  'items' => array(
357
  'type' => 'integer',
inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php CHANGED
@@ -37,7 +37,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
37
  $post_status_obj = get_post_status_object( $post->post_status );
38
 
39
  if ( ! $post_status_obj || ! $post_status_obj->public ) {
40
- return new WP_Error( 'lp_section_not_public', __( 'Course is not public', 'learnpress' ), array( 'status' => rest_authorization_required_code() ) );
41
  }
42
 
43
  return true;
@@ -113,7 +113,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
113
  'type' => 'object',
114
  'properties' => array(
115
  'id' => array(
116
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
117
  'type' => 'integer',
118
  'context' => array( 'view', 'edit' ),
119
  'readonly' => true,
@@ -140,7 +140,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
140
  $params['context']['default'] = 'view';
141
 
142
  $params['page'] = array(
143
- 'description' => __( 'Current page of the collection.', 'learnpress' ),
144
  'type' => 'integer',
145
  'default' => 1,
146
  'sanitize_callback' => 'absint',
@@ -148,7 +148,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
148
  'minimum' => 1,
149
  );
150
  $params['per_page'] = array(
151
- 'description' => __( 'Maximum number of items to be returned in result set.', 'learnpress' ),
152
  'type' => 'integer',
153
  'default' => 10,
154
  'minimum' => 1,
@@ -157,7 +157,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
157
  'validate_callback' => 'rest_validate_request_arg',
158
  );
159
  $params['order'] = array(
160
- 'description' => __( 'Order sort attribute ascending or descending.', 'learnpress' ),
161
  'type' => 'string',
162
  'default' => 'asc',
163
  'enum' => array( 'asc', 'desc' ),
@@ -170,7 +170,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
170
  'validate_callback' => 'rest_validate_request_arg',
171
  );
172
  $params['exclude'] = array(
173
- 'description' => __( 'Ensure result set excludes specific IDs.', 'learnpress' ),
174
  'type' => 'array',
175
  'items' => array(
176
  'type' => 'integer',
@@ -179,7 +179,7 @@ class LP_Jwt_Sections_V1_Controller extends LP_REST_Jwt_Controller {
179
  'sanitize_callback' => 'wp_parse_id_list',
180
  );
181
  $params['include'] = array(
182
- 'description' => __( 'Limit result set to specific ids.', 'learnpress' ),
183
  'type' => 'array',
184
  'items' => array(
185
  'type' => 'integer',
37
  $post_status_obj = get_post_status_object( $post->post_status );
38
 
39
  if ( ! $post_status_obj || ! $post_status_obj->public ) {
40
+ return new WP_Error( 'lp_section_not_public', __( 'The course is not public', 'learnpress' ), array( 'status' => rest_authorization_required_code() ) );
41
  }
42
 
43
  return true;
113
  'type' => 'object',
114
  'properties' => array(
115
  'id' => array(
116
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
117
  'type' => 'integer',
118
  'context' => array( 'view', 'edit' ),
119
  'readonly' => true,
140
  $params['context']['default'] = 'view';
141
 
142
  $params['page'] = array(
143
+ 'description' => __( 'The current page of the collection.', 'learnpress' ),
144
  'type' => 'integer',
145
  'default' => 1,
146
  'sanitize_callback' => 'absint',
148
  'minimum' => 1,
149
  );
150
  $params['per_page'] = array(
151
+ 'description' => __( 'The maximum number of items to be returned in the result set.', 'learnpress' ),
152
  'type' => 'integer',
153
  'default' => 10,
154
  'minimum' => 1,
157
  'validate_callback' => 'rest_validate_request_arg',
158
  );
159
  $params['order'] = array(
160
+ 'description' => __( 'Sorting attributes in ascending or descending order.', 'learnpress' ),
161
  'type' => 'string',
162
  'default' => 'asc',
163
  'enum' => array( 'asc', 'desc' ),
170
  'validate_callback' => 'rest_validate_request_arg',
171
  );
172
  $params['exclude'] = array(
173
+ 'description' => __( 'Ensure the result set excludes specific IDs.', 'learnpress' ),
174
  'type' => 'array',
175
  'items' => array(
176
  'type' => 'integer',
179
  'sanitize_callback' => 'wp_parse_id_list',
180
  );
181
  $params['include'] = array(
182
+ 'description' => __( 'Limit the result set to specific IDs.', 'learnpress' ),
183
  'type' => 'array',
184
  'items' => array(
185
  'type' => 'integer',
inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php CHANGED
@@ -39,7 +39,7 @@ class LP_Jwt_Users_V1_Controller extends LP_REST_Jwt_Controller {
39
  array(
40
  'args' => array(
41
  'id' => array(
42
- 'description' => esc_html__( 'Unique identifier for the resource.', 'learnpress' ),
43
  'type' => 'integer',
44
  ),
45
  ),
@@ -385,7 +385,7 @@ class LP_Jwt_Users_V1_Controller extends LP_REST_Jwt_Controller {
385
  return rest_ensure_response(
386
  array(
387
  'code' => 'success',
388
- 'message' => esc_html__( 'Your password has been updated, Please login again to continue!', 'learnpress' ),
389
  )
390
  );
391
  }
@@ -820,7 +820,7 @@ class LP_Jwt_Users_V1_Controller extends LP_REST_Jwt_Controller {
820
  'total' => $order->get_total(),
821
  'currency' => $order->get_currency(),
822
  'status' => $order->get_status(),
823
- 'date' => lp_jwt_prepare_date_response( $order->get_order_date() ),
824
  );
825
  }
826
  }
@@ -1454,7 +1454,7 @@ class LP_Jwt_Users_V1_Controller extends LP_REST_Jwt_Controller {
1454
  $query_params['context']['default'] = 'view';
1455
 
1456
  $query_params['exclude'] = array(
1457
- 'description' => __( 'Ensure result set excludes specific IDs.' ),
1458
  'type' => 'array',
1459
  'items' => array(
1460
  'type' => 'integer',
@@ -1463,7 +1463,7 @@ class LP_Jwt_Users_V1_Controller extends LP_REST_Jwt_Controller {
1463
  );
1464
 
1465
  $query_params['include'] = array(
1466
- 'description' => __( 'Limit result set to specific IDs.' ),
1467
  'type' => 'array',
1468
  'items' => array(
1469
  'type' => 'integer',
@@ -1478,14 +1478,14 @@ class LP_Jwt_Users_V1_Controller extends LP_REST_Jwt_Controller {
1478
 
1479
  $query_params['order'] = array(
1480
  'default' => 'asc',
1481
- 'description' => __( 'Order sort attribute ascending or descending.' ),
1482
  'enum' => array( 'asc', 'desc' ),
1483
  'type' => 'string',
1484
  );
1485
 
1486
  $query_params['orderby'] = array(
1487
  'default' => 'name',
1488
- 'description' => __( 'Sort collection by object attribute.' ),
1489
  'enum' => array(
1490
  'id',
1491
  'include',
39
  array(
40
  'args' => array(
41
  'id' => array(
42
+ 'description' => esc_html__( 'A unique identifier for the resource.', 'learnpress' ),
43
  'type' => 'integer',
44
  ),
45
  ),
385
  return rest_ensure_response(
386
  array(
387
  'code' => 'success',
388
+ 'message' => esc_html__( 'Your password has been updated. Please log in again to continue!', 'learnpress' ),
389
  )
390
  );
391
  }
820
  'total' => $order->get_total(),
821
  'currency' => $order->get_currency(),
822
  'status' => $order->get_status(),
823
+ 'date' => $order->get_order_date( 'timestamp' ) ? lp_jwt_prepare_date_response( get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $order->get_order_date( 'timestamp' ) ), 'Y-m-d H:i:s' ) ) : '',
824
  );
825
  }
826
  }
1454
  $query_params['context']['default'] = 'view';
1455
 
1456
  $query_params['exclude'] = array(
1457
+ 'description' => __( 'Ensure the result set excludes specific IDs.' ),
1458
  'type' => 'array',
1459
  'items' => array(
1460
  'type' => 'integer',
1463
  );
1464
 
1465
  $query_params['include'] = array(
1466
+ 'description' => __( 'Limit the result set to specific IDs.' ),
1467
  'type' => 'array',
1468
  'items' => array(
1469
  'type' => 'integer',
1478
 
1479
  $query_params['order'] = array(
1480
  'default' => 'asc',
1481
+ 'description' => __( 'Sorting attributes in ascending or descending order.' ),
1482
  'enum' => array( 'asc', 'desc' ),
1483
  'type' => 'string',
1484
  );
1485
 
1486
  $query_params['orderby'] = array(
1487
  'default' => 'name',
1488
+ 'description' => __( 'Sort collections by the object attribute.' ),
1489
  'enum' => array(
1490
  'id',
1491
  'include',
inc/lp-core-functions.php CHANGED
@@ -46,7 +46,7 @@ add_filter( 'use_block_editor_for_post_type', 'learnpress_gutenberg_disable_cpt'
46
  * @param string $type
47
  *
48
  * @return bool|LP_Course_CURD|LP_User_CURD|LP_Quiz_CURD|LP_Question_CURD
49
- * @depecated 4.1.7.2
50
  */
51
  /*function learn_press_get_curd( $type ) {
52
  $curds = array(
@@ -793,7 +793,7 @@ function learn_press_human_time_to_seconds( $time, $default = '' ) {
793
  * @param array $vars .
794
  *
795
  * @return bool
796
- * @depecated 4.1.7.2
797
  */
798
  /*function learn_press_send_mail( $to = '', $action = '', $vars = array() ) {
799
  $email_settings = LP_Settings::instance();
@@ -1905,7 +1905,7 @@ function learn_press_add_endpoints() {
1905
  $endpoints = $settings->get( 'quiz_endpoints' );
1906
  if ( $endpoints ) {
1907
  foreach ( $endpoints as $endpoint => $value ) {
1908
- $endpoint = preg_replace( '!_!', '-', $endpoint );
1909
  LearnPress::instance()->query_vars[ $endpoint ] = $value;
1910
  add_rewrite_endpoint(
1911
  $value, /*EP_ROOT | */
@@ -1972,7 +1972,7 @@ if ( ! function_exists( 'learn_press_reset_auto_increment' ) ) {
1972
  * @param bool $hash
1973
  *
1974
  * @return string
1975
- * @depecated 4.1.7.2
1976
  */
1977
  /*function learn_press_get_log_file_path( $handle, $hash = false ) {
1978
  if ( $hash ) {
@@ -2046,6 +2046,14 @@ function learn_press_get_current_profile_tab( $default = true ) {
2046
  global $wp_query, $wp;
2047
  $current = '';
2048
 
 
 
 
 
 
 
 
 
2049
  if ( ! empty( $_REQUEST['tab'] ) ) {
2050
  $current = LP_Helper::sanitize_params_submitted( $_REQUEST['tab'] );
2051
  } elseif ( ! empty( $wp_query->query_vars['tab'] ) ) {
@@ -2086,7 +2094,7 @@ function learn_press_profile_tab_exists( $tab ) {
2086
  * @param string $string
2087
  *
2088
  * @return string
2089
- * @depecated 4.1.7.2
2090
  */
2091
  /*function _learn_press_urlencode( $string ) {
2092
  return preg_replace( '/\s/', '+', $string );
@@ -2101,7 +2109,7 @@ function learn_press_profile_tab_exists( $tab ) {
2101
  * @param string $post_type
2102
  *
2103
  * @return string
2104
- * @depecated 4.1.7.2
2105
  */
2106
  /*function learn_press_post_type_archive_link( $link, $post_type ) {
2107
  if ( $post_type == LP_COURSE_CPT && learn_press_get_page_id( 'courses' ) ) {
@@ -2213,7 +2221,7 @@ if ( defined( 'LP_ENABLE_CART' ) && LP_ENABLE_CART ) {
2213
  array(
2214
  'title' => __( 'Enable cart', 'learnpress' ),
2215
  'desc' => __(
2216
- 'Check this option to enable user purchase multiple courses at one time.',
2217
  'learnpress'
2218
  ),
2219
  'id' => $class->get_field_name( 'enable_cart' ),
@@ -2222,14 +2230,14 @@ if ( defined( 'LP_ENABLE_CART' ) && LP_ENABLE_CART ) {
2222
  ),
2223
  array(
2224
  'title' => __( 'Add to cart redirect', 'learnpress' ),
2225
- 'desc' => __( 'Redirect to checkout immediately after adding course to cart.', 'learnpress' ),
2226
  'id' => $class->get_field_name( 'redirect_after_add' ),
2227
  'default' => 'yes',
2228
  'type' => 'checkbox',
2229
  ),
2230
  array(
2231
  'title' => __( 'AJAX add to cart', 'learnpress' ),
2232
- 'desc' => __( 'Using AJAX to add course to cart.', 'learnpress' ),
2233
  'id' => $class->get_field_name( 'ajax_add_to_cart' ),
2234
  'default' => 'no',
2235
  'type' => 'checkbox',
@@ -2364,7 +2372,7 @@ function learn_press_debug() {
2364
  * Get current time to user for calculate remaining time of quiz.
2365
  *
2366
  * @return int
2367
- * @depecated 4.1.7.2
2368
  */
2369
  /*function learn_press_get_current_time() {
2370
  $current_time = apply_filters( 'learn_press_get_current_time', 0 );
@@ -2530,7 +2538,7 @@ function learn_press_tooltip( $tooltip, $html = false ) {
2530
  *
2531
  * @return float|int
2532
  * @since 3.0.0
2533
- * @depecated 4.1.7.2
2534
  */
2535
  /*function learn_press_timezone_offset() {
2536
  if ( $tz = get_option( 'timezone_string' ) ) {
@@ -2708,7 +2716,7 @@ function learn_press_get_post_type( $post ) {
2708
  * @param string $type
2709
  *
2710
  * @since 3.1.0
2711
- * @depecated 4.1.7.2
2712
  */
2713
  /*function learn_press_cache_add_post_type( $id, $type = '' ) {
2714
  if ( false === ( $post_types = LP_Object_Cache::get( 'post-types', 'learn-press' ) ) ) {
@@ -2725,7 +2733,7 @@ function learn_press_get_post_type( $post ) {
2725
  }*/
2726
 
2727
  /**
2728
- * @depecated 4.1.7.2
2729
  */
2730
  /*function learn_press_has_option( $name ) {
2731
  global $wpdb;
@@ -2747,7 +2755,7 @@ function _learn_press_schedule_enable_shuffle_themes() {
2747
  add_action( 'learn-press/schedule-enable-shuffle-themes', '_learn_press_schedule_enable_shuffle_themes' );
2748
 
2749
  /**
2750
- * @depecated 4.1.7.2
2751
  */
2752
  /*function learn_press_show_log() {
2753
  if ( trim( LP_Request::get( 'show_log' ) ) === md5( AUTH_KEY ) ) {
@@ -2784,7 +2792,7 @@ function learn_press_global_script_params() {
2784
  *
2785
  * @return string
2786
  * @since 3.3.0
2787
- * @depecated 4.1.7.2
2788
  */
2789
  /*function learn_press_get_cron_url() {
2790
  $nonce = get_option( 'learnpress_cron_url_nonce' );
@@ -2809,7 +2817,7 @@ function learn_press_global_script_params() {
2809
  *
2810
  * @return array
2811
  * @since 3.3.0
2812
- * @depecated 4.1.7.2
2813
  */
2814
  /*function learn_press_get_expired_courses() {
2815
  global $wpdb;
@@ -2819,12 +2827,12 @@ function learn_press_global_script_params() {
2819
  SELECT X.*
2820
  FROM(
2821
  SELECT ui.*
2822
- FROM {$wpdb->learnpress_user_items} ui
2823
  LEFT JOIN {$wpdb->learnpress_user_items} uix
2824
  ON ui.item_id = uix.item_id
2825
  AND ui.user_id = uix.user_id
2826
  AND ui.user_item_id < uix.user_item_id
2827
- WHERE uix.user_item_id IS NULL
2828
  ) X
2829
  INNER JOIN {$wpdb->users} u ON u.ID = X.user_id
2830
  INNER JOIN {$wpdb->posts} p ON p.ID = X.item_id
@@ -2884,7 +2892,7 @@ function learn_press_get_question_support_feature( $feature ) {
2884
  * @param string $color
2885
  *
2886
  * @since 3.3.0
2887
- * @depecated 4.1.7.2
2888
  */
2889
  /*function learn_press_circle_progress_html( $percent = 0, $width = 32, $border = 4, $color = '' ) {
2890
  $radius = $width / 2;
@@ -2894,13 +2902,13 @@ function learn_press_get_question_support_feature( $feature ) {
2894
 
2895
  printf(
2896
  '<svg class="circle-progress-bar" width="%d" height="%d">
2897
- <circle class="circle-progress-bar__circle"
2898
- stroke="%s"
2899
- stroke-width="%d"
2900
- style="stroke-dasharray:%s %s; stroke-dashoffset:%s;"
2901
- fill="transparent"
2902
- r="%d" cx="%d" cy="%d"></circle>
2903
- </svg>',
2904
  $width,
2905
  $width,
2906
  $color,
@@ -2915,7 +2923,7 @@ function learn_press_get_question_support_feature( $feature ) {
2915
  }*/
2916
 
2917
  /**
2918
- * @depecated 4.1.7.2
2919
  */
2920
  /*function learn_press_is_page( $page_name ) {
2921
  $page_id = learn_press_get_page_id( $page_name );
@@ -2931,7 +2939,7 @@ function learn_press_get_question_support_feature( $feature ) {
2931
  *
2932
  * @return false|string
2933
  * @since 3.x.x
2934
- * @depecated 4.1.7.2
2935
  */
2936
  /*function learn_press_date_end_from( $duration, $start = '' ) {
2937
  $format = 'Y-m-d H:i:s';
@@ -2976,35 +2984,35 @@ function learn_press_course_evaluation_methods( $postid, $return = '', $final_qu
2976
  $final_quiz_btn = '<a href="#" class="lp-metabox-get-final-quiz" data-postid="' . $postid . '" data-loading="' . esc_attr__(
2977
  'Loading...',
2978
  'learnpress'
2979
- ) . '">' . esc_html__( 'Get Passing Grade', 'learnpress' ) . '</a>';
2980
 
2981
  $course_desc = array(
2982
  'evaluate_lesson' => sprintf(
2983
  '<p>%s<br/>%s</p>',
2984
- __( 'Evaluate by the number of lessons completed per total number of lessons.', 'learnpress' ),
2985
- __( 'E.g: Course has 10 lessons and user completed 5 lessons then the result = 5/10 (50.%)', 'learnpress' )
2986
  ),
2987
  'evaluate_final_quiz' => __(
2988
- 'Evaluate by result of final quiz in the course. You have to add a quiz to the end of the course.',
2989
  'learnpress'
2990
  ),
2991
  'evaluate_quiz' => sprintf(
2992
  '<p>%s<br/>%s</p>',
2993
- __( 'Evaluate by the number of quizzes passed per total number of quizzes.', 'learnpress' ),
2994
  __(
2995
- 'E.g: The course has 10 quizzes and the user passed 5 quizzes then the result = 5/10 (50%).',
2996
  'learnpress'
2997
  )
2998
  ),
2999
  'evaluate_questions' => sprintf(
3000
  '<p>%s<br/>%s</p>',
3001
- __( 'Evaluate by total number of correct answers per total number of questions.', 'learnpress' ),
3002
  __(
3003
- 'E.g: Course has 10 questions. User correct 5 questions. Result is 5/10 (50%).',
3004
  'learnpress'
3005
  )
3006
  ),
3007
- 'evaluate_mark' => __( 'Evaluate by total score achieved per total score of the questions.', 'learnpress' ),
3008
  );
3009
 
3010
  $methods = apply_filters(
@@ -3018,7 +3026,7 @@ function learn_press_course_evaluation_methods( $postid, $return = '', $final_qu
3018
  $course_tip,
3019
  $course_desc['evaluate_final_quiz']
3020
  ) . $final_quiz_btn . $final_quizz_passing,
3021
- 'evaluate_quiz' => __( 'Evaluate via quizzes passed', 'learnpress' ) . sprintf(
3022
  $course_tip,
3023
  $course_desc['evaluate_quiz']
3024
  ),
@@ -3048,7 +3056,7 @@ function learn_press_course_evaluation_methods( $postid, $return = '', $final_qu
3048
  *
3049
  * @return false|int|string
3050
  * @since 4.0.0
3051
- * @depecated 4.1.7.2
3052
  */
3053
  /*function learn_press_time_from_gmt( $gmt_time, $format = 'Y-m-d H:i:s' ) {
3054
  if ( is_string( $gmt_time ) ) {
@@ -3086,7 +3094,7 @@ function learn_press_get_quiz_max_retrying( $quiz_id = 0, $course_id = 0 ) {
3086
  *
3087
  * @return int
3088
  * @since 4.0.0
3089
- * @depecated 4.1.7.2
3090
  */
3091
  /*function learn_press_get_course_max_retrying( $course_id ) {
3092
  return apply_filters( 'learn-press/max-retry-course-allowed', 1, $course_id );
@@ -3166,40 +3174,20 @@ add_filter( 'auto_update_plugin', 'learnpress_disable_auto_update', 10, 2 );*/
3166
  add_action(
3167
  'in_plugin_update_message-learnpress/learnpress.php',
3168
  function ( $plugin_data ) {
3169
- version_update_warning( LEARNPRESS_VERSION, $plugin_data['new_version'] );
3170
- }
3171
- );
3172
- /**
3173
- * Custom message warning have new version
3174
- *
3175
- * @param $current_version
3176
- * @param $new_version
3177
- * @author hungkv
3178
- */
3179
- function version_update_warning( $current_version, $new_version ) {
3180
- $current_version_minor_part = explode( '.', $current_version )[1];
3181
- $new_version_minor_part = explode( '.', $new_version )[1];
3182
- if ( $current_version_minor_part === $new_version_minor_part ) {
3183
- return;
3184
- }
3185
-
3186
- $info = get_plugin_data( LP_PLUGIN_FILE );
3187
- ?>
3188
- <hr class="lp-update--warning__separator"/>
3189
- <div class="lp-update--warning">
3190
  <div>
3191
- <div class="lp-update-warning__title">
3192
- <?php echo esc_html__( 'Heads up, Please backup before upgrade!', 'learnpress' ); ?>
3193
- </div>
3194
- <div class="lp-update-warning__message">
3195
- <?php echo esc_html__( 'The latest update includes some substantial changes across different areas of the plugin. We highly recommend you backup your site before upgrading, and make sure you first update in a staging environment', 'learnpress' ); ?>
3196
- <?php echo esc_html__( 'Learners require WordPress version ' . $info['Requires at least'] . ' or higher.', 'learnpress' ); ?>
3197
- </div>
3198
  </div>
3199
- </div>
3200
-
3201
- <?php
3202
- }
3203
 
3204
  // If profile content don't have shortcode profile.
3205
  function lp_add_shortcode_profile() {
46
  * @param string $type
47
  *
48
  * @return bool|LP_Course_CURD|LP_User_CURD|LP_Quiz_CURD|LP_Question_CURD
49
+ * @deprecated 4.1.7.2
50
  */
51
  /*function learn_press_get_curd( $type ) {
52
  $curds = array(
793
  * @param array $vars .
794
  *
795
  * @return bool
796
+ * @deprecated 4.1.7.2
797
  */
798
  /*function learn_press_send_mail( $to = '', $action = '', $vars = array() ) {
799
  $email_settings = LP_Settings::instance();
1905
  $endpoints = $settings->get( 'quiz_endpoints' );
1906
  if ( $endpoints ) {
1907
  foreach ( $endpoints as $endpoint => $value ) {
1908
+ $endpoint = preg_replace( '!_!', '-', $endpoint );
1909
  LearnPress::instance()->query_vars[ $endpoint ] = $value;
1910
  add_rewrite_endpoint(
1911
  $value, /*EP_ROOT | */
1972
  * @param bool $hash
1973
  *
1974
  * @return string
1975
+ * @deprecated 4.1.7.2
1976
  */
1977
  /*function learn_press_get_log_file_path( $handle, $hash = false ) {
1978
  if ( $hash ) {
2046
  global $wp_query, $wp;
2047
  $current = '';
2048
 
2049
+ // Only load on profile page.
2050
+ $page_profile_option = untrailingslashit( get_the_permalink( learn_press_get_page_id( 'profile' ) ) );
2051
+ $page_profile_option = str_replace( '/', '\/', $page_profile_option );
2052
+ $pattern = '/' . $page_profile_option . '/';
2053
+ if ( ! preg_match( $pattern, LP_Helper::getUrlCurrent() ) ) {
2054
+ return false;
2055
+ }
2056
+
2057
  if ( ! empty( $_REQUEST['tab'] ) ) {
2058
  $current = LP_Helper::sanitize_params_submitted( $_REQUEST['tab'] );
2059
  } elseif ( ! empty( $wp_query->query_vars['tab'] ) ) {
2094
  * @param string $string
2095
  *
2096
  * @return string
2097
+ * @deprecated 4.1.7.2
2098
  */
2099
  /*function _learn_press_urlencode( $string ) {
2100
  return preg_replace( '/\s/', '+', $string );
2109
  * @param string $post_type
2110
  *
2111
  * @return string
2112
+ * @deprecated 4.1.7.2
2113
  */
2114
  /*function learn_press_post_type_archive_link( $link, $post_type ) {
2115
  if ( $post_type == LP_COURSE_CPT && learn_press_get_page_id( 'courses' ) ) {
2221
  array(
2222
  'title' => __( 'Enable cart', 'learnpress' ),
2223
  'desc' => __(
2224
+ 'Check this option to enable users to purchase multiple courses at one time.',
2225
  'learnpress'
2226
  ),
2227
  'id' => $class->get_field_name( 'enable_cart' ),
2230
  ),
2231
  array(
2232
  'title' => __( 'Add to cart redirect', 'learnpress' ),
2233
+ 'desc' => __( 'Redirect to checkout immediately after adding the course to the cart.', 'learnpress' ),
2234
  'id' => $class->get_field_name( 'redirect_after_add' ),
2235
  'default' => 'yes',
2236
  'type' => 'checkbox',
2237
  ),
2238
  array(
2239
  'title' => __( 'AJAX add to cart', 'learnpress' ),
2240
+ 'desc' => __( 'Using AJAX to add the course to the cart.', 'learnpress' ),
2241
  'id' => $class->get_field_name( 'ajax_add_to_cart' ),
2242
  'default' => 'no',
2243
  'type' => 'checkbox',
2372
  * Get current time to user for calculate remaining time of quiz.
2373
  *
2374
  * @return int
2375
+ * @deprecated 4.1.7.2
2376
  */
2377
  /*function learn_press_get_current_time() {
2378
  $current_time = apply_filters( 'learn_press_get_current_time', 0 );
2538
  *
2539
  * @return float|int
2540
  * @since 3.0.0
2541
+ * @deprecated 4.1.7.2
2542
  */
2543
  /*function learn_press_timezone_offset() {
2544
  if ( $tz = get_option( 'timezone_string' ) ) {
2716
  * @param string $type
2717
  *
2718
  * @since 3.1.0
2719
+ * @deprecated 4.1.7.2
2720
  */
2721
  /*function learn_press_cache_add_post_type( $id, $type = '' ) {
2722
  if ( false === ( $post_types = LP_Object_Cache::get( 'post-types', 'learn-press' ) ) ) {
2733
  }*/
2734
 
2735
  /**
2736
+ * @deprecated 4.1.7.2
2737
  */
2738
  /*function learn_press_has_option( $name ) {
2739
  global $wpdb;
2755
  add_action( 'learn-press/schedule-enable-shuffle-themes', '_learn_press_schedule_enable_shuffle_themes' );
2756
 
2757
  /**
2758
+ * @deprecated 4.1.7.2
2759
  */
2760
  /*function learn_press_show_log() {
2761
  if ( trim( LP_Request::get( 'show_log' ) ) === md5( AUTH_KEY ) ) {
2792
  *
2793
  * @return string
2794
  * @since 3.3.0
2795
+ * @deprecated 4.1.7.2
2796
  */
2797
  /*function learn_press_get_cron_url() {
2798
  $nonce = get_option( 'learnpress_cron_url_nonce' );
2817
  *
2818
  * @return array
2819
  * @since 3.3.0
2820
+ * @deprecated 4.1.7.2
2821
  */
2822
  /*function learn_press_get_expired_courses() {
2823
  global $wpdb;
2827
  SELECT X.*
2828
  FROM(
2829
  SELECT ui.*
2830
+ FROM {$wpdb->learnpress_user_items} ui
2831
  LEFT JOIN {$wpdb->learnpress_user_items} uix
2832
  ON ui.item_id = uix.item_id
2833
  AND ui.user_id = uix.user_id
2834
  AND ui.user_item_id < uix.user_item_id
2835
+ WHERE uix.user_item_id IS NULL
2836
  ) X
2837
  INNER JOIN {$wpdb->users} u ON u.ID = X.user_id
2838
  INNER JOIN {$wpdb->posts} p ON p.ID = X.item_id
2892
  * @param string $color
2893
  *
2894
  * @since 3.3.0
2895
+ * @deprecated 4.1.7.2
2896
  */
2897
  /*function learn_press_circle_progress_html( $percent = 0, $width = 32, $border = 4, $color = '' ) {
2898
  $radius = $width / 2;
2902
 
2903
  printf(
2904
  '<svg class="circle-progress-bar" width="%d" height="%d">
2905
+ <circle class="circle-progress-bar__circle"
2906
+ stroke="%s"
2907
+ stroke-width="%d"
2908
+ style="stroke-dasharray:%s %s; stroke-dashoffset:%s;"
2909
+ fill="transparent"
2910
+ r="%d" cx="%d" cy="%d"></circle>
2911
+ </svg>',
2912
  $width,
2913
  $width,
2914
  $color,
2923
  }*/
2924
 
2925
  /**
2926
+ * @deprecated 4.1.7.2
2927
  */
2928
  /*function learn_press_is_page( $page_name ) {
2929
  $page_id = learn_press_get_page_id( $page_name );
2939
  *
2940
  * @return false|string
2941
  * @since 3.x.x
2942
+ * @deprecated 4.1.7.2
2943
  */
2944
  /*function learn_press_date_end_from( $duration, $start = '' ) {
2945
  $format = 'Y-m-d H:i:s';
2984
  $final_quiz_btn = '<a href="#" class="lp-metabox-get-final-quiz" data-postid="' . $postid . '" data-loading="' . esc_attr__(
2985
  'Loading...',
2986
  'learnpress'
2987
+ ) . '">' . esc_html__( 'Get A Passing Grade', 'learnpress' ) . '</a>';
2988
 
2989
  $course_desc = array(
2990
  'evaluate_lesson' => sprintf(
2991
  '<p>%s<br/>%s</p>',
2992
+ __( 'Evaluate by the number of completed lessons per the total number of lessons.', 'learnpress' ),
2993
+ __( 'E.g: If a course has 10 lessons and a user completes 5 lessons, then the result is 5/10 (50%).', 'learnpress' )
2994
  ),
2995
  'evaluate_final_quiz' => __(
2996
+ 'Evaluate by the result of the final quiz in the course. You have to add a quiz at the end of the course.',
2997
  'learnpress'
2998
  ),
2999
  'evaluate_quiz' => sprintf(
3000
  '<p>%s<br/>%s</p>',
3001
+ __( 'Evaluate by the number of passed quizzes per the total number of quizzes.', 'learnpress' ),
3002
  __(
3003
+ 'E.g: If the course has 10 quizzes and the user passes 5 quizzes, then the result is 5/10 (50%).',
3004
  'learnpress'
3005
  )
3006
  ),
3007
  'evaluate_questions' => sprintf(
3008
  '<p>%s<br/>%s</p>',
3009
+ __( 'Evaluate by the number of correct answers per the total number of questions.', 'learnpress' ),
3010
  __(
3011
+ 'E.g: If the course has 10 questions and the user corrects 5 questions, then the result is 5/10 (50%).',
3012
  'learnpress'
3013
  )
3014
  ),
3015
+ 'evaluate_mark' => __( 'Evaluate by the number of achieved scores per the total score of the questions.', 'learnpress' ),
3016
  );
3017
 
3018
  $methods = apply_filters(
3026
  $course_tip,
3027
  $course_desc['evaluate_final_quiz']
3028
  ) . $final_quiz_btn . $final_quizz_passing,
3029
+ 'evaluate_quiz' => __( 'Evaluate via passed quizzes', 'learnpress' ) . sprintf(
3030
  $course_tip,
3031
  $course_desc['evaluate_quiz']
3032
  ),
3056
  *
3057
  * @return false|int|string
3058
  * @since 4.0.0
3059
+ * @deprecated 4.1.7.2
3060
  */
3061
  /*function learn_press_time_from_gmt( $gmt_time, $format = 'Y-m-d H:i:s' ) {
3062
  if ( is_string( $gmt_time ) ) {
3094
  *
3095
  * @return int
3096
  * @since 4.0.0
3097
+ * @deprecated 4.1.7.2
3098
  */
3099
  /*function learn_press_get_course_max_retrying( $course_id ) {
3100
  return apply_filters( 'learn-press/max-retry-course-allowed', 1, $course_id );
3174
  add_action(
3175
  'in_plugin_update_message-learnpress/learnpress.php',
3176
  function ( $plugin_data ) {
3177
+ if ( version_compare( $plugin_data['new_version'], LEARNPRESS_VERSION, '<=' ) ) {
3178
+ return;
3179
+ }
3180
+ ?>
3181
+ <hr/>
3182
+ <h3>
3183
+ <?php echo esc_html__( 'Heads up! Please backup before upgrading!', 'learnpress' ); ?>
3184
+ </h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
3185
  <div>
3186
+ <?php echo esc_html__( 'The latest update includes some substantial changes across different areas of the plugin. We highly recommend you backup your site before upgrading, and make sure you first update in a staging environment', 'learnpress' ); ?>
 
 
 
 
 
 
3187
  </div>
3188
+ <?php
3189
+ }
3190
+ );
 
3191
 
3192
  // If profile content don't have shortcode profile.
3193
  function lp_add_shortcode_profile() {
inc/lp-deprecated.php CHANGED
@@ -390,7 +390,7 @@ function learn_press_get_students_list_filter() {
390
  }
391
 
392
  /**
393
- * @depecated 4.1.6.9
394
  */
395
  /*function learn_press_get_request_args( $args = array() ) {
396
  $request = array();
@@ -904,7 +904,7 @@ if ( ! function_exists( 'learn_press_content_item_summary_quiz_countdown' ) ) {
904
  }
905
 
906
  /**
907
- * @depecated 4.1.6.9
908
  */
909
  /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_result' ) ) {
910
 
@@ -919,7 +919,7 @@ if ( ! function_exists( 'learn_press_content_item_summary_quiz_countdown' ) ) {
919
  }*/
920
 
921
  /**
922
- * @depecated 4.1.6.9
923
  */
924
  /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_question' ) ) {
925
 
@@ -1371,7 +1371,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1371
  * @param $order_id
1372
  *
1373
  * @return mixed
1374
- * @depecated 4.1.6.9
1375
  */
1376
  /*function _learn_press_checkout_success_result( $results, $order_id ) {
1377
  if ( $results['result'] == 'success' ) {
@@ -1398,7 +1398,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1398
  }*/
1399
 
1400
  /**
1401
- * @depecated 4.1.6.9
1402
  */
1403
  /*if ( ! function_exists( 'learn_press_content_item_summary_question_hint' ) ) {
1404
  function learn_press_content_item_summary_question_hint() {
@@ -1420,7 +1420,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1420
  }*/
1421
 
1422
  /**
1423
- * @depecated 4.1.6.9
1424
  */
1425
  /*if ( ! function_exists( 'learn_press_content_item_summary_questions' ) ) {
1426
  function learn_press_content_item_summary_questions() {
@@ -1446,7 +1446,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1446
  }*/
1447
 
1448
  /**
1449
- * @depecated 4.1.6.9
1450
  */
1451
  /*if ( ! function_exists( 'learn_press_content_item_summary_question_numbers' ) ) {
1452
 
@@ -1471,7 +1471,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1471
  }*/
1472
 
1473
  /**
1474
- * @depecated 4.1.6.9
1475
  */
1476
  /*if ( ! function_exists( 'learn_press_quiz_nav_buttons' ) ) {
1477
 
@@ -1493,7 +1493,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1493
  }*/
1494
 
1495
  /**
1496
- * @depecated 4.1.6.9
1497
  */
1498
  /*if ( ! function_exists( 'learn_press_quiz_start_button' ) ) {
1499
 
@@ -1518,7 +1518,7 @@ if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) {
1518
  }*/
1519
 
1520
  /**
1521
- * @depecated 4.1.6.9
1522
  */
1523
  /*if ( ! function_exists( 'learn_press_quiz_continue_button' ) ) {
1524
 
@@ -1573,7 +1573,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1573
  }
1574
 
1575
  /**
1576
- * @depecated 4.1.6.9
1577
  */
1578
  /*if ( ! function_exists( 'learn_press_quiz_result_button' ) ) {
1579
 
@@ -1599,7 +1599,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1599
  }*/
1600
 
1601
  /**
1602
- * @depecated 4.1.6.9
1603
  */
1604
  /*if ( ! function_exists( 'learn_press_quiz_summary_button' ) ) {
1605
 
@@ -1621,7 +1621,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1621
  }*/
1622
 
1623
  /**
1624
- * @depecated 4.1.6.9
1625
  */
1626
  /*if ( ! function_exists( 'learn_press_quiz_check_button' ) ) {
1627
 
@@ -1647,7 +1647,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1647
  }*/
1648
 
1649
  /**
1650
- * @depecated 4.1.6.9
1651
  */
1652
  /*if ( ! function_exists( 'learn_press_quiz_hint_button' ) ) {
1653
 
@@ -1684,7 +1684,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1684
  }*/
1685
 
1686
  /**
1687
- * @depecated 4.1.6.9
1688
  */
1689
  /*if ( ! function_exists( 'learn_press_profile_order_details' ) ) {
1690
  function learn_press_profile_order_details() {
@@ -1699,7 +1699,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1699
  }*/
1700
 
1701
  /**
1702
- * @depecated 4.1.6.9
1703
  */
1704
  /*if ( ! function_exists( 'learn_press_profile_order_recover' ) ) {
1705
  function learn_press_profile_order_recover() {
@@ -1713,7 +1713,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1713
  }*/
1714
 
1715
  /**
1716
- * @depecated 4.1.6.9
1717
  */
1718
  /*if ( ! function_exists( 'learn_press_profile_order_message' ) ) {
1719
  function learn_press_profile_order_message() {
@@ -1727,7 +1727,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1727
  }*/
1728
 
1729
  /**
1730
- * @depecated 4.1.6.9
1731
  */
1732
  /*if ( ! function_exists( 'learn_press_profile_dashboard_logged_in' ) ) {
1733
  function learn_press_profile_dashboard_logged_in() {
@@ -1736,7 +1736,7 @@ if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) {
1736
  }*/
1737
 
1738
  /**
1739
- * @depecated 4.1.6.9
1740
  */
1741
  /*if ( ! function_exists( 'learn_press_profile_dashboard_user_bio' ) ) {
1742
  function learn_press_profile_dashboard_user_bio() {
@@ -1767,7 +1767,7 @@ if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) {
1767
  }
1768
 
1769
  /**
1770
- * @depecated 4.1.6.9
1771
  */
1772
  /*if ( ! function_exists( 'learn_press_profile_login_form' ) ) {
1773
  function learn_press_profile_login_form() {
@@ -1791,7 +1791,7 @@ if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) {
1791
  }*/
1792
 
1793
  /**
1794
- * @depecated 4.1.6.9
1795
  */
1796
  /*if ( ! function_exists( 'learn_press_profile_register_form' ) ) {
1797
  function learn_press_profile_register_form() {
@@ -1814,7 +1814,7 @@ if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) {
1814
  }*/
1815
 
1816
  /**
1817
- * @depecated 4.1.6.9
1818
  */
1819
  /*if ( ! function_exists( 'learn_press_content_item_lesson_title' ) ) {
1820
  function learn_press_content_item_lesson_title() {
@@ -1830,7 +1830,7 @@ if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) {
1830
  }*/
1831
 
1832
  /**
1833
- * @depecated 4.1.6.9
1834
  */
1835
  /*if ( ! function_exists( 'learn_press_content_item_lesson_content' ) ) {
1836
  function learn_press_content_item_lesson_content() {
@@ -1851,7 +1851,7 @@ if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) {
1851
  }*/
1852
 
1853
  /**
1854
- * @depecated 4.1.6.9
1855
  */
1856
  /*if ( ! function_exists( 'learn_press_content_item_lesson_content_blocked' ) ) {
1857
  function learn_press_content_item_lesson_content_blocked() {
@@ -1866,7 +1866,7 @@ if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) {
1866
  }*/
1867
 
1868
  /**
1869
- * @depecated 4.1.6.9
1870
  */
1871
  /*if ( ! function_exists( 'learn_press_content_item_lesson_complete_button' ) ) {
1872
  function learn_press_content_item_lesson_complete_button() {
@@ -1964,7 +1964,7 @@ if ( ! function_exists( 'learn_press_search_form' ) ) {
1964
  }
1965
 
1966
  /**
1967
- * @depecated 4.1.6.9
1968
  */
1969
  /*if ( ! function_exists( 'learn_press_content_single_item' ) ) {
1970
  function learn_press_content_single_item() {
@@ -1977,7 +1977,7 @@ if ( ! function_exists( 'learn_press_search_form' ) ) {
1977
  }*/
1978
 
1979
  /**
1980
- * @depecated 4.1.6.9
1981
  */
1982
  /*if ( ! function_exists( 'learn_press_content_single_course' ) ) {
1983
  function learn_press_content_single_course() {
@@ -2187,7 +2187,7 @@ if ( ! function_exists( 'learn_press_become_teacher_heading' ) ) {
2187
  return;
2188
  }
2189
  ?>
2190
- <h3><?php _e( 'Fill out the form and send us your requesting.', 'learnpress' ); ?></h3>
2191
  <?php
2192
  }
2193
  }
390
  }
391
 
392
  /**
393
+ * @deprecated 4.1.6.9
394
  */
395
  /*function learn_press_get_request_args( $args = array() ) {
396
  $request = array();
904
  }
905
 
906
  /**
907
+ * @deprecated 4.1.6.9
908
  */
909
  /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_result' ) ) {
910
 
919
  }*/
920
 
921
  /**
922
+ * @deprecated 4.1.6.9
923
  */
924
  /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_question' ) ) {
925
 
1371
  * @param $order_id
1372
  *
1373
  * @return mixed
1374
+ * @deprecated 4.1.6.9
1375
  */
1376
  /*function _learn_press_checkout_success_result( $results, $order_id ) {
1377
  if ( $results['result'] == 'success' ) {
1398
  }*/
1399
 
1400
  /**
1401
+ * @deprecated 4.1.6.9
1402
  */
1403
  /*if ( ! function_exists( 'learn_press_content_item_summary_question_hint' ) ) {
1404
  function learn_press_content_item_summary_question_hint() {
1420
  }*/
1421
 
1422
  /**
1423
+ * @deprecated 4.1.6.9
1424
  */
1425
  /*if ( ! function_exists( 'learn_press_content_item_summary_questions' ) ) {
1426
  function learn_press_content_item_summary_questions() {
1446
  }*/
1447
 
1448
  /**
1449
+ * @deprecated 4.1.6.9
1450
  */
1451
  /*if ( ! function_exists( 'learn_press_content_item_summary_question_numbers' ) ) {
1452
 
1471
  }*/
1472
 
1473
  /**
1474
+ * @deprecated 4.1.6.9
1475
  */
1476
  /*if ( ! function_exists( 'learn_press_quiz_nav_buttons' ) ) {
1477
 
1493
  }*/
1494
 
1495
  /**
1496
+ * @deprecated 4.1.6.9
1497
  */
1498
  /*if ( ! function_exists( 'learn_press_quiz_start_button' ) ) {
1499
 
1518
  }*/
1519
 
1520
  /**
1521
+ * @deprecated 4.1.6.9
1522
  */
1523
  /*if ( ! function_exists( 'learn_press_quiz_continue_button' ) ) {
1524
 
1573
  }
1574
 
1575
  /**
1576
+ * @deprecated 4.1.6.9
1577
  */
1578
  /*if ( ! function_exists( 'learn_press_quiz_result_button' ) ) {
1579
 
1599
  }*/
1600
 
1601
  /**
1602
+ * @deprecated 4.1.6.9
1603
  */
1604
  /*if ( ! function_exists( 'learn_press_quiz_summary_button' ) ) {
1605
 
1621
  }*/
1622
 
1623
  /**
1624
+ * @deprecated 4.1.6.9
1625
  */
1626
  /*if ( ! function_exists( 'learn_press_quiz_check_button' ) ) {
1627
 
1647
  }*/
1648
 
1649
  /**
1650
+ * @deprecated 4.1.6.9
1651
  */
1652
  /*if ( ! function_exists( 'learn_press_quiz_hint_button' ) ) {
1653
 
1684
  }*/
1685
 
1686
  /**
1687
+ * @deprecated 4.1.6.9
1688
  */
1689
  /*if ( ! function_exists( 'learn_press_profile_order_details' ) ) {
1690
  function learn_press_profile_order_details() {
1699
  }*/
1700
 
1701
  /**
1702
+ * @deprecated 4.1.6.9
1703
  */
1704
  /*if ( ! function_exists( 'learn_press_profile_order_recover' ) ) {
1705
  function learn_press_profile_order_recover() {
1713
  }*/
1714
 
1715
  /**
1716
+ * @deprecated 4.1.6.9
1717
  */
1718
  /*if ( ! function_exists( 'learn_press_profile_order_message' ) ) {
1719
  function learn_press_profile_order_message() {
1727
  }*/
1728
 
1729
  /**
1730
+ * @deprecated 4.1.6.9
1731
  */
1732
  /*if ( ! function_exists( 'learn_press_profile_dashboard_logged_in' ) ) {
1733
  function learn_press_profile_dashboard_logged_in() {
1736
  }*/
1737
 
1738
  /**
1739
+ * @deprecated 4.1.6.9
1740
  */
1741
  /*if ( ! function_exists( 'learn_press_profile_dashboard_user_bio' ) ) {
1742
  function learn_press_profile_dashboard_user_bio() {
1767
  }
1768
 
1769
  /**
1770
+ * @deprecated 4.1.6.9
1771
  */
1772
  /*if ( ! function_exists( 'learn_press_profile_login_form' ) ) {
1773
  function learn_press_profile_login_form() {
1791
  }*/
1792
 
1793
  /**
1794
+ * @deprecated 4.1.6.9
1795
  */
1796
  /*if ( ! function_exists( 'learn_press_profile_register_form' ) ) {
1797
  function learn_press_profile_register_form() {
1814
  }*/
1815
 
1816
  /**
1817
+ * @deprecated 4.1.6.9
1818
  */
1819
  /*if ( ! function_exists( 'learn_press_content_item_lesson_title' ) ) {
1820
  function learn_press_content_item_lesson_title() {
1830
  }*/
1831
 
1832
  /**
1833
+ * @deprecated 4.1.6.9
1834
  */
1835
  /*if ( ! function_exists( 'learn_press_content_item_lesson_content' ) ) {
1836
  function learn_press_content_item_lesson_content() {
1851
  }*/
1852
 
1853
  /**
1854
+ * @deprecated 4.1.6.9
1855
  */
1856
  /*if ( ! function_exists( 'learn_press_content_item_lesson_content_blocked' ) ) {
1857
  function learn_press_content_item_lesson_content_blocked() {
1866
  }*/
1867
 
1868
  /**
1869
+ * @deprecated 4.1.6.9
1870
  */
1871
  /*if ( ! function_exists( 'learn_press_content_item_lesson_complete_button' ) ) {
1872
  function learn_press_content_item_lesson_complete_button() {
1964
  }
1965
 
1966
  /**
1967
+ * @deprecated 4.1.6.9
1968
  */
1969
  /*if ( ! function_exists( 'learn_press_content_single_item' ) ) {
1970
  function learn_press_content_single_item() {
1977
  }*/
1978
 
1979
  /**
1980
+ * @deprecated 4.1.6.9
1981
  */
1982
  /*if ( ! function_exists( 'learn_press_content_single_course' ) ) {
1983
  function learn_press_content_single_course() {
2187
  return;
2188
  }
2189
  ?>
2190
+ <h3><?php _e( 'Fill out the form and send us your request', 'learnpress' ); ?></h3>
2191
  <?php
2192
  }
2193
  }
inc/lp-template-functions.php CHANGED
@@ -719,23 +719,6 @@ if ( ! function_exists( 'learn_press_page_title' ) ) {
719
  }
720
  }
721
 
722
- /**
723
- * @depecated 4.1.6.4
724
- */
725
- function learn_press_template_redirect() {
726
- _deprecated_function( __FUNCTION__, '4.1.6.4' );
727
- global $wp_query, $wp;
728
-
729
- // When default permalinks are enabled, redirect shop page to post type archive url
730
- if ( ! empty( $_GET['page_id'] ) && get_option( 'permalink_structure' ) == '' && $_GET['page_id'] == learn_press_get_page_id( 'courses' ) ) {
731
- wp_safe_redirect( get_post_type_archive_link( 'lp_course' ) );
732
- exit;
733
- }
734
- }
735
-
736
- // add_action( 'template_redirect', 'learn_press_template_redirect' );
737
-
738
-
739
  /**
740
  * Get template part.
741
  *
@@ -1055,7 +1038,7 @@ if ( ! function_exists( 'learn_press_get_profile_display_name' ) ) {
1055
  }
1056
 
1057
  /**
1058
- * @depecated 4.1.6.9
1059
  */
1060
  /*if ( ! function_exists( 'learn_press_content_item_comments' ) ) {
1061
  function learn_press_content_item_comments() {
@@ -1110,7 +1093,7 @@ function learn_press_label_html( $label, $type = '' ) {
1110
  }
1111
 
1112
  /**
1113
- * @depecated 4.1.6.4
1114
  */
1115
  function learn_press_get_course_redirect( $link ) {
1116
  _deprecated_function( __FUNCTION__, '4.1.6.4' );
@@ -1419,7 +1402,7 @@ function learn_press_register_sidebars() {
1419
  array(
1420
  'name' => esc_html__( 'Course Sidebar', 'learnpress' ),
1421
  'id' => 'course-sidebar',
1422
- 'description' => esc_html__( 'Widgets in this area will be shown in single course', 'learnpress' ),
1423
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
1424
  'after_widget' => '</div>',
1425
  'before_title' => '<h2 class="widgettitle">',
@@ -1430,7 +1413,7 @@ function learn_press_register_sidebars() {
1430
  array(
1431
  'name' => esc_html__( 'All Courses', 'learnpress' ),
1432
  'id' => 'archive-courses-sidebar',
1433
- 'description' => esc_html__( 'Widgets in this area will be shown in all courses page', 'learnpress' ),
1434
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
1435
  'after_widget' => '</div>',
1436
  'before_title' => '<h2 class="widgettitle">',
719
  }
720
  }
721
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
722
  /**
723
  * Get template part.
724
  *
1038
  }
1039
 
1040
  /**
1041
+ * @deprecated 4.1.6.9
1042
  */
1043
  /*if ( ! function_exists( 'learn_press_content_item_comments' ) ) {
1044
  function learn_press_content_item_comments() {
1093
  }
1094
 
1095
  /**
1096
+ * @deprecated 4.1.6.4
1097
  */
1098
  function learn_press_get_course_redirect( $link ) {
1099
  _deprecated_function( __FUNCTION__, '4.1.6.4' );
1402
  array(
1403
  'name' => esc_html__( 'Course Sidebar', 'learnpress' ),
1404
  'id' => 'course-sidebar',
1405
+ 'description' => esc_html__( 'Widgets in this area will be shown in a single course', 'learnpress' ),
1406
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
1407
  'after_widget' => '</div>',
1408
  'before_title' => '<h2 class="widgettitle">',
1413
  array(
1414
  'name' => esc_html__( 'All Courses', 'learnpress' ),
1415
  'id' => 'archive-courses-sidebar',
1416
+ 'description' => esc_html__( 'Widgets in this area will be shown on all course pages', 'learnpress' ),
1417
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
1418
  'after_widget' => '</div>',
1419
  'before_title' => '<h2 class="widgettitle">',
inc/lp-webhooks.php CHANGED
@@ -87,7 +87,7 @@ function learn_press_process_web_hooks() {
87
  echo "</pre>\n===============================================================\n";
88
  }
89
  $output = ob_get_clean();
90
- wp_die( $output, __( 'LearnPress webhook process Complete', 'learnpress' ), array( 'response' => 200 ) );
91
  }
92
  }
93
 
87
  echo "</pre>\n===============================================================\n";
88
  }
89
  $output = ob_get_clean();
90
+ wp_die( $output, __( 'The LearnPress webhook process is complete', 'learnpress' ), array( 'response' => 200 ) );
91
  }
92
  }
93
 
inc/order/class-lp-order.php CHANGED
@@ -104,12 +104,10 @@ if ( ! class_exists( 'LP_Order' ) ) {
104
  *
105
  * @param int|string $date
106
  */
107
- public function set_order_date( $date ) {
108
- if ( is_numeric( $date ) ) {
109
- $date = gmdate( 'Y-m-d H:i:s', $date );
110
- }
111
- $this->_set_data_date( 'order_date', $date );
112
 
 
113
  }
114
 
115
  /**
@@ -1019,7 +1017,7 @@ if ( ! class_exists( 'LP_Order' ) ) {
1019
  * in case this order is for multi users
1020
  *
1021
  * @since 2.1.5
1022
- * @depecated 4.1.6.9
1023
  */
1024
  /*public function print_users() {
1025
  $user_ids = get_post_meta( $this->get_id(), '_user_id' );
104
  *
105
  * @param int|string $date
106
  */
107
+ public function set_order_date( $date ): LP_Order {
108
+ $this->set_data_date( 'order_date', $date );
 
 
 
109
 
110
+ return $this;
111
  }
112
 
113
  /**
1017
  * in case this order is for multi users
1018
  *
1019
  * @since 2.1.5
1020
+ * @deprecated 4.1.6.9
1021
  */
1022
  /*public function print_users() {
1023
  $user_ids = get_post_meta( $this->get_id(), '_user_id' );
inc/order/lp-order-functions.php CHANGED
@@ -740,9 +740,9 @@ function learn_press_get_register_order_statuses() {
740
  function _learn_press_get_order_status_description( $status ) {
741
  static $descriptions = null;
742
  $descriptions = array(
743
- 'pending' => __( 'Order received in case user buy a course but doesn\'t finalise the order.', 'learnpress' ),
744
  'processing' => __( 'Payment received and the order is awaiting fulfillment.', 'learnpress' ),
745
- 'completed' => __( 'Order fulfilled and complete.', 'learnpress' ),
746
  'cancelled' => __( 'The order is cancelled by an admin or the customer.', 'learnpress' ),
747
  );
748
 
@@ -784,13 +784,13 @@ if ( ! function_exists( 'learn_press_cancel_order_process' ) ) {
784
  learn_press_add_message( sprintf( __( 'Order number <strong>%s</strong> not found', 'learnpress' ), $order_id ), 'error' );
785
  } elseif ( $order->has_status( 'pending' ) ) {
786
  $order->update_status( 'cancelled' );
787
- $order->add_note( __( 'Order cancelled by customer', 'learnpress' ) );
788
 
789
  // set updated message
790
  learn_press_add_message( sprintf( __( 'Order number <strong>%s</strong> has been cancelled', 'learnpress' ), $order->get_order_number() ) );
791
  $url = $order->get_cancel_order_url( true );
792
  } else {
793
- learn_press_add_message( sprintf( __( 'Order number <strong>%s</strong> can not be cancelled', 'learnpress' ), $order->get_order_number() ), 'error' );
794
  }
795
  if ( ! $url ) {
796
  $url = learn_press_user_profile_link( $user->get_id(), LP_Settings::instance()->get( 'profile_endpoints.profile-orders', 'orders' ) );
740
  function _learn_press_get_order_status_description( $status ) {
741
  static $descriptions = null;
742
  $descriptions = array(
743
+ 'pending' => __( 'Order received in case a user purchases a course but doesn\'t finalize the order.', 'learnpress' ),
744
  'processing' => __( 'Payment received and the order is awaiting fulfillment.', 'learnpress' ),
745
+ 'completed' => __( 'The order is fulfilled and completed.', 'learnpress' ),
746
  'cancelled' => __( 'The order is cancelled by an admin or the customer.', 'learnpress' ),
747
  );
748
 
784
  learn_press_add_message( sprintf( __( 'Order number <strong>%s</strong> not found', 'learnpress' ), $order_id ), 'error' );
785
  } elseif ( $order->has_status( 'pending' ) ) {
786
  $order->update_status( 'cancelled' );
787
+ $order->add_note( __( 'The order is cancelled by the customer', 'learnpress' ) );
788
 
789
  // set updated message
790
  learn_press_add_message( sprintf( __( 'Order number <strong>%s</strong> has been cancelled', 'learnpress' ), $order->get_order_number() ) );
791
  $url = $order->get_cancel_order_url( true );
792
  } else {
793
+ learn_press_add_message( sprintf( __( 'The order number <strong>%s</strong> can not be cancelled.', 'learnpress' ), $order->get_order_number() ), 'error' );
794
  }
795
  if ( ! $url ) {
796
  $url = learn_press_user_profile_link( $user->get_id(), LP_Settings::instance()->get( 'profile_endpoints.profile-orders', 'orders' ) );
inc/question/class-lp-question.php CHANGED
@@ -130,7 +130,11 @@ if ( ! class_exists( 'LP_Question' ) ) {
130
  return LP_Global::object_is_support_feature( $this->object_type . '.' . $this->get_type(), $feature, $type );
131
  }*/
132
 
 
 
 
133
  public function get_supports() {
 
134
  if ( empty( LP_Global::$object_support_features ) ) {
135
  return false;
136
  }
@@ -138,10 +142,6 @@ if ( ! class_exists( 'LP_Question' ) ) {
138
  return LP_Global::get_object_supports( $this->object_type . '.' . $this->get_type() );
139
  }
140
 
141
- public static function get_type_support_answer_options() {
142
-
143
- }
144
-
145
  /**
146
  * Load data for question
147
  *
130
  return LP_Global::object_is_support_feature( $this->object_type . '.' . $this->get_type(), $feature, $type );
131
  }*/
132
 
133
+ /**
134
+ * @deprecated 4.1.7.3
135
+ */
136
  public function get_supports() {
137
+ _deprecated_function( __FUNCTION__, '4.1.7.3' );
138
  if ( empty( LP_Global::$object_support_features ) ) {
139
  return false;
140
  }
142
  return LP_Global::get_object_supports( $this->object_type . '.' . $this->get_type() );
143
  }
144
 
 
 
 
 
145
  /**
146
  * Load data for question
147
  *
inc/quiz/class-lp-quiz.php CHANGED
@@ -451,7 +451,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
451
  }
452
  }
453
 
454
- return apply_filters( 'learn-press/quiz/questions', $questions, $this->get_id(), $context );
455
  }
456
 
457
  /**
@@ -461,48 +461,46 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
461
  */
462
  public function quiz_editor_get_questions() {
463
  // list questions
464
- $questions = $this->get_questions( 'edit' );
465
  // order questions in quiz
466
  $question_order = learn_press_quiz_get_questions_order( $questions );
467
 
468
  $result = array();
469
- if ( is_array( $questions ) ) {
470
- foreach ( $questions as $index => $id ) {
471
 
472
- $question = LP_Question::get_question( $id );
 
473
 
474
- $answers = array();
475
- // handle question answer
476
- if ( is_array( $question->get_data( 'answer_options' ) ) ) {
477
- foreach ( $question->get_data( 'answer_options' ) as $answer ) {
478
- $answers[] = $answer;
479
- }
480
  }
 
481
 
482
- $post = get_post( $id );
483
- $result[] = apply_filters(
484
- 'learn-press/quiz-editor/question-data',
485
- array(
486
- 'id' => $id,
487
- 'open' => false,
488
- 'title' => $post->post_title,
489
- 'type' => array(
490
- 'key' => $question->get_type(),
491
- 'label' => $question->get_type_label(),
492
- ),
493
- 'answers' => apply_filters( 'learn-press/quiz-editor/question-answers-data', $answers, $id, $this->get_id() ),
494
- 'settings' => array(
495
- 'content' => $post->post_content,
496
- 'mark' => get_post_meta( $id, '_lp_mark', true ),
497
- 'explanation' => get_post_meta( $id, '_lp_explanation', true ),
498
- 'hint' => get_post_meta( $id, '_lp_hint', true ),
499
- ),
500
- 'order' => $question_order[ $index ],
501
  ),
502
- $id,
503
- $this->get_id()
504
- );
505
- }
 
 
 
 
 
 
 
 
506
  }
507
 
508
  return apply_filters( 'learn-press/quiz/quiz_editor_questions', $result, $this->get_id() );
@@ -531,7 +529,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
531
  */
532
  public function count_questions() {
533
  $size = 0;
534
- $questions = $this->get_questions();
535
 
536
  if ( $questions ) {
537
  $size = sizeof( $questions );
@@ -547,10 +545,8 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
547
  *
548
  * @return int[]
549
  * @editor tungnx
550
- * @throws Exception
551
  * @version 1.0.1
552
  * @since 3.2.0
553
- *
554
  */
555
  public function get_question_ids( string $context = 'display' ): array {
556
  $ids = $this->_curd->read_question_ids( $this->get_id(), $context );
@@ -584,7 +580,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
584
  ),
585
  'quiz_time_is_over' => array(
586
  'title' => __( 'Time\'s up!', 'learnpress' ),
587
- 'message' => __( 'The time is up! Your quiz will automate come to finish', 'learnpress' ),
588
  ),
589
  'finished_quiz' => __( 'Congrats! You have finished this quiz', 'learnpress' ),
590
  'retaken_quiz' => __( 'Congrats! You have re-taken this quiz. Please wait a moment and the page will reload', 'learnpress' ),
@@ -646,9 +642,9 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
646
  * @return bool
647
  */
648
  public function has_question( $question_id ) {
649
- $questions = $this->get_questions();
650
 
651
- return apply_filters( 'learn-press/quiz/has-question', is_array( $questions ) && ( false !== array_search( $question_id, $questions ) ), $question_id, $this->get_id() );
652
  }
653
 
654
  /**
@@ -692,7 +688,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
692
  * @param int $at
693
  *
694
  * @return bool
695
- * @depecated 4.1.6.9
696
  */
697
  /*public function get_question_at( $at = 0 ) {
698
  $questions = $this->get_questions();
@@ -712,7 +708,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
712
  * @param int $id
713
  *
714
  * @return bool
715
- * @depecated 4.1.6.9
716
  */
717
  /*public function get_prev_question( $id ) {
718
  $prev = false;
@@ -736,7 +732,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
736
  * @param int $id
737
  *
738
  * @return bool
739
- * @depecated 4.1.6.9
740
  */
741
  /*public function get_next_question( $id ) {
742
  $next = false;
@@ -761,7 +757,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
761
  * @param int $start
762
  *
763
  * @return bool|mixed
764
- * @depecated 4.1.6.9
765
  */
766
  /*public function get_question_index( $id, $start = 0 ) {
767
  $index = 0;
@@ -829,8 +825,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
829
  $questions = (array) $results->questions;
830
 
831
  } else {
832
- $questions = (array) $this->get_questions();
833
- $questions = array_keys( $questions );
834
  }
835
 
836
  $position = array_search( $question, $questions );
@@ -1028,7 +1023,7 @@ if ( ! class_exists( 'LP_Quiz' ) ) {
1028
  * @param null $position
1029
  *
1030
  * @return array
1031
- * @depecated 4.1.6.9
1032
  */
1033
  /*public function get_question_number_class( $question_id, $position = null ) {
1034
  if ( null === $position ) {
451
  }
452
  }
453
 
454
+ return apply_filters( 'learn-press/quiz/questions', $questions, $this->get_id(), $this->get_course_id(), $context );
455
  }
456
 
457
  /**
461
  */
462
  public function quiz_editor_get_questions() {
463
  // list questions
464
+ $questions = $this->get_question_ids( 'edit' );
465
  // order questions in quiz
466
  $question_order = learn_press_quiz_get_questions_order( $questions );
467
 
468
  $result = array();
 
 
469
 
470
+ foreach ( $questions as $id ) {
471
+ $question = LP_Question::get_question( $id );
472
 
473
+ $answers = array();
474
+ // handle question answer
475
+ if ( is_array( $question->get_data( 'answer_options' ) ) ) {
476
+ foreach ( $question->get_data( 'answer_options' ) as $answer ) {
477
+ $answers[] = $answer;
 
478
  }
479
+ }
480
 
481
+ $post = get_post( $id );
482
+ $result[] = apply_filters(
483
+ 'learn-press/quiz-editor/question-data',
484
+ array(
485
+ 'id' => $id,
486
+ 'open' => false,
487
+ 'title' => $post->post_title,
488
+ 'type' => array(
489
+ 'key' => $question->get_type(),
490
+ 'label' => $question->get_type_label(),
 
 
 
 
 
 
 
 
 
491
  ),
492
+ 'answers' => apply_filters( 'learn-press/quiz-editor/question-answers-data', $answers, $id, $this->get_id() ),
493
+ 'settings' => array(
494
+ 'content' => $post->post_content,
495
+ 'mark' => get_post_meta( $id, '_lp_mark', true ),
496
+ 'explanation' => get_post_meta( $id, '_lp_explanation', true ),
497
+ 'hint' => get_post_meta( $id, '_lp_hint', true ),
498
+ ),
499
+ 'order' => $question_order[ $id ],
500
+ ),
501
+ $id,
502
+ $this->get_id()
503
+ );
504
  }
505
 
506
  return apply_filters( 'learn-press/quiz/quiz_editor_questions', $result, $this->get_id() );
529
  */
530
  public function count_questions() {
531
  $size = 0;
532
+ $questions = $this->get_question_ids();
533
 
534
  if ( $questions ) {
535
  $size = sizeof( $questions );
545
  *
546
  * @return int[]
547
  * @editor tungnx
 
548
  * @version 1.0.1
549
  * @since 3.2.0
 
550
  */
551
  public function get_question_ids( string $context = 'display' ): array {
552
  $ids = $this->_curd->read_question_ids( $this->get_id(), $context );
580
  ),
581
  'quiz_time_is_over' => array(
582
  'title' => __( 'Time\'s up!', 'learnpress' ),
583
+ 'message' => __( 'The time is up! Your quiz will automatically come to an end', 'learnpress' ),
584
  ),
585
  'finished_quiz' => __( 'Congrats! You have finished this quiz', 'learnpress' ),
586
  'retaken_quiz' => __( 'Congrats! You have re-taken this quiz. Please wait a moment and the page will reload', 'learnpress' ),
642
  * @return bool
643
  */
644
  public function has_question( $question_id ) {
645
+ $questions = $this->get_question_ids();
646
 
647
+ return apply_filters( 'learn-press/quiz/has-question', in_array( $question_id, $questions ), $question_id, $this->get_id() );
648
  }
649
 
650
  /**
688
  * @param int $at
689
  *
690
  * @return bool
691
+ * @deprecated 4.1.6.9
692
  */
693
  /*public function get_question_at( $at = 0 ) {
694
  $questions = $this->get_questions();
708
  * @param int $id
709
  *
710
  * @return bool
711
+ * @deprecated 4.1.6.9
712
  */
713
  /*public function get_prev_question( $id ) {
714
  $prev = false;
732
  * @param int $id
733
  *
734
  * @return bool
735
+ * @deprecated 4.1.6.9
736
  */
737
  /*public function get_next_question( $id ) {
738
  $next = false;
757
  * @param int $start
758
  *
759
  * @return bool|mixed
760
+ * @deprecated 4.1.6.9
761
  */
762
  /*public function get_question_index( $id, $start = 0 ) {
763
  $index = 0;
825
  $questions = (array) $results->questions;
826
 
827
  } else {
828
+ $questions = $this->get_question_ids();
 
829
  }
830
 
831
  $position = array_search( $question, $questions );
1023
  * @param null $position
1024
  *
1025
  * @return array
1026
+ * @deprecated 4.1.6.9
1027
  */
1028
  /*public function get_question_number_class( $question_id, $position = null ) {
1029
  if ( null === $position ) {
inc/quiz/lp-quiz-functions.php CHANGED
@@ -58,8 +58,10 @@ function learn_press_get_question_answer_meta( $item_id, $meta_key, $single = tr
58
  * @param boolean $only_ids return an array of questions with IDs only or as post objects
59
  *
60
  * @return array|null
 
61
  */
62
  function learn_press_get_quiz_questions( $quiz_id = null, $only_ids = true ) {
 
63
  if ( ! $quiz_id ) {
64
  $quiz_id = get_the_ID();
65
  }
@@ -93,7 +95,7 @@ function learn_press_get_quiz_id( $id ) {
93
  * @param int $quiz_id The ID of quiz need to check
94
  *
95
  * @return boolean
96
- * @depecated 4.1.6.9
97
  */
98
  /*function learn_press_user_has_completed_quiz( $user_id = null, $quiz_id = null ) {
99
  $user = learn_press_get_user( $user_id );
58
  * @param boolean $only_ids return an array of questions with IDs only or as post objects
59
  *
60
  * @return array|null
61
+ * @deprecated 4.1.7.3
62
  */
63
  function learn_press_get_quiz_questions( $quiz_id = null, $only_ids = true ) {
64
+ _deprecated_function( __FUNCTION__, '4.1.7.3' );
65
  if ( ! $quiz_id ) {
66
  $quiz_id = get_the_ID();
67
  }
95
  * @param int $quiz_id The ID of quiz need to check
96
  *
97
  * @return boolean
98
+ * @deprecated 4.1.6.9
99
  */
100
  /*function learn_press_user_has_completed_quiz( $user_id = null, $quiz_id = null ) {
101
  $user = learn_press_get_user( $user_id );
inc/rest-api/class-lp-rest-authentication.php DELETED
@@ -1,185 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_REST_Authentication
5
- *
6
- * @since 3.3.0
7
- * @depecated 4.1.6.8
8
- */
9
- class LP_REST_Authentication {
10
-
11
- /**
12
- * @var string
13
- */
14
- protected static $wp_rest_nonce = '';
15
-
16
- /**
17
- * @var int
18
- */
19
- protected static $wp_current_user_id = 0;
20
-
21
- public function __construct() {
22
- add_action( 'rest_authentication_errors', array( $this, 'rest_cookie_check_errors' ), 0 );
23
- // add_filter( 'determine_current_user', array( $this, 'authenticate' ), 15 );
24
- // add_filter( 'rest_pre_dispatch', array( $this, 'check_user_permissions' ), 10, 3 );
25
- }
26
-
27
- /**
28
- * @param $result
29
- *
30
- * @return mixed
31
- */
32
- public function rest_cookie_check_errors( $result ) {
33
- if ( ! empty( $result ) ) {
34
- return $result;
35
- }
36
-
37
- if ( is_user_logged_in() ) {
38
- self::$wp_rest_nonce = wp_create_nonce( 'wp_rest' );
39
- self::$wp_current_user_id = get_current_user_id();
40
- }
41
-
42
- return $result;
43
- }
44
-
45
- /**
46
- * Check if request is rest api.
47
- *
48
- * @return bool
49
- */
50
- public function is_rest_api_request() {
51
- if ( empty( $_SERVER['REQUEST_URI'] ) ) {
52
- return false;
53
- }
54
-
55
- $rest_prefix = trailingslashit( rest_get_url_prefix() );
56
- $request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );
57
-
58
- return apply_filters( 'learn-press/is-rest-api-request', false !== strpos( $request_uri, $rest_prefix . 'lp/' ) );
59
- }
60
-
61
- /**
62
- * @param int $user_id
63
- *
64
- * @return int
65
- */
66
- public function authenticate( $user_id ) {
67
- if ( $user_id || ! $this->is_rest_api_request() ) {
68
- return $user_id;
69
- }
70
-
71
- if ( is_ssl() ) {
72
- $user_id = $this->perform_basic_authentication();
73
- }
74
-
75
- if ( $user_id ) {
76
- return $user_id;
77
- }
78
-
79
- return $this->perform_oauth_authentication();
80
- }
81
-
82
- public function perform_basic_authentication() {
83
- return 2;
84
- }
85
-
86
- public function perform_oauth_authentication() {
87
-
88
- return 2;
89
-
90
- $params = $this->get_oauth_parameters();
91
- if ( empty( $params ) ) {
92
- return false;
93
- }
94
-
95
- // Fetch WP user by consumer key.
96
- $this->user = $this->get_user_data_by_consumer_key( $params['oauth_consumer_key'] );
97
-
98
- if ( empty( $this->user ) ) {
99
- $this->set_error( new WP_Error( 'learnpress_rest_authentication_error', __( 'Consumer key is invalid.', 'learnpress' ), array( 'status' => 401 ) ) );
100
-
101
- return false;
102
- }
103
-
104
- // Perform OAuth validation.
105
- $signature = $this->check_oauth_signature( $this->user, $params );
106
- if ( is_wp_error( $signature ) ) {
107
- $this->set_error( $signature );
108
- return false;
109
- }
110
-
111
- $timestamp_and_nonce = $this->check_oauth_timestamp_and_nonce( $this->user, $params['oauth_timestamp'], $params['oauth_nonce'] );
112
- if ( is_wp_error( $timestamp_and_nonce ) ) {
113
- $this->set_error( $timestamp_and_nonce );
114
- return false;
115
- }
116
-
117
- return $this->user->user_id;
118
- }
119
-
120
- public function get_user_by_consumer_key() {
121
-
122
- }
123
-
124
- public function check_user_permissions() {
125
-
126
- }
127
-
128
- /**
129
- * @return string
130
- */
131
- public static function get_wp_rest_nonce() {
132
- return self::$wp_rest_nonce;
133
- }
134
-
135
- /**
136
- * @return int
137
- */
138
- public static function get_wp_user_id() {
139
- return self::$wp_current_user_id;
140
- }
141
-
142
- /**
143
- * Check permission of a user on a post type.
144
- *
145
- * @param string $post_type
146
- * @param string $permission
147
- * @param int $user_id
148
- *
149
- * @return boolean
150
- */
151
- public static function check_post_permissions( $post_type, $permission = 'read', $user_id = 0 ) {
152
- if ( ! $user_id ) {
153
- $user_id = self::get_wp_user_id();
154
- }
155
-
156
- $permissions = array(
157
- 'read' => 'read_private_posts',
158
- 'create' => 'publish_posts',
159
- 'edit' => 'edit_post',
160
- 'delete' => 'delete_post',
161
- 'batch' => 'edit_others_posts',
162
- );
163
-
164
- if ( 'revision' === $post_type ) {
165
- $user_permission = false;
166
- } else {
167
- $cap = $permissions[ $permission ];
168
- $post_type_object = get_post_type_object( $post_type );
169
- $user_permission = current_user_can( $post_type_object->cap->$cap, $user_id );
170
- }
171
-
172
- return apply_filters( 'learn-press/rest/check-permission', $user_permission, $permission, $user_id, $post_type );
173
- }
174
-
175
- /**
176
- * Check permission if user is logged in.
177
- *
178
- * @return bool
179
- */
180
- public static function check_logged_in_permission() {
181
- return ! ! self::get_wp_user_id();
182
- }
183
- }
184
-
185
- return new LP_REST_Authentication();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/rest-api/v1/admin/class-lp-admin-rest-reset-data-controller.php CHANGED
@@ -174,7 +174,7 @@ class LP_REST_Admin_Reset_Data_Controller extends LP_Abstract_REST_Controller {
174
  array(
175
  'status' => LP_COURSE_ENROLLED,
176
  'graduation' => 'in-progress',
177
- 'start_time' => current_time( 'mysql', true ),
178
  'end_time' => null,
179
  ),
180
  array(
174
  array(
175
  'status' => LP_COURSE_ENROLLED,
176
  'graduation' => 'in-progress',
177
+ 'start_time' => current_time( 'mysql', 1 ),
178
  'end_time' => null,
179
  ),
180
  array(
inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php CHANGED
@@ -55,7 +55,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
55
  '(?P<key>[\w]+)' => array(
56
  'args' => array(
57
  'id' => array(
58
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
59
  'type' => 'string',
60
  ),
61
  ),
@@ -297,7 +297,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
297
  $can_enroll = $user->can_enroll_course( $course_id, false );
298
 
299
  if ( ! $can_enroll->check ) {
300
- throw new Exception( $can_enroll->message ?? esc_html__( 'Error: Cannot enroll course.', 'learnpress' ) );
301
  }
302
 
303
  $filter = new LP_User_Items_Filter();
@@ -311,14 +311,14 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
311
  'user_item_id' => $course_item->user_item_id,
312
  'graduation' => LP_COURSE_GRADUATION_IN_PROGRESS,
313
  'status' => LP_COURSE_ENROLLED,
314
- 'start_time' => current_time( 'mysql', true ),
315
  ];
316
 
317
  $user_item_new_or_update = new LP_User_Item_Course( $user_item_data );
318
  $result = $user_item_new_or_update->update();
319
 
320
  if ( ! $result ) {
321
- throw new Exception( esc_html__( 'Error: Can\'t Enroll course.', 'learnpress' ) );
322
  }
323
 
324
  do_action( 'learnpress/user/course-enrolled', $course_item->ref_id, $course_id, $user->get_id() );
@@ -337,7 +337,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
337
  $cart_id = $cart->add_to_cart( $course_id, 1, array() );
338
 
339
  if ( ! $cart_id ) {
340
- throw new Exception( esc_html__( 'Error: Can\'t add Course to cart.', 'learnpress' ) );
341
  }
342
 
343
  if ( is_user_logged_in() ) {
@@ -359,7 +359,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
359
  $response->status = 'success';
360
  // Course has no items
361
  $response->message = esc_html__(
362
- 'Congrats! You enroll course successfully. Redirecting...',
363
  'learnpress'
364
  );
365
 
@@ -376,7 +376,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
376
  );
377
 
378
  if ( empty( $redirect_url ) ) {
379
- throw new Exception( __( 'Error: Please setup page for checkout.', 'learnpress' ) );
380
  } elseif ( ! is_user_logged_in() ) { // Fix case: cache page with user anonymous
381
  $redirect_url = LP_Helper::get_link_no_cache( $redirect_url );
382
  }
@@ -423,7 +423,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
423
  $user = learn_press_get_current_user();
424
 
425
  if ( ! $user->can_purchase_course( $course_id ) ) {
426
- throw new Exception( esc_html__( 'Error: Cannot purchase course!.', 'learnpress' ) );
427
  }
428
 
429
  $latest_user_item_id = 0;
@@ -485,7 +485,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
485
  $cart_id = $cart->add_to_cart( $course_id, 1, array() );
486
 
487
  if ( ! $cart_id ) {
488
- throw new Exception( __( 'Error: Can\'t add Course to cart.', 'learnpress' ) );
489
  }
490
 
491
  if ( ! empty( $allow_repurchase_type ) ) {
@@ -500,7 +500,7 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
500
  );
501
 
502
  if ( empty( $redirect_url ) ) {
503
- throw new Exception( __( 'Error: Please setup page for checkout.', 'learnpress' ) );
504
  } elseif ( ! is_user_logged_in() ) { // Fix case: cache page with user anonymous
505
  $redirect_url = LP_Helper::get_link_no_cache( $redirect_url );
506
  }
@@ -550,19 +550,22 @@ class LP_REST_Courses_Controller extends LP_Abstract_REST_Controller {
550
  $can_retry = $user->can_retry_course( $course_id );
551
 
552
  if ( ! $can_retry ) {
553
- throw new Exception( __( 'You can\'t retry course', 'learnpress' ) );
554
  }
555
 
556
  $user_course_data = $user->get_course_data( $course_id );
 
 
 
557
 
558
  // Up retaken.
559
  $user_course_data->increase_retake_count();
560
 
561
- // Set status, start_time, end_time of course to enrolled.
562
  $user_course_data->set_status( LP_COURSE_ENROLLED )
563
- ->set_start_time( current_time( 'mysql', true ) )
564
- ->set_end_time( '' )
565
- ->set_graduation( 'in-progress' )
566
  ->update();
567
 
568
  // Remove items' course user learned.
55
  '(?P<key>[\w]+)' => array(
56
  'args' => array(
57
  'id' => array(
58
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
59
  'type' => 'string',
60
  ),
61
  ),
297
  $can_enroll = $user->can_enroll_course( $course_id, false );
298
 
299
  if ( ! $can_enroll->check ) {
300
+ throw new Exception( $can_enroll->message ?? esc_html__( 'Error: Cannot enroll in the course.', 'learnpress' ) );
301
  }
302
 
303
  $filter = new LP_User_Items_Filter();
311
  'user_item_id' => $course_item->user_item_id,
312
  'graduation' => LP_COURSE_GRADUATION_IN_PROGRESS,
313
  'status' => LP_COURSE_ENROLLED,
314
+ 'start_time' => time(),
315
  ];
316
 
317
  $user_item_new_or_update = new LP_User_Item_Course( $user_item_data );
318
  $result = $user_item_new_or_update->update();
319
 
320
  if ( ! $result ) {
321
+ throw new Exception( esc_html__( 'Error: Cannot Enroll in the course.', 'learnpress' ) );
322
  }
323
 
324
  do_action( 'learnpress/user/course-enrolled', $course_item->ref_id, $course_id, $user->get_id() );
337
  $cart_id = $cart->add_to_cart( $course_id, 1, array() );
338
 
339
  if ( ! $cart_id ) {
340
+ throw new Exception( esc_html__( 'Error: The course cannot be added to the cart.', 'learnpress' ) );
341
  }
342
 
343
  if ( is_user_logged_in() ) {
359
  $response->status = 'success';
360
  // Course has no items
361
  $response->message = esc_html__(
362
+ 'Congrats! You have enrolled in the course successfully. Redirecting...',
363
  'learnpress'
364
  );
365
 
376
  );
377
 
378
  if ( empty( $redirect_url ) ) {
379
+ throw new Exception( __( 'Error: Please set up a page for checkout.', 'learnpress' ) );
380
  } elseif ( ! is_user_logged_in() ) { // Fix case: cache page with user anonymous
381
  $redirect_url = LP_Helper::get_link_no_cache( $redirect_url );
382
  }
423
  $user = learn_press_get_current_user();
424
 
425
  if ( ! $user->can_purchase_course( $course_id ) ) {
426
+ throw new Exception( esc_html__( 'Error: Cannot purchase the course!', 'learnpress' ) );
427
  }
428
 
429
  $latest_user_item_id = 0;
485
  $cart_id = $cart->add_to_cart( $course_id, 1, array() );
486
 
487
  if ( ! $cart_id ) {
488
+ throw new Exception( __( 'Error: The course cannot be added to the cart.', 'learnpress' ) );
489
  }
490
 
491
  if ( ! empty( $allow_repurchase_type ) ) {
500
  );
501
 
502
  if ( empty( $redirect_url ) ) {
503
+ throw new Exception( __( 'Error: Please set up a page for checkout.', 'learnpress' ) );
504
  } elseif ( ! is_user_logged_in() ) { // Fix case: cache page with user anonymous
505
  $redirect_url = LP_Helper::get_link_no_cache( $redirect_url );
506
  }
550
  $can_retry = $user->can_retry_course( $course_id );
551
 
552
  if ( ! $can_retry ) {
553
+ throw new Exception( __( 'You can\'t retry the course', 'learnpress' ) );
554
  }
555
 
556
  $user_course_data = $user->get_course_data( $course_id );
557
+ if ( ! $user_course_data ) {
558
+ throw new Exception( __( 'Invalid course data of user', 'learnpress' ) );
559
+ }
560
 
561
  // Up retaken.
562
  $user_course_data->increase_retake_count();
563
 
564
+ // Set status, start_time, end_time of course to enrol.
565
  $user_course_data->set_status( LP_COURSE_ENROLLED )
566
+ ->set_start_time( time() )
567
+ ->set_end_time()
568
+ ->set_graduation( LP_COURSE_GRADUATION_IN_PROGRESS )
569
  ->update();
570
 
571
  // Remove items' course user learned.
inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php CHANGED
@@ -64,11 +64,11 @@ class LP_REST_Lazy_Load_Controller extends LP_Abstract_REST_Controller {
64
  try {
65
  $course = learn_press_get_course( $course_id );
66
  if ( ! $course ) {
67
- throw new Exception( esc_html__( 'Course is invalid!', 'learnpress' ) );
68
  }
69
 
70
  if ( $course->is_no_required_enroll() ) {
71
- throw new Exception( esc_html__( 'Course is no require enroll!', 'learnpress' ) );
72
  }
73
 
74
  $user = learn_press_get_user( $user_id );
@@ -115,14 +115,14 @@ class LP_REST_Lazy_Load_Controller extends LP_Abstract_REST_Controller {
115
  if ( $course_id && $user_id ) {
116
  $course = learn_press_get_course( $course_id );
117
  if ( ! $course ) {
118
- $response->message = __( 'Course is invalid', 'learnpress' );
119
 
120
  return $response;
121
  }
122
 
123
  $user = learn_press_get_user( $user_id );
124
  if ( $user->is_guest() ) {
125
- $response->message = __( 'You are Guest', 'learnpress' );
126
 
127
  return $response;
128
  }
@@ -170,12 +170,12 @@ class LP_REST_Lazy_Load_Controller extends LP_Abstract_REST_Controller {
170
 
171
  try {
172
  if ( empty( $course_id ) ) {
173
- throw new Exception( esc_html__( 'Course is invalid!', 'learnpress' ) );
174
  }
175
 
176
  $course = learn_press_get_course( $course_id );
177
  if ( ! $course ) {
178
- throw new Exception( esc_html__( 'Course is invalid!', 'learnpress' ) );
179
  }
180
 
181
  $filters = new LP_Section_Filter();
@@ -254,7 +254,7 @@ class LP_REST_Lazy_Load_Controller extends LP_Abstract_REST_Controller {
254
 
255
  try {
256
  if ( empty( $section_id ) ) {
257
- throw new Exception( esc_html__( 'Section is invalid!', 'learnpress' ) );
258
  }
259
 
260
  $filters = new LP_Section_Items_Filter();
64
  try {
65
  $course = learn_press_get_course( $course_id );
66
  if ( ! $course ) {
67
+ throw new Exception( esc_html__( 'The course is invalid!', 'learnpress' ) );
68
  }
69
 
70
  if ( $course->is_no_required_enroll() ) {
71
+ throw new Exception( esc_html__( 'The course is not required to enroll!', 'learnpress' ) );
72
  }
73
 
74
  $user = learn_press_get_user( $user_id );
115
  if ( $course_id && $user_id ) {
116
  $course = learn_press_get_course( $course_id );
117
  if ( ! $course ) {
118
+ $response->message = __( 'The course is invalid!', 'learnpress' );
119
 
120
  return $response;
121
  }
122
 
123
  $user = learn_press_get_user( $user_id );
124
  if ( $user->is_guest() ) {
125
+ $response->message = __( 'You are a Guest', 'learnpress' );
126
 
127
  return $response;
128
  }
170
 
171
  try {
172
  if ( empty( $course_id ) ) {
173
+ throw new Exception( esc_html__( 'The course is invalid!', 'learnpress' ) );
174
  }
175
 
176
  $course = learn_press_get_course( $course_id );
177
  if ( ! $course ) {
178
+ throw new Exception( esc_html__( 'The course is invalid!', 'learnpress' ) );
179
  }
180
 
181
  $filters = new LP_Section_Filter();
254
 
255
  try {
256
  if ( empty( $section_id ) ) {
257
+ throw new Exception( esc_html__( 'The section is invalid!', 'learnpress' ) );
258
  }
259
 
260
  $filters = new LP_Section_Items_Filter();
inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php CHANGED
@@ -124,7 +124,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
124
  }
125
 
126
  if ( ! LP_WP_Filesystem::instance()->is_writable( $upload_dir['path'] ) ) {
127
- throw new Exception( __( 'Upload directory is not writable', 'learnpress' ) );
128
  }
129
 
130
  // Delete old image if exists
@@ -146,7 +146,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
146
  $put_content = LP_WP_Filesystem::instance()->put_contents( $upload_dir['path'] . '/' . $file_name, $file_base64, FS_CHMOD_FILE );
147
 
148
  if ( ! $put_content ) {
149
- throw new Exception( __( 'Can not write file', 'learnpress' ) );
150
  }
151
 
152
  update_user_meta( $user_id, '_lp_profile_picture', $upload_dir['subdir'] . '/' . $file_name );
@@ -167,7 +167,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
167
  $user_id = get_current_user_id();
168
 
169
  if ( ! $user_id ) {
170
- throw new Exception( esc_html__( 'User is invalid', 'learnpress' ) );
171
  }
172
 
173
  $upload_dir = learn_press_user_profile_picture_upload_dir( true );
@@ -179,7 +179,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
179
  }
180
 
181
  if ( ! LP_WP_Filesystem::instance()->is_writable( $upload_dir['path'] ) ) {
182
- throw new Exception( __( 'Upload directory is not writable', 'learnpress' ) );
183
  }
184
 
185
  $path_img = get_user_meta( $user_id, '_lp_profile_picture', true );
@@ -191,7 +191,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
191
  LP_WP_Filesystem::instance()->unlink( $path );
192
 
193
  $response->status = 'success';
194
- $response->message = esc_html__( 'Profile picture remove successfully', 'learnpress' );
195
  }
196
  }
197
  } catch ( \Throwable $th ) {
@@ -214,7 +214,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
214
  $user = learn_press_get_user( $user_id );
215
 
216
  if ( ! $user ) {
217
- throw new Exception( esc_html__( 'User not exists!', 'learnpress' ) );
218
  }
219
 
220
  $profile = learn_press_get_profile( $user_id );
@@ -334,7 +334,7 @@ class LP_REST_Profile_Controller extends LP_Abstract_REST_Controller {
334
 
335
  try {
336
  if ( ! $user_id ) {
337
- throw new Exception( __( 'User is invalid!', 'learnpress' ) );
338
  }
339
 
340
  $filter = new LP_User_Items_Filter();
124
  }
125
 
126
  if ( ! LP_WP_Filesystem::instance()->is_writable( $upload_dir['path'] ) ) {
127
+ throw new Exception( __( 'The upload directory is not writable', 'learnpress' ) );
128
  }
129
 
130
  // Delete old image if exists
146
  $put_content = LP_WP_Filesystem::instance()->put_contents( $upload_dir['path'] . '/' . $file_name, $file_base64, FS_CHMOD_FILE );
147
 
148
  if ( ! $put_content ) {
149
+ throw new Exception( __( 'Cannot write the file', 'learnpress' ) );
150
  }
151
 
152
  update_user_meta( $user_id, '_lp_profile_picture', $upload_dir['subdir'] . '/' . $file_name );
167
  $user_id = get_current_user_id();
168
 
169
  if ( ! $user_id ) {
170
+ throw new Exception( esc_html__( 'The user is invalid', 'learnpress' ) );
171
  }
172
 
173
  $upload_dir = learn_press_user_profile_picture_upload_dir( true );
179
  }
180
 
181
  if ( ! LP_WP_Filesystem::instance()->is_writable( $upload_dir['path'] ) ) {
182
+ throw new Exception( __( 'The upload directory is not writable', 'learnpress' ) );
183
  }
184
 
185
  $path_img = get_user_meta( $user_id, '_lp_profile_picture', true );
191
  LP_WP_Filesystem::instance()->unlink( $path );
192
 
193
  $response->status = 'success';
194
+ $response->message = esc_html__( 'The profile picture has been removed successfully', 'learnpress' );
195
  }
196
  }
197
  } catch ( \Throwable $th ) {
214
  $user = learn_press_get_user( $user_id );
215
 
216
  if ( ! $user ) {
217
+ throw new Exception( esc_html__( 'The user does not exist!', 'learnpress' ) );
218
  }
219
 
220
  $profile = learn_press_get_profile( $user_id );
334
 
335
  try {
336
  if ( ! $user_id ) {
337
+ throw new Exception( __( 'The user is invalid', 'learnpress' ) );
338
  }
339
 
340
  $filter = new LP_User_Items_Filter();
inc/rest-api/v1/frontend/class-lp-rest-settings-controller.php CHANGED
@@ -20,7 +20,7 @@ class LP_REST_Settings_Controller extends LP_Abstract_REST_Controller {
20
  '(?P<key>[\w]+)' => array(
21
  'args' => array(
22
  'id' => array(
23
- 'description' => __( 'Unique identifier for the resource.', 'learnpress' ),
24
  'type' => 'string',
25
  ),
26
  ),
20
  '(?P<key>[\w]+)' => array(
21
  'args' => array(
22
  'id' => array(
23
+ 'description' => __( 'A unique identifier for the resource.', 'learnpress' ),
24
  'type' => 'string',
25
  ),
26
  ),
inc/rest-api/v1/frontend/class-lp-rest-users-controller.php CHANGED
@@ -92,13 +92,13 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
92
  public function get_item_endpoint_args() {
93
  return array(
94
  'item_id' => array(
95
- 'description' => __( 'The ID of course item object.', 'learnpress' ),
96
  'type' => 'int',
97
  'validate_callback' => array( $this, 'validate_arg' ),
98
  'required' => true,
99
  ),
100
  'course_id' => array(
101
- 'description' => __( 'The ID of course object.', 'learnpress' ),
102
  'type' => 'int',
103
  'validate_callback' => array( $this, 'validate_arg' ),
104
  'required' => true,
@@ -159,13 +159,15 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
159
  $quiz = learn_press_get_quiz( $item_id );
160
 
161
  if ( ! $course ) {
162
- throw new Exception( __( 'Course is invalid!', 'learnpress' ) );
163
  }
164
 
165
  if ( ! $quiz ) {
166
- throw new Exception( __( 'Quiz is invalid!', 'learnpress' ) );
167
  }
168
 
 
 
169
  // For no required enroll course
170
  if ( $user->is_guest() && $course->is_no_required_enroll() ) {
171
  if ( $quiz->get_retake_count() >= 0 ) {
@@ -204,6 +206,8 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
204
  $lp_quiz_cache->clear( $key_cache );
205
  // End
206
 
 
 
207
  $show_check = $quiz->get_instant_check();
208
  $duration = $quiz->get_duration();
209
  $show_correct_review = $quiz->get_show_correct_review();
@@ -250,7 +254,7 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
250
  * @return WP_Error|WP_HTTP_Response|WP_REST_Response
251
  * @editor tungnx
252
  * @modify 4.1.4.1
253
- * @version 1.0.1
254
  */
255
  public function submit_quiz_new( WP_REST_Request $request ) {
256
  //$response = new LP_REST_Response();
@@ -269,20 +273,19 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
269
  $course = learn_press_get_course( $course_id );
270
 
271
  if ( ! $course ) {
272
- throw new Exception( 'Course is invalid!' );
273
  }
 
 
 
 
 
 
274
 
275
  // Course is no required enroll
276
  if ( $course->is_no_required_enroll() ) {
277
  $no_required_enroll = new LP_Course_No_Required_Enroll( $course );
278
 
279
- // Use for Review Quiz.
280
- $quiz = learn_press_get_quiz( $item_id );
281
-
282
- if ( ! $quiz ) {
283
- throw new Exception( __( 'Quiz is invalid!', 'learnpress' ) );
284
- }
285
-
286
  $result = $no_required_enroll->get_result_quiz( $quiz, $answered );
287
 
288
  // Set time spent
@@ -298,8 +301,6 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
298
  $response['status'] = 'success';
299
  $response['results'] = $result;
300
 
301
- //learn_press_setcookie( 'quiz_submit_status_' . $course_id . '_' . $item_id . '', 'completed', time() + ( 7 * DAY_IN_SECONDS ), false );
302
-
303
  return rest_ensure_response( $response );
304
  }
305
 
@@ -310,15 +311,14 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
310
  throw new Exception( 'User not enrolled course!' );
311
  }
312
 
 
 
 
313
  $user_quiz = $user_course->get_item( $item_id );
314
-
315
  if ( ! $user_quiz ) {
316
  throw new Exception();
317
  }
318
 
319
- $end_time = gmdate( 'Y-m-d H:i:s', strtotime( $user_quiz->get_start_time( 'mysql' ) . " + $time_spend second" ) );
320
- $user_quiz->set_end_time( $end_time );
321
-
322
  // For case save result when check instant answer
323
  $result_instant_check = LP_User_Items_Result_DB::instance()->get_result( $user_quiz->get_user_item_id() );
324
  if ( $result_instant_check ) {
@@ -329,7 +329,11 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
329
  }
330
  }
331
 
332
- // Calculate quiz result and save
 
 
 
 
333
  $result = $user_quiz->calculate_quiz_result( $answered );
334
  // Save
335
  LP_User_Items_Result_DB::instance()->update( $user_quiz->get_user_item_id(), wp_json_encode( $result ) );
@@ -395,7 +399,7 @@ class LP_REST_Users_Controller extends LP_Abstract_REST_Controller {
395
  } else {
396
  $user = learn_press_get_current_user();
397
  if ( $user->is_guest() ) {
398
- throw new Exception( 'User is invalid!', 'learnrpess' );
399
  }
400
 
401
  $user_course = $user->get_course_data( $course_id );
92
  public function get_item_endpoint_args() {
93
  return array(
94
  'item_id' => array(
95
+ 'description' => __( 'The ID of the course item object.', 'learnpress' ),
96
  'type' => 'int',
97
  'validate_callback' => array( $this, 'validate_arg' ),
98
  'required' => true,
99
  ),
100
  'course_id' => array(
101
+ 'description' => __( 'The ID of the course object.', 'learnpress' ),
102
  'type' => 'int',
103
  'validate_callback' => array( $this, 'validate_arg' ),
104
  'required' => true,
159
  $quiz = learn_press_get_quiz( $item_id );
160
 
161
  if ( ! $course ) {
162
+ throw new Exception( __( 'The course is invalid!', 'learnpress' ) );
163
  }
164
 
165
  if ( ! $quiz ) {
166
+ throw new Exception( __( 'The quiz is invalid!', 'learnpress' ) );
167
  }
168
 
169
+ do_action( 'learn-press/user/before/start-quiz', $item_id, $course_id, $user_id );
170
+
171
  // For no required enroll course
172
  if ( $user->is_guest() && $course->is_no_required_enroll() ) {
173
  if ( $quiz->get_retake_count() >= 0 ) {
206
  $lp_quiz_cache->clear( $key_cache );
207
  // End
208
 
209
+ $quiz->set_course( $course );
210
+
211
  $show_check = $quiz->get_instant_check();
212
  $duration = $quiz->get_duration();
213
  $show_correct_review = $quiz->get_show_correct_review();
254
  * @return WP_Error|WP_HTTP_Response|WP_REST_Response
255
  * @editor tungnx
256
  * @modify 4.1.4.1
257
+ * @version 1.0.2
258
  */
259
  public function submit_quiz_new( WP_REST_Request $request ) {
260
  //$response = new LP_REST_Response();
273
  $course = learn_press_get_course( $course_id );
274
 
275
  if ( ! $course ) {
276
+ throw new Exception( 'The course is invalid!' );
277
  }
278
+ // Use for Review Quiz.
279
+ $quiz = learn_press_get_quiz( $item_id );
280
+ if ( ! $quiz ) {
281
+ throw new Exception( __( 'The quiz is invalid!', 'learnpress' ) );
282
+ }
283
+ $quiz->set_course( $course );
284
 
285
  // Course is no required enroll
286
  if ( $course->is_no_required_enroll() ) {
287
  $no_required_enroll = new LP_Course_No_Required_Enroll( $course );
288
 
 
 
 
 
 
 
 
289
  $result = $no_required_enroll->get_result_quiz( $quiz, $answered );
290
 
291
  // Set time spent
301
  $response['status'] = 'success';
302
  $response['results'] = $result;
303
 
 
 
304
  return rest_ensure_response( $response );
305
  }
306
 
311
  throw new Exception( 'User not enrolled course!' );
312
  }
313
 
314
+ /**
315
+ * @var LP_User_Item_Quiz $user_quiz
316
+ */
317
  $user_quiz = $user_course->get_item( $item_id );
 
318
  if ( ! $user_quiz ) {
319
  throw new Exception();
320
  }
321
 
 
 
 
322
  // For case save result when check instant answer
323
  $result_instant_check = LP_User_Items_Result_DB::instance()->get_result( $user_quiz->get_user_item_id() );
324
  if ( $result_instant_check ) {
329
  }
330
  }
331
 
332
+ // Set end time.
333
+ $start_time = $user_quiz->get_start_time()->getTimestamp();
334
+ $user_quiz->set_end_time( $start_time + $time_spend );
335
+
336
+ // Calculate quiz result and save.
337
  $result = $user_quiz->calculate_quiz_result( $answered );
338
  // Save
339
  LP_User_Items_Result_DB::instance()->update( $user_quiz->get_user_item_id(), wp_json_encode( $result ) );
399
  } else {
400
  $user = learn_press_get_current_user();
401
  if ( $user->is_guest() ) {
402
+ throw new Exception( 'The user is invalid', 'learnrpess' );
403
  }
404
 
405
  $user_course = $user->get_course_data( $course_id );
inc/settings/abstract-settings-page.php CHANGED
@@ -48,7 +48,7 @@ class LP_Abstract_Settings_Page extends LP_Abstract_Settings {
48
  if ( $settings ) {
49
  LP_Meta_Box_Helper::output_fields( $settings );
50
  } else {
51
- echo esc_html__( 'No setting available.', 'learnpress' );
52
  }
53
  }
54
 
48
  if ( $settings ) {
49
  LP_Meta_Box_Helper::output_fields( $settings );
50
  } else {
51
+ echo esc_html__( 'No settings available.', 'learnpress' );
52
  }
53
  }
54
 
inc/shortcodes/class-lp-shortcode-become-a-teacher.php CHANGED
@@ -74,7 +74,7 @@ if ( ! class_exists( 'LP_Shortcode_Become_A_Teacher' ) ) {
74
  $message = sprintf( esc_html__( 'Please %s to send your request!', 'learnpress' ), sprintf( '<strong><a href="%s">%s</a></strong>', learn_press_get_login_url(), _x( 'login', 'become-teacher-form', 'learnpress' ) ) );
75
  } else {
76
  if ( learn_press_become_teacher_sent() ) {
77
- $message = esc_html__( 'Your have already sent the request. Please wait for approvement.', 'learnpress' );
78
  } elseif ( learn_press_user_maybe_is_a_teacher() ) {
79
  $message = esc_html__( 'You are a teacher!', 'learnpress' );
80
  }
@@ -84,7 +84,7 @@ if ( ! class_exists( 'LP_Shortcode_Become_A_Teacher' ) ) {
84
  $atts = shortcode_atts(
85
  array(
86
  'title' => esc_html__( 'Become a Teacher', 'learnpress' ),
87
- 'description' => esc_html__( 'Fill in your information and send us to become a teacher.', 'learnpress' ),
88
  'submit_button_text' => esc_html__( 'Submit', 'learnpress' ),
89
  'submit_button_process_text' => esc_html__( 'Processing', 'learnpress' ),
90
  ),
74
  $message = sprintf( esc_html__( 'Please %s to send your request!', 'learnpress' ), sprintf( '<strong><a href="%s">%s</a></strong>', learn_press_get_login_url(), _x( 'login', 'become-teacher-form', 'learnpress' ) ) );
75
  } else {
76
  if ( learn_press_become_teacher_sent() ) {
77
+ $message = esc_html__( 'You have already sent the request. Please wait for the approval.', 'learnpress' );
78
  } elseif ( learn_press_user_maybe_is_a_teacher() ) {
79
  $message = esc_html__( 'You are a teacher!', 'learnpress' );
80
  }
84
  $atts = shortcode_atts(
85
  array(
86
  'title' => esc_html__( 'Become a Teacher', 'learnpress' ),
87
+ 'description' => esc_html__( 'Fill in your information and send it to us to become a teacher.', 'learnpress' ),
88
  'submit_button_text' => esc_html__( 'Submit', 'learnpress' ),
89
  'submit_button_process_text' => esc_html__( 'Processing', 'learnpress' ),
90
  ),
inc/shortcodes/class-lp-shortcode-button-enroll.php DELETED
@@ -1,96 +0,0 @@
1
- <?php
2
- /**
3
- * Button Enroll Shortcode.
4
- *
5
- * @author ThimPress
6
- * @category Shortcodes
7
- * @package Learnpress/Shortcodes
8
- * @version 3.0.0
9
- * @extends LP_Abstract_Shortcode
10
- */
11
-
12
- /**
13
- * Prevent loading this file directly
14
- */
15
- defined( 'ABSPATH' ) || exit();
16
-
17
- if ( ! class_exists( 'LP_Shortcode_Button_Enroll' ) ) {
18
-
19
- /**
20
- * Class LP_Shortcode_Button_Enroll
21
- *
22
- * @since 3.0.0
23
- */
24
- class LP_Shortcode_Button_Enroll extends LP_Abstract_Shortcode {
25
-
26
- /**
27
- * LP_Shortcode_Button_Enroll constructor.
28
- *
29
- * @param mixed $atts
30
- */
31
- public function __construct( $atts = '' ) {
32
- parent::__construct( $atts );
33
-
34
- $this->_atts = shortcode_atts(
35
- array(
36
- 'id' => 0,
37
- 'text' => '',
38
- ),
39
- $this->_atts
40
- );
41
- }
42
-
43
- /**
44
- * Output form.
45
- *
46
- * @return string
47
- */
48
- public function output() {
49
- ob_start();
50
-
51
- $atts = $this->_atts;
52
-
53
- if ( 'current' === $atts['id'] ) {
54
- $course_id = learn_press_is_course() ? get_the_ID() : 0;
55
- } else {
56
- $course_id = $atts['id'];
57
- }
58
-
59
- $course = learn_press_get_course( $course_id );
60
-
61
- if ( $course_id && $course ) {
62
- LP_Global::set_course( $course );
63
- global $post;
64
-
65
- $post = get_post( $course_id );
66
-
67
- setup_postdata( $post );
68
- add_filter( 'learn-press/enroll-course-button-text', array( $this, 'button_text' ) );
69
-
70
- learn_press_get_template( 'single-course/buttons/enroll.php', array( 'course' => $course ) );
71
-
72
- remove_filter( 'learn-press/enroll-course-button-text', array( $this, 'button_text' ) );
73
- wp_reset_postdata();
74
- LP_Global::reset();
75
-
76
- } else {
77
-
78
- }
79
-
80
- return ob_get_clean();
81
- }
82
-
83
- /**
84
- * @param string $text
85
- *
86
- * @return string
87
- */
88
- public function button_text( $text ) {
89
- if ( $this->_atts['text'] ) {
90
- $text = $this->_atts['text'];
91
- }
92
-
93
- return $text;
94
- }
95
- }
96
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/shortcodes/class-lp-shortcode-button-purchase.php CHANGED
@@ -63,7 +63,6 @@ if ( ! class_exists( 'LP_Shortcode_Button_Purchase' ) ) {
63
  wp_enqueue_script( 'lp-single-course' );
64
  add_filter( 'learn-press/purchase-course-button-text', array( $this, 'button_text' ) );
65
  do_action( 'learn-press/course-buttons', $course );
66
- LP_Global::reset();
67
  }
68
 
69
  return ob_get_clean();
63
  wp_enqueue_script( 'lp-single-course' );
64
  add_filter( 'learn-press/purchase-course-button-text', array( $this, 'button_text' ) );
65
  do_action( 'learn-press/course-buttons', $course );
 
66
  }
67
 
68
  return ob_get_clean();
inc/shortcodes/class-lp-shortcode-profile.php CHANGED
@@ -50,7 +50,7 @@ if ( ! class_exists( 'LP_Shortcode_Profile' ) ) {
50
  }
51
 
52
  if ( ! $viewing_user ) {
53
- return new WP_Error( 'cannot-view-profile', esc_html__( 'You can\'t viewing user profile', 'learnpress' ) );
54
  }
55
  }
56
 
50
  }
51
 
52
  if ( ! $viewing_user ) {
53
+ return new WP_Error( 'cannot-view-profile', esc_html__( 'You can\'t view the user profile', 'learnpress' ) );
54
  }
55
  }
56
 
inc/templates/class-lp-template-course.php CHANGED
@@ -58,7 +58,7 @@ class LP_Template_Course extends LP_Abstract_Template {
58
  *
59
  * @throws Exception
60
  */
61
- public function button_retry( $course ) {
62
  $user = learn_press_get_current_user();
63
  if ( empty( $course ) ) {
64
  $course = learn_press_get_course();
@@ -152,7 +152,7 @@ class LP_Template_Course extends LP_Abstract_Template {
152
 
153
  try {
154
  if ( $user && $user->has_enrolled_course( get_the_ID() ) ) {
155
- throw new Exception( 'User has enrolled course' );
156
  }
157
 
158
  $price_html = $course->get_course_price_html();
@@ -177,7 +177,7 @@ class LP_Template_Course extends LP_Abstract_Template {
177
  * @throws Exception
178
  * @version 4.0.1
179
  */
180
- public function course_purchase_button( $course ) {
181
  $can_show = true;
182
  if ( empty( $course ) ) {
183
  $course = learn_press_get_course();
@@ -229,7 +229,7 @@ class LP_Template_Course extends LP_Abstract_Template {
229
  * @throws Exception
230
  * @version 4.0.2
231
  */
232
- public function course_enroll_button( $course ) {
233
  $can_show = true;
234
  $user = learn_press_get_current_user();
235
  if ( empty( $course ) ) {
@@ -346,7 +346,7 @@ class LP_Template_Course extends LP_Abstract_Template {
346
  * @version 4.0.2
347
  * @since 4.0.0
348
  */
349
- public function course_continue_button( $course ) {
350
  $can_show = true;
351
  $user = learn_press_get_current_user();
352
  if ( empty( $course ) ) {
@@ -363,7 +363,7 @@ class LP_Template_Course extends LP_Abstract_Template {
363
  }
364
 
365
  if ( $user->has_finished_course( $course->get_id() ) ) {
366
- throw new Exception( 'User has finished course' );
367
  }
368
 
369
  // Course has no items
@@ -393,7 +393,7 @@ class LP_Template_Course extends LP_Abstract_Template {
393
  learn_press_get_template( 'single-course/buttons/continue.php', $args );
394
  }
395
 
396
- public function course_finish_button( $course ) {
397
  $user = learn_press_get_current_user();
398
  if ( empty( $course ) ) {
399
  $course = learn_press_get_course();
@@ -430,7 +430,7 @@ class LP_Template_Course extends LP_Abstract_Template {
430
  * @editor tungnx
431
  * @modify 4.1.3
432
  */
433
- public function course_external_button( $course ) {
434
  if ( empty( $course ) ) {
435
  $course = learn_press_get_course();
436
  }
@@ -669,7 +669,7 @@ class LP_Template_Course extends LP_Abstract_Template {
669
  }
670
 
671
  /**
672
- * @depecated 4.1.7.2
673
  */
674
  public function item_quiz_content() {
675
  $item = LP_Global::course_item();
@@ -678,7 +678,7 @@ class LP_Template_Course extends LP_Abstract_Template {
678
  }
679
 
680
  /**
681
- * @depecated 4.1.7.2
682
  */
683
  public function item_lesson_content_blocked() {
684
  $item = LP_Global::course_item();
@@ -721,7 +721,7 @@ class LP_Template_Course extends LP_Abstract_Template {
721
  }
722
 
723
  /**
724
- * @depecated 4.1.6.9
725
  */
726
  /*public function lesson_comment_form() {
727
  $course = learn_press_get_course();
@@ -871,7 +871,7 @@ class LP_Template_Course extends LP_Abstract_Template {
871
  }
872
 
873
  /**
874
- * @depecated 4.1.7.2
875
  */
876
  /*public function instructor_socials() {
877
  $instructor = $this->course->get_instructor();
@@ -973,10 +973,16 @@ class LP_Template_Course extends LP_Abstract_Template {
973
  $start_time = $user_course->get_start_time();
974
  $end_time = $user_course->get_end_time();
975
  $expiration_time = $user_course->get_expiration_time();
 
 
 
 
 
 
976
 
977
  learn_press_get_template(
978
  'single-course/sidebar/user-time',
979
- compact( 'status', 'start_time', 'end_time', 'expiration_time' )
980
  );
981
  }
982
 
58
  *
59
  * @throws Exception
60
  */
61
+ public function button_retry( $course = null ) {
62
  $user = learn_press_get_current_user();
63
  if ( empty( $course ) ) {
64
  $course = learn_press_get_course();
152
 
153
  try {
154
  if ( $user && $user->has_enrolled_course( get_the_ID() ) ) {
155
+ throw new Exception( 'The user has enrolled in the course' );
156
  }
157
 
158
  $price_html = $course->get_course_price_html();
177
  * @throws Exception
178
  * @version 4.0.1
179
  */
180
+ public function course_purchase_button( $course = null ) {
181
  $can_show = true;
182
  if ( empty( $course ) ) {
183
  $course = learn_press_get_course();
229
  * @throws Exception
230
  * @version 4.0.2
231
  */
232
+ public function course_enroll_button( $course = null ) {
233
  $can_show = true;
234
  $user = learn_press_get_current_user();
235
  if ( empty( $course ) ) {
346
  * @version 4.0.2
347
  * @since 4.0.0
348
  */
349
+ public function course_continue_button( $course = null ) {
350
  $can_show = true;
351
  $user = learn_press_get_current_user();
352
  if ( empty( $course ) ) {
363
  }
364
 
365
  if ( $user->has_finished_course( $course->get_id() ) ) {
366
+ throw new Exception( 'The user has completed the course.' );
367
  }
368
 
369
  // Course has no items
393
  learn_press_get_template( 'single-course/buttons/continue.php', $args );
394
  }
395
 
396
+ public function course_finish_button( $course = null ) {
397
  $user = learn_press_get_current_user();
398
  if ( empty( $course ) ) {
399
  $course = learn_press_get_course();
430
  * @editor tungnx
431
  * @modify 4.1.3
432
  */
433
+ public function course_external_button( $course = null ) {
434
  if ( empty( $course ) ) {
435
  $course = learn_press_get_course();
436
  }
669
  }
670
 
671
  /**
672
+ * @deprecated 4.1.7.2
673
  */
674
  public function item_quiz_content() {
675
  $item = LP_Global::course_item();
678
  }
679
 
680
  /**
681
+ * @deprecated 4.1.7.2
682
  */
683
  public function item_lesson_content_blocked() {
684
  $item = LP_Global::course_item();
721
  }
722
 
723
  /**
724
+ * @deprecated 4.1.6.9
725
  */
726
  /*public function lesson_comment_form() {
727
  $course = learn_press_get_course();
871
  }
872
 
873
  /**
874
+ * @deprecated 4.1.7.2
875
  */
876
  /*public function instructor_socials() {
877
  $instructor = $this->course->get_instructor();
973
  $start_time = $user_course->get_start_time();
974
  $end_time = $user_course->get_end_time();
975
  $expiration_time = $user_course->get_expiration_time();
976
+ $data = [
977
+ 'status' => $status,
978
+ 'start_time' => $start_time,
979
+ 'end_time' => $end_time,
980
+ 'expiration_time' => $expiration_time,
981
+ ];
982
 
983
  learn_press_get_template(
984
  'single-course/sidebar/user-time',
985
+ compact( 'data' )
986
  );
987
  }
988
 
inc/updates/learnpress-upgrade-4.php CHANGED
@@ -36,6 +36,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
36
  * @see modify_tb_lp_user_items
37
  * @see remove_course_status_cancelled
38
  * @see convert_result_graduation_item
 
39
  * @see convert_result_questions
40
  * @see convert_retake_quiz
41
  * @see create_col_extra_value_on_tb_lp_user_itemmeta
@@ -88,6 +89,11 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
88
  ),
89
  'convert_result_graduation_item' => new LP_Step(
90
  'convert_result_graduation_item',
 
 
 
 
 
91
  'Convert Data Result courses, items\' courses',
92
  ''
93
  ),
@@ -489,19 +495,20 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
489
  * @return LP_Step
490
  */
491
  protected function convert_result_graduation_item( array $data ): LP_Step {
492
- $response = new LP_Step( __FUNCTION__, '' );
493
- $lp_db = LP_Database::getInstance();
494
- $page = 0;
495
- $offset = 0;
496
- $limit = 100;
497
- $total_row = 0;
 
498
 
499
  try {
500
  if ( empty( $data ) ) {
501
  // Check total rows.
502
  $query = $lp_db->wpdb->prepare(
503
  "
504
- SELECT COUNT(learnpress_user_item_id) FROM $lp_db->tb_lp_user_itemmeta
505
  WHERE meta_key = %s
506
  ",
507
  'grade'
@@ -518,7 +525,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
518
  $query = $lp_db->wpdb->prepare(
519
  "
520
  SELECT learnpress_user_item_id AS user_item_id, meta_value AS grade
521
- FROM $lp_db->tb_lp_user_itemmeta
522
  WHERE meta_key = %s
523
  LIMIT %d, %d
524
  ",
@@ -528,12 +535,6 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
528
  );
529
  $user_item_grades = $lp_db->wpdb->get_results( $query );
530
 
531
- $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
532
-
533
- if ( empty( $user_item_grades ) || 100 === $percent ) {
534
- return $this->finish_step( $response, __FUNCTION__ . ' finished' );
535
- }
536
-
537
  /**
538
  * Copy value of meta_key "grade" table learnpress_user_itemmeta LP3
539
  * to column "graduation" LP4 table learnpress_user_items
@@ -544,7 +545,7 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
544
  UPDATE $lp_db->tb_lp_user_items
545
  SET graduation = %s
546
  WHERE user_item_id = %d;
547
- ",
548
  $user_item_grade->grade,
549
  $user_item_grade->user_item_id
550
  );
@@ -553,6 +554,29 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
553
  $lp_db->check_execute_has_error();
554
  }
555
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  $response->status = 'success';
557
  $response->message = 'Insert success';
558
  $response->percent = $percent;
@@ -565,6 +589,98 @@ class LP_Upgrade_4 extends LP_Handle_Upgrade_Steps {
565
  return $response;
566
  }
567
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
568
  /**
569
  * Convert value of meta_key "_question_answers" table learnpress_user_itemmeta LP3 to column result LP4 table learnpress_user_item_results
570
  *
36
  * @see modify_tb_lp_user_items
37
  * @see remove_course_status_cancelled
38
  * @see convert_result_graduation_item
39
+ * @see convert_result_items
40
  * @see convert_result_questions
41
  * @see convert_retake_quiz
42
  * @see create_col_extra_value_on_tb_lp_user_itemmeta
89
  ),
90
  'convert_result_graduation_item' => new LP_Step(
91
  'convert_result_graduation_item',
92
+ 'Convert Data Graduation items of courses',
93
+ ''
94
+ ),
95
+ 'convert_result_items' => new LP_Step(
96
+ 'convert_result_items',
97
  'Convert Data Result courses, items\' courses',
98
  ''
99
  ),
495
  * @return LP_Step
496
  */
497
  protected function convert_result_graduation_item( array $data ): LP_Step {
498
+ $response = new LP_Step( __FUNCTION__, '' );
499
+ $lp_db = LP_Database::getInstance();
500
+ $page = 0;
501
+ $offset = 0;
502
+ $limit = 100;
503
+ $total_row = 0;
504
+ $suffix_table_bk = '_bk';
505
 
506
  try {
507
  if ( empty( $data ) ) {
508
  // Check total rows.
509
  $query = $lp_db->wpdb->prepare(
510
  "
511
+ SELECT COUNT(learnpress_user_item_id) FROM $lp_db->tb_lp_user_itemmeta{$suffix_table_bk}
512
  WHERE meta_key = %s
513
  ",
514
  'grade'
525
  $query = $lp_db->wpdb->prepare(
526
  "
527
  SELECT learnpress_user_item_id AS user_item_id, meta_value AS grade
528
+ FROM $lp_db->tb_lp_user_itemmeta{$suffix_table_bk}
529
  WHERE meta_key = %s
530
  LIMIT %d, %d
531
  ",
535
  );
536
  $user_item_grades = $lp_db->wpdb->get_results( $query );
537
 
 
 
 
 
 
 
538
  /**
539
  * Copy value of meta_key "grade" table learnpress_user_itemmeta LP3
540
  * to column "graduation" LP4 table learnpress_user_items
545
  UPDATE $lp_db->tb_lp_user_items
546
  SET graduation = %s
547
  WHERE user_item_id = %d;
548
+ ",
549
  $user_item_grade->grade,
550
  $user_item_grade->user_item_id
551
  );
554
  $lp_db->check_execute_has_error();
555
  }
556
 
557
+ $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
558
+ if ( empty( $user_item_grades ) || 100 == $percent ) {
559
+ // Update graduation for case grade wrong (null or lesson completed but still 'in-progress').
560
+ $lp_db->wpdb->query(
561
+ "
562
+ UPDATE $lp_db->tb_lp_user_items
563
+ SET graduation = 'passed'
564
+ WHERE status = 'completed'
565
+ AND item_type = 'lp_lesson'
566
+ "
567
+ );
568
+ // Update graduation for case status empty and grade null
569
+ $lp_db->wpdb->query(
570
+ "
571
+ UPDATE $lp_db->tb_lp_user_items
572
+ SET graduation = 'in-progress'
573
+ WHERE (status = '' OR status = 'enrolled')
574
+ "
575
+ );
576
+
577
+ return $this->finish_step( $response, __FUNCTION__ . ' finished' );
578
+ }
579
+
580
  $response->status = 'success';
581
  $response->message = 'Insert success';
582
  $response->percent = $percent;
589
  return $response;
590
  }
591
 
592
+ /**
593
+ * Convert result items (lesson).
594
+ *
595
+ * @param array $data
596
+ *
597
+ * @return LP_Step
598
+ */
599
+ protected function convert_result_items( array $data ): LP_Step {
600
+ $response = new LP_Step( __FUNCTION__, '' );
601
+ $lp_db = LP_Database::getInstance();
602
+ $page = 0;
603
+ $offset = 0;
604
+ $limit = 100;
605
+ $total_row = 0;
606
+
607
+ try {
608
+ if ( empty( $data ) ) {
609
+ // Check total rows.
610
+ $query = "
611
+ SELECT COUNT(learnpress_user_item_id) FROM $lp_db->tb_lp_user_itemmeta
612
+ WHERE meta_key LIKE '%course_results_evaluate%'
613
+ ";
614
+
615
+ $total_row = $response->data->total_rows = (int) $lp_db->wpdb->get_var( $query );
616
+ } else {
617
+ $page = $data['p'];
618
+ $offset = $limit * $page;
619
+ $total_row = $data['total_rows'];
620
+ }
621
+
622
+ // Convert rows.
623
+ $query = $lp_db->wpdb->prepare(
624
+ "
625
+ SELECT learnpress_user_item_id AS user_item_id, meta_value AS result
626
+ FROM $lp_db->tb_lp_user_itemmeta
627
+ WHERE meta_key LIKE '%course_results_evaluate%'
628
+ LIMIT %d offset %d
629
+ ",
630
+ $limit,
631
+ $offset
632
+ );
633
+
634
+ $result_lessons = $lp_db->wpdb->get_results( $query );
635
+ if ( 0 === count( $result_lessons ) ) {
636
+ return $this->finish_step( $response, 'Convert result question success' );
637
+ }
638
+
639
+ foreach ( $result_lessons as $result_lesson_obj ) {
640
+ $result_lesson = maybe_unserialize( ( $result_lesson_obj->result ) );
641
+ if ( ! $result_lesson ) {
642
+ continue;
643
+ }
644
+
645
+ $result_json = json_encode( $result_lesson );
646
+
647
+ // Check exists user_item_id value on table learnpress_user_item_results.
648
+ $check = $lp_db->wpdb->get_var(
649
+ $lp_db->wpdb->prepare(
650
+ "
651
+ SELECT user_item_id FROM $lp_db->tb_lp_user_item_results
652
+ WHERE user_item_id = %d
653
+ ",
654
+ $result_lesson_obj->user_item_id
655
+ )
656
+ );
657
+
658
+ if ( empty( $check ) ) {
659
+ $lp_db->wpdb->insert(
660
+ $lp_db->tb_lp_user_item_results,
661
+ array(
662
+ 'result' => $result_json,
663
+ 'user_item_id' => $result_lesson_obj->user_item_id,
664
+ )
665
+ );
666
+ $lp_db->check_execute_has_error();
667
+ }
668
+ }
669
+
670
+ $percent = LP_Helper::progress_percent( $offset, $limit, $total_row );
671
+
672
+ $response->status = 'success';
673
+ $response->message = 'Insert lesson result success';
674
+ $response->percent = $percent;
675
+ $response->data->p = ++ $page;
676
+ $response->data->total_rows = $total_row;
677
+ } catch ( Throwable $e ) {
678
+ $response->message = $this->error_step( $response->name, $e->getMessage() );
679
+ }
680
+
681
+ return $response;
682
+ }
683
+
684
  /**
685
  * Convert value of meta_key "_question_answers" table learnpress_user_itemmeta LP3 to column result LP4 table learnpress_user_item_results
686
  *
inc/user-item/class-lp-user-item-course.php CHANGED
@@ -191,7 +191,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
191
 
192
  /**
193
  * @return LP_User_Item|bool
194
- * @depecated 4.1.6.9.2
195
  */
196
  /*public function get_viewing_item() {
197
  $item = LP_Global::course_item();
@@ -384,7 +384,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
384
  * @param string $context
385
  *
386
  * @return string
387
- * @depecated 4.1.6.9.3
388
  */
389
  public function get_grade( string $context = '' ): string {
390
  $grade = $this->get_graduation() ?? '';
@@ -630,7 +630,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
630
  }
631
 
632
  if ( $item->type == LP_QUIZ_CPT ) {
633
- $total_questions += count( $itemObj->get_questions() );
634
  $total_mark_question += $itemObj->get_mark();
635
  }
636
  }
@@ -694,7 +694,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
694
  }
695
 
696
  /**
697
- * @depecated 4.1.6.9.2
698
  */
699
  /*protected function _is_passed( $result ) {
700
  $is_passed = LP_COURSE_GRADUATION_FAILED;
@@ -897,7 +897,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
897
 
898
  /**
899
  * @return bool
900
- * @depecated 4.1.6.9.2
901
  */
902
  /*public function can_graduated() {
903
  return $this->get_results( 'result' ) >= $this->get_passing_condition();
@@ -996,8 +996,10 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
996
  * Update course item and it's child.
997
  *
998
  * @TODO: tungnx - review to modify
 
999
  */
1000
  public function save() {
 
1001
  /**
1002
  * @var LP_User_Item $item
1003
  */
@@ -1008,16 +1010,14 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
1008
  }
1009
 
1010
  foreach ( $items as $item_id => $item ) {
1011
-
1012
  if ( ! $item->get_status() ) {
1013
  continue;
1014
  }
1015
 
1016
  /**
1017
- * Auto fill the end-time if it isn't already set
1018
  */
1019
  if ( in_array( $item->get_status(), array( 'completed', 'finished' ) ) ) {
1020
-
1021
  if ( ! $item->get_end_time() || $item->get_end_time()->is_null() ) {
1022
  $item->set_end_time( current_time( 'mysql', 1 ) );
1023
  }
@@ -1037,7 +1037,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
1037
  * @param int $section_id - Optional. Get in specific section
1038
  *
1039
  * @return array|bool|mixed
1040
- * @depecated 4.1.6.9
1041
  */
1042
  public function get_passed_items( $type = '', $with_total = false, $section_id = 0 ) {
1043
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
191
 
192
  /**
193
  * @return LP_User_Item|bool
194
+ * @deprecated 4.1.6.9.2
195
  */
196
  /*public function get_viewing_item() {
197
  $item = LP_Global::course_item();
384
  * @param string $context
385
  *
386
  * @return string
387
+ * @deprecated 4.1.6.9.3
388
  */
389
  public function get_grade( string $context = '' ): string {
390
  $grade = $this->get_graduation() ?? '';
630
  }
631
 
632
  if ( $item->type == LP_QUIZ_CPT ) {
633
+ $total_questions += count( $itemObj->get_question_ids() );
634
  $total_mark_question += $itemObj->get_mark();
635
  }
636
  }
694
  }
695
 
696
  /**
697
+ * @deprecated 4.1.6.9.2
698
  */
699
  /*protected function _is_passed( $result ) {
700
  $is_passed = LP_COURSE_GRADUATION_FAILED;
897
 
898
  /**
899
  * @return bool
900
+ * @deprecated 4.1.6.9.2
901
  */
902
  /*public function can_graduated() {
903
  return $this->get_results( 'result' ) >= $this->get_passing_condition();
996
  * Update course item and it's child.
997
  *
998
  * @TODO: tungnx - review to modify
999
+ * @deprecated 4.1.7.3
1000
  */
1001
  public function save() {
1002
+ _deprecated_function( __METHOD__, '4.1.7.3' );
1003
  /**
1004
  * @var LP_User_Item $item
1005
  */
1010
  }
1011
 
1012
  foreach ( $items as $item_id => $item ) {
 
1013
  if ( ! $item->get_status() ) {
1014
  continue;
1015
  }
1016
 
1017
  /**
1018
+ * Autofill the end-time if it isn't already set
1019
  */
1020
  if ( in_array( $item->get_status(), array( 'completed', 'finished' ) ) ) {
 
1021
  if ( ! $item->get_end_time() || $item->get_end_time()->is_null() ) {
1022
  $item->set_end_time( current_time( 'mysql', 1 ) );
1023
  }
1037
  * @param int $section_id - Optional. Get in specific section
1038
  *
1039
  * @return array|bool|mixed
1040
+ * @deprecated 4.1.6.9
1041
  */
1042
  public function get_passed_items( $type = '', $with_total = false, $section_id = 0 ) {
1043
  _deprecated_function( __FUNCTION__, '4.1.6.9' );
inc/user-item/class-lp-user-item-quiz.php CHANGED
@@ -271,7 +271,7 @@ class LP_User_Item_Quiz extends LP_User_Item {
271
  $user_quiz = LP_User_Items_DB::getInstance()->get_user_course_item( $filter, true );
272
  $course_start_time = $user_quiz->start_time;
273
  $timestamp_expire = strtotime( $course_start_time . ' +' . $duration );
274
- $timestamp_current = strtotime( current_time( 'mysql', 1 ) );
275
  $timestamp_remaining = $timestamp_expire - $timestamp_current;
276
 
277
  if ( $timestamp_remaining < 0 ) {
@@ -480,7 +480,7 @@ class LP_User_Item_Quiz extends LP_User_Item {
480
  throw new Exception();
481
  }
482
 
483
- $question_ids = $quiz->get_questions();
484
  $result['mark'] = $quiz->get_mark();
485
  $result['question_count'] = count( $question_ids );
486
  $result['time_spend'] = $this->get_time_interval( 'display' );
@@ -670,7 +670,7 @@ class LP_User_Item_Quiz extends LP_User_Item {
670
 
671
  public function get_total_questions() {
672
  $quiz = learn_press_get_quiz( $this->get_item_id() );
673
- $questions = $quiz->get_questions();
674
 
675
  return sizeof( $questions );
676
  }
@@ -744,12 +744,12 @@ class LP_User_Item_Quiz extends LP_User_Item {
744
  public function instant_check_question( int $question_id, $answered = null ): array {
745
  $question = learn_press_get_question( $question_id );
746
  if ( ! $question ) {
747
- throw new Exception( __( 'Question is invalid!', 'learnpress' ) );
748
  }
749
 
750
  $can_check = $this->can_check_answer( $question_id );
751
  if ( ! $can_check ) {
752
- throw new Exception( __( 'Cannot check answer the question.', 'learnpress' ) );
753
  }
754
 
755
  $answered_check = array(
271
  $user_quiz = LP_User_Items_DB::getInstance()->get_user_course_item( $filter, true );
272
  $course_start_time = $user_quiz->start_time;
273
  $timestamp_expire = strtotime( $course_start_time . ' +' . $duration );
274
+ $timestamp_current = time();
275
  $timestamp_remaining = $timestamp_expire - $timestamp_current;
276
 
277
  if ( $timestamp_remaining < 0 ) {
480
  throw new Exception();
481
  }
482
 
483
+ $question_ids = $quiz->get_question_ids();
484
  $result['mark'] = $quiz->get_mark();
485
  $result['question_count'] = count( $question_ids );
486
  $result['time_spend'] = $this->get_time_interval( 'display' );
670
 
671
  public function get_total_questions() {
672
  $quiz = learn_press_get_quiz( $this->get_item_id() );
673
+ $questions = $quiz->get_question_ids();
674
 
675
  return sizeof( $questions );
676
  }
744
  public function instant_check_question( int $question_id, $answered = null ): array {
745
  $question = learn_press_get_question( $question_id );
746
  if ( ! $question ) {
747
+ throw new Exception( __( 'The question is invalid!', 'learnpress' ) );
748
  }
749
 
750
  $can_check = $this->can_check_answer( $question_id );
751
  if ( ! $can_check ) {
752
+ throw new Exception( __( 'Cannot check the answer to the question.', 'learnpress' ) );
753
  }
754
 
755
  $answered_check = array(
inc/user-item/class-lp-user-item.php CHANGED
@@ -69,9 +69,9 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
69
  */
70
  public $_parent_id = '';
71
 
72
-
73
  /**
74
  * @var string
 
75
  */
76
  protected $_data_key = '';
77
 
@@ -116,31 +116,10 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
116
  $item_id = $item['item_id'];
117
  }
118
 
119
- if ( ! empty( $item['start_time'] ) ) {
120
- $this->set_start_time( $item['start_time'] );
121
- } else {
122
- $this->set_start_time( current_time( 'mysql', 1 ) );
123
- }
124
-
125
- if ( ! empty( $item['end_time'] ) ) {
126
- $this->set_end_time( $item['end_time'] );
127
- } else {
128
- $this->set_end_time( null );
129
- }
130
-
131
- if ( ! empty( $item['user_id'] ) ) {
132
- $item['user_id'] = absint( $item['user_id'] );
133
-
134
- $this->set_user_id( $item['user_id'] );
135
- } else {
136
- $this->set_user_id( get_current_user_id() );
137
- }
138
-
139
- if ( ! empty( $item['status'] ) ) {
140
- $this->set_status( $item['status'] );
141
- } else {
142
- $this->set_status( '' );
143
- }
144
 
145
  if ( ! empty( $item['ref_id'] ) ) {
146
  $item['ref_id'] = absint( $item['ref_id'] );
@@ -165,13 +144,11 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
165
  $this->set_data( 'access_level', $item['access_level'] );
166
  }
167
 
168
- if ( ! empty( $item['graduation'] ) ) {
169
- $this->set_data( 'graduation', $item['graduation'] );
170
- }
171
 
172
- $new_data = $this->get_mysql_data();
173
- ksort( $new_data );
174
- $this->_data_key = md5( serialize( $new_data ) );
175
  }
176
 
177
  public function set_user_id( $user_id ) {
@@ -221,8 +198,9 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
221
  *
222
  * @return $this
223
  */
224
- public function set_start_time( $time ) {
225
- $this->_set_data_date( 'start_time', $time );
 
226
 
227
  return $this;
228
  }
@@ -259,20 +237,12 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
259
  return $this->format_time( $date, $format, $local );
260
  }
261
 
262
- /**
263
- * @param $time
264
- *
265
- * @deprecated 4.0.0
266
- */
267
- public function set_start_time_gmt( $time ) {
268
- _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.0.0' );
269
- }
270
-
271
  /**
272
  * @param string $format
273
  *
274
  * @return array|bool|LP_Datetime|mixed|string
275
  * @deprecated
 
276
  */
277
  public function get_start_time_gmt( $format = '' ) {
278
  _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.0.0' );
@@ -292,12 +262,8 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
292
  *
293
  * @return $this
294
  */
295
- public function set_end_time( $time ) {
296
- if ( $time && '0000-00-00 00:00:00' !== $time ) {
297
- $this->_set_data_date( 'end_time', $time );
298
- } else {
299
- $this->_set_data( 'end_time', '' );
300
- }
301
 
302
  return $this;
303
  }
@@ -674,7 +640,7 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
674
  switch ( $k ) {
675
  case 'start_time':
676
  case 'end_time':
677
- $v = is_a( $v, 'LP_Datetime' ) ? $v->toSql( false ) : $v;
678
  break;
679
  }
680
  $columns[ $k ] = $v;
@@ -752,16 +718,9 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
752
  * @updated 3.1.0
753
  *
754
  * @return bool|mixed
755
- * @throws Exception
756
  */
757
  public function update( $force = false, $wp_error = false ) {
758
-
759
- $data = $this->get_mysql_data();
760
-
761
- /**
762
- * @since 3.3.0
763
- * Allow filter to modify data
764
- */
765
  $data = apply_filters( 'learn-press/update-user-item-data', $data, $this->get_user_item_id() );
766
  $where = array();
767
 
@@ -769,19 +728,19 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
769
  $where = array( 'user_item_id' => $this->get_user_item_id() );
770
  }
771
 
772
- $return = learn_press_update_user_item_field( $data, $where );
773
 
774
  // Clear cache first status
775
  $this->get_status( 'status', true );
776
 
777
- if ( $return ) {
778
- foreach ( (array) $return as $k => $v ) {
779
  $this->_set_data( $k, $v );
780
  }
781
  $this->_changes = array();
782
  }
783
 
784
- return $return;
785
  }
786
 
787
  /**
@@ -921,35 +880,10 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
921
  * @version 4.0.1
922
  */
923
  public function complete( $status = 'completed' ) {
924
- global $wpdb;
925
-
926
- // $end_time = new LP_Datetime();
927
- // $null_time = null;
928
-
929
  try {
930
- // if ( ! $this->get_end_time() ) {
931
- $this->set_end_time( current_time( 'mysql', 1 ) );
932
- // }
933
-
934
  $this->set_status( $status );
935
  $this->update();
936
-
937
- /*
938
- $query = $wpdb->prepare(
939
- "SELECT user_item_id
940
- FROM {$wpdb->prefix}learnpress_user_items
941
- WHERE user_id = %d
942
- AND item_id = %d
943
- AND status = %s
944
- GROUP BY user_item_id DESC
945
- LIMIT 1
946
- ",
947
- $this->get_user_id(),
948
- $this->get_item_id(),
949
- $status
950
- );
951
-
952
- return $wpdb->get_var( $query );*/
953
  } catch ( Throwable $e ) {
954
  error_log( __FUNCTION__ . ':' . $e->getMessage() );
955
  return false;
@@ -974,15 +908,17 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
974
  return 'passed' === $this->get_graduation();
975
  }
976
 
 
 
 
 
 
977
  public function get_percent_result( $decimal = 1 ) {
978
  return apply_filters(
979
  'learn-press/user/item-percent-result',
980
- sprintf(
981
- '%s%%',
982
- round( $this->get_result( 'result' ), $decimal ),
983
- $this->get_user_id(),
984
- $this->get_item_id()
985
- )
986
  );
987
  }
988
 
@@ -993,7 +929,7 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
993
  *
994
  * @return LP_Datetime
995
  * @since 3.3.0
996
- * @depecated 4.1.7
997
  */
998
  /*public function set_duration( $duration ) {
999
  if ( $duration instanceof LP_Datetime ) {
@@ -1006,7 +942,7 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
1006
  }*/
1007
 
1008
  /**
1009
- * @depecated 4.1.7
1010
  */
1011
  /*public function is_change() {
1012
 
@@ -1016,7 +952,11 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
1016
  return $this->_data_key !== md5( serialize( $new_data ) );
1017
  }*/
1018
 
 
 
 
1019
  protected function _set_data_date( $key, $value, $extra = false ) {
 
1020
  if ( $value instanceof LP_Datetime ) {
1021
  $value = $value->getTimestamp();
1022
  } else {
@@ -1032,7 +972,7 @@ class LP_User_Item extends LP_Abstract_Object_Data implements ArrayAccess {
1032
  * @param $arguments
1033
  *
1034
  * @return mixed
1035
- * @depecated 4.1.7
1036
  */
1037
  /*public function __call( $name, $arguments ) {
1038
  if ( ! method_exists( $this, $name ) ) {
69
  */
70
  public $_parent_id = '';
71
 
 
72
  /**
73
  * @var string
74
+ * @deprecated 4.1.7.3
75
  */
76
  protected $_data_key = '';
77
 
116
  $item_id = $item['item_id'];
117
  }
118
 
119
+ $this->set_start_time( $item['start_time'] ?? time() );
120
+ $this->set_end_time( $item['end_time'] ?? '' );
121
+ $this->set_user_id( absint( $item['user_id'] ?? get_current_user_id() ) );
122
+ $this->set_status( $item['status'] ?? '' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  if ( ! empty( $item['ref_id'] ) ) {
125
  $item['ref_id'] = absint( $item['ref_id'] );
144
  $this->set_data( 'access_level', $item['access_level'] );
145
  }
146
 
147
+ $this->set_data( 'graduation', $item['graduation'] ?? LP_COURSE_GRADUATION_IN_PROGRESS );
 
 
148
 
149
+ // $new_data = $this->get_mysql_data();
150
+ // ksort( $new_data );
151
+ // $this->_data_key = md5( serialize( $new_data ) );
152
  }
153
 
154
  public function set_user_id( $user_id ) {
198
  *
199
  * @return $this
200
  */
201
+ public function set_start_time( $time ): LP_User_Item {
202
+ $lp_time = new LP_Datetime( $time );
203
+ $this->set_data( 'start_time', $lp_time );
204
 
205
  return $this;
206
  }
237
  return $this->format_time( $date, $format, $local );
238
  }
239
 
 
 
 
 
 
 
 
 
 
240
  /**
241
  * @param string $format
242
  *
243
  * @return array|bool|LP_Datetime|mixed|string
244
  * @deprecated
245
+ * Addon certificate v4.0.3 is using.
246
  */
247
  public function get_start_time_gmt( $format = '' ) {
248
  _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.0.0' );
262
  *
263
  * @return $this
264
  */
265
+ public function set_end_time( $time = '' ): LP_User_Item {
266
+ $this->set_data_date( 'end_time', $time );
 
 
 
 
267
 
268
  return $this;
269
  }
640
  switch ( $k ) {
641
  case 'start_time':
642
  case 'end_time':
643
+ //$v = is_a( $v, 'LP_Datetime' ) ? $v->toSql( false ) : $v;
644
  break;
645
  }
646
  $columns[ $k ] = $v;
718
  * @updated 3.1.0
719
  *
720
  * @return bool|mixed
 
721
  */
722
  public function update( $force = false, $wp_error = false ) {
723
+ $data = $this->get_mysql_data();
 
 
 
 
 
 
724
  $data = apply_filters( 'learn-press/update-user-item-data', $data, $this->get_user_item_id() );
725
  $where = array();
726
 
728
  $where = array( 'user_item_id' => $this->get_user_item_id() );
729
  }
730
 
731
+ $rs = learn_press_update_user_item_field( $data, $where );
732
 
733
  // Clear cache first status
734
  $this->get_status( 'status', true );
735
 
736
+ if ( $rs ) {
737
+ foreach ( (array) $rs as $k => $v ) {
738
  $this->_set_data( $k, $v );
739
  }
740
  $this->_changes = array();
741
  }
742
 
743
+ return $rs;
744
  }
745
 
746
  /**
880
  * @version 4.0.1
881
  */
882
  public function complete( $status = 'completed' ) {
 
 
 
 
 
883
  try {
884
+ $this->set_end_time( time() );
 
 
 
885
  $this->set_status( $status );
886
  $this->update();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
887
  } catch ( Throwable $e ) {
888
  error_log( __FUNCTION__ . ':' . $e->getMessage() );
889
  return false;
908
  return 'passed' === $this->get_graduation();
909
  }
910
 
911
+ /**
912
+ * @param int $decimal
913
+ *
914
+ * @return mixed|null
915
+ */
916
  public function get_percent_result( $decimal = 1 ) {
917
  return apply_filters(
918
  'learn-press/user/item-percent-result',
919
+ sprintf( '%s%', round( $this->get_result( 'result' ), $decimal ) ),
920
+ $this->get_user_id(),
921
+ $this->get_item_id()
 
 
 
922
  );
923
  }
924
 
929
  *
930
  * @return LP_Datetime
931
  * @since 3.3.0
932
+ * @deprecated 4.1.7
933
  */
934
  /*public function set_duration( $duration ) {
935
  if ( $duration instanceof LP_Datetime ) {
942
  }*/
943
 
944
  /**
945
+ * @deprecated 4.1.7
946
  */
947
  /*public function is_change() {
948
 
952
  return $this->_data_key !== md5( serialize( $new_data ) );
953
  }*/
954
 
955
+ /**
956
+ * @deprecated 4.1.7.3
957
+ */
958
  protected function _set_data_date( $key, $value, $extra = false ) {
959
+ _deprecated_function( __FUNCTION__, '4.1.7.3', 'set_data_date' );
960
  if ( $value instanceof LP_Datetime ) {
961
  $value = $value->getTimestamp();
962
  } else {
972
  * @param $arguments
973
  *
974
  * @return mixed
975
+ * @deprecated 4.1.7
976
  */
977
  /*public function __call( $name, $arguments ) {
978
  if ( ! method_exists( $this, $name ) ) {
inc/user/abstract-lp-user.php CHANGED
@@ -451,16 +451,14 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
451
 
452
  if ( ! $course_id ) {
453
  $course_id = get_the_ID();
454
- }
455
-
456
- if ( ! $course_id ) {
457
- return $status;
458
  }
459
 
460
  $item = $this->get_item( $item_id, $course_id, true );
461
-
462
- if ( false !== $item ) {
463
- $status = $item['status'];
464
  }
465
 
466
  return apply_filters( 'learn-press/user-item-status', $status, $item_id, $this->get_id(), $course_id );
@@ -560,7 +558,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
560
  $quiz_data = $this->get_item_data( $quiz_id, $course_id );
561
  $remain = $quiz_data->hint( $question_id );
562
  if ( false === $remain ) {
563
- return new WP_Error( 1001, __( 'You can not hint question.', 'learnpress' ) );
564
  }
565
 
566
  return $remain;
@@ -627,7 +625,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
627
  if ( is_callable( $callback ) ) {
628
  return call_user_func_array( $callback, $args );
629
  } else {
630
- throw new Exception( sprintf( __( 'The role %s for user doesn\'t exist', 'learnpress' ), $role ) );
631
  }
632
  }
633
 
@@ -701,6 +699,9 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
701
 
702
  if ( $course ) {
703
  $user_course = $this->get_course_data( $course_id );
 
 
 
704
 
705
  $result = $user_course->calculate_course_results();
706
 
@@ -714,9 +715,8 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
714
  }
715
 
716
  $user_course->set_graduation( $graduation );
717
- $user_course->save();
718
-
719
- $return = $user_course->complete( 'finished' );
720
 
721
  if ( $return ) {
722
  do_action( 'learn-press/user-course-finished', $course_id, $this->get_id(), $return );
@@ -776,7 +776,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
776
  if ( is_callable( $callback ) ) {
777
  return call_user_func_array( $callback, $args );
778
  } else {
779
- throw new Exception( sprintf( __( 'The role %s for user doesn\'t exist', 'learnpress' ), $role ) );
780
  }
781
  }
782
 
@@ -788,7 +788,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
788
  if ( is_callable( $callback ) ) {
789
  return call_user_func_array( $callback, $args );
790
  } else {
791
- throw new Exception( sprintf( __( 'The role %s for user doesn\'t exist', 'learnpress' ), $role ) );
792
  }
793
  }
794
 
@@ -830,7 +830,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
830
  * @param int $course_id
831
  *
832
  * @return bool
833
- * @depecated 4.1.6.9
834
  */
835
  /*public function has_completed_quiz( $quiz_id, $course_id = 0 ): bool {
836
  return $this->get_item_status( $quiz_id, $course_id ) == 'completed';
@@ -870,11 +870,8 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
870
  throw new Exception( __( 'You have already completed this lesson.', 'learnpress' ) );
871
  }
872
 
873
- $item->set_end_time( time() );
874
- $item->set_status( 'completed' );
875
  $item->set_graduation( 'passed' );
876
-
877
- $updated = $item->update();
878
 
879
  do_action( 'learn-press/user-completed-lesson', $lesson_id, $course_id, $this->get_id() );
880
  } catch ( Throwable $e ) {
@@ -891,7 +888,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
891
  * @param null $course_id Course id.
892
  *
893
  * @return bool
894
- * @depecated 4.1.6.9
895
  */
896
  public function has_completed_lesson( $lesson_id = 0, $course_id = null ): bool {
897
  return 'completed' === $this->get_item_status( $lesson_id, $course_id );
@@ -919,7 +916,7 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
919
  * @param $course_id
920
  *
921
  * @return int
922
- * @depecated 4.1.6.9
923
  */
924
  public function get_course_history_id( $course_id ) {
925
  $history = $this->get_course_info( $course_id );
451
 
452
  if ( ! $course_id ) {
453
  $course_id = get_the_ID();
454
+ if ( ! $course_id ) {
455
+ return $status;
456
+ }
 
457
  }
458
 
459
  $item = $this->get_item( $item_id, $course_id, true );
460
+ if ( $item instanceof LP_User_Item ) {
461
+ $status = $item->get_status();
 
462
  }
463
 
464
  return apply_filters( 'learn-press/user-item-status', $status, $item_id, $this->get_id(), $course_id );
558
  $quiz_data = $this->get_item_data( $quiz_id, $course_id );
559
  $remain = $quiz_data->hint( $question_id );
560
  if ( false === $remain ) {
561
+ return new WP_Error( 1001, __( 'You can not hint at the question.', 'learnpress' ) );
562
  }
563
 
564
  return $remain;
625
  if ( is_callable( $callback ) ) {
626
  return call_user_func_array( $callback, $args );
627
  } else {
628
+ throw new Exception( sprintf( __( 'The role %s for the user doesn\'t exist', 'learnpress' ), $role ) );
629
  }
630
  }
631
 
699
 
700
  if ( $course ) {
701
  $user_course = $this->get_course_data( $course_id );
702
+ if ( ! $user_course ) {
703
+ return $return;
704
+ }
705
 
706
  $result = $user_course->calculate_course_results();
707
 
715
  }
716
 
717
  $user_course->set_graduation( $graduation );
718
+ //$user_course->save();
719
+ $return = $user_course->complete( LP_COURSE_FINISHED );
 
720
 
721
  if ( $return ) {
722
  do_action( 'learn-press/user-course-finished', $course_id, $this->get_id(), $return );
776
  if ( is_callable( $callback ) ) {
777
  return call_user_func_array( $callback, $args );
778
  } else {
779
+ throw new Exception( sprintf( __( 'The role %s for the user doesn\'t exist', 'learnpress' ), $role ) );
780
  }
781
  }
782
 
788
  if ( is_callable( $callback ) ) {
789
  return call_user_func_array( $callback, $args );
790
  } else {
791
+ throw new Exception( sprintf( __( 'The role %s for the user doesn\'t exist', 'learnpress' ), $role ) );
792
  }
793
  }
794
 
830
  * @param int $course_id
831
  *
832
  * @return bool
833
+ * @deprecated 4.1.6.9
834
  */
835
  /*public function has_completed_quiz( $quiz_id, $course_id = 0 ): bool {
836
  return $this->get_item_status( $quiz_id, $course_id ) == 'completed';
870
  throw new Exception( __( 'You have already completed this lesson.', 'learnpress' ) );
871
  }
872
 
 
 
873
  $item->set_graduation( 'passed' );
874
+ $updated = $item->complete();
 
875
 
876
  do_action( 'learn-press/user-completed-lesson', $lesson_id, $course_id, $this->get_id() );
877
  } catch ( Throwable $e ) {
888
  * @param null $course_id Course id.
889
  *
890
  * @return bool
891
+ * @deprecated 4.1.6.9
892
  */
893
  public function has_completed_lesson( $lesson_id = 0, $course_id = null ): bool {
894
  return 'completed' === $this->get_item_status( $lesson_id, $course_id );
916
  * @param $course_id
917
  *
918
  * @return int
919
+ * @deprecated 4.1.6.9
920
  */
921
  public function get_course_history_id( $course_id ) {
922
  $history = $this->get_course_info( $course_id );
inc/user/class-lp-profile-tabs.php CHANGED
@@ -23,7 +23,6 @@ class LP_Profile_Tabs extends LP_Array_Access {
23
  */
24
  public function __construct( $tabs, $profile ) {
25
  parent::__construct( $tabs );
26
-
27
  $this->profile = $profile;
28
 
29
  $this->_sanitize();
23
  */
24
  public function __construct( $tabs, $profile ) {
25
  parent::__construct( $tabs );
 
26
  $this->profile = $profile;
27
 
28
  $this->_sanitize();
inc/user/class-lp-profile.php CHANGED
@@ -76,10 +76,10 @@ if ( ! class_exists( 'LP_Profile' ) ) {
76
  $this->_default_actions = apply_filters(
77
  'learn-press/profile-default-actions',
78
  array(
79
- 'basic-information' => esc_html__( 'Account information updated successful.', 'learnpress' ),
80
- 'avatar' => esc_html__( 'Account avatar updated successful.', 'learnpress' ),
81
- 'password' => esc_html__( 'Password updated successful.', 'learnpress' ),
82
- 'privacy' => esc_html__( 'Account privacy updated successful.', 'learnpress' ),
83
  )
84
  );
85
 
@@ -103,9 +103,11 @@ if ( ! class_exists( 'LP_Profile' ) ) {
103
 
104
  /**
105
  * Prevent access view owned course in non admin, instructor profile page.
 
106
  */
107
  public function init() {
108
- $profile = self::instance();
 
109
  $user = $profile->get_user();
110
  $role = $user->get_role();
111
 
@@ -114,7 +116,7 @@ if ( ! class_exists( 'LP_Profile' ) ) {
114
 
115
  $data_tabs = apply_filters( 'learn-press/profile-tabs', $this->_default_settings );
116
  $this->_tabs = new LP_Profile_Tabs( $data_tabs, self::instance() );
117
- }
118
  }
119
 
120
  public function is_guest() {
@@ -237,7 +239,7 @@ if ( ! class_exists( 'LP_Profile' ) ) {
237
  * @return LP_Profile_Tabs
238
  */
239
  public function get_tabs() {
240
- if ( $this->_tabs === null ) {
241
  $settings = LP_Settings::instance();
242
  $course_sections = array();
243
 
@@ -320,11 +322,12 @@ if ( ! class_exists( 'LP_Profile' ) ) {
320
  'icon' => '<i class="fas fa-user-secret"></i>',
321
  );
322
  }
323
- }
324
 
325
- $tabs = apply_filters( 'learn-press/profile-tabs', $this->_default_settings );
 
326
 
327
- return $this->_tabs = new LP_Profile_Tabs( $tabs, $this );
328
  }
329
 
330
  public function get_slug( $data, $default = '' ) {
@@ -521,7 +524,7 @@ if ( ! class_exists( 'LP_Profile' ) ) {
521
  public function save( $nonce ) {
522
  $user_id = get_current_user_id();
523
  if ( ! $user_id ) {
524
- return new WP_Error( 2, 'User is invalid!' );
525
  }
526
 
527
  $message = '';
@@ -1145,7 +1148,7 @@ if ( ! class_exists( 'LP_Profile' ) ) {
1145
 
1146
  try {
1147
  if ( ! $user ) {
1148
- throw new Exception( 'User is invalid!' );
1149
  }
1150
 
1151
  $user_id = $user->get_id();
@@ -1205,28 +1208,3 @@ if ( ! class_exists( 'LP_Profile' ) ) {
1205
  }
1206
  }
1207
  }
1208
-
1209
- /*function learn_press_profile_init() {
1210
- $current_page = LP_Page_Controller::page_current();
1211
-
1212
- if ( LP_PAGE_PROFILE !== $current_page ) {
1213
- return;
1214
- }
1215
-
1216
- $profile = LP_Profile::instance();
1217
- $user = $profile->get_user();
1218
-
1219
- if ( ! $profile->get_tabs()->current_user_can_view() ) {
1220
- global $wp_query;
1221
-
1222
- if ( $user->is_guest() ) {
1223
- wp_redirect( $profile->get_login_url() );
1224
- exit;
1225
- }
1226
-
1227
- add_filter( 'redirect_canonical', '__return_false' );
1228
- $wp_query->set_404();
1229
- }
1230
- }*/
1231
-
1232
- //add_filter( 'wp', 'learn_press_profile_init' );
76
  $this->_default_actions = apply_filters(
77
  'learn-press/profile-default-actions',
78
  array(
79
+ 'basic-information' => esc_html__( 'Account information updated successfully.', 'learnpress' ),
80
+ 'avatar' => esc_html__( 'Account avatar updated successfully.', 'learnpress' ),
81
+ 'password' => esc_html__( 'Password updated successfully.', 'learnpress' ),
82
+ 'privacy' => esc_html__( 'Account privacy updated successfully.', 'learnpress' ),
83
  )
84
  );
85
 
103
 
104
  /**
105
  * Prevent access view owned course in non admin, instructor profile page.
106
+ * @deprecated 4.1.7.3
107
  */
108
  public function init() {
109
+ _deprecated_function( __FUNCTION__, '4.1.7.3' );
110
+ /*$profile = self::instance();
111
  $user = $profile->get_user();
112
  $role = $user->get_role();
113
 
116
 
117
  $data_tabs = apply_filters( 'learn-press/profile-tabs', $this->_default_settings );
118
  $this->_tabs = new LP_Profile_Tabs( $data_tabs, self::instance() );
119
+ }*/
120
  }
121
 
122
  public function is_guest() {
239
  * @return LP_Profile_Tabs
240
  */
241
  public function get_tabs() {
242
+ //if ( $this->_tabs === null ) {
243
  $settings = LP_Settings::instance();
244
  $course_sections = array();
245
 
322
  'icon' => '<i class="fas fa-user-secret"></i>',
323
  );
324
  }
325
+ //}
326
 
327
+ $tabs = $this->_default_settings;
328
+ $tabs = apply_filters( 'learn-press/profile-tabs', $tabs );
329
 
330
+ return $this->_tabs = new LP_Profile_Tabs( $tabs, $this );
331
  }
332
 
333
  public function get_slug( $data, $default = '' ) {
524
  public function save( $nonce ) {
525
  $user_id = get_current_user_id();
526
  if ( ! $user_id ) {
527
+ return new WP_Error( 2, 'The user is invalid' );
528
  }
529
 
530
  $message = '';
1148
 
1149
  try {
1150
  if ( ! $user ) {
1151
+ throw new Exception( 'The user is invalid' );
1152
  }
1153
 
1154
  $user_id = $user->get_id();
1208
  }
1209
  }
1210
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/user/class-lp-user-factory.php CHANGED
@@ -204,7 +204,7 @@ class LP_User_Factory {
204
  if ( $allow_repurchase_type === 'keep' ) {
205
  // Set data for update user item
206
  $user_item_data['user_item_id'] = $latest_user_item_id;
207
- $user_item_data['start_time'] = current_time( 'mysql', true );
208
  $user_item_data['end_time'] = null;
209
  $user_item_data['status'] = LP_COURSE_ENROLLED;
210
  $user_item_data['graduation'] = LP_COURSE_GRADUATION_IN_PROGRESS;
@@ -305,26 +305,25 @@ class LP_User_Factory {
305
  return $args;
306
  }
307
 
 
 
 
 
 
308
  public static function get_pending_requests() {
309
- $pending_requests = LP_Object_Cache::get( 'pending-requests', 'lp-users' );
310
- if ( false === $pending_requests ) {
311
- global $wpdb;
312
- $query = $wpdb->prepare(
313
- "
314
- SELECT ID
315
- FROM {$wpdb->users} u
316
- INNER JOIN {$wpdb->usermeta} um ON um.user_id = u.ID AND um.meta_key = %s
317
- WHERE um.meta_value = %s
318
  ",
319
- '_requested_become_teacher',
320
- 'yes'
321
- );
322
-
323
- $pending_requests = $wpdb->get_col( $query );
324
- LP_Object_Cache::set( 'pending-requests', $pending_requests, 'lp-users' );
325
- }
326
 
327
- return $pending_requests;
328
  }
329
 
330
  public static function get_guest_id() {
204
  if ( $allow_repurchase_type === 'keep' ) {
205
  // Set data for update user item
206
  $user_item_data['user_item_id'] = $latest_user_item_id;
207
+ $user_item_data['start_time'] = time();
208
  $user_item_data['end_time'] = null;
209
  $user_item_data['status'] = LP_COURSE_ENROLLED;
210
  $user_item_data['graduation'] = LP_COURSE_GRADUATION_IN_PROGRESS;
305
  return $args;
306
  }
307
 
308
+ /**
309
+ * Get pending requests be come a Teacher.
310
+ *
311
+ * @return array
312
+ */
313
  public static function get_pending_requests() {
314
+ global $wpdb;
315
+ $query = $wpdb->prepare(
316
+ "
317
+ SELECT ID
318
+ FROM {$wpdb->users} u
319
+ INNER JOIN {$wpdb->usermeta} um ON um.user_id = u.ID AND um.meta_key = %s
320
+ WHERE um.meta_value = %s
 
 
321
  ",
322
+ '_requested_become_teacher',
323
+ 'yes'
324
+ );
 
 
 
 
325
 
326
+ return $wpdb->get_col( $query );
327
  }
328
 
329
  public static function get_guest_id() {
inc/user/class-lp-user.php CHANGED
@@ -19,7 +19,7 @@ class LP_User extends LP_Abstract_User {
19
  public function can_view_content_course( int $course_id = 0 ): LP_Model_User_Can_View_Course_Item {
20
  $view = new LP_Model_User_Can_View_Course_Item();
21
  $view->message = esc_html__(
22
- 'This content is protected, please enroll course to view this content!',
23
  'learnpress'
24
  );
25
 
@@ -43,7 +43,7 @@ class LP_User extends LP_Abstract_User {
43
  return $view;
44
  } elseif ( ! is_user_logged_in() ) {
45
  $view->message = __(
46
- 'This content is protected, please login, enroll course to view this content!',
47
  'learnpress'
48
  );
49
 
@@ -60,19 +60,19 @@ class LP_User extends LP_Abstract_User {
60
  if ( $is_finished_course && $enable_block_item_when_finish ) {
61
  $view->key = LP_BLOCK_COURSE_FINISHED;
62
  $view->message = __(
63
- 'You finished this course. This content is protected, please enroll course to view this content!',
64
  'learnpress'
65
  );
66
  } elseif ( 0 === $course->timestamp_remaining_duration() ) {
67
  $view->key = LP_BLOCK_COURSE_DURATION_EXPIRE;
68
  $view->message = __(
69
- 'Content of this item has blocked because the course has exceeded duration.',
70
  'learnpress'
71
  );
72
  } elseif ( $this->get_course_status( $course_id ) === LP_COURSE_PURCHASED ) {
73
  $view->key = LP_BLOCK_COURSE_PURCHASE;
74
  $view->message = __(
75
- 'This content is protected, please enroll course to view this content!',
76
  'learnpress'
77
  );
78
  } else {
@@ -159,7 +159,6 @@ class LP_User extends LP_Abstract_User {
159
  }
160
 
161
  $user_course_data = $this->get_course_data( $course_id );
162
-
163
  if ( $user_course_data instanceof LP_User_Item_Course ) {
164
  $retaken = $user_course_data->get_retaken_count();
165
  $can_retake_times = $retake_option - $retaken;
@@ -219,7 +218,7 @@ class LP_User extends LP_Abstract_User {
219
  $user_course = $this->get_course_data( $course_id );
220
 
221
  if ( ! $user_course || ! $user_course->is_enrolled() ) {
222
- throw new Exception( esc_html__( 'Course is not enrolled', 'learnpress' ) );
223
  }
224
  } catch ( Throwable $th ) {
225
  $result_check->check = false;
@@ -287,23 +286,23 @@ class LP_User extends LP_Abstract_User {
287
  }
288
 
289
  if ( ! $course->is_publish() ) {
290
- throw new Exception( esc_html__( 'Course is not public', 'learnpress' ) );
291
  }
292
 
293
  if ( $course->get_external_link() && ! $this->has_purchased_course( $course_id ) ) {
294
- throw new Exception( esc_html__( 'Course is External', 'learnpress' ) );
295
  }
296
 
297
  if ( ! $course->is_in_stock() ) {
298
- throw new Exception( esc_html__( 'Course is full students', 'learnpress' ) );
299
  }
300
 
301
  if ( $course->is_no_required_enroll() ) {
302
- throw new Exception( esc_html__( 'Course is not require enrolling.', 'learnpress' ) );
303
  }
304
 
305
  if ( ! $course->is_free() && ! $this->has_purchased_course( $course_id ) ) {
306
- throw new Exception( esc_html__( 'Course is not purchased.', 'learnpress' ) );
307
  }
308
 
309
  if ( $this->has_enrolled_course( $course_id ) ) {
@@ -438,15 +437,15 @@ class LP_User extends LP_Abstract_User {
438
  $course_id = $course->get_id();
439
 
440
  if ( $this->has_finished_course( $course_id ) ) {
441
- throw new Exception( esc_html__( 'Course is has finished.', 'learnpress' ) );
442
  }
443
 
444
  if ( ! $this->has_enrolled_course( $course_id ) ) {
445
- throw new Exception( esc_html__( 'Course is not enroll.', 'learnpress' ) );
446
  }
447
 
448
  if ( ! $this->is_course_in_progress( $course_id ) ) {
449
- throw new Exception( esc_html__( 'Error: Course is not in-progress.', 'learnpress' ) );
450
  }
451
 
452
  $course_data = $this->get_course_data( $course_id );
@@ -471,7 +470,7 @@ class LP_User extends LP_Abstract_User {
471
  }
472
 
473
  if ( ! apply_filters( 'lp_can_finish_course', true ) ) {
474
- throw new Exception( esc_html__( 'Error: Filter disable finish course.', 'learnpress' ) );
475
  }
476
  } catch ( Exception $e ) {
477
  $return['status'] = 'false';
@@ -505,7 +504,7 @@ class LP_User extends LP_Abstract_User {
505
  $course_id = $this->_verify_course_item( $quiz_id, $course_id );
506
  if ( ! $course_id ) {
507
  throw new Exception(
508
- __( 'Course does not exist or does not contain the quiz', 'learnpress' ),
509
  LP_INVALID_QUIZ_OR_COURSE
510
  );
511
  }
@@ -524,7 +523,7 @@ class LP_User extends LP_Abstract_User {
524
  if ( ! $this->has_enrolled_course( $course_id ) || ! $this->is_course_in_progress( $course_id ) ) {
525
  if ( ! $course->is_no_required_enroll() ) {
526
  throw new Exception(
527
- __( 'Please enroll course before starting quiz.', 'learnpress' ),
528
  LP_COURSE_IS_FINISHED
529
  );
530
  }
@@ -533,7 +532,7 @@ class LP_User extends LP_Abstract_User {
533
  // Check if user has already started or completed quiz
534
  if ( $this->has_item_status( array( 'started', 'completed' ), $quiz_id, $course_id ) ) {
535
  throw new Exception(
536
- __( 'User has started or completed quiz', 'learnpress' ),
537
  LP_QUIZ_HAS_STARTED_OR_COMPLETED
538
  );
539
  }
@@ -542,7 +541,7 @@ class LP_User extends LP_Abstract_User {
542
  if ( $user->is_guest() ) {
543
  // if course required enroll => print message "You have to login for starting quiz"
544
  if ( ! $course->is_no_required_enroll() ) {
545
- throw new Exception( __( 'You have to login for starting quiz.', 'learnpress' ), LP_REQUIRE_LOGIN );
546
  }
547
  }
548
 
@@ -597,7 +596,7 @@ class LP_User extends LP_Abstract_User {
597
  // If user has already finished the course
598
  if ( $this->has_finished_course( $course_id ) ) {
599
  throw new Exception(
600
- __( 'User has already finished course of this quiz', 'learnpress' ),
601
  LP_COURSE_IS_FINISHED
602
  );
603
 
@@ -606,7 +605,7 @@ class LP_User extends LP_Abstract_User {
606
  // Check if user has already started or completed quiz
607
  if ( $this->has_item_status( array( 'completed' ), $quiz_id, $course_id ) ) {
608
  throw new Exception(
609
- __( 'User has completed quiz', 'learnpress' ),
610
  LP_QUIZ_HAS_STARTED_OR_COMPLETED
611
  );
612
  }
@@ -646,7 +645,7 @@ class LP_User extends LP_Abstract_User {
646
  throw new Exception(
647
  sprintf(
648
  __(
649
- 'Course does not exist or does not contain the quiz.',
650
  'learnpress'
651
  ),
652
  __CLASS__,
@@ -673,7 +672,7 @@ class LP_User extends LP_Abstract_User {
673
  if ( ! $this->has_item_status( array( 'completed' ), $quiz_id, $course_id ) ) {
674
  throw new Exception(
675
  sprintf(
676
- __( '%1$s::%2$s - User has not completed quiz.', 'learnpress' ),
677
  __CLASS__,
678
  __FUNCTION__
679
  ),
@@ -686,7 +685,7 @@ class LP_User extends LP_Abstract_User {
686
  if ( ! $this->has_retake_quiz( $quiz_id, $course_id ) ) {
687
  throw new Exception(
688
  sprintf(
689
- __( '%1$s::%2$s - Your Quiz can\'t retake.', 'learnpress' ),
690
  __CLASS__,
691
  __FUNCTION__
692
  ),
19
  public function can_view_content_course( int $course_id = 0 ): LP_Model_User_Can_View_Course_Item {
20
  $view = new LP_Model_User_Can_View_Course_Item();
21
  $view->message = esc_html__(
22
+ 'This content is protected. Please enroll in the course to view this content!',
23
  'learnpress'
24
  );
25
 
43
  return $view;
44
  } elseif ( ! is_user_logged_in() ) {
45
  $view->message = __(
46
+ 'This content is protected. Please log in or enroll in the course to view this content!',
47
  'learnpress'
48
  );
49
 
60
  if ( $is_finished_course && $enable_block_item_when_finish ) {
61
  $view->key = LP_BLOCK_COURSE_FINISHED;
62
  $view->message = __(
63
+ 'You finished this course. This content is protected. Please enroll in the course to view this content!',
64
  'learnpress'
65
  );
66
  } elseif ( 0 === $course->timestamp_remaining_duration() ) {
67
  $view->key = LP_BLOCK_COURSE_DURATION_EXPIRE;
68
  $view->message = __(
69
+ 'The content of this item has been blocked because the course has exceeded its duration.',
70
  'learnpress'
71
  );
72
  } elseif ( $this->get_course_status( $course_id ) === LP_COURSE_PURCHASED ) {
73
  $view->key = LP_BLOCK_COURSE_PURCHASE;
74
  $view->message = __(
75
+ 'This content is protected. Please enroll in the course to view this content!',
76
  'learnpress'
77
  );
78
  } else {
159
  }
160
 
161
  $user_course_data = $this->get_course_data( $course_id );
 
162
  if ( $user_course_data instanceof LP_User_Item_Course ) {
163
  $retaken = $user_course_data->get_retaken_count();
164
  $can_retake_times = $retake_option - $retaken;
218
  $user_course = $this->get_course_data( $course_id );
219
 
220
  if ( ! $user_course || ! $user_course->is_enrolled() ) {
221
+ throw new Exception( esc_html__( 'The course is not enrolled.', 'learnpress' ) );
222
  }
223
  } catch ( Throwable $th ) {
224
  $result_check->check = false;
286
  }
287
 
288
  if ( ! $course->is_publish() ) {
289
+ throw new Exception( esc_html__( 'The course is not public', 'learnpress' ) );
290
  }
291
 
292
  if ( $course->get_external_link() && ! $this->has_purchased_course( $course_id ) ) {
293
+ throw new Exception( esc_html__( 'The course is external', 'learnpress' ) );
294
  }
295
 
296
  if ( ! $course->is_in_stock() ) {
297
+ throw new Exception( esc_html__( 'The course is full of students.', 'learnpress' ) );
298
  }
299
 
300
  if ( $course->is_no_required_enroll() ) {
301
+ throw new Exception( esc_html__( 'The course is not required to enroll.', 'learnpress' ) );
302
  }
303
 
304
  if ( ! $course->is_free() && ! $this->has_purchased_course( $course_id ) ) {
305
+ throw new Exception( esc_html__( 'The course is not purchased.', 'learnpress' ) );
306
  }
307
 
308
  if ( $this->has_enrolled_course( $course_id ) ) {
437
  $course_id = $course->get_id();
438
 
439
  if ( $this->has_finished_course( $course_id ) ) {
440
+ throw new Exception( esc_html__( 'The course has finished.', 'learnpress' ) );
441
  }
442
 
443
  if ( ! $this->has_enrolled_course( $course_id ) ) {
444
+ throw new Exception( esc_html__( 'The course is not enrolled.', 'learnpress' ) );
445
  }
446
 
447
  if ( ! $this->is_course_in_progress( $course_id ) ) {
448
+ throw new Exception( esc_html__( 'Error: The course is not in progress.', 'learnpress' ) );
449
  }
450
 
451
  $course_data = $this->get_course_data( $course_id );
470
  }
471
 
472
  if ( ! apply_filters( 'lp_can_finish_course', true ) ) {
473
+ throw new Exception( esc_html__( 'Error: Filter the disabled finished courses.', 'learnpress' ) );
474
  }
475
  } catch ( Exception $e ) {
476
  $return['status'] = 'false';
504
  $course_id = $this->_verify_course_item( $quiz_id, $course_id );
505
  if ( ! $course_id ) {
506
  throw new Exception(
507
+ __( 'The course does not exist or does not contain a quiz.', 'learnpress' ),
508
  LP_INVALID_QUIZ_OR_COURSE
509
  );
510
  }
523
  if ( ! $this->has_enrolled_course( $course_id ) || ! $this->is_course_in_progress( $course_id ) ) {
524
  if ( ! $course->is_no_required_enroll() ) {
525
  throw new Exception(
526
+ __( 'Please enroll in the course before starting the quiz.', 'learnpress' ),
527
  LP_COURSE_IS_FINISHED
528
  );
529
  }
532
  // Check if user has already started or completed quiz
533
  if ( $this->has_item_status( array( 'started', 'completed' ), $quiz_id, $course_id ) ) {
534
  throw new Exception(
535
+ __( 'The user has started or completed the quiz.', 'learnpress' ),
536
  LP_QUIZ_HAS_STARTED_OR_COMPLETED
537
  );
538
  }
541
  if ( $user->is_guest() ) {
542
  // if course required enroll => print message "You have to login for starting quiz"
543
  if ( ! $course->is_no_required_enroll() ) {
544
+ throw new Exception( __( 'You have to log in to start the quiz.', 'learnpress' ), LP_REQUIRE_LOGIN );
545
  }
546
  }
547
 
596
  // If user has already finished the course
597
  if ( $this->has_finished_course( $course_id ) ) {
598
  throw new Exception(
599
+ __( 'The user has already finished the course of this quiz.', 'learnpress' ),
600
  LP_COURSE_IS_FINISHED
601
  );
602
 
605
  // Check if user has already started or completed quiz
606
  if ( $this->has_item_status( array( 'completed' ), $quiz_id, $course_id ) ) {
607
  throw new Exception(
608
+ __( 'The user has completed the quiz', 'learnpress' ),
609
  LP_QUIZ_HAS_STARTED_OR_COMPLETED
610
  );
611
  }
645
  throw new Exception(
646
  sprintf(
647
  __(
648
+ 'The course does not exist or does not contain a quiz.',
649
  'learnpress'
650
  ),
651
  __CLASS__,
672
  if ( ! $this->has_item_status( array( 'completed' ), $quiz_id, $course_id ) ) {
673
  throw new Exception(
674
  sprintf(
675
+ __( '%1$s::%2$s - The ser has not completed the quiz.', 'learnpress' ),
676
  __CLASS__,
677
  __FUNCTION__
678
  ),
685
  if ( ! $this->has_retake_quiz( $quiz_id, $course_id ) ) {
686
  throw new Exception(
687
  sprintf(
688
+ __( '%1$s::%2$s - Your quiz can\'t be retaken.', 'learnpress' ),
689
  __CLASS__,
690
  __FUNCTION__
691
  ),
inc/user/lp-user-functions.php CHANGED
@@ -63,7 +63,7 @@ function learn_press_delete_user_data( $user_id, $course_id = 0 ) {
63
  * @return bool
64
  * @editor tungnx
65
  * @reason this function only get cache, not handle get user_item_id
66
- * @depecated 4.1.6.9
67
  */
68
  function learn_press_get_user_item_id( $user_id, $item_id, $course_id = 0 /* added 3.0.0 */ ) {
69
  return false;
@@ -251,14 +251,15 @@ add_action( 'init', 'learn_press_add_user_roles' );
251
  * @param array $args
252
  *
253
  * @return mixed
 
254
  */
255
- function learn_press_get_user_questions( $user_id = null, $args = array() ) {
256
  if ( ! $user_id ) {
257
  $user_id = get_current_user_id();
258
  }
259
 
260
  return learn_press_get_user( $user_id )->get_questions( $args );
261
- }
262
 
263
  /**
264
  * Get the type of current user
@@ -399,11 +400,12 @@ add_action( 'register_form', 'learn_press_user_become_teacher_registration_form'
399
  *
400
  * @return mixed
401
  */
402
- function learn_press_update_user_item_field( $fields, $where = false, $update_cache = true, $update_extra_fields_as_meta = false ) {
403
  global $wpdb;
404
 
405
- // Table fields
406
  $table_fields = array(
 
407
  'user_id' => '%d',
408
  'item_id' => '%d',
409
  'ref_id' => '%d',
@@ -434,22 +436,20 @@ function learn_press_update_user_item_field( $fields, $where = false, $update_ca
434
  }
435
  }
436
 
437
- $data = array();
438
- $data_format = array();
439
- $date_time_fields = array(
440
- 'start_time',
441
- 'end_time',
442
- );
443
-
444
  foreach ( $fields as $field => $value ) {
445
  if ( ! empty( $table_fields[ $field ] ) ) {
446
  $data[ $field ] = $value;
447
 
448
  // Do not format the date-time field if it's value is NULL
449
- if ( in_array( $field, $date_time_fields ) && ! $value ) {
450
  $data[ $field ] = null;
451
  $data_format[] = '';
452
  } else {
 
 
 
453
  $data_format[] = $table_fields[ $field ];
454
  }
455
  }
@@ -462,16 +462,15 @@ function learn_press_update_user_item_field( $fields, $where = false, $update_ca
462
  );
463
  }
464
 
465
- if ( $where && empty( $where['user_id'] ) ) {
466
- $where['user_id'] = ! empty( $fields['user_id'] ) ? $fields['user_id'] : learn_press_get_current_user_id();
467
- }
468
-
469
  $where_format = array();
 
 
 
 
470
 
471
- // Build where and where format
472
- if ( $where ) {
473
  foreach ( $where as $field => $value ) {
474
- if ( ! empty( $table_fields[ $field ] ) ) {
475
  $where_format[] = $table_fields[ $field ];
476
  }
477
  }
@@ -484,15 +483,7 @@ function learn_press_update_user_item_field( $fields, $where = false, $update_ca
484
  $inserted = false;
485
  $updated = false;
486
 
487
- // Ensure all fields are instance of LP_Datetime have to
488
- // convert to string of datetime.
489
- foreach ( $data as $k => $v ) {
490
- if ( $v instanceof LP_Datetime ) {
491
- $data[ $k ] = $v->toSql();
492
- }
493
- }
494
-
495
- // If $where is not empty consider we are updating
496
  if ( $where ) {
497
  $updated = $wpdb->update(
498
  $wpdb->learnpress_user_items,
@@ -502,14 +493,12 @@ function learn_press_update_user_item_field( $fields, $where = false, $update_ca
502
  $where_format
503
  );
504
  } else {
505
-
506
- // Otherwise, insert a new one
507
  if ( $wpdb->insert(
508
  $wpdb->learnpress_user_items,
509
  $data,
510
  $data_format
511
- )
512
- ) {
513
  $inserted = $wpdb->insert_id;
514
  }
515
  }
@@ -532,9 +521,10 @@ function learn_press_update_user_item_field( $fields, $where = false, $update_ca
532
 
533
  /**
534
  * If there is some fields does not contain in the main table
535
- * then consider update them as meta data.
 
536
  */
537
- if ( $updated_item && $update_extra_fields_as_meta ) {
538
  $extra_fields = array_diff_key( $fields, $table_fields );
539
  if ( $extra_fields ) {
540
  foreach ( $extra_fields as $meta_key => $meta_value ) {
@@ -553,7 +543,7 @@ function learn_press_update_user_item_field( $fields, $where = false, $update_ca
553
  }
554
  }
555
  }
556
- }
557
 
558
  do_action( 'learn-press/updated-user-item-meta', $updated_item );
559
 
@@ -605,7 +595,7 @@ function learn_press_get_user_item( $where, $single = true ) {
605
  FROM {$wpdb->prefix}learnpress_user_items
606
  WHERE " . join( ' AND ', $where_str ) . '
607
  ORDER BY user_item_id DESC
608
- ',
609
  $where
610
  );
611
  if ( $single || ! empty( $where['user_item_id'] ) ) {
@@ -683,7 +673,7 @@ function learn_press_delete_user_item_meta( $object_id, $meta_key, $meta_value =
683
  * Get temp users.
684
  *
685
  * @return array
686
- * @depecated 4.1.6.9
687
  */
688
  /*function learn_press_get_temp_users() {
689
  return false;
@@ -718,8 +708,9 @@ function learn_press_delete_user_item_meta( $object_id, $meta_key, $meta_value =
718
  * @param $object_id
719
  * @param $meta_key
720
  * @param $_meta_value
 
721
  */
722
- function _learn_press_update_created_time_user_item_meta( $meta_id, $object_id, $meta_key, $_meta_value ) {
723
  global $wpdb;
724
  $wpdb->update(
725
  $wpdb->learnpress_user_itemmeta,
@@ -728,7 +719,7 @@ function _learn_press_update_created_time_user_item_meta( $meta_id, $object_id,
728
  array( '%s' ),
729
  array( '%d' )
730
  );
731
- }
732
 
733
  // add_action( 'added_learnpress_user_item_meta', '_learn_press_update_created_time_user_item_meta', 10, 4 );
734
 
@@ -741,8 +732,9 @@ function _learn_press_update_created_time_user_item_meta( $meta_id, $object_id,
741
  * @param $object_id
742
  * @param $meta_key
743
  * @param $_meta_value
 
744
  */
745
- function _learn_press_update_updated_time_user_item_meta( $meta_id, $object_id, $meta_key, $_meta_value ) {
746
  global $wpdb;
747
  $wpdb->update(
748
  $wpdb->learnpress_user_itemmeta,
@@ -751,7 +743,7 @@ function _learn_press_update_updated_time_user_item_meta( $meta_id, $object_id,
751
  array( '%s' ),
752
  array( '%d' )
753
  );
754
- }
755
 
756
  // add_action( 'updated_learnpress_user_item_meta', '_learn_press_update_updated_time_user_item_meta', 10, 4 );
757
 
@@ -762,12 +754,13 @@ function _learn_press_update_updated_time_user_item_meta( $meta_id, $object_id,
762
  * @param int $course_id
763
  *
764
  * @return bool|mixed
 
765
  */
766
- function learn_press_user_has_quiz_status( $status, $quiz_id = 0, $user_id = 0, $course_id = 0 ) {
767
  $user = learn_press_get_user( $user_id );
768
 
769
  return $user->has_quiz_status( $status, $quiz_id, $course_id );
770
- }
771
 
772
  if ( ! function_exists( 'learn_press_pre_get_avatar_callback' ) ) {
773
  /**
@@ -893,7 +886,7 @@ function _learn_press_before_purchase_course_handler( $course_id, $cart ) {
893
  learn_press_get_login_url( $return_url )
894
  );
895
  if ( $redirect !== false ) {
896
- learn_press_add_message( __( 'Please login to enroll this course', 'learnpress' ) );
897
 
898
  if ( learn_press_is_ajax() ) {
899
  learn_press_send_json(
@@ -911,7 +904,7 @@ function _learn_press_before_purchase_course_handler( $course_id, $cart ) {
911
  $user = learn_press_get_current_user();
912
  $redirect = false;
913
  if ( $user->has_finished_course( $course_id ) ) {
914
- learn_press_add_message( __( 'You have already finished course', 'learnpress' ) );
915
  $redirect = true;
916
  } elseif ( $user->has_purchased_course( $course_id ) ) {
917
  learn_press_add_message( __( 'You have already enrolled in this course', 'learnpress' ) );
@@ -1028,7 +1021,7 @@ function learn_press_update_user_profile_basic_information( $wp_error = false )
1028
  $user_id = get_current_user_id();
1029
 
1030
  if ( ! $user_id ) {
1031
- return new WP_Error( 2, 'User is invalid!' );
1032
  }
1033
 
1034
  $update_data = array(
@@ -1069,7 +1062,7 @@ function learn_press_update_user_profile_change_password( $wp_error = false ) {
1069
  $user_id = get_current_user_id();
1070
 
1071
  if ( ! $user_id ) {
1072
- return new WP_Error( 2, 'User is invalid!' );
1073
  }
1074
 
1075
  $old_pass = filter_input( INPUT_POST, 'pass0' );
@@ -1087,13 +1080,13 @@ function learn_press_update_user_profile_change_password( $wp_error = false ) {
1087
 
1088
  try {
1089
  if ( ! $check_old_pass ) {
1090
- throw new Exception( __( 'Old password incorrect!', 'learnpress' ) );
1091
  } else {
1092
  $new_pass = filter_input( INPUT_POST, 'pass1' );
1093
  $new_pass2 = filter_input( INPUT_POST, 'pass2' );
1094
 
1095
  if ( ! $new_pass || ! $new_pass2 || ( $new_pass != $new_pass2 ) ) {
1096
- throw new Exception( __( 'Confirmation password incorrect!', 'learnpress' ) );
1097
  } else {
1098
  $update_data = array(
1099
  'user_pass' => $new_pass,
@@ -1370,13 +1363,13 @@ function learn_press_create_user_item( $args = array(), $wp_error = false ) {
1370
  $defaults = array(
1371
  'user_id' => get_current_user_id(),
1372
  'item_id' => '',
1373
- 'start_time' => current_time( 'mysql', true ),
1374
  'end_time' => '',
1375
  'graduation' => '',
1376
  'item_type' => '',
1377
  'status' => '',
1378
  'ref_id' => 0,
1379
- 'ref_type' => 0,
1380
  'parent_id' => 0,
1381
  'create_meta' => array(),
1382
  );
@@ -1392,7 +1385,8 @@ function learn_press_create_user_item( $args = array(), $wp_error = false ) {
1392
  return 0;
1393
  }
1394
 
1395
- if ( empty( $item_data['item_type'] ) && $post_type = learn_press_get_post_type( $item_data['item_id'] ) ) {
 
1396
  $item_data['item_type'] = $post_type;
1397
  }
1398
 
@@ -1417,7 +1411,8 @@ function learn_press_create_user_item( $args = array(), $wp_error = false ) {
1417
  }
1418
 
1419
  // Filter
1420
- if ( ! $item_data = apply_filters( 'learn-press/create-user-item-data', $item_data ) ) {
 
1421
  if ( $wp_error ) {
1422
  return new WP_Error( 'invalid_item_data', __( 'Invalid item data.', 'learnpress' ) );
1423
  }
@@ -1434,11 +1429,8 @@ function learn_press_create_user_item( $args = array(), $wp_error = false ) {
1434
  }
1435
 
1436
  $user_item = new LP_User_Item( $item_data );
1437
-
1438
- $result = $user_item->update( true, false );
1439
-
1440
  if ( ! $result || is_wp_error( $result ) ) {
1441
-
1442
  if ( $wp_error && is_wp_error( $result ) ) {
1443
  return $result;
1444
  }
@@ -1471,8 +1463,6 @@ function learn_press_create_user_item( $args = array(), $wp_error = false ) {
1471
  * @return bool|array|LP_User_Item|WP_Error
1472
  */
1473
  function learn_press_create_user_item_for_quiz( $args = array(), $wp_error = false ) {
1474
- global $wpdb;
1475
-
1476
  $item_data = wp_parse_args(
1477
  $args,
1478
  array(
@@ -1487,7 +1477,7 @@ function learn_press_create_user_item_for_quiz( $args = array(), $wp_error = fal
1487
 
1488
  if ( $user_item && ! is_wp_error( $user_item ) ) {
1489
  $user_item = new LP_User_Item_Quiz( $user_item->get_data() );
1490
- $user_item->update( true );
1491
  }
1492
 
1493
  return $user_item;
@@ -1572,7 +1562,7 @@ function learn_press_user_start_quiz( $quiz_id, $user_id = 0, $course_id = 0, $w
1572
  }
1573
 
1574
  // Reset first cache
1575
- $user_quiz->get_status( 'status', true );
1576
 
1577
  return $user_quiz;
1578
  }
@@ -1641,13 +1631,13 @@ function learn_press_user_retake_quiz( $quiz_id, $user_id = 0, $course_id = 0, $
1641
  learn_press_delete_user_item_meta( $data->user_item_id, '_lp_question_checked' );
1642
 
1643
  $user_item->set_status( LP_ITEM_STARTED )
1644
- ->set_start_time( current_time( 'mysql', 1 ) ) // Error Retake when change timezone - Nhamdv
1645
- ->set_end_time( '' )
1646
  ->set_graduation( LP_COURSE_GRADUATION_IN_PROGRESS )
1647
  ->update();
1648
 
1649
  // Reset first cache
1650
- $user_item->get_status( 'status', true );
1651
 
1652
  // Error Retake when change timezone - Nhamdv
1653
  // learn_press_update_user_item_field(
63
  * @return bool
64
  * @editor tungnx
65
  * @reason this function only get cache, not handle get user_item_id
66
+ * @deprecated 4.1.6.9
67
  */
68
  function learn_press_get_user_item_id( $user_id, $item_id, $course_id = 0 /* added 3.0.0 */ ) {
69
  return false;
251
  * @param array $args
252
  *
253
  * @return mixed
254
+ * @deprecated 4.1.7.3
255
  */
256
+ /*function learn_press_get_user_questions( $user_id = null, $args = array() ) {
257
  if ( ! $user_id ) {
258
  $user_id = get_current_user_id();
259
  }
260
 
261
  return learn_press_get_user( $user_id )->get_questions( $args );
262
+ }*/
263
 
264
  /**
265
  * Get the type of current user
400
  *
401
  * @return mixed
402
  */
403
+ function learn_press_update_user_item_field( array $fields = [], $where = false, $update_cache = true, $update_extra_fields_as_meta = false ) {
404
  global $wpdb;
405
 
406
+ // Table fields format.
407
  $table_fields = array(
408
+ 'user_item_id' => '%d',
409
  'user_id' => '%d',
410
  'item_id' => '%d',
411
  'ref_id' => '%d',
436
  }
437
  }
438
 
439
+ $data = array();
440
+ $data_format = array();
 
 
 
 
 
441
  foreach ( $fields as $field => $value ) {
442
  if ( ! empty( $table_fields[ $field ] ) ) {
443
  $data[ $field ] = $value;
444
 
445
  // Do not format the date-time field if it's value is NULL
446
+ if ( in_array( $field, [ 'start_time', 'end_time' ] ) && empty( $value ) ) {
447
  $data[ $field ] = null;
448
  $data_format[] = '';
449
  } else {
450
+ if ( $value instanceof LP_Datetime ) {
451
+ $data[ $field ] = $value->toSql();
452
+ }
453
  $data_format[] = $table_fields[ $field ];
454
  }
455
  }
462
  );
463
  }
464
 
465
+ // Set where and where format
 
 
 
466
  $where_format = array();
467
+ if ( is_array( $where ) && ! empty( $where ) ) {
468
+ if ( empty( $where['user_id'] ) ) {
469
+ $where['user_id'] = ! empty( $fields['user_id'] ) ? $fields['user_id'] : learn_press_get_current_user_id();
470
+ }
471
 
 
 
472
  foreach ( $where as $field => $value ) {
473
+ if ( isset( $table_fields[ $field ] ) ) {
474
  $where_format[] = $table_fields[ $field ];
475
  }
476
  }
483
  $inserted = false;
484
  $updated = false;
485
 
486
+ // Update to database.
 
 
 
 
 
 
 
 
487
  if ( $where ) {
488
  $updated = $wpdb->update(
489
  $wpdb->learnpress_user_items,
493
  $where_format
494
  );
495
  } else {
496
+ // Insert to database.
 
497
  if ( $wpdb->insert(
498
  $wpdb->learnpress_user_items,
499
  $data,
500
  $data_format
501
+ ) ) {
 
502
  $inserted = $wpdb->insert_id;
503
  }
504
  }
521
 
522
  /**
523
  * If there is some fields does not contain in the main table
524
+ * then consider update them as metadata.
525
+ * @comment by tungnx - 4.1.7.3
526
  */
527
+ /*if ( $updated_item && $update_extra_fields_as_meta ) {
528
  $extra_fields = array_diff_key( $fields, $table_fields );
529
  if ( $extra_fields ) {
530
  foreach ( $extra_fields as $meta_key => $meta_value ) {
543
  }
544
  }
545
  }
546
+ }*/
547
 
548
  do_action( 'learn-press/updated-user-item-meta', $updated_item );
549
 
595
  FROM {$wpdb->prefix}learnpress_user_items
596
  WHERE " . join( ' AND ', $where_str ) . '
597
  ORDER BY user_item_id DESC
598
+ ',
599
  $where
600
  );
601
  if ( $single || ! empty( $where['user_item_id'] ) ) {
673
  * Get temp users.
674
  *
675
  * @return array
676
+ * @deprecated 4.1.6.9
677
  */
678
  /*function learn_press_get_temp_users() {
679
  return false;
708
  * @param $object_id
709
  * @param $meta_key
710
  * @param $_meta_value
711
+ * @deprecated 4.1.7.3
712
  */
713
+ /*function _learn_press_update_created_time_user_item_meta( $meta_id, $object_id, $meta_key, $_meta_value ) {
714
  global $wpdb;
715
  $wpdb->update(
716
  $wpdb->learnpress_user_itemmeta,
719
  array( '%s' ),
720
  array( '%d' )
721
  );
722
+ }*/
723
 
724
  // add_action( 'added_learnpress_user_item_meta', '_learn_press_update_created_time_user_item_meta', 10, 4 );
725
 
732
  * @param $object_id
733
  * @param $meta_key
734
  * @param $_meta_value
735
+ * @deprecated
736
  */
737
+ /*function _learn_press_update_updated_time_user_item_meta( $meta_id, $object_id, $meta_key, $_meta_value ) {
738
  global $wpdb;
739
  $wpdb->update(
740
  $wpdb->learnpress_user_itemmeta,
743
  array( '%s' ),
744
  array( '%d' )
745
  );
746
+ }*/
747
 
748
  // add_action( 'updated_learnpress_user_item_meta', '_learn_press_update_updated_time_user_item_meta', 10, 4 );
749
 
754
  * @param int $course_id
755
  *
756
  * @return bool|mixed
757
+ * @deprecated 4.1.7.3
758
  */
759
+ /*function learn_press_user_has_quiz_status( $status, $quiz_id = 0, $user_id = 0, $course_id = 0 ) {
760
  $user = learn_press_get_user( $user_id );
761
 
762
  return $user->has_quiz_status( $status, $quiz_id, $course_id );
763
+ }*/
764
 
765
  if ( ! function_exists( 'learn_press_pre_get_avatar_callback' ) ) {
766
  /**
886
  learn_press_get_login_url( $return_url )
887
  );
888
  if ( $redirect !== false ) {
889
+ learn_press_add_message( __( 'Please log in to enroll in this course', 'learnpress' ) );
890
 
891
  if ( learn_press_is_ajax() ) {
892
  learn_press_send_json(
904
  $user = learn_press_get_current_user();
905
  $redirect = false;
906
  if ( $user->has_finished_course( $course_id ) ) {
907
+ learn_press_add_message( __( 'You have already finished the course', 'learnpress' ) );
908
  $redirect = true;
909
  } elseif ( $user->has_purchased_course( $course_id ) ) {
910
  learn_press_add_message( __( 'You have already enrolled in this course', 'learnpress' ) );
1021
  $user_id = get_current_user_id();
1022
 
1023
  if ( ! $user_id ) {
1024
+ return new WP_Error( 2, 'The user is invalid' );
1025
  }
1026
 
1027
  $update_data = array(
1062
  $user_id = get_current_user_id();
1063
 
1064
  if ( ! $user_id ) {
1065
+ return new WP_Error( 2, 'The user is invalid' );
1066
  }
1067
 
1068
  $old_pass = filter_input( INPUT_POST, 'pass0' );
1080
 
1081
  try {
1082
  if ( ! $check_old_pass ) {
1083
+ throw new Exception( __( 'The old password is incorrect!', 'learnpress' ) );
1084
  } else {
1085
  $new_pass = filter_input( INPUT_POST, 'pass1' );
1086
  $new_pass2 = filter_input( INPUT_POST, 'pass2' );
1087
 
1088
  if ( ! $new_pass || ! $new_pass2 || ( $new_pass != $new_pass2 ) ) {
1089
+ throw new Exception( __( 'Incorrect confirmation password!', 'learnpress' ) );
1090
  } else {
1091
  $update_data = array(
1092
  'user_pass' => $new_pass,
1363
  $defaults = array(
1364
  'user_id' => get_current_user_id(),
1365
  'item_id' => '',
1366
+ 'start_time' => time(),
1367
  'end_time' => '',
1368
  'graduation' => '',
1369
  'item_type' => '',
1370
  'status' => '',
1371
  'ref_id' => 0,
1372
+ 'ref_type' => '',
1373
  'parent_id' => 0,
1374
  'create_meta' => array(),
1375
  );
1385
  return 0;
1386
  }
1387
 
1388
+ $post_type = learn_press_get_post_type( $item_data['item_id'] );
1389
+ if ( empty( $item_data['item_type'] ) && $post_type ) {
1390
  $item_data['item_type'] = $post_type;
1391
  }
1392
 
1411
  }
1412
 
1413
  // Filter
1414
+ $item_data = apply_filters( 'learn-press/create-user-item-data', $item_data );
1415
+ if ( ! $item_data ) {
1416
  if ( $wp_error ) {
1417
  return new WP_Error( 'invalid_item_data', __( 'Invalid item data.', 'learnpress' ) );
1418
  }
1429
  }
1430
 
1431
  $user_item = new LP_User_Item( $item_data );
1432
+ $result = $user_item->update();
 
 
1433
  if ( ! $result || is_wp_error( $result ) ) {
 
1434
  if ( $wp_error && is_wp_error( $result ) ) {
1435
  return $result;
1436
  }
1463
  * @return bool|array|LP_User_Item|WP_Error
1464
  */
1465
  function learn_press_create_user_item_for_quiz( $args = array(), $wp_error = false ) {
 
 
1466
  $item_data = wp_parse_args(
1467
  $args,
1468
  array(
1477
 
1478
  if ( $user_item && ! is_wp_error( $user_item ) ) {
1479
  $user_item = new LP_User_Item_Quiz( $user_item->get_data() );
1480
+ $user_item->update();
1481
  }
1482
 
1483
  return $user_item;
1562
  }
1563
 
1564
  // Reset first cache
1565
+ //$user_quiz->get_status( 'status', true );
1566
 
1567
  return $user_quiz;
1568
  }
1631
  learn_press_delete_user_item_meta( $data->user_item_id, '_lp_question_checked' );
1632
 
1633
  $user_item->set_status( LP_ITEM_STARTED )
1634
+ ->set_start_time( time() ) // Error Retake when change timezone - Nhamdv
1635
+ ->set_end_time()
1636
  ->set_graduation( LP_COURSE_GRADUATION_IN_PROGRESS )
1637
  ->update();
1638
 
1639
  // Reset first cache
1640
+ //$user_item->get_status( 'status', true );
1641
 
1642
  // Error Retake when change timezone - Nhamdv
1643
  // learn_press_update_user_item_field(
inc/widgets/course-progress.php CHANGED
@@ -53,7 +53,7 @@ if ( ! class_exists( 'LP_Widget_Course_Progress' ) ) {
53
  $user_id = get_current_user_id();
54
 
55
  if ( empty( $user_id ) ) {
56
- return new WP_Error( 'no_user', esc_html__( 'You need login to view Course Progress', 'learnpress' ) );
57
  }
58
 
59
  if ( empty( $instance['course_id'] ) ) {
@@ -62,7 +62,7 @@ if ( ! class_exists( 'LP_Widget_Course_Progress' ) ) {
62
 
63
  $course = learn_press_get_course( $instance['course_id'] );
64
  if ( ! $course ) {
65
- return new WP_Error( 'no_course', esc_html__( 'Course is invalid', 'learnpress' ) );
66
  }
67
 
68
  $user = learn_press_get_user( $user_id );
53
  $user_id = get_current_user_id();
54
 
55
  if ( empty( $user_id ) ) {
56
+ return new WP_Error( 'no_user', esc_html__( 'You need to log in to view the Course Progress', 'learnpress' ) );
57
  }
58
 
59
  if ( empty( $instance['course_id'] ) ) {
62
 
63
  $course = learn_press_get_course( $instance['course_id'] );
64
  if ( ! $course ) {
65
+ return new WP_Error( 'no_course', esc_html__( 'The course is invalid!', 'learnpress' ) );
66
  }
67
 
68
  $user = learn_press_get_user( $user_id );
languages/learnpress.pot CHANGED
@@ -2,22 +2,22 @@
2
  # This file is distributed under the same license as the LearnPress plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: LearnPress 4.1.7.2-beta-4\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/lp-doing\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-10-03T11:01:40+03:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: learnpress\n"
16
 
17
  #. Plugin Name of the plugin
18
- #: inc/admin/class-lp-admin.php:135
19
- #: inc/admin/class-lp-admin.php:143
20
- #: inc/admin/lp-admin-functions.php:1715
21
  #: inc/admin/settings/class-lp-settings-emails.php:154
22
  #: inc/external-plugin/elementor/class-lp-elementor.php:41
23
  #: assets/js/dist/frontend/quiz.min.js:8
@@ -41,7 +41,7 @@ msgid "http://thimpress.com"
41
  msgstr ""
42
 
43
  #: config/settings/course.php:8
44
- msgid "The site will be redirected to the URL added after clicking finish course button."
45
  msgstr ""
46
 
47
  #: config/settings/course.php:9
@@ -55,7 +55,7 @@ msgstr ""
55
  #: inc/admin/settings/class-lp-settings-profile.php:59
56
  #: inc/admin/sub-menus/class-lp-submenu-statistics.php:26
57
  #: inc/admin/views/meta-boxes/course/settings.php:22
58
- #: inc/user/class-lp-profile.php:279
59
  msgid "General"
60
  msgstr ""
61
 
@@ -64,7 +64,7 @@ msgid "Review courses"
64
  msgstr ""
65
 
66
  #: config/settings/course.php:24
67
- msgid "Courses created by instructors will be pending in review first."
68
  msgstr ""
69
 
70
  #: config/settings/course.php:30
@@ -72,15 +72,15 @@ msgid "Auto start"
72
  msgstr ""
73
 
74
  #: config/settings/course.php:34
75
- msgid "Students will get started courses immediately after successfully purchased."
76
  msgstr ""
77
 
78
  #: config/settings/course.php:37
79
- msgid "Enable confirmation popup finish course, complete item"
80
  msgstr ""
81
 
82
  #: config/settings/course.php:38
83
- msgid "Show confirmation popup before finishing course or completing item."
84
  msgstr ""
85
 
86
  #: config/settings/course.php:44
@@ -88,7 +88,7 @@ msgid "Archive page layout"
88
  msgstr ""
89
 
90
  #: config/settings/course.php:45
91
- msgid "Type display list course on Course Archive page"
92
  msgstr ""
93
 
94
  #: config/settings/course.php:52
@@ -96,23 +96,23 @@ msgid "Courses per page"
96
  msgstr ""
97
 
98
  #: config/settings/course.php:53
99
- msgid "Number of courses displayed per page."
100
  msgstr ""
101
 
102
  #: config/settings/course.php:63
103
- msgid "Enable loading ajax Courses on the Course Archive page"
104
  msgstr ""
105
 
106
  #: config/settings/course.php:64
107
- msgid "On/Off <i>loading ajax Courses</i>"
108
  msgstr ""
109
 
110
  #: config/settings/course.php:70
111
- msgid "Not run Ajax when reloading Course Archive page"
112
  msgstr ""
113
 
114
  #: config/settings/course.php:71
115
- msgid "Ajax is only applied when selecting pagination, filtering, searching and sorting. Not applicable when reloading Course Archive page."
116
  msgstr ""
117
 
118
  #: config/settings/course.php:78
@@ -120,7 +120,7 @@ msgid "Thumbnail dimensions"
120
  msgstr ""
121
 
122
  #: config/settings/course.php:84
123
- msgid "Redirect when finish course"
124
  msgstr ""
125
 
126
  #: config/settings/course.php:101
@@ -132,7 +132,7 @@ msgid "Section Per Page"
132
  msgstr ""
133
 
134
  #: config/settings/course.php:109
135
- msgid "Number of sections displayed per page ( Enter -1 for display all sections)."
136
  msgstr ""
137
 
138
  #: config/settings/course.php:112
@@ -140,7 +140,7 @@ msgid "Course Item Per Page"
140
  msgstr ""
141
 
142
  #: config/settings/course.php:116
143
- msgid "Number of course items displayed per page in section ( Enter -1 for display all course items)."
144
  msgstr ""
145
 
146
  #: config/settings/course.php:128
@@ -164,7 +164,7 @@ msgstr ""
164
  #: inc/admin/settings/class-lp-settings-advanced.php:72
165
  #: inc/course/lp-course-functions.php:450
166
  #: inc/custom-post-types/lesson.php:158
167
- #: inc/lp-template-functions.php:1004
168
  msgid "Lesson"
169
  msgstr ""
170
 
@@ -173,7 +173,7 @@ msgstr ""
173
  #: inc/course/lp-course-functions.php:451
174
  #: inc/custom-post-types/question.php:320
175
  #: inc/custom-post-types/quiz.php:87
176
- #: inc/lp-template-functions.php:994
177
  #: templates/profile/tabs/quizzes.php:54
178
  msgid "Quiz"
179
  msgstr ""
@@ -215,7 +215,7 @@ msgid "Logout Redirect"
215
  msgstr ""
216
 
217
  #: config/settings/general.php:51
218
- msgid "The page where user will be redirected to after logging out."
219
  msgstr ""
220
 
221
  #: config/settings/general.php:57
@@ -244,11 +244,12 @@ msgid "Thousands separator"
244
  msgstr ""
245
 
246
  #: config/settings/general.php:79
247
- msgid "This sets the thousand separator of displayed prices."
248
  msgstr ""
249
 
250
  #: config/settings/general.php:86
251
- msgid "Decimals separator"
 
252
  msgstr ""
253
 
254
  #: config/settings/general.php:87
@@ -256,11 +257,12 @@ msgid "This sets the decimal separator of displayed prices."
256
  msgstr ""
257
 
258
  #: config/settings/general.php:94
259
- msgid "Number of decimals"
 
260
  msgstr ""
261
 
262
  #: config/settings/general.php:95
263
- msgid "This sets the number of decimal points shown in displayed prices."
264
  msgstr ""
265
 
266
  #: config/settings/general.php:105
@@ -274,11 +276,11 @@ msgid "Publish profile"
274
  msgstr ""
275
 
276
  #: config/settings/general.php:113
277
- msgid "This option will add a sub-item \"Privacy\" under Setting tab on the Profile page. If users want to publish or hide their course, quiz tab when other users visit their profile page, they need to enable/disable that option in the Privacy section."
278
  msgstr ""
279
 
280
  #: config/settings/general.php:114
281
- msgid "Public all user profile page (Overview tab only)."
282
  msgstr ""
283
 
284
  #: config/settings/general.php:117
@@ -291,31 +293,31 @@ msgstr ""
291
 
292
  #: inc/abstract-settings.php:89
293
  #: inc/settings/abstract-settings-page.php:51
294
- msgid "No setting available."
295
  msgstr ""
296
 
297
  #: inc/abstracts/abstract-addon.php:284
298
  msgid "<strong>%1$s</strong> add-on version %2$s requires <strong>LearnPress</strong> version %3$s or higher %4$s"
299
  msgstr ""
300
 
301
- #: inc/abstracts/abstract-addon.php:366
302
  msgid "%s plugin file does not exist."
303
  msgstr ""
304
 
305
- #: inc/abstracts/abstract-addon.php:387
306
  msgid "%s plugin class does not exist."
307
  msgstr ""
308
 
309
- #: inc/abstracts/abstract-object-data.php:344
310
- msgid "The following these functions %1$s do not exists in %2$s"
311
  msgstr ""
312
 
313
  #: inc/admin/class-lp-admin-ajax.php:219
314
- msgid "Ops! ID not found"
315
  msgstr ""
316
 
317
  #: inc/admin/class-lp-admin-ajax.php:262
318
- msgid "Duplicate post fail, please try again"
319
  msgstr ""
320
 
321
  #: inc/admin/class-lp-admin-ajax.php:405
@@ -323,7 +325,7 @@ msgid "Access denied"
323
  msgstr ""
324
 
325
  #: inc/admin/class-lp-admin-ajax.php:411
326
- msgid "Check nonce failed"
327
  msgstr ""
328
 
329
  #: inc/admin/class-lp-admin-ajax.php:417
@@ -355,7 +357,7 @@ msgid "Empty page name!"
355
  msgstr ""
356
 
357
  #: inc/admin/class-lp-admin-assets.php:32
358
- msgid "Ooops! Error."
359
  msgstr ""
360
 
361
  #: inc/admin/class-lp-admin-assets.php:33
@@ -368,7 +370,7 @@ msgid "Guest"
368
  msgstr ""
369
 
370
  #: inc/admin/class-lp-admin-assets.php:39
371
- msgid "Before taking this action, we strongly recommend you should backup your site first before proceeding. Should any issues come at hand, do not hesitate to contact our Support team. Are you sure to proceed the update protocol?"
372
  msgstr ""
373
 
374
  #: inc/admin/class-lp-admin-dashboard.php:21
@@ -389,91 +391,95 @@ msgstr ""
389
  msgid "Created by: "
390
  msgstr ""
391
 
392
- #: inc/admin/class-lp-admin-menu.php:66
393
  msgid "View Courses"
394
  msgstr ""
395
 
396
- #: inc/admin/class-lp-admin-menu.php:87
 
 
 
 
397
  msgid "Learning Management System"
398
  msgstr ""
399
 
400
- #: inc/admin/class-lp-admin.php:90
401
  msgid "Available Courses"
402
  msgstr ""
403
 
404
- #: inc/admin/class-lp-admin.php:214
405
  msgid "Shop Page"
406
  msgstr ""
407
 
408
- #: inc/admin/class-lp-admin.php:218
409
  msgid "Cart Page"
410
  msgstr ""
411
 
412
- #: inc/admin/class-lp-admin.php:222
413
  msgid "Checkout Page"
414
  msgstr ""
415
 
416
- #: inc/admin/class-lp-admin.php:226
417
  msgid "My Account Page"
418
  msgstr ""
419
 
420
- #: inc/admin/class-lp-admin.php:230
421
  msgid "Terms and Conditions Page"
422
  msgstr ""
423
 
424
- #: inc/admin/class-lp-admin.php:247
425
  msgid "Account"
426
  msgstr ""
427
 
428
- #: inc/admin/class-lp-admin.php:248
429
  msgid "Billing"
430
  msgstr ""
431
 
432
- #: inc/admin/class-lp-admin.php:249
433
  #: inc/admin/views/meta-boxes/fields/date.php:39
434
  #: inc/class-lp-assets.php:73
435
- #: inc/lp-core-functions.php:2771
436
- #: inc/order/class-lp-order.php:954
437
  #: assets/js/dist/frontend/quiz.min.js:44
438
  msgid "Cancel"
439
  msgstr ""
440
 
441
- #: inc/admin/class-lp-admin.php:250
442
- #: inc/admin/class-lp-admin.php:314
443
  msgid "Checkout"
444
  msgstr ""
445
 
446
- #: inc/admin/class-lp-admin.php:251
447
  msgid "Confirmation"
448
  msgstr ""
449
 
450
- #: inc/admin/class-lp-admin.php:252
451
  #: inc/admin/views/meta-boxes/order/content-tab-preview-exports-invoice.php:23
452
  msgid "Invoice"
453
  msgstr ""
454
 
455
- #: inc/admin/class-lp-admin.php:253
456
  msgid "Levels"
457
  msgstr ""
458
 
459
- #: inc/admin/class-lp-admin.php:281
460
  msgid "Members"
461
  msgstr ""
462
 
463
- #: inc/admin/class-lp-admin.php:282
464
  msgid "Activity"
465
  msgstr ""
466
 
467
- #: inc/admin/class-lp-admin.php:283
468
  #: templates/global/form-register.php:51
469
  msgid "Register"
470
  msgstr ""
471
 
472
- #: inc/admin/class-lp-admin.php:284
473
  msgid "Activate"
474
  msgstr ""
475
 
476
- #: inc/admin/class-lp-admin.php:312
477
  #: inc/admin/lp-admin-actions.php:217
478
  #: inc/admin/settings/class-lp-settings-profile.php:150
479
  #: inc/admin/sub-menus/class-lp-submenu-statistics.php:21
@@ -483,86 +489,82 @@ msgstr ""
483
  #: inc/custom-post-types/course.php:107
484
  #: inc/lp-template-functions.php:312
485
  #: inc/settings/class-lp-settings-courses.php:16
486
- #: inc/user/class-lp-profile.php:246
487
- #: inc/user/class-lp-profile.php:597
488
  msgid "Courses"
489
  msgstr ""
490
 
491
- #: inc/admin/class-lp-admin.php:313
492
  #: inc/admin/settings/class-lp-settings-profile.php:24
493
  #: inc/admin/views/meta-boxes/order/details.php:101
494
  msgid "Profile"
495
  msgstr ""
496
 
497
- #: inc/admin/class-lp-admin.php:315
498
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:86
499
  msgid "Become a Teacher"
500
  msgstr ""
501
 
502
- #: inc/admin/class-lp-admin.php:359
503
  msgid "LearnPress Page"
504
  msgstr ""
505
 
506
- #: inc/admin/class-lp-admin.php:408
507
  msgid "LearnPress Pages (%d)"
508
  msgstr ""
509
 
510
- #: inc/admin/class-lp-admin.php:458
511
  msgctxt "pending-request"
512
  msgid "Accept"
513
  msgstr ""
514
 
515
- #: inc/admin/class-lp-admin.php:462
516
  msgctxt "pending-request"
517
  msgid "Deny"
518
  msgstr ""
519
 
520
- #: inc/admin/class-lp-admin.php:532
521
  msgid "Pending Request %s"
522
  msgstr ""
523
 
524
- #: inc/admin/class-lp-admin.php:566
525
- msgid "Sorry, you are not allowed to edit this user."
526
  msgstr ""
527
 
528
- #: inc/admin/class-lp-admin.php:574
529
- msgid "User has %s to become a teacher."
530
  msgstr ""
531
 
532
- #: inc/admin/class-lp-admin.php:685
533
- msgid "If you like <strong>LearnPress</strong> please leave us a %1$s&#9733;&#9733;&#9733;&#9733;&#9733;%2$s rating. A huge thanks from LearnPress team for your generous."
534
- msgstr ""
535
-
536
- #: inc/admin/class-lp-admin.php:689
537
  msgid "Thanks :)"
538
  msgstr ""
539
 
540
- #: inc/admin/class-lp-admin.php:758
541
- msgid "Fail while joining newsletter! Please try again!"
542
  msgstr ""
543
 
544
- #: inc/admin/class-lp-admin.php:784
545
  msgid "Something went wrong: "
546
  msgstr ""
547
 
548
- #: inc/admin/class-lp-admin.php:786
549
- msgid "Thank you for subscribing! Please check and click the confirmation link from the email we've just sent to your mail box."
550
  msgstr ""
551
 
552
- #: inc/admin/class-lp-admin.php:908
553
- msgid "Permalink only available if the item is already assigned to a course."
554
  msgstr ""
555
 
556
  #: inc/admin/class-lp-install-sample-data.php:68
557
- msgid "Are you sure you want to install sample course data?"
558
  msgstr ""
559
 
560
  #: inc/admin/class-lp-install-sample-data.php:69
561
- msgid "Are you sure you want to delete sample course data?"
562
  msgstr ""
563
 
564
  #: inc/admin/class-lp-install-sample-data.php:158
565
- msgid "Course \"%s\" has been created"
566
  msgstr ""
567
 
568
  #: inc/admin/class-lp-install-sample-data.php:159
@@ -574,7 +576,7 @@ msgstr ""
574
  #: inc/custom-post-types/abstract.php:938
575
  #: inc/custom-post-types/abstract.php:948
576
  #: inc/custom-post-types/question.php:366
577
- #: inc/order/class-lp-order.php:946
578
  msgid "View"
579
  msgstr ""
580
 
@@ -591,7 +593,7 @@ msgid "No data sample."
591
  msgstr ""
592
 
593
  #: inc/admin/class-lp-install-sample-data.php:208
594
- msgid "Delete sample data successfully!"
595
  msgstr ""
596
 
597
  #: inc/admin/class-lp-install-sample-data.php:354
@@ -715,10 +717,10 @@ msgid "Last Updated:"
715
  msgstr ""
716
 
717
  #: inc/admin/class-lp-plugin-install-list-table.php:483
718
- #: inc/class-lp-datetime.php:209
719
  #: inc/custom-post-types/order.php:762
720
- #: inc/order/class-lp-order.php:150
721
- #: inc/user-item/class-lp-user-item.php:240
722
  msgid "%s ago"
723
  msgstr ""
724
 
@@ -742,7 +744,7 @@ msgid "<strong>Compatible</strong> with your version of WordPress"
742
  msgstr ""
743
 
744
  #: inc/admin/class-lp-reset-data.php:103
745
- msgid "Item progress deleted"
746
  msgstr ""
747
 
748
  #: inc/admin/class-lp-reset-data.php:105
@@ -766,7 +768,7 @@ msgstr ""
766
 
767
  #: inc/admin/class-lp-setup-wizard.php:76
768
  msgctxt "static-page"
769
- msgid "LP Become Teacher"
770
  msgstr ""
771
 
772
  #: inc/admin/class-lp-setup-wizard.php:77
@@ -841,7 +843,7 @@ msgid "New Quiz"
841
  msgstr ""
842
 
843
  #: inc/admin/editor/class-lp-admin-editor-quiz.php:164
844
- #: inc/admin/editor/class-lp-admin-editor-quiz.php:604
845
  msgid "Quiz creation failed."
846
  msgstr ""
847
 
@@ -871,11 +873,15 @@ msgid "Buy Now"
871
  msgstr ""
872
 
873
  #: inc/admin/lp-admin-actions.php:222
 
 
874
  #: inc/custom-post-types/course.php:485
875
  msgid "Categories"
876
  msgstr ""
877
 
878
  #: inc/admin/lp-admin-actions.php:227
 
 
879
  msgid "Tags"
880
  msgstr ""
881
 
@@ -899,78 +905,78 @@ msgctxt "copy lesson"
899
  msgid "Duplicate"
900
  msgstr ""
901
 
902
- #: inc/admin/lp-admin-functions.php:222
903
  msgid "[ Add a new page ]"
904
  msgstr ""
905
 
906
- #: inc/admin/lp-admin-functions.php:245
907
  msgid "Select Page"
908
  msgstr ""
909
 
910
- #: inc/admin/lp-admin-functions.php:263
911
  #: inc/admin/meta-box/fields/select-page.php:24
912
  msgid "Select a page&hellip;"
913
  msgstr ""
914
 
915
- #: inc/admin/lp-admin-functions.php:291
916
- msgctxt "drop down pages"
917
  msgid "or"
918
  msgstr ""
919
 
920
- #: inc/admin/lp-admin-functions.php:294
921
  msgid "Create new"
922
  msgstr ""
923
 
924
- #: inc/admin/lp-admin-functions.php:299
925
  msgid "New page title"
926
  msgstr ""
927
 
928
- #: inc/admin/lp-admin-functions.php:301
929
  msgid "Ok [Enter]"
930
  msgstr ""
931
 
932
- #: inc/admin/lp-admin-functions.php:303
933
  msgid "Cancel [ESC]"
934
  msgstr ""
935
 
936
- #: inc/admin/lp-admin-functions.php:308
937
  msgid "Edit page"
938
  msgstr ""
939
 
940
- #: inc/admin/lp-admin-functions.php:311
941
  msgid "View page"
942
  msgstr ""
943
 
944
- #: inc/admin/lp-admin-functions.php:425
945
  msgid "Minutes"
946
  msgstr ""
947
 
948
- #: inc/admin/lp-admin-functions.php:469
949
- #: inc/admin/lp-admin-functions.php:515
950
  #: inc/admin/settings/class-lp-settings-emails.php:141
951
  msgid "Plain Text"
952
  msgstr ""
953
 
954
- #: inc/admin/lp-admin-functions.php:470
955
- #: inc/admin/lp-admin-functions.php:516
956
  #: inc/admin/settings/class-lp-settings-emails.php:142
957
  msgid "HTML"
958
  msgstr ""
959
 
960
- #: inc/admin/lp-admin-functions.php:715
961
  #: inc/admin/views/addons/html-loop-theme.php:45
962
  msgid "Get it now"
963
  msgstr ""
964
 
965
- #: inc/admin/lp-admin-functions.php:717
966
  #: inc/admin/views/addons/html-loop-theme.php:46
967
  msgid "View Demo"
968
  msgstr ""
969
 
970
- #: inc/admin/lp-admin-functions.php:1029
971
- #: inc/admin/lp-admin-functions.php:1223
972
- #: inc/admin/lp-admin-functions.php:1439
973
- #: inc/admin/lp-admin-functions.php:2297
974
  #: inc/admin/views/statistics/courses.php:27
975
  #: inc/admin/views/statistics/general.php:43
976
  #: inc/admin/views/statistics/orders.php:29
@@ -981,14 +987,14 @@ msgstr ""
981
  #: inc/lp-deprecated.php:384
982
  #: inc/templates/class-lp-template-profile.php:100
983
  #: inc/templates/class-lp-template-profile.php:111
984
- #: inc/user/class-lp-profile.php:840
985
- #: inc/user/class-lp-profile.php:872
986
- #: inc/user/class-lp-profile.php:906
987
  #: templates/widgets/course-info.php:35
988
  msgid "All"
989
  msgstr ""
990
 
991
- #: inc/admin/lp-admin-functions.php:1034
992
  #: inc/admin/views/statistics/courses.php:9
993
  #: inc/admin/views/statistics/general.php:9
994
  #: inc/admin/views/statistics/orders.php:9
@@ -996,7 +1002,7 @@ msgstr ""
996
  msgid "Instructors"
997
  msgstr ""
998
 
999
- #: inc/admin/lp-admin-functions.php:1039
1000
  #: inc/admin/views/statistics/courses.php:8
1001
  #: inc/admin/views/statistics/general.php:8
1002
  #: inc/admin/views/statistics/orders.php:8
@@ -1006,58 +1012,58 @@ msgstr ""
1006
  msgid "Students"
1007
  msgstr ""
1008
 
1009
- #: inc/admin/lp-admin-functions.php:1228
1010
- #: inc/admin/lp-admin-functions.php:2302
1011
  #: inc/templates/class-lp-template-profile.php:112
1012
- #: inc/user/class-lp-profile.php:841
1013
  msgid "Publish"
1014
  msgstr ""
1015
 
1016
- #: inc/admin/lp-admin-functions.php:1233
1017
- #: inc/admin/lp-admin-functions.php:1449
1018
- #: inc/admin/lp-admin-functions.php:2307
1019
  #: inc/templates/class-lp-template-profile.php:113
1020
- #: inc/user/class-lp-profile.php:842
1021
  msgid "Pending"
1022
  msgstr ""
1023
 
1024
- #: inc/admin/lp-admin-functions.php:1238
1025
- #: inc/admin/lp-admin-functions.php:2312
1026
  msgid "Paid"
1027
  msgstr ""
1028
 
1029
- #: inc/admin/lp-admin-functions.php:1243
1030
- #: inc/admin/lp-admin-functions.php:2317
1031
- #: inc/course/abstract-course.php:663
1032
- #: inc/course/abstract-course.php:692
1033
  #: templates/order/order-details.php:43
1034
  msgid "Free"
1035
  msgstr ""
1036
 
1037
- #: inc/admin/lp-admin-functions.php:1444
1038
  #: inc/user-item/class-lp-user-item-quiz.php:146
1039
- #: inc/user-item/class-lp-user-item.php:801
1040
  #: templates/content-lesson/button-complete.php:37
1041
  msgid "Completed"
1042
  msgstr ""
1043
 
1044
- #: inc/admin/lp-admin-functions.php:1477
1045
- msgid "Pending Courses / Publish Courses"
1046
  msgstr ""
1047
 
1048
- #: inc/admin/lp-admin-functions.php:1478
1049
- msgid "Free Courses / Priced Courses"
1050
  msgstr ""
1051
 
1052
- #: inc/admin/lp-admin-functions.php:1858
1053
- msgid " Copy"
1054
  msgstr ""
1055
 
1056
- #: inc/admin/lp-admin-functions.php:1966
1057
  msgid "Question id %s does not exist."
1058
  msgstr ""
1059
 
1060
- #: inc/admin/lp-admin-functions.php:1970
1061
  msgid "Quiz id %s does not exist."
1062
  msgstr ""
1063
 
@@ -1098,7 +1104,7 @@ msgid "Add new"
1098
  msgstr ""
1099
 
1100
  #: inc/admin/meta-box/fields/email-content.php:45
1101
- msgid "General Setting"
1102
  msgstr ""
1103
 
1104
  #: inc/admin/meta-box/fields/email-content.php:95
@@ -1106,7 +1112,7 @@ msgid "This template has been overridden by your theme and can be found in: <cod
1106
  msgstr ""
1107
 
1108
  #: inc/admin/meta-box/fields/email-content.php:135
1109
- msgid "Click on any variables above to insert them to the email."
1110
  msgstr ""
1111
 
1112
  #: inc/admin/meta-box/fields/image-advanced.php:25
@@ -1127,7 +1133,7 @@ msgid "Add to gallery"
1127
  msgstr ""
1128
 
1129
  #: inc/admin/meta-box/fields/image-advanced.php:38
1130
- msgid "Delete image"
1131
  msgstr ""
1132
 
1133
  #: inc/admin/meta-box/fields/image.php:24
@@ -1135,7 +1141,7 @@ msgid "Select images"
1135
  msgstr ""
1136
 
1137
  #: inc/admin/meta-box/fields/image.php:24
1138
- #: inc/admin/views/meta-boxes/fields/autocomplete.php:59
1139
  msgid "Select"
1140
  msgstr ""
1141
 
@@ -1223,7 +1229,7 @@ msgid "Debug Mode"
1223
  msgstr ""
1224
 
1225
  #: inc/admin/settings/class-lp-settings-advanced.php:93
1226
- msgid "Enable debug mode for developer."
1227
  msgstr ""
1228
 
1229
  #: inc/admin/settings/class-lp-settings-advanced.php:110
@@ -1233,7 +1239,7 @@ msgid "Enable"
1233
  msgstr ""
1234
 
1235
  #: inc/admin/settings/class-lp-settings-advanced.php:114
1236
- msgid "Question navigation position is sticky, if not right below the quiz content"
1237
  msgstr ""
1238
 
1239
  #: inc/admin/settings/class-lp-settings-emails.php:25
@@ -1284,7 +1290,7 @@ msgid "Guest checkout"
1284
  msgstr ""
1285
 
1286
  #: inc/admin/settings/class-lp-settings-payments.php:85
1287
- msgid "Enable guest checkout"
1288
  msgstr ""
1289
 
1290
  #: inc/admin/settings/class-lp-settings-payments.php:88
@@ -1292,7 +1298,7 @@ msgid "Account login"
1292
  msgstr ""
1293
 
1294
  #: inc/admin/settings/class-lp-settings-payments.php:92
1295
- msgid "Enable login form in checkout"
1296
  msgstr ""
1297
 
1298
  #: inc/admin/settings/class-lp-settings-payments.php:95
@@ -1300,7 +1306,7 @@ msgid "Account creation"
1300
  msgstr ""
1301
 
1302
  #: inc/admin/settings/class-lp-settings-payments.php:99
1303
- msgid "Enable register form in checkout"
1304
  msgstr ""
1305
 
1306
  #: inc/admin/settings/class-lp-settings-payments.php:108
@@ -1316,7 +1322,7 @@ msgid "Enable login form"
1316
  msgstr ""
1317
 
1318
  #: inc/admin/settings/class-lp-settings-profile.php:74
1319
- msgid "Enable login from profile if the user is not logged in."
1320
  msgstr ""
1321
 
1322
  #: inc/admin/settings/class-lp-settings-profile.php:77
@@ -1324,7 +1330,7 @@ msgid "Enable register form"
1324
  msgstr ""
1325
 
1326
  #: inc/admin/settings/class-lp-settings-profile.php:81
1327
- msgid "Enable register from profile if the user is not logged in."
1328
  msgstr ""
1329
 
1330
  #: inc/admin/settings/class-lp-settings-profile.php:84
@@ -1332,23 +1338,23 @@ msgid "Enable default fields"
1332
  msgstr ""
1333
 
1334
  #: inc/admin/settings/class-lp-settings-profile.php:89
1335
- #: inc/user/lp-user-functions.php:1848
1336
- #: inc/user/lp-user-functions.php:1850
1337
  #: templates/profile/tabs/settings/basic-information.php:33
1338
  msgid "First name"
1339
  msgstr ""
1340
 
1341
  #: inc/admin/settings/class-lp-settings-profile.php:96
1342
- #: inc/user/lp-user-functions.php:1861
1343
- #: inc/user/lp-user-functions.php:1863
1344
  #: templates/profile/tabs/settings/basic-information.php:39
1345
  msgid "Last name"
1346
  msgstr ""
1347
 
1348
  #: inc/admin/settings/class-lp-settings-profile.php:103
1349
  #: inc/admin/settings/class-lp-settings-profile.php:115
1350
- #: inc/user/lp-user-functions.php:1874
1351
- #: inc/user/lp-user-functions.php:1876
1352
  #: templates/profile/tabs/settings/basic-information.php:45
1353
  msgid "Display name"
1354
  msgstr ""
@@ -1401,15 +1407,15 @@ msgid "Required?"
1401
  msgstr ""
1402
 
1403
  #: inc/admin/settings/class-lp-settings-profile.php:133
1404
- msgid "Custom fields for form register."
1405
  msgstr ""
1406
 
1407
  #: inc/admin/settings/class-lp-settings-profile.php:158
1408
  #: inc/custom-post-types/quiz.php:85
1409
  #: inc/custom-post-types/quiz.php:86
1410
  #: inc/custom-post-types/quiz.php:90
1411
- #: inc/user/class-lp-profile.php:253
1412
- #: inc/user/class-lp-profile.php:604
1413
  #: templates/widgets/course-info.php:30
1414
  msgid "Quizzes"
1415
  msgstr ""
@@ -1420,21 +1426,21 @@ msgstr ""
1420
  #: inc/custom-post-types/order.php:823
1421
  #: inc/custom-post-types/order.php:824
1422
  #: inc/custom-post-types/order.php:828
1423
- #: inc/user/class-lp-profile.php:260
1424
  msgid "Orders"
1425
  msgstr ""
1426
 
1427
  #: inc/admin/settings/class-lp-settings-profile.php:174
1428
  #: inc/admin/views/meta-boxes/order/content-tab-preview-exports-invoice.php:61
1429
  #: inc/admin/views/meta-boxes/order/details.php:40
1430
- #: inc/user/class-lp-profile.php:267
1431
  msgid "Order details"
1432
  msgstr ""
1433
 
1434
  #: inc/admin/settings/class-lp-settings-profile.php:188
1435
  #: inc/admin/sub-menus/class-lp-submenu-settings.php:18
1436
- #: inc/user/class-lp-profile.php:274
1437
- #: learnpress.php:484
1438
  msgid "Settings"
1439
  msgstr ""
1440
 
@@ -1493,7 +1499,7 @@ msgid "Reset Password"
1493
  msgstr ""
1494
 
1495
  #: inc/admin/sub-menus/class-lp-submenu-addons.php:14
1496
- #: learnpress.php:486
1497
  msgid "Add-ons"
1498
  msgstr ""
1499
 
@@ -1501,19 +1507,19 @@ msgstr ""
1501
  msgid "LearnPress Add-ons"
1502
  msgstr ""
1503
 
1504
- #: inc/admin/sub-menus/class-lp-submenu-addons.php:33
1505
  msgid "Get more (%d)"
1506
  msgstr ""
1507
 
1508
- #: inc/admin/sub-menus/class-lp-submenu-addons.php:34
1509
  msgid "Installed (%d)"
1510
  msgstr ""
1511
 
1512
- #: inc/admin/sub-menus/class-lp-submenu-addons.php:35
1513
  msgid "Themes (%d)"
1514
  msgstr ""
1515
 
1516
- #: inc/admin/sub-menus/class-lp-submenu-addons.php:63
1517
  msgid "Search..."
1518
  msgstr ""
1519
 
@@ -1521,15 +1527,15 @@ msgstr ""
1521
  msgid "LearnPress Settings"
1522
  msgstr ""
1523
 
1524
- #: inc/admin/sub-menus/class-lp-submenu-settings.php:58
1525
  msgid "Save settings"
1526
  msgstr ""
1527
 
1528
- #: inc/admin/sub-menus/class-lp-submenu-statistics.php:15
1529
  msgid "Statistics"
1530
  msgstr ""
1531
 
1532
- #: inc/admin/sub-menus/class-lp-submenu-statistics.php:16
1533
  msgid "LearnPress Statistics"
1534
  msgstr ""
1535
 
@@ -1545,15 +1551,15 @@ msgstr ""
1545
  msgid "LearnPress Tools"
1546
  msgstr ""
1547
 
1548
- #: inc/admin/sub-menus/class-lp-submenu-tools.php:19
1549
  msgid "Course Data"
1550
  msgstr ""
1551
 
1552
- #: inc/admin/sub-menus/class-lp-submenu-tools.php:20
1553
  msgid "Database"
1554
  msgstr ""
1555
 
1556
- #: inc/admin/sub-menus/class-lp-submenu-tools.php:21
1557
  msgid "Templates"
1558
  msgstr ""
1559
 
@@ -1570,7 +1576,7 @@ msgid "Installed add-ons"
1570
  msgstr ""
1571
 
1572
  #: inc/admin/views/addons/html-plugins-more.php:18
1573
- msgid "There is no available add-ons."
1574
  msgstr ""
1575
 
1576
  #: inc/admin/views/addons/html-plugins-more.php:26
@@ -1601,7 +1607,7 @@ msgid "Details"
1601
  msgstr ""
1602
 
1603
  #: inc/admin/views/course/editor.php:41
1604
- msgid "Something went wrong! Please reload to continue editing curriculum."
1605
  msgstr ""
1606
 
1607
  #: inc/admin/views/course/modal-choose-items.php:54
@@ -1612,7 +1618,7 @@ msgid "Selected items"
1612
  msgstr ""
1613
 
1614
  #: inc/admin/views/course/modal-choose-items.php:71
1615
- msgid "Type here to search item"
1616
  msgstr ""
1617
 
1618
  #: inc/admin/views/course/modal-choose-items.php:76
@@ -1648,11 +1654,11 @@ msgstr ""
1648
 
1649
  #: inc/admin/views/course/section-item.php:27
1650
  #: inc/admin/views/quiz/question-actions.php:31
1651
- msgid "Edit item"
1652
  msgstr ""
1653
 
1654
  #: inc/admin/views/course/section-item.php:34
1655
- msgid "Remove from course"
1656
  msgstr ""
1657
 
1658
  #: inc/admin/views/course/section-item.php:37
@@ -1686,7 +1692,7 @@ msgid "Downloaded"
1686
  msgstr ""
1687
 
1688
  #: inc/admin/views/dashboard/plugin-status/html-results.php:23
1689
- msgid "Active Installed"
1690
  msgstr ""
1691
 
1692
  #: inc/admin/views/dashboard/plugin-status/html-results.php:36
@@ -1702,15 +1708,15 @@ msgid "Current Version"
1702
  msgstr ""
1703
 
1704
  #: inc/admin/views/html-admin-notice-templates.php:39
1705
- msgid "There is a new update of LearnPress. You may need to update your theme <strong>(%s)</strong> to avoid outdated template files."
1706
  msgstr ""
1707
 
1708
  #: inc/admin/views/html-admin-notice-templates.php:44
1709
- msgid "This is not a bug, don't worry. Read more about Outdated template files notice <a href=\"%s\" target=\"_blank\">here</a>."
1710
  msgstr ""
1711
 
1712
  #: inc/admin/views/html-admin-notice-templates.php:58
1713
- msgid "View list of outdated templates"
1714
  msgstr ""
1715
 
1716
  #: inc/admin/views/html-admin-notice-templates.php:61
@@ -1755,14 +1761,14 @@ msgstr ""
1755
  #: inc/admin/views/meta-boxes/quiz/settings.php:17
1756
  #: inc/custom-post-types/lesson.php:227
1757
  #: inc/custom-post-types/quiz.php:239
1758
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1072
1759
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:500
1760
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:636
1761
  msgid "Duration"
1762
  msgstr ""
1763
 
1764
  #: inc/admin/views/meta-boxes/course/settings.php:76
1765
- msgid "Set 0 for lifetime access."
1766
  msgstr ""
1767
 
1768
  #: inc/admin/views/meta-boxes/course/settings.php:87
@@ -1770,11 +1776,11 @@ msgid "Block content"
1770
  msgstr ""
1771
 
1772
  #: inc/admin/views/meta-boxes/course/settings.php:88
1773
- msgid "Block course when duration expires."
1774
  msgstr ""
1775
 
1776
  #: inc/admin/views/meta-boxes/course/settings.php:93
1777
- msgid "Block course after student finished this course."
1778
  msgstr ""
1779
 
1780
  #: inc/admin/views/meta-boxes/course/settings.php:97
@@ -1782,7 +1788,7 @@ msgid "Allow Repurchase"
1782
  msgstr ""
1783
 
1784
  #: inc/admin/views/meta-boxes/course/settings.php:98
1785
- msgid "Allow users to repurchase this course after course finished or blocked ( Do not apply to free courses )."
1786
  msgstr ""
1787
 
1788
  #: inc/admin/views/meta-boxes/course/settings.php:102
@@ -1814,7 +1820,7 @@ msgid "Fake Students Enrolled"
1814
  msgstr ""
1815
 
1816
  #: inc/admin/views/meta-boxes/course/settings.php:124
1817
- msgid "How many students have taken this course"
1818
  msgstr ""
1819
 
1820
  #: inc/admin/views/meta-boxes/course/settings.php:136
@@ -1822,7 +1828,7 @@ msgid "Max student"
1822
  msgstr ""
1823
 
1824
  #: inc/admin/views/meta-boxes/course/settings.php:137
1825
- msgid "Maximum students can join the course. Set 0 for unlimited."
1826
  msgstr ""
1827
 
1828
  #: inc/admin/views/meta-boxes/course/settings.php:149
@@ -1830,7 +1836,7 @@ msgid "Re-take Course"
1830
  msgstr ""
1831
 
1832
  #: inc/admin/views/meta-boxes/course/settings.php:150
1833
- msgid "The number of times a user can learn again this course. Set 0 to disable."
1834
  msgstr ""
1835
 
1836
  #: inc/admin/views/meta-boxes/course/settings.php:162
@@ -1838,7 +1844,7 @@ msgid "Finish button"
1838
  msgstr ""
1839
 
1840
  #: inc/admin/views/meta-boxes/course/settings.php:163
1841
- msgid "Allow show finish button when the student has completed all items but has not passed the course assessment."
1842
  msgstr ""
1843
 
1844
  #: inc/admin/views/meta-boxes/course/settings.php:167
@@ -1846,7 +1852,7 @@ msgid "Featured list"
1846
  msgstr ""
1847
 
1848
  #: inc/admin/views/meta-boxes/course/settings.php:168
1849
- msgid "Add the course to Featured List."
1850
  msgstr ""
1851
 
1852
  #: inc/admin/views/meta-boxes/course/settings.php:172
@@ -1862,7 +1868,7 @@ msgid "External link"
1862
  msgstr ""
1863
 
1864
  #: inc/admin/views/meta-boxes/course/settings.php:177
1865
- msgid "Normally use for offline classes, Ex: link to a contact page. Format: https://google.com"
1866
  msgstr ""
1867
 
1868
  #: inc/admin/views/meta-boxes/course/settings.php:207
@@ -1900,19 +1906,19 @@ msgid "To&hellip;"
1900
  msgstr ""
1901
 
1902
  #: inc/admin/views/meta-boxes/course/settings.php:254
1903
- msgid "No enroll requirement"
1904
  msgstr ""
1905
 
1906
  #: inc/admin/views/meta-boxes/course/settings.php:255
1907
- msgid "Students can see the content of all course items and do the quiz without login."
1908
  msgstr ""
1909
 
1910
  #: inc/admin/views/meta-boxes/course/settings.php:304
1911
- msgid "The method to assess the result of a student for a course."
1912
  msgstr ""
1913
 
1914
  #: inc/admin/views/meta-boxes/course/settings.php:307
1915
- msgid "<br /><strong>Note! </strong>No final quiz in course, please add a final quiz"
1916
  msgstr ""
1917
 
1918
  #: inc/admin/views/meta-boxes/course/settings.php:329
@@ -1930,7 +1936,7 @@ msgid "Passing Grade(%)"
1930
  msgstr ""
1931
 
1932
  #: inc/admin/views/meta-boxes/course/settings.php:349
1933
- msgid "The condition that must be achieved to finish the course."
1934
  msgstr ""
1935
 
1936
  #: inc/admin/views/meta-boxes/course/settings.php:370
@@ -2000,7 +2006,7 @@ msgstr ""
2000
  #: inc/custom-post-types/abstract.php:960
2001
  #: inc/custom-post-types/lesson.php:130
2002
  #: inc/custom-post-types/lesson.php:230
2003
- #: inc/lp-template-functions.php:1007
2004
  #: templates/loop/single-course/loop-section-item.php:32
2005
  #: templates/single-course/section/item-meta.php:32
2006
  msgid "Preview"
@@ -2015,7 +2021,7 @@ msgid "Choose an action"
2015
  msgstr ""
2016
 
2017
  #: inc/admin/views/meta-boxes/order/actions.php:20
2018
- msgid "Trigger action of current order status"
2019
  msgstr ""
2020
 
2021
  #: inc/admin/views/meta-boxes/order/actions.php:29
@@ -2096,7 +2102,7 @@ msgid "Status:"
2096
  msgstr ""
2097
 
2098
  #: inc/admin/views/meta-boxes/order/details.php:74
2099
- msgid "When change Status to \"Pending\", \"Cancelled\" or \"Failed\" will delete all course, lesson, quiz... progress!"
2100
  msgstr ""
2101
 
2102
  #: inc/admin/views/meta-boxes/order/details.php:83
@@ -2106,7 +2112,7 @@ msgstr ""
2106
  #: inc/admin/views/meta-boxes/order/details.php:88
2107
  #: inc/admin/views/meta-boxes/order/details.php:118
2108
  #: inc/admin/views/meta-boxes/order/details.php:241
2109
- msgid "Add multi users"
2110
  msgstr ""
2111
 
2112
  #: inc/admin/views/meta-boxes/order/details.php:93
@@ -2136,7 +2142,7 @@ msgid "Customer Note"
2136
  msgstr ""
2137
 
2138
  #: inc/admin/views/meta-boxes/order/details.php:172
2139
- msgid "No order items"
2140
  msgstr ""
2141
 
2142
  #: inc/admin/views/meta-boxes/order/details.php:183
@@ -2157,7 +2163,7 @@ msgid "In order to change the order item, please change the order status to 'Pen
2157
  msgstr ""
2158
 
2159
  #: inc/admin/views/meta-boxes/order/details.php:265
2160
- msgid "Type here to search the course"
2161
  msgstr ""
2162
 
2163
  #: inc/admin/views/meta-boxes/order/details.php:268
@@ -2221,7 +2227,7 @@ msgstr ""
2221
 
2222
  #: inc/admin/views/meta-boxes/question/settings.php:31
2223
  #: inc/admin/views/quiz/question-meta.php:44
2224
- msgid "Instruction for user to select the right answer. The text will be shown when users click the 'Hint' button."
2225
  msgstr ""
2226
 
2227
  #: inc/admin/views/meta-boxes/question/settings.php:35
@@ -2232,7 +2238,7 @@ msgstr ""
2232
 
2233
  #: inc/admin/views/meta-boxes/question/settings.php:36
2234
  #: inc/admin/views/quiz/question-meta.php:55
2235
- msgid "Explanation will be displayed when students click button \"Check Answer\"."
2236
  msgstr ""
2237
 
2238
  #: inc/admin/views/meta-boxes/quiz/settings.php:9
@@ -2240,11 +2246,11 @@ msgid "Quiz Settings"
2240
  msgstr ""
2241
 
2242
  #: inc/admin/views/meta-boxes/quiz/settings.php:18
2243
- msgid "Set 0 for no limit, larger than 0 for limit"
2244
  msgstr ""
2245
 
2246
  #: inc/admin/views/meta-boxes/quiz/settings.php:30
2247
- msgid "The condition that must be achieved in order to be passed the quiz."
2248
  msgstr ""
2249
 
2250
  #: inc/admin/views/meta-boxes/quiz/settings.php:43
@@ -2260,7 +2266,7 @@ msgid "Negative Marking"
2260
  msgstr ""
2261
 
2262
  #: inc/admin/views/meta-boxes/quiz/settings.php:49
2263
- msgid "For each question which students answer wrongly, the total point is deducted exactly the question's point"
2264
  msgstr ""
2265
 
2266
  #: inc/admin/views/meta-boxes/quiz/settings.php:53
@@ -2268,7 +2274,7 @@ msgid "Minus for skip"
2268
  msgstr ""
2269
 
2270
  #: inc/admin/views/meta-boxes/quiz/settings.php:54
2271
- msgid "For each question which students answer skip, the total point is deducted exactly the question's point"
2272
  msgstr ""
2273
 
2274
  #: inc/admin/views/meta-boxes/quiz/settings.php:58
@@ -2277,7 +2283,7 @@ msgid "Retake"
2277
  msgstr ""
2278
 
2279
  #: inc/admin/views/meta-boxes/quiz/settings.php:59
2280
- msgid "How many times the user can re-take this quiz. Set 0 to disable. Set -1 to infinite."
2281
  msgstr ""
2282
 
2283
  #: inc/admin/views/meta-boxes/quiz/settings.php:71
@@ -2285,7 +2291,7 @@ msgid "Pagination"
2285
  msgstr ""
2286
 
2287
  #: inc/admin/views/meta-boxes/quiz/settings.php:72
2288
- msgid "The number of questions displayed on each page."
2289
  msgstr ""
2290
 
2291
  #: inc/admin/views/meta-boxes/quiz/settings.php:85
@@ -2298,11 +2304,11 @@ msgid "Allow students to review this quiz after they finish the quiz."
2298
  msgstr ""
2299
 
2300
  #: inc/admin/views/meta-boxes/quiz/settings.php:90
2301
- msgid "Show correct answer"
2302
  msgstr ""
2303
 
2304
  #: inc/admin/views/meta-boxes/quiz/settings.php:91
2305
- msgid "Allow students view correct answer question in review this quiz."
2306
  msgstr ""
2307
 
2308
  #: inc/admin/views/question/answer.php:17
@@ -2316,19 +2322,19 @@ msgid "Correction"
2316
  msgstr ""
2317
 
2318
  #: inc/admin/views/question/answer.php:27
2319
- msgid "Add new Answer"
2320
  msgstr ""
2321
 
2322
  #: inc/admin/views/question/fib-answer-editor.php:5
2323
- msgid "Select a word in passage above and click <strong>'Insert new blank'</strong> to make that word is a blank for filling."
2324
  msgstr ""
2325
 
2326
  #: inc/admin/views/question/fib-answer-editor.php:8
2327
- msgid "Insert new blank"
2328
  msgstr ""
2329
 
2330
  #: inc/admin/views/question/fib-answer-editor.php:9
2331
- msgid "Clear all blanks"
2332
  msgstr ""
2333
 
2334
  #: inc/admin/views/question/fib-answer-editor.php:10
@@ -2364,7 +2370,7 @@ msgid "Range"
2364
  msgstr ""
2365
 
2366
  #: inc/admin/views/question/fib-answer-editor.php:48
2367
- msgid "Match any number in a range. Use <code>100, 200</code> will match any value from 100 to 200."
2368
  msgstr ""
2369
 
2370
  #: inc/admin/views/question/fib-answer-editor.php:53
@@ -2372,7 +2378,7 @@ msgid "Any"
2372
  msgstr ""
2373
 
2374
  #: inc/admin/views/question/fib-answer-editor.php:54
2375
- msgid "Match any value in a set of words. Use <code>fill, blank, question</code> will match any value in the set."
2376
  msgstr ""
2377
 
2378
  #: inc/admin/views/quiz/editor.php:49
@@ -2403,7 +2409,7 @@ msgid "Questions"
2403
  msgstr ""
2404
 
2405
  #: inc/admin/views/quiz/modal-choose-items.php:64
2406
- msgid "Type here to search question"
2407
  msgstr ""
2408
 
2409
  #: inc/admin/views/quiz/question-actions.php:28
@@ -2411,7 +2417,7 @@ msgid "Duplicate"
2411
  msgstr ""
2412
 
2413
  #: inc/admin/views/quiz/question-actions.php:38
2414
- msgid "Remove from quiz"
2415
  msgstr ""
2416
 
2417
  #: inc/admin/views/quiz/question-answer.php:29
@@ -2459,7 +2465,7 @@ msgid "Paypal Email"
2459
  msgstr ""
2460
 
2461
  #: inc/admin/views/setup/setup-paypal.php:22
2462
- msgid "Your Paypal email in live mode."
2463
  msgstr ""
2464
 
2465
  #: inc/admin/views/setup/setup-stripe.php:15
@@ -2486,14 +2492,6 @@ msgstr ""
2486
  msgid "Thousands Separator"
2487
  msgstr ""
2488
 
2489
- #: inc/admin/views/setup/steps/currency.php:64
2490
- msgid "Decimals Separator"
2491
- msgstr ""
2492
-
2493
- #: inc/admin/views/setup/steps/currency.php:71
2494
- msgid "Number of Decimals"
2495
- msgstr ""
2496
-
2497
  #: inc/admin/views/setup/steps/emails.php:12
2498
  msgid "Emails system"
2499
  msgstr ""
@@ -2503,15 +2501,15 @@ msgid "Emails are sent to users or teachers for each particular action."
2503
  msgstr ""
2504
 
2505
  #: inc/admin/views/setup/steps/emails.php:15
2506
- msgid "You can enable/disable each email in LearnPress settings later."
2507
  msgstr ""
2508
 
2509
  #: inc/admin/views/setup/steps/emails.php:16
2510
- msgid "But in right now, you can enable all emails to see how emails work."
2511
  msgstr ""
2512
 
2513
  #: inc/admin/views/setup/steps/emails.php:17
2514
- msgid "You can skip to next step if you don’t want to."
2515
  msgstr ""
2516
 
2517
  #: inc/admin/views/setup/steps/emails.php:22
@@ -2539,7 +2537,7 @@ msgid "Static Pages"
2539
  msgstr ""
2540
 
2541
  #: inc/admin/views/setup/steps/pages.php:16
2542
- msgid "The pages will display content of LP's necessary pages, such as: Courses, Checkout, Profile"
2543
  msgstr ""
2544
 
2545
  #: inc/admin/views/setup/steps/pages.php:17
@@ -2547,7 +2545,7 @@ msgid "If you are not sure, click <a href=\"%s\" id=\"create-pages\">here</a> to
2547
  msgstr ""
2548
 
2549
  #: inc/admin/views/setup/steps/pages.php:22
2550
- msgid "Page: show list Courses"
2551
  msgstr ""
2552
 
2553
  #: inc/admin/views/setup/steps/pages.php:30
@@ -2658,11 +2656,11 @@ msgid "Go to Update"
2658
  msgstr ""
2659
 
2660
  #: inc/admin/views/updates/html-updated-latest-message.php:16
2661
- msgid "LearnPress has just updated to latest version."
2662
  msgstr ""
2663
 
2664
  #: inc/admin/views/updates/html-updating-message.php:15
2665
- msgid "<strong>LearnPress update</strong> – We are running updater to upgrade your database to the latest version."
2666
  msgstr ""
2667
 
2668
  #: inc/admin/views/updates/html-upgrade-message-3.0.0.php:14
@@ -2695,17 +2693,17 @@ msgid "%1$d of %2$d items"
2695
  msgstr ""
2696
 
2697
  #: inc/admin/views/user/course-progress.php:35
2698
- #: templates/single-course/sidebar/user-progress.php:51
2699
  msgid "Course progress:"
2700
  msgstr ""
2701
 
2702
  #: inc/admin/views/user/courses.php:22
2703
- msgid "Course list of user enrolled"
2704
  msgstr ""
2705
 
2706
  #: inc/background-process/class-lp-background-query-items.php:128
2707
  #: inc/background-process/class-lp-background-query-items.php:182
2708
- msgid "There is no items found!"
2709
  msgstr ""
2710
 
2711
  #: inc/background-process/class-lp-background-query-items.php:133
@@ -2717,7 +2715,7 @@ msgid "WP query plugins empty!"
2717
  msgstr ""
2718
 
2719
  #: inc/background-process/class-lp-background-query-items.php:232
2720
- msgid "There is no item found!"
2721
  msgstr ""
2722
 
2723
  #: inc/block-template/class-block-until.php:57
@@ -2749,27 +2747,23 @@ msgid "Sorry! This course is not purchasable."
2749
  msgstr ""
2750
 
2751
  #: inc/cart/class-lp-cart.php:167
2752
- msgid "Sorry! The number of enrolled students has reached limit"
2753
  msgstr ""
2754
 
2755
  #: inc/cart/class-lp-cart.php:327
2756
  msgid "%s has been removed from your cart because it can no longer be purchased."
2757
  msgstr ""
2758
 
2759
- #: inc/cart/class-lp-cart.php:508
2760
- msgid "Checkout page hasn't been setup"
2761
- msgstr ""
2762
-
2763
  #: inc/class-lp-ajax.php:85
2764
  msgid "The order %s has been successfully recovered."
2765
  msgstr ""
2766
 
2767
  #: inc/class-lp-ajax.php:113
2768
- msgid "Your email is already exists. Continue with this email?"
2769
  msgstr ""
2770
 
2771
  #: inc/class-lp-ajax.php:120
2772
- msgid "Create new account with this email? Account information will be sent to this email."
2773
  msgstr ""
2774
 
2775
  #: inc/class-lp-ajax.php:146
@@ -2805,19 +2799,19 @@ msgid "Congrats! You have completed \"%s\"."
2805
  msgstr ""
2806
 
2807
  #: inc/class-lp-assets.php:72
2808
- #: inc/lp-core-functions.php:2770
2809
  #: assets/js/dist/frontend/quiz.min.js:41
2810
  msgid "OK"
2811
  msgstr ""
2812
 
2813
  #: inc/class-lp-assets.php:74
2814
- #: inc/lp-core-functions.php:2772
2815
  #: templates/global/lp-modal-overlay.php:24
2816
  msgid "Yes"
2817
  msgstr ""
2818
 
2819
  #: inc/class-lp-assets.php:75
2820
- #: inc/lp-core-functions.php:2773
2821
  #: templates/global/lp-modal-overlay.php:23
2822
  msgid "No"
2823
  msgstr ""
@@ -2848,14 +2842,6 @@ msgstr ""
2848
  msgid "Place order"
2849
  msgstr ""
2850
 
2851
- #: inc/class-lp-backward-plugins.php:44
2852
- msgid "There are some add-ons had gone outdated and might conflict with <strong>LearnPress</strong> that need to be deactivated. Please upgrade them to the newest version to ensure stability and performance of your site."
2853
- msgstr ""
2854
-
2855
- #: inc/class-lp-backward-plugins.php:101
2856
- msgid "LearnPress plugin slug should be <strong>%1$s</strong> to make sure it works properly. Currently, it is <strong>%2$s</strong>. Please correct it's name and active again. <a href=\"%3$s\">Back</a>"
2857
- msgstr ""
2858
-
2859
  #: inc/class-lp-breadcrumb.php:124
2860
  msgid "Error 404"
2861
  msgstr ""
@@ -2896,7 +2882,7 @@ msgstr ""
2896
  #: inc/class-lp-checkout.php:307
2897
  #: inc/class-lp-checkout.php:311
2898
  #: inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php:121
2899
- #: inc/user/class-lp-profile.php:286
2900
  #: templates/checkout/account-login.php:30
2901
  #: templates/checkout/account-login.php:31
2902
  #: templates/checkout/account-register.php:32
@@ -2950,11 +2936,11 @@ msgid "%s is not a valid email."
2950
  msgstr ""
2951
 
2952
  #: inc/class-lp-checkout.php:549
2953
- msgid "%s is not exists."
2954
  msgstr ""
2955
 
2956
  #: inc/class-lp-checkout.php:563
2957
- msgid "Your email is not a valid."
2958
  msgstr ""
2959
 
2960
  #: inc/class-lp-checkout.php:652
@@ -2994,11 +2980,11 @@ msgid "Error:"
2994
  msgstr ""
2995
 
2996
  #: inc/class-lp-forms-handler.php:80
2997
- msgid "Username is required"
2998
  msgstr ""
2999
 
3000
  #: inc/class-lp-forms-handler.php:171
3001
- msgid "I need become an instructor"
3002
  msgstr ""
3003
 
3004
  #: inc/class-lp-forms-handler.php:186
@@ -3006,70 +2992,70 @@ msgid " was successfully created!"
3006
  msgstr ""
3007
 
3008
  #: inc/class-lp-forms-handler.php:189
3009
- msgid "Your request become an instructor has been sent. We will get back to you soon!"
3010
  msgstr ""
3011
 
3012
  #: inc/class-lp-forms-handler.php:226
3013
  msgid "An account is already registered with your email address."
3014
  msgstr ""
3015
 
3016
- #: inc/class-lp-forms-handler.php:236
3017
  #: inc/curds/class-lp-user-curd.php:2142
3018
- msgid "An account is already registered with that username. Please choose another."
3019
  msgstr ""
3020
 
3021
- #: inc/class-lp-forms-handler.php:244
3022
  msgid "Please enter an account password."
3023
  msgstr ""
3024
 
3025
- #: inc/class-lp-forms-handler.php:248
3026
  msgid "Password is too short!"
3027
  msgstr ""
3028
 
3029
- #: inc/class-lp-forms-handler.php:252
3030
- msgid "Password can not have spacing!"
3031
  msgstr ""
3032
 
3033
- #: inc/class-lp-forms-handler.php:256
3034
  msgid "Please enter confirm password."
3035
  msgstr ""
3036
 
3037
- #: inc/class-lp-forms-handler.php:260
3038
- msgid "Confirmation password incorrect!."
3039
  msgstr ""
3040
 
3041
- #: inc/class-lp-forms-handler.php:268
3042
- #: inc/class-lp-forms-handler.php:335
3043
  msgid " is required field."
3044
  msgstr ""
3045
 
3046
- #: inc/class-lp-forms-handler.php:313
3047
  msgid "Email is required"
3048
  msgstr ""
3049
 
3050
- #: inc/class-lp-forms-handler.php:317
3051
  msgid "Display name is required"
3052
  msgstr ""
3053
 
3054
- #: inc/class-lp-forms-handler.php:321
3055
- #: inc/class-lp-forms-handler.php:325
3056
- msgid "Display name cannot be changed to email address due to privacy concern."
3057
  msgstr ""
3058
 
3059
- #: inc/class-lp-forms-handler.php:327
3060
  msgid "This email address is already registered."
3061
  msgstr ""
3062
 
3063
- #: inc/class-lp-forms-handler.php:359
3064
  msgid "Enter a username or email address."
3065
  msgstr ""
3066
 
3067
- #: inc/class-lp-forms-handler.php:379
3068
- #: inc/class-lp-forms-handler.php:383
3069
  msgid "Invalid username or email."
3070
  msgstr ""
3071
 
3072
- #: inc/class-lp-forms-handler.php:394
3073
  msgid "Password reset is not allowed for this user."
3074
  msgstr ""
3075
 
@@ -3110,31 +3096,31 @@ msgid "Forgot password?"
3110
  msgstr ""
3111
 
3112
  #: inc/class-lp-shortcodes.php:220
3113
- msgid "Create new account"
3114
  msgstr ""
3115
 
3116
  #: inc/class-lp-strings.php:22
3117
- msgid "You've already completed quiz."
3118
  msgstr ""
3119
 
3120
  #: inc/class-lp-strings.php:23
3121
- msgid "Do you want to redo quiz \"%s\"?"
3122
  msgstr ""
3123
 
3124
  #: inc/class-lp-strings.php:24
3125
- msgid "Do you want to complete quiz \"%s\"?"
3126
  msgstr ""
3127
 
3128
  #: inc/class-lp-strings.php:25
3129
- msgid "Do you want to complete lesson \"%s\"?"
3130
  msgstr ""
3131
 
3132
  #: inc/class-lp-strings.php:26
3133
- msgid "Do you want to finish course \"%s\"?"
3134
  msgstr ""
3135
 
3136
  #: inc/class-lp-strings.php:27
3137
- msgid "Do you want to retake course \"%s\"?"
3138
  msgstr ""
3139
 
3140
  #: inc/class-lp-thumbnail-helper.php:60
@@ -3143,26 +3129,26 @@ msgid "course thumbnail"
3143
  msgstr ""
3144
 
3145
  #: inc/class-lp-widget.php:247
3146
- msgid "There is no options for this widget."
3147
  msgstr ""
3148
 
3149
- #: inc/course/abstract-course.php:772
3150
- #: inc/course/abstract-course.php:792
3151
  #: inc/lesson/class-lp-lesson.php:104
3152
- #: inc/quiz/class-lp-quiz.php:637
3153
  msgid "The function %s doesn't exist"
3154
  msgstr ""
3155
 
3156
- #: inc/course/abstract-course.php:1257
3157
- msgid "This course will end within next %s"
3158
  msgstr ""
3159
 
3160
- #: inc/course/abstract-course.php:1285
3161
  msgctxt "External Link button text"
3162
  msgid "More Info"
3163
  msgstr ""
3164
 
3165
- #: inc/course/abstract-course.php:1322
3166
  msgid "Tags: "
3167
  msgstr ""
3168
 
@@ -3186,32 +3172,32 @@ msgctxt "course item status title"
3186
  msgid "Unread"
3187
  msgstr ""
3188
 
3189
- #: inc/course/lp-course-functions.php:760
3190
  msgid "Edit this item"
3191
  msgstr ""
3192
 
3193
- #: inc/course/lp-course-functions.php:971
3194
- #: inc/lp-core-functions.php:2410
3195
  #: inc/templates/class-lp-template-profile.php:103
3196
  #: inc/user-item/class-lp-user-item-quiz.php:147
3197
- #: inc/user/class-lp-profile.php:874
3198
- #: inc/user/class-lp-profile.php:908
3199
  #: assets/js/dist/frontend/quiz.min.js:167
3200
  msgid "Passed"
3201
  msgstr ""
3202
 
3203
- #: inc/course/lp-course-functions.php:974
3204
- #: inc/lp-core-functions.php:2413
3205
  #: inc/templates/class-lp-template-profile.php:104
3206
  #: inc/user-item/class-lp-user-item-quiz.php:148
3207
- #: inc/user/class-lp-profile.php:875
3208
- #: inc/user/class-lp-profile.php:909
3209
  #: assets/js/dist/frontend/quiz.min.js:169
3210
  msgid "Failed"
3211
  msgstr ""
3212
 
3213
- #: inc/course/lp-course-functions.php:977
3214
- #: inc/lp-core-functions.php:2416
3215
  #: inc/lp-deprecated.php:385
3216
  #: inc/templates/class-lp-template-profile.php:101
3217
  #: inc/user-item/class-lp-user-item-quiz.php:144
@@ -3219,32 +3205,32 @@ msgstr ""
3219
  msgid "In Progress"
3220
  msgstr ""
3221
 
3222
- #: inc/course/lp-course-functions.php:1055
3223
- msgid "lessons completed per total number of lessons."
3224
  msgstr ""
3225
 
3226
- #: inc/course/lp-course-functions.php:1058
3227
- msgid "quizzes passed per total number of quizzes."
3228
  msgstr ""
3229
 
3230
- #: inc/course/lp-course-functions.php:1061
3231
  msgid "Final Quiz"
3232
  msgstr ""
3233
 
3234
- #: inc/course/lp-course-functions.php:1064
3235
- msgid "correct answers per total number of questions."
3236
  msgstr ""
3237
 
3238
- #: inc/course/lp-course-functions.php:1067
3239
- msgid "score achieved per total score of the questions."
3240
  msgstr ""
3241
 
3242
- #: inc/course/lp-course-functions.php:1076
3243
  msgid "Require"
3244
  msgstr ""
3245
 
3246
  #: inc/curds/class-lp-course-curd.php:27
3247
- msgid "Course does not exist."
3248
  msgstr ""
3249
 
3250
  #: inc/curds/class-lp-lesson-curd.php:35
@@ -3269,15 +3255,15 @@ msgid "Order is already assigned."
3269
  msgstr ""
3270
 
3271
  #: inc/curds/class-lp-order-curd.php:506
3272
- msgid "User invalid!."
3273
  msgstr ""
3274
 
3275
  #: inc/curds/class-lp-order-curd.php:510
3276
- msgid "Order key invalid with Email!"
3277
  msgstr ""
3278
 
3279
  #: inc/curds/class-lp-question-curd.php:28
3280
- msgid "Question does not exist."
3281
  msgstr ""
3282
 
3283
  #: inc/curds/class-lp-question-curd.php:228
@@ -3290,7 +3276,8 @@ msgid "Invalid question with ID \"%d\"."
3290
  msgstr ""
3291
 
3292
  #: inc/curds/class-lp-quiz-curd.php:29
3293
- msgid "Quiz does not exist."
 
3294
  msgstr ""
3295
 
3296
  #: inc/curds/class-lp-quiz-curd.php:43
@@ -3298,16 +3285,16 @@ msgid "Invalid quiz with ID \"%d\"."
3298
  msgstr ""
3299
 
3300
  #: inc/curds/class-lp-user-curd.php:1931
3301
- msgid "No item in Order"
3302
  msgstr ""
3303
 
3304
  #: inc/curds/class-lp-user-curd.php:2063
3305
- #: inc/user/class-lp-user.php:736
3306
  msgid "quiz"
3307
  msgstr ""
3308
 
3309
  #: inc/curds/class-lp-user-curd.php:2064
3310
- #: inc/user/class-lp-user.php:737
3311
  msgid "quizzes"
3312
  msgstr ""
3313
 
@@ -3316,11 +3303,7 @@ msgid "An account is already registered with your email address. Please log in."
3316
  msgstr ""
3317
 
3318
  #: inc/curds/class-lp-user-curd.php:2154
3319
- msgid "Failed to create user"
3320
- msgstr ""
3321
-
3322
- #: inc/curds/class-lp-user-item-curd.php:21
3323
- msgid "Quiz does not exists."
3324
  msgstr ""
3325
 
3326
  #: inc/curds/class-lp-user-item-curd.php:35
@@ -3328,11 +3311,11 @@ msgid "Invalid quiz."
3328
  msgstr ""
3329
 
3330
  #: inc/custom-post-types/abstract.php:432
3331
- msgid "This item has already assigned to course. It will be removed from course if it is not published."
3332
  msgstr ""
3333
 
3334
  #: inc/custom-post-types/abstract.php:447
3335
- msgid "This question has already assigned to quiz. It will be removed from quiz if it is not published."
3336
  msgstr ""
3337
 
3338
  #: inc/custom-post-types/abstract.php:718
@@ -3364,7 +3347,7 @@ msgstr ""
3364
 
3365
  #. translators: %s: date and time of the revision
3366
  #: inc/custom-post-types/abstract.php:923
3367
- msgid "Lesson restored to revision from %s"
3368
  msgstr ""
3369
 
3370
  #: inc/custom-post-types/abstract.php:924
@@ -3397,7 +3380,7 @@ msgid "Create a new"
3397
  msgstr ""
3398
 
3399
  #: inc/custom-post-types/course.php:75
3400
- msgid "Do you want to remove item \"{{ITEM_NAME}}\" to trash?"
3401
  msgstr ""
3402
 
3403
  #: inc/custom-post-types/course.php:78
@@ -3405,19 +3388,19 @@ msgid "Items"
3405
  msgstr ""
3406
 
3407
  #: inc/custom-post-types/course.php:80
3408
- msgid "Course sale price must less than the regular price"
3409
  msgstr ""
3410
 
3411
  #: inc/custom-post-types/course.php:81
3412
- msgid "Course price must greater than the sale price"
3413
  msgstr ""
3414
 
3415
  #: inc/custom-post-types/course.php:82
3416
- msgid "Sale start date must before sale end date"
3417
  msgstr ""
3418
 
3419
  #: inc/custom-post-types/course.php:83
3420
- msgid "Sale end date must after sale start date"
3421
  msgstr ""
3422
 
3423
  #: inc/custom-post-types/course.php:84
@@ -3443,7 +3426,7 @@ msgid "View Course"
3443
  msgstr ""
3444
 
3445
  #: inc/custom-post-types/course.php:109
3446
- msgid "Add New Course"
3447
  msgstr ""
3448
 
3449
  #: inc/custom-post-types/course.php:110
@@ -3470,7 +3453,7 @@ msgid "You haven't had any courses yet. Click <a href=\"%s\">Add new</a> to star
3470
  msgstr ""
3471
 
3472
  #: inc/custom-post-types/course.php:115
3473
- msgid "No course found in Trash"
3474
  msgstr ""
3475
 
3476
  #: inc/custom-post-types/course.php:118
@@ -3490,7 +3473,7 @@ msgid "Category"
3490
  msgstr ""
3491
 
3492
  #: inc/custom-post-types/course.php:166
3493
- msgid "Add New Course Category"
3494
  msgstr ""
3495
 
3496
  #: inc/custom-post-types/course.php:167
@@ -3534,7 +3517,7 @@ msgid "Update Course Tag"
3534
  msgstr ""
3535
 
3536
  #: inc/custom-post-types/course.php:202
3537
- msgid "Add New Course Tag"
3538
  msgstr ""
3539
 
3540
  #: inc/custom-post-types/course.php:203
@@ -3608,7 +3591,7 @@ msgid "Lessons"
3608
  msgstr ""
3609
 
3610
  #: inc/custom-post-types/lesson.php:159
3611
- msgid "Add New Lesson"
3612
  msgstr ""
3613
 
3614
  #: inc/custom-post-types/lesson.php:161
@@ -3632,7 +3615,7 @@ msgid "No lesson found"
3632
  msgstr ""
3633
 
3634
  #: inc/custom-post-types/lesson.php:167
3635
- msgid "No lesson found in Trash"
3636
  msgstr ""
3637
 
3638
  #: inc/custom-post-types/lesson.php:226
@@ -3650,7 +3633,7 @@ msgid "Assigned"
3650
  msgstr ""
3651
 
3652
  #: inc/custom-post-types/order.php:382
3653
- msgid "Order number, course name etc..."
3654
  msgstr ""
3655
 
3656
  #: inc/custom-post-types/order.php:581
@@ -3674,12 +3657,12 @@ msgstr ""
3674
 
3675
  #: inc/custom-post-types/order.php:668
3676
  #: inc/lp-deprecated.php:354
3677
- #: inc/user-item/class-lp-user-item.php:800
3678
  msgid "Purchased"
3679
  msgstr ""
3680
 
3681
  #: inc/custom-post-types/order.php:671
3682
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1330
3683
  #: templates/emails/order-items-table.php:72
3684
  #: templates/emails/plain/order-items-table.php:58
3685
  #: templates/profile/tabs/orders/list.php:31
@@ -3687,13 +3670,13 @@ msgid "Status"
3687
  msgstr ""
3688
 
3689
  #: inc/custom-post-types/order.php:721
3690
- #: inc/order/class-lp-order.php:458
3691
  msgid "(Guest)"
3692
  msgstr ""
3693
 
3694
  #: inc/custom-post-types/order.php:777
3695
  #: templates/checkout/order-received.php:71
3696
- msgid "Course does not exist"
3697
  msgstr ""
3698
 
3699
  #: inc/custom-post-types/order.php:779
@@ -3710,7 +3693,7 @@ msgid "Pay via <strong>%s</strong>"
3710
  msgstr ""
3711
 
3712
  #: inc/custom-post-types/order.php:826
3713
- msgid "Add New Order"
3714
  msgstr ""
3715
 
3716
  #: inc/custom-post-types/order.php:827
@@ -3732,7 +3715,7 @@ msgid "No order found"
3732
  msgstr ""
3733
 
3734
  #: inc/custom-post-types/order.php:834
3735
- msgid "No order found in Trash"
3736
  msgstr ""
3737
 
3738
  #: inc/custom-post-types/order.php:1002
@@ -3763,7 +3746,7 @@ msgstr ""
3763
 
3764
  #: inc/custom-post-types/question.php:166
3765
  #: inc/custom-post-types/quiz.php:177
3766
- msgid "Are you sure to remove all blanks?"
3767
  msgstr ""
3768
 
3769
  #: inc/custom-post-types/question.php:183
@@ -3771,7 +3754,7 @@ msgid "Question Tag"
3771
  msgstr ""
3772
 
3773
  #: inc/custom-post-types/question.php:186
3774
- msgid "Add New Tag"
3775
  msgstr ""
3776
 
3777
  #: inc/custom-post-types/question.php:187
@@ -3788,7 +3771,7 @@ msgid "View Question"
3788
  msgstr ""
3789
 
3790
  #: inc/custom-post-types/question.php:210
3791
- msgid "Add New Question"
3792
  msgstr ""
3793
 
3794
  #: inc/custom-post-types/question.php:212
@@ -3808,7 +3791,7 @@ msgid "No questions found"
3808
  msgstr ""
3809
 
3810
  #: inc/custom-post-types/question.php:216
3811
- msgid "No questions found in trash"
3812
  msgstr ""
3813
 
3814
  #: inc/custom-post-types/question.php:498
@@ -3816,7 +3799,7 @@ msgid "Answer Options"
3816
  msgstr ""
3817
 
3818
  #: inc/custom-post-types/quiz.php:88
3819
- msgid "Add New Quiz"
3820
  msgstr ""
3821
 
3822
  #: inc/custom-post-types/quiz.php:89
@@ -3840,7 +3823,7 @@ msgid "You haven't had any quizzes yet. Click <a href=\"%s\">Add new</a> to star
3840
  msgstr ""
3841
 
3842
  #: inc/custom-post-types/quiz.php:96
3843
- msgid "No quiz found in Trash"
3844
  msgstr ""
3845
 
3846
  #: inc/custom-post-types/quiz.php:167
@@ -3848,7 +3831,7 @@ msgid "Option"
3848
  msgstr ""
3849
 
3850
  #: inc/custom-post-types/quiz.php:172
3851
- msgid "Do you want to move question \"{{QUESTION_NAME}}\" to trash?"
3852
  msgstr ""
3853
 
3854
  #: inc/custom-post-types/quiz.php:286
@@ -3883,7 +3866,7 @@ msgstr ""
3883
  #: inc/databases/class-lp-order-db.php:131
3884
  #: inc/databases/class-lp-user-items-db.php:111
3885
  #: inc/databases/class-lp-user-items-db.php:457
3886
- msgid "User invalid!"
3887
  msgstr ""
3888
 
3889
  #: inc/databases/class-lp-section-db.php:155
@@ -3919,57 +3902,57 @@ msgid "Admin"
3919
  msgstr ""
3920
 
3921
  #: inc/emails/admin/class-lp-email-cancelled-order-admin.php:26
3922
- msgid "Send email to admin when order has been cancelled."
3923
  msgstr ""
3924
 
3925
  #: inc/emails/admin/class-lp-email-cancelled-order-admin.php:27
3926
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:28
3927
- msgid "Order placed on {{order_date}} has been cancelled"
3928
  msgstr ""
3929
 
3930
  #: inc/emails/admin/class-lp-email-cancelled-order-admin.php:28
3931
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:29
3932
- msgid "User order has been cancelled"
3933
  msgstr ""
3934
 
3935
  #: inc/emails/admin/class-lp-email-completed-order-admin.php:27
3936
- msgid "Send email to admin when an order has been completed."
3937
  msgstr ""
3938
 
3939
  #: inc/emails/admin/class-lp-email-completed-order-admin.php:28
3940
- msgid "Order placed on {{order_date}} has been completed"
3941
  msgstr ""
3942
 
3943
  #: inc/emails/admin/class-lp-email-completed-order-admin.php:29
3944
- msgid "User order has been completed"
3945
  msgstr ""
3946
 
3947
  #: inc/emails/admin/class-lp-email-enrolled-course-admin.php:29
3948
- msgid "Send this email to admin when user has enrolled course."
3949
  msgstr ""
3950
 
3951
  #: inc/emails/admin/class-lp-email-enrolled-course-admin.php:30
3952
  #: inc/emails/instructor/class-lp-email-enrolled-course-instructor.php:28
3953
- msgid "{{user_display_name}} has enrolled course"
3954
  msgstr ""
3955
 
3956
  #: inc/emails/admin/class-lp-email-enrolled-course-admin.php:31
3957
  #: inc/emails/instructor/class-lp-email-enrolled-course-instructor.php:29
3958
- msgid "User has enrolled course"
3959
  msgstr ""
3960
 
3961
  #: inc/emails/admin/class-lp-email-finished-course-admin.php:27
3962
- msgid "Send this email to admin when user has finished course."
3963
  msgstr ""
3964
 
3965
  #: inc/emails/admin/class-lp-email-finished-course-admin.php:28
3966
  #: inc/emails/instructor/class-lp-email-finished-course-instructor.php:28
3967
- msgid "{{user_display_name}} has finished course"
3968
  msgstr ""
3969
 
3970
  #: inc/emails/admin/class-lp-email-finished-course-admin.php:29
3971
  #: inc/emails/instructor/class-lp-email-finished-course-instructor.php:29
3972
- msgid "User has finished course"
3973
  msgstr ""
3974
 
3975
  #: inc/emails/admin/class-lp-email-new-order-admin.php:26
@@ -3991,7 +3974,7 @@ msgid "Recipient(s)"
3991
  msgstr ""
3992
 
3993
  #: inc/emails/class-lp-email.php:869
3994
- msgid "Separate other recipients by comma."
3995
  msgstr ""
3996
 
3997
  #: inc/emails/class-lp-email.php:874
@@ -4003,7 +3986,7 @@ msgid "Email heading"
4003
  msgstr ""
4004
 
4005
  #: inc/emails/guest/class-lp-email-cancelled-order-guest.php:26
4006
- msgid "Send email to guest when order has been cancelled."
4007
  msgstr ""
4008
 
4009
  #: inc/emails/guest/class-lp-email-cancelled-order-guest.php:28
@@ -4018,7 +4001,7 @@ msgstr ""
4018
 
4019
  #: inc/emails/guest/class-lp-email-completed-order-guest.php:30
4020
  #: inc/emails/guest/class-lp-email-new-order-guest.php:26
4021
- msgid "Send email to the user who has bought course as guest."
4022
  msgstr ""
4023
 
4024
  #: inc/emails/guest/class-lp-email-completed-order-guest.php:32
@@ -4046,7 +4029,7 @@ msgid "Thank you for your order"
4046
  msgstr ""
4047
 
4048
  #: inc/emails/guest/class-lp-email-processing-order-guest.php:23
4049
- msgid "Send email to user who has purchased course as a Guest when the order is processing."
4050
  msgstr ""
4051
 
4052
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:25
@@ -4059,15 +4042,15 @@ msgid "Instructor"
4059
  msgstr ""
4060
 
4061
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:26
4062
- msgid "Send email to course instructor when order has been cancelled"
4063
  msgstr ""
4064
 
4065
  #: inc/emails/instructor/class-lp-email-enrolled-course-instructor.php:26
4066
- msgid "Send this email to instructor when they have enrolled course."
4067
  msgstr ""
4068
 
4069
  #: inc/emails/instructor/class-lp-email-finished-course-instructor.php:26
4070
- msgid "Send this email to instructor when they have finished course."
4071
  msgstr ""
4072
 
4073
  #: inc/emails/instructor/class-lp-email-instructor-accepted.php:28
@@ -4075,15 +4058,12 @@ msgid "Accepted"
4075
  msgstr ""
4076
 
4077
  #: inc/emails/instructor/class-lp-email-instructor-accepted.php:29
4078
- msgid "Become an instructor email accepted."
 
4079
  msgstr ""
4080
 
4081
  #: inc/emails/instructor/class-lp-email-instructor-accepted.php:31
4082
- msgid "[{{site_title}}] Your request to become an instructor accepted"
4083
- msgstr ""
4084
-
4085
- #: inc/emails/instructor/class-lp-email-instructor-accepted.php:32
4086
- msgid "Become an instructor accepted"
4087
  msgstr ""
4088
 
4089
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:24
@@ -4091,19 +4071,19 @@ msgid "Denied"
4091
  msgstr ""
4092
 
4093
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:25
4094
- msgid "Become an instructor email denied."
4095
  msgstr ""
4096
 
4097
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:27
4098
- msgid "[{{site_title}}] Your request to become an instructor denied"
4099
  msgstr ""
4100
 
4101
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:28
4102
- msgid "Become an instructor denied"
4103
  msgstr ""
4104
 
4105
  #: inc/emails/instructor/class-lp-email-new-order-instructor.php:22
4106
- msgid "Notify instructors when a user enroll their courses."
4107
  msgstr ""
4108
 
4109
  #: inc/emails/student/class-lp-email-cancelled-order-user.php:25
@@ -4116,47 +4096,47 @@ msgid "User"
4116
  msgstr ""
4117
 
4118
  #: inc/emails/student/class-lp-email-cancelled-order-user.php:26
4119
- msgid "Send email to user when order has been cancelled."
4120
  msgstr ""
4121
 
4122
  #: inc/emails/student/class-lp-email-completed-order-user.php:30
4123
- msgid "Send email to the user who has bought course when order is completed."
4124
  msgstr ""
4125
 
4126
  #: inc/emails/student/class-lp-email-enrolled-course-user.php:28
4127
- msgid "Send this email to user when they have enrolled course."
4128
  msgstr ""
4129
 
4130
  #: inc/emails/student/class-lp-email-enrolled-course-user.php:30
4131
- msgid "[{{site_title}}] You have enrolled in course"
4132
  msgstr ""
4133
 
4134
  #: inc/emails/student/class-lp-email-enrolled-course-user.php:31
4135
- msgid "You have enrolled course"
4136
  msgstr ""
4137
 
4138
  #: inc/emails/student/class-lp-email-finished-course-user.php:27
4139
- msgid "Send this email to user when they have finished course."
4140
  msgstr ""
4141
 
4142
  #: inc/emails/student/class-lp-email-finished-course-user.php:29
4143
- msgid "[{{site_title}}] You have finished course"
4144
  msgstr ""
4145
 
4146
  #: inc/emails/student/class-lp-email-finished-course-user.php:30
4147
- msgid "You have finished course"
4148
  msgstr ""
4149
 
4150
  #: inc/emails/student/class-lp-email-new-order-user.php:26
4151
- msgid "Notify users when they successfully enroll a course."
4152
  msgstr ""
4153
 
4154
  #: inc/emails/student/class-lp-email-processing-order-user.php:23
4155
- msgid "Notify users when their course orders are in processing."
4156
  msgstr ""
4157
 
4158
  #: inc/emails/types/class-lp-email-reset-password.php:19
4159
- msgid "Reset Password Email."
4160
  msgstr ""
4161
 
4162
  #: inc/emails/types/class-lp-email-reset-password.php:21
@@ -4170,7 +4150,7 @@ msgstr ""
4170
 
4171
  #: inc/external-plugin/elementor/widgets/become-a-teacher.php:44
4172
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:87
4173
- msgid "Fill in your information and send us to become a teacher."
4174
  msgstr ""
4175
 
4176
  #: inc/external-plugin/elementor/widgets/become-a-teacher.php:51
@@ -4252,7 +4232,7 @@ msgid "Login Form"
4252
  msgstr ""
4253
 
4254
  #: inc/external-plugin/elementor/widgets/login-form.php:31
4255
- msgid "Login form is disabled"
4256
  msgstr ""
4257
 
4258
  #: inc/external-plugin/elementor/widgets/register-form.php:13
@@ -4260,7 +4240,7 @@ msgid "Register Form"
4260
  msgstr ""
4261
 
4262
  #: inc/external-plugin/elementor/widgets/register-form.php:33
4263
- msgid "Register form is disabled"
4264
  msgstr ""
4265
 
4266
  #: inc/external-plugin/elementor/widgets/widget-base.php:114
@@ -4350,11 +4330,11 @@ msgid "Instruction"
4350
  msgstr ""
4351
 
4352
  #: inc/gateways/offline-payment/class-lp-gateway-offline-payment.php:166
4353
- msgid "Payment to be made upon delivery."
4354
  msgstr ""
4355
 
4356
  #: inc/gateways/paypal/class-lp-gateway-paypal.php:93
4357
- msgid "Make payment via Paypal."
4358
  msgstr ""
4359
 
4360
  #: inc/gateways/paypal/class-lp-gateway-paypal.php:97
@@ -4382,15 +4362,15 @@ msgid "Sandbox email address"
4382
  msgstr ""
4383
 
4384
  #: inc/handle-steps/class-lp-handle-steps.php:26
4385
- msgid "Steps invalid"
4386
  msgstr ""
4387
 
4388
  #: inc/handle-steps/class-lp-handle-steps.php:31
4389
- msgid "Step invalid"
4390
  msgstr ""
4391
 
4392
  #: inc/handle-steps/class-lp-handle-steps.php:78
4393
- msgid "Not found function"
4394
  msgstr ""
4395
 
4396
  #: inc/jwt/includes/class-jwt-public.php:44
@@ -4443,11 +4423,11 @@ msgid "User ID not found in the token"
4443
  msgstr ""
4444
 
4445
  #: inc/jwt/includes/class-jwt-public.php:336
4446
- msgid "Token must have an expiration."
4447
  msgstr ""
4448
 
4449
  #: inc/jwt/includes/class-jwt-public.php:346
4450
- msgid "Token has expired."
4451
  msgstr ""
4452
 
4453
  #: inc/jwt/includes/class-jwt-public.php:361
@@ -4458,7 +4438,7 @@ msgstr ""
4458
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:64
4459
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:89
4460
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:114
4461
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:992
4462
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:32
4463
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:58
4464
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:430
@@ -4471,7 +4451,7 @@ msgstr ""
4471
  #: inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php:42
4472
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:58
4473
  #: inc/rest-api/v1/frontend/class-lp-rest-settings-controller.php:23
4474
- msgid "Unique identifier for the resource."
4475
  msgstr ""
4476
 
4477
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:147
@@ -4483,27 +4463,24 @@ msgid "Receipt data is empty."
4483
  msgstr ""
4484
 
4485
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:262
4486
- msgid "Secret key is empty."
4487
  msgstr ""
4488
 
4489
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:288
4490
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:314
4491
- msgid "Cannot verify receipt"
4492
  msgstr ""
4493
 
4494
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:294
4495
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:305
4496
- msgid "Course id is invalid."
4497
- msgstr ""
4498
-
4499
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:331
4500
- msgid "Course is not exists."
4501
  msgstr ""
4502
 
4503
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:347
4504
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:340
4505
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:488
4506
- msgid "Error: Can't add Course to cart."
4507
  msgstr ""
4508
 
4509
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:365
@@ -4515,7 +4492,7 @@ msgid "Error: No Course ID available."
4515
  msgstr ""
4516
 
4517
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:399
4518
- msgid "Can not finish course."
4519
  msgstr ""
4520
 
4521
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:405
@@ -4532,237 +4509,237 @@ msgstr ""
4532
  msgid "Cannot create existing %s."
4533
  msgstr ""
4534
 
4535
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:575
4536
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:296
4537
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:372
4538
  #: templates/single-course/sidebar/user-time.php:37
4539
  msgid "Lifetime"
4540
  msgstr ""
4541
 
4542
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:827
4543
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:160
4544
  msgid "%s days"
4545
  msgstr ""
4546
 
4547
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:828
4548
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:161
4549
  msgid "%s hours"
4550
  msgstr ""
4551
 
4552
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:829
4553
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:162
4554
  msgid "%s mins"
4555
  msgstr ""
4556
 
4557
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:830
4558
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:163
4559
  msgid "%s secs"
4560
  msgstr ""
4561
 
4562
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:998
4563
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:436
4564
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:203
4565
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:572
4566
  msgid "Course name."
4567
  msgstr ""
4568
 
4569
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1003
4570
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:441
4571
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:208
4572
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:577
4573
  msgid "Course slug."
4574
  msgstr ""
4575
 
4576
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1008
4577
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:446
4578
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:213
4579
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:582
4580
  msgid "Course URL."
4581
  msgstr ""
4582
 
4583
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1015
4584
  msgid "Course Image URL."
4585
  msgstr ""
4586
 
4587
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1021
4588
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:453
4589
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:220
4590
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:589
4591
  msgid "The date the Course was created, in the site's timezone."
4592
  msgstr ""
4593
 
4594
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1028
4595
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:459
4596
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:226
4597
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:595
4598
  msgid "The date the Course was created, as GMT."
4599
  msgstr ""
4600
 
4601
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1035
4602
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:465
4603
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:232
4604
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:601
4605
  msgid "The date the Course was last modified, in the site's timezone."
4606
  msgstr ""
4607
 
4608
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1042
4609
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:471
4610
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:238
4611
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:607
4612
  msgid "The date the Course was last modified, as GMT."
4613
  msgstr ""
4614
 
4615
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1049
4616
- msgid "Shows if the course is on sale."
4617
  msgstr ""
4618
 
4619
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1055
4620
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:477
4621
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:244
4622
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:613
4623
  msgid "Course status (post status)."
4624
  msgstr ""
4625
 
4626
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1062
4627
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:484
4628
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:251
4629
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:620
4630
- msgid "Content course."
4631
  msgstr ""
4632
 
4633
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1067
4634
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:489
4635
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:256
4636
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:625
4637
  msgid "Retrieves the course excerpt.."
4638
  msgstr ""
4639
 
4640
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1077
4641
- msgid "Count student enrolled"
4642
  msgstr ""
4643
 
4644
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1083
4645
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:494
4646
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:630
4647
- msgid "Can finish course"
4648
  msgstr ""
4649
 
4650
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1089
4651
- msgid "Can retake course"
4652
  msgstr ""
4653
 
4654
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1095
4655
- msgid "Total retake"
4656
  msgstr ""
4657
 
4658
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1101
4659
  msgid "Retaken"
4660
  msgstr ""
4661
 
4662
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1107
4663
  msgid "Course Review add-on"
4664
  msgstr ""
4665
 
4666
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1113
4667
  msgid "Course Price"
4668
  msgstr ""
4669
 
4670
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1119
4671
  msgid "Course Price Rendered"
4672
  msgstr ""
4673
 
4674
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1125
4675
  msgid "Course Origin Price"
4676
  msgstr ""
4677
 
4678
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1131
4679
  msgid "Course Origin Price Rendered"
4680
  msgstr ""
4681
 
4682
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1137
4683
  msgid "Course Sale Price"
4684
  msgstr ""
4685
 
4686
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1143
4687
  msgid "Course Sale Price Rendered"
4688
  msgstr ""
4689
 
4690
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1149
4691
  msgid "List of categories."
4692
  msgstr ""
4693
 
4694
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1156
4695
  msgid "Category ID."
4696
  msgstr ""
4697
 
4698
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1161
4699
  msgid "Category name."
4700
  msgstr ""
4701
 
4702
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1167
4703
  msgid "Category slug."
4704
  msgstr ""
4705
 
4706
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1176
4707
  msgid "List of tags."
4708
  msgstr ""
4709
 
4710
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1183
4711
  msgid "Tag ID."
4712
  msgstr ""
4713
 
4714
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1188
4715
  msgid "Tag name."
4716
  msgstr ""
4717
 
4718
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1194
4719
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1221
4720
  msgid "Tag slug."
4721
  msgstr ""
4722
 
4723
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1203
4724
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1236
4725
  msgid "Retrieves the course sections and items.."
4726
  msgstr ""
4727
 
4728
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1210
4729
  msgid "User ID."
4730
  msgstr ""
4731
 
4732
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1215
4733
  msgid "Display name."
4734
  msgstr ""
4735
 
4736
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1227
4737
  msgid "Social Infor."
4738
  msgstr ""
4739
 
4740
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1243
4741
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:14
4742
  msgid "Section ID."
4743
  msgstr ""
4744
 
4745
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1248
4746
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:122
4747
  msgid "Section name."
4748
  msgstr ""
4749
 
4750
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1253
4751
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:14
4752
  msgid "Course ID."
4753
  msgstr ""
4754
 
4755
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1258
4756
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:127
4757
  msgid "Section description."
4758
  msgstr ""
4759
 
4760
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1263
4761
  msgid "Section items."
4762
  msgstr ""
4763
 
4764
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1268
4765
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1283
4766
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:510
4767
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:266
4768
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:646
@@ -4770,56 +4747,56 @@ msgstr ""
4770
  msgid "Item ID."
4771
  msgstr ""
4772
 
4773
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1273
4774
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:687
4775
  msgid "Item Type."
4776
  msgstr ""
4777
 
4778
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1278
4779
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:692
4780
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:721
4781
  msgid "Item title."
4782
  msgstr ""
4783
 
4784
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1288
4785
  msgid "Percent."
4786
  msgstr ""
4787
 
4788
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1293
4789
  msgid "Duration."
4790
  msgstr ""
4791
 
4792
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1298
4793
  msgid "Graduation."
4794
  msgstr ""
4795
 
4796
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1303
4797
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:542
4798
  msgid "Status."
4799
  msgstr ""
4800
 
4801
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1308
4802
  msgid "Locked."
4803
  msgstr ""
4804
 
4805
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1318
4806
  msgid "List of course user data."
4807
  msgstr ""
4808
 
4809
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1325
4810
  msgid "Graduation"
4811
  msgstr ""
4812
 
4813
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1336
4814
  msgid "Start time"
4815
  msgstr ""
4816
 
4817
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1342
4818
  #: templates/profile/tabs/courses/course-list.php:25
4819
  msgid "End time"
4820
  msgstr ""
4821
 
4822
- #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1348
4823
  #: templates/profile/tabs/courses/course-list.php:24
4824
  msgid "Expiration time"
4825
  msgstr ""
@@ -4829,20 +4806,20 @@ msgid "Error: No lesson available!."
4829
  msgstr ""
4830
 
4831
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:207
4832
- msgid "Error: This lesson is not assign in Course."
4833
  msgstr ""
4834
 
4835
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:214
4836
- #: inc/user/class-lp-user.php:435
4837
  msgid "Error: No Course or User available."
4838
  msgstr ""
4839
 
4840
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:220
4841
- msgid "Error: Cannot complete Lesson"
4842
  msgstr ""
4843
 
4844
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:224
4845
- msgid "Congrats! You complete lesson is successfully"
4846
  msgstr ""
4847
 
4848
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:505
@@ -4892,7 +4869,7 @@ msgstr ""
4892
 
4893
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:14
4894
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:475
4895
- msgid "Method '%s' not implemented. Must be overridden in subclass."
4896
  msgstr ""
4897
 
4898
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:19
@@ -4914,13 +4891,13 @@ msgstr ""
4914
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:506
4915
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:315
4916
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:143
4917
- msgid "Current page of the collection."
4918
  msgstr ""
4919
 
4920
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:514
4921
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:323
4922
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:151
4923
- msgid "Maximum number of items to be returned in result set."
4924
  msgstr ""
4925
 
4926
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:523
@@ -4940,13 +4917,13 @@ msgstr ""
4940
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:541
4941
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:345
4942
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:173
4943
- msgid "Ensure result set excludes specific IDs."
4944
  msgstr ""
4945
 
4946
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:550
4947
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:354
4948
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:182
4949
- msgid "Limit result set to specific ids."
4950
  msgstr ""
4951
 
4952
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:559
@@ -4956,20 +4933,20 @@ msgstr ""
4956
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:565
4957
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:332
4958
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:160
4959
- msgid "Order sort attribute ascending or descending."
4960
  msgstr ""
4961
 
4962
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:572
4963
- msgid "Sort collection by object attribute."
4964
  msgstr ""
4965
 
4966
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:586
4967
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:602
4968
- msgid "Limit result set to posts assigned to specific authors."
4969
  msgstr ""
4970
 
4971
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:594
4972
- msgid "Ensure result set excludes posts assigned to specific authors."
4973
  msgstr ""
4974
 
4975
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:610
@@ -4977,11 +4954,11 @@ msgid "Get item learned by user."
4977
  msgstr ""
4978
 
4979
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:618
4980
- msgid "Limit result set to those of particular parent IDs."
4981
  msgstr ""
4982
 
4983
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:627
4984
- msgid "Limit result set to all items except those of a particular parent ID."
4985
  msgstr ""
4986
 
4987
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:58
@@ -4995,21 +4972,21 @@ msgid "Question ID."
4995
  msgstr ""
4996
 
4997
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:102
4998
- msgid "Answer all question."
4999
  msgstr ""
5000
 
5001
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:231
5002
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:257
5003
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:285
5004
- msgid "No Quiz ID or Quiz is not assigned in Course."
5005
  msgstr ""
5006
 
5007
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:292
5008
- msgid "No Answed param."
5009
  msgstr ""
5010
 
5011
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:673
5012
- msgid "List all Question in Quiz."
5013
  msgstr ""
5014
 
5015
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:677
@@ -5046,13 +5023,13 @@ msgid "Sorry, Invalid Section ID param."
5046
  msgstr ""
5047
 
5048
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:37
5049
- msgid "Please assigned section to Course."
5050
  msgstr ""
5051
 
5052
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:44
5053
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:40
5054
- #: inc/user/class-lp-user.php:290
5055
- msgid "Course is not public"
5056
  msgstr ""
5057
 
5058
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:219
@@ -5136,7 +5113,7 @@ msgid "Your account has been deleted."
5136
  msgstr ""
5137
 
5138
  #: inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php:388
5139
- msgid "Your password has been updated, Please login again to continue!"
5140
  msgstr ""
5141
 
5142
  #: inc/lp-core-functions.php:732
@@ -5805,157 +5782,153 @@ msgid "Jersey pound"
5805
  msgstr ""
5806
 
5807
  #: inc/lp-core-functions.php:1403
5808
- #: inc/lp-template-functions.php:1546
5809
  msgid "%s week"
5810
  msgid_plural "%s weeks"
5811
  msgstr[0] ""
5812
  msgstr[1] ""
5813
 
5814
  #: inc/lp-core-functions.php:1407
5815
- #: inc/lp-template-functions.php:1542
5816
  msgid "%s day"
5817
  msgid_plural "%s days"
5818
  msgstr[0] ""
5819
  msgstr[1] ""
5820
 
5821
  #: inc/lp-core-functions.php:1412
5822
- #: inc/lp-template-functions.php:1537
5823
  msgid "%s hour"
5824
  msgid_plural "%s hours"
5825
  msgstr[0] ""
5826
  msgstr[1] ""
5827
 
5828
  #: inc/lp-core-functions.php:1416
5829
- #: inc/lp-template-functions.php:1531
5830
  msgid "%s minute"
5831
  msgid_plural "%s minutes"
5832
  msgstr[0] ""
5833
  msgstr[1] ""
5834
 
5835
- #: inc/lp-core-functions.php:2210
5836
  msgid "Cart"
5837
  msgstr ""
5838
 
5839
- #: inc/lp-core-functions.php:2214
5840
  msgid "Enable cart"
5841
  msgstr ""
5842
 
5843
- #: inc/lp-core-functions.php:2215
5844
- msgid "Check this option to enable user purchase multiple courses at one time."
5845
  msgstr ""
5846
 
5847
- #: inc/lp-core-functions.php:2224
5848
  msgid "Add to cart redirect"
5849
  msgstr ""
5850
 
5851
- #: inc/lp-core-functions.php:2225
5852
- msgid "Redirect to checkout immediately after adding course to cart."
5853
  msgstr ""
5854
 
5855
- #: inc/lp-core-functions.php:2231
5856
  msgid "AJAX add to cart"
5857
  msgstr ""
5858
 
5859
- #: inc/lp-core-functions.php:2232
5860
- msgid "Using AJAX to add course to cart."
5861
  msgstr ""
5862
 
5863
- #: inc/lp-core-functions.php:2238
5864
  msgid "Cart page"
5865
  msgstr ""
5866
 
5867
- #: inc/lp-core-functions.php:2588
5868
  msgctxt "static-page-name"
5869
  msgid "Checkout"
5870
  msgstr ""
5871
 
5872
- #: inc/lp-core-functions.php:2589
5873
  msgctxt "static-page-name"
5874
  msgid "Courses"
5875
  msgstr ""
5876
 
5877
- #: inc/lp-core-functions.php:2590
5878
  msgctxt "static-page-name"
5879
  msgid "Profile"
5880
  msgstr ""
5881
 
5882
- #: inc/lp-core-functions.php:2591
5883
  msgctxt "static-page-name"
5884
  msgid "Become a Teacher"
5885
  msgstr ""
5886
 
5887
- #: inc/lp-core-functions.php:2976
5888
  msgid "Loading..."
5889
  msgstr ""
5890
 
5891
- #: inc/lp-core-functions.php:2979
5892
- msgid "Get Passing Grade"
5893
  msgstr ""
5894
 
5895
- #: inc/lp-core-functions.php:2984
5896
- msgid "Evaluate by the number of lessons completed per total number of lessons."
5897
  msgstr ""
5898
 
5899
- #: inc/lp-core-functions.php:2985
5900
- msgid "E.g: Course has 10 lessons and user completed 5 lessons then the result = 5/10 (50.%)"
5901
  msgstr ""
5902
 
5903
- #: inc/lp-core-functions.php:2987
5904
- msgid "Evaluate by result of final quiz in the course. You have to add a quiz to the end of the course."
5905
  msgstr ""
5906
 
5907
- #: inc/lp-core-functions.php:2993
5908
- msgid "Evaluate by the number of quizzes passed per total number of quizzes."
5909
  msgstr ""
5910
 
5911
- #: inc/lp-core-functions.php:2994
5912
- msgid "E.g: The course has 10 quizzes and the user passed 5 quizzes then the result = 5/10 (50%)."
5913
  msgstr ""
5914
 
5915
- #: inc/lp-core-functions.php:3001
5916
- msgid "Evaluate by total number of correct answers per total number of questions."
5917
  msgstr ""
5918
 
5919
- #: inc/lp-core-functions.php:3002
5920
- msgid "E.g: Course has 10 questions. User correct 5 questions. Result is 5/10 (50%)."
5921
  msgstr ""
5922
 
5923
- #: inc/lp-core-functions.php:3007
5924
- msgid "Evaluate by total score achieved per total score of the questions."
5925
  msgstr ""
5926
 
5927
- #: inc/lp-core-functions.php:3013
5928
  msgid "Evaluate via lessons"
5929
  msgstr ""
5930
 
5931
- #: inc/lp-core-functions.php:3017
5932
  msgid "Evaluate via results of the final quiz"
5933
  msgstr ""
5934
 
5935
- #: inc/lp-core-functions.php:3021
5936
- msgid "Evaluate via quizzes passed"
5937
  msgstr ""
5938
 
5939
- #: inc/lp-core-functions.php:3025
5940
  msgid "Evaluate via questions"
5941
  msgstr ""
5942
 
5943
- #: inc/lp-core-functions.php:3029
5944
  msgid "Evaluate via mark"
5945
  msgstr ""
5946
 
5947
- #: inc/lp-core-functions.php:3192
5948
- msgid "Heads up, Please backup before upgrade!"
5949
  msgstr ""
5950
 
5951
- #: inc/lp-core-functions.php:3195
5952
  msgid "The latest update includes some substantial changes across different areas of the plugin. We highly recommend you backup your site before upgrading, and make sure you first update in a staging environment"
5953
  msgstr ""
5954
 
5955
- #: inc/lp-core-functions.php:3196
5956
- msgid "Learners require WordPress version "
5957
- msgstr ""
5958
-
5959
  #: inc/lp-deprecated.php:353
5960
  msgid "Learning"
5961
  msgstr ""
@@ -5963,9 +5936,9 @@ msgstr ""
5963
  #: inc/lp-deprecated.php:355
5964
  #: inc/lp-deprecated.php:386
5965
  #: inc/templates/class-lp-template-profile.php:102
5966
- #: inc/user-item/class-lp-user-item.php:803
5967
- #: inc/user/class-lp-profile.php:873
5968
- #: inc/user/class-lp-profile.php:907
5969
  msgid "Finished"
5970
  msgstr ""
5971
 
@@ -5980,7 +5953,7 @@ msgid "Home"
5980
  msgstr ""
5981
 
5982
  #: inc/lp-deprecated.php:2190
5983
- msgid "Fill out the form and send us your requesting."
5984
  msgstr ""
5985
 
5986
  #: inc/lp-deprecated.php:2229
@@ -6016,42 +5989,42 @@ msgstr ""
6016
  msgid "Overview"
6017
  msgstr ""
6018
 
6019
- #: inc/lp-template-functions.php:998
6020
- #: inc/lp-template-functions.php:1184
6021
  #: inc/templates/class-lp-template-course.php:132
6022
  msgid "Final"
6023
  msgstr ""
6024
 
6025
- #: inc/lp-template-functions.php:1420
6026
  msgid "Course Sidebar"
6027
  msgstr ""
6028
 
6029
- #: inc/lp-template-functions.php:1422
6030
- msgid "Widgets in this area will be shown in single course"
6031
  msgstr ""
6032
 
6033
- #: inc/lp-template-functions.php:1431
6034
  msgid "All Courses"
6035
  msgstr ""
6036
 
6037
- #: inc/lp-template-functions.php:1433
6038
- msgid "Widgets in this area will be shown in all courses page"
6039
  msgstr ""
6040
 
6041
- #: inc/lp-template-functions.php:1570
6042
- #: inc/lp-template-functions.php:1579
6043
  msgid "All levels"
6044
  msgstr ""
6045
 
6046
- #: inc/lp-template-functions.php:1580
6047
  msgid "Beginner"
6048
  msgstr ""
6049
 
6050
- #: inc/lp-template-functions.php:1581
6051
  msgid "Intermediate"
6052
  msgstr ""
6053
 
6054
- #: inc/lp-template-functions.php:1582
6055
  msgid "Expert"
6056
  msgstr ""
6057
 
@@ -6060,29 +6033,29 @@ msgid "LearnPress webhook %s process completed"
6060
  msgstr ""
6061
 
6062
  #: inc/lp-webhooks.php:90
6063
- msgid "LearnPress webhook process Complete"
6064
  msgstr ""
6065
 
6066
- #: inc/order/class-lp-order.php:188
6067
- #: inc/order/class-lp-order.php:198
6068
  #: templates/checkout/order-received.php:38
6069
  msgid "Thank you. Your order has been received."
6070
  msgstr ""
6071
 
6072
- #: inc/order/class-lp-order.php:347
6073
  msgid "Removed"
6074
  msgstr ""
6075
 
6076
- #: inc/order/class-lp-order.php:456
6077
  msgid "%s (Guest)"
6078
  msgstr ""
6079
 
6080
- #: inc/order/class-lp-order.php:1004
6081
  msgctxt "full name"
6082
  msgid "%1$s"
6083
  msgstr ""
6084
 
6085
- #: inc/order/class-lp-order.php:1116
6086
  msgid "Order on"
6087
  msgstr ""
6088
 
@@ -6142,7 +6115,7 @@ msgstr[0] ""
6142
  msgstr[1] ""
6143
 
6144
  #: inc/order/lp-order-functions.php:743
6145
- msgid "Order received in case user buy a course but doesn't finalise the order."
6146
  msgstr ""
6147
 
6148
  #: inc/order/lp-order-functions.php:744
@@ -6150,7 +6123,7 @@ msgid "Payment received and the order is awaiting fulfillment."
6150
  msgstr ""
6151
 
6152
  #: inc/order/lp-order-functions.php:745
6153
- msgid "Order fulfilled and complete."
6154
  msgstr ""
6155
 
6156
  #: inc/order/lp-order-functions.php:746
@@ -6162,7 +6135,7 @@ msgid "Order number <strong>%s</strong> not found"
6162
  msgstr ""
6163
 
6164
  #: inc/order/lp-order-functions.php:787
6165
- msgid "Order cancelled by customer"
6166
  msgstr ""
6167
 
6168
  #: inc/order/lp-order-functions.php:790
@@ -6170,7 +6143,7 @@ msgid "Order number <strong>%s</strong> has been cancelled"
6170
  msgstr ""
6171
 
6172
  #: inc/order/lp-order-functions.php:793
6173
- msgid "Order number <strong>%s</strong> can not be cancelled"
6174
  msgstr ""
6175
 
6176
  #: inc/question/class-lp-question-true-or-false.php:49
@@ -6209,46 +6182,42 @@ msgstr ""
6209
  msgid "Third option"
6210
  msgstr ""
6211
 
6212
- #: inc/quiz/class-lp-quiz.php:521
6213
  msgid "Unlimited"
6214
  msgstr ""
6215
 
6216
- #: inc/quiz/class-lp-quiz.php:578
6217
  msgid "Finish quiz"
6218
  msgstr ""
6219
 
6220
- #: inc/quiz/class-lp-quiz.php:579
6221
  msgid "Are you sure you want to finish this quiz?"
6222
  msgstr ""
6223
 
6224
- #: inc/quiz/class-lp-quiz.php:582
6225
  msgid "Retake quiz"
6226
  msgstr ""
6227
 
6228
- #: inc/quiz/class-lp-quiz.php:583
6229
  msgid "Are you sure you want to retake this quiz?"
6230
  msgstr ""
6231
 
6232
- #: inc/quiz/class-lp-quiz.php:586
6233
  msgid "Time's up!"
6234
  msgstr ""
6235
 
6236
- #: inc/quiz/class-lp-quiz.php:587
6237
- msgid "The time is up! Your quiz will automate come to finish"
6238
  msgstr ""
6239
 
6240
- #: inc/quiz/class-lp-quiz.php:589
6241
  msgid "Congrats! You have finished this quiz"
6242
  msgstr ""
6243
 
6244
- #: inc/quiz/class-lp-quiz.php:590
6245
  msgid "Congrats! You have re-taken this quiz. Please wait a moment and the page will reload"
6246
  msgstr ""
6247
 
6248
- #: inc/rest-api/class-lp-rest-authentication.php:99
6249
- msgid "Consumer key is invalid."
6250
- msgstr ""
6251
-
6252
  #: inc/rest-api/v1/admin/class-lp-admin-rest-course-controller.php:50
6253
  msgid "No Course ID available!"
6254
  msgstr ""
@@ -6299,20 +6268,20 @@ msgid "Invalid course!"
6299
  msgstr ""
6300
 
6301
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:300
6302
- msgid "Error: Cannot enroll course."
6303
  msgstr ""
6304
 
6305
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:321
6306
- msgid "Error: Can't Enroll course."
6307
  msgstr ""
6308
 
6309
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:361
6310
- msgid "Congrats! You enroll course successfully. Redirecting..."
6311
  msgstr ""
6312
 
6313
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:379
6314
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:503
6315
- msgid "Error: Please setup page for checkout."
6316
  msgstr ""
6317
 
6318
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:384
@@ -6328,7 +6297,7 @@ msgid "Error: No Course available."
6328
  msgstr ""
6329
 
6330
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:426
6331
- msgid "Error: Cannot purchase course!."
6332
  msgstr ""
6333
 
6334
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:449
@@ -6352,41 +6321,42 @@ msgid "Invalid params"
6352
  msgstr ""
6353
 
6354
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:541
6355
- #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:671
6356
  #: inc/user/abstract-lp-user.php:853
6357
  msgid "Invalid course"
6358
  msgstr ""
6359
 
6360
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:553
6361
- msgid "You can't retry course"
 
 
 
 
6362
  msgstr ""
6363
 
6364
- #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:579
6365
  msgid "Now you can learn this course"
6366
  msgstr ""
6367
 
6368
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:67
 
6369
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:173
6370
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:178
6371
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:162
6372
- msgid "Course is invalid!"
 
6373
  msgstr ""
6374
 
6375
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:71
6376
- msgid "Course is no require enroll!"
6377
- msgstr ""
6378
-
6379
- #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:118
6380
- #: inc/widgets/course-progress.php:65
6381
- msgid "Course is invalid"
6382
  msgstr ""
6383
 
6384
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:125
6385
- msgid "You are Guest"
6386
  msgstr ""
6387
 
6388
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:257
6389
- msgid "Section is invalid!"
6390
  msgstr ""
6391
 
6392
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:111
@@ -6399,11 +6369,11 @@ msgstr ""
6399
 
6400
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:127
6401
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:182
6402
- msgid "Upload directory is not writable"
6403
  msgstr ""
6404
 
6405
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:149
6406
- msgid "Can not write file"
6407
  msgstr ""
6408
 
6409
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:155
@@ -6411,11 +6381,12 @@ msgid "Avatar updated"
6411
  msgstr ""
6412
 
6413
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:170
6414
- msgid "User is invalid"
 
6415
  msgstr ""
6416
 
6417
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:194
6418
- msgid "Profile picture remove successfully"
6419
  msgstr ""
6420
 
6421
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:211
@@ -6424,7 +6395,7 @@ msgid "No user ID found!"
6424
  msgstr ""
6425
 
6426
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:217
6427
- msgid "User not exists!"
6428
  msgstr ""
6429
 
6430
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:283
@@ -6435,16 +6406,12 @@ msgstr ""
6435
  msgid "No User available!"
6436
  msgstr ""
6437
 
6438
- #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:337
6439
- msgid "User is invalid!"
6440
- msgstr ""
6441
-
6442
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:95
6443
- msgid "The ID of course item object."
6444
  msgstr ""
6445
 
6446
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:101
6447
- msgid "The ID of course object."
6448
  msgstr ""
6449
 
6450
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:122
@@ -6452,8 +6419,8 @@ msgid "%s was not registered as a request argument."
6452
  msgstr ""
6453
 
6454
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:166
6455
- #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:283
6456
- msgid "Quiz is invalid!"
6457
  msgstr ""
6458
 
6459
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:74
@@ -6466,7 +6433,7 @@ msgid "login"
6466
  msgstr ""
6467
 
6468
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:77
6469
- msgid "Your have already sent the request. Please wait for approvement."
6470
  msgstr ""
6471
 
6472
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:79
@@ -6483,7 +6450,7 @@ msgid "Your are logged in as %1$s. <a href=\"%2$s\">Log out</a>?"
6483
  msgstr ""
6484
 
6485
  #: inc/shortcodes/class-lp-shortcode-profile.php:53
6486
- msgid "You can't viewing user profile"
6487
  msgstr ""
6488
 
6489
  #: inc/templates/class-lp-template-course.php:311
@@ -6527,34 +6494,34 @@ msgid "Not Started"
6527
  msgstr ""
6528
 
6529
  #: inc/user-item/class-lp-user-item-quiz.php:747
6530
- msgid "Question is invalid!"
6531
  msgstr ""
6532
 
6533
  #: inc/user-item/class-lp-user-item-quiz.php:752
6534
- msgid "Cannot check answer the question."
6535
  msgstr ""
6536
 
6537
- #: inc/user-item/class-lp-user-item.php:799
6538
  #: templates/profile/tabs/courses.php:33
6539
  msgid "Enrolled"
6540
  msgstr ""
6541
 
6542
- #: inc/user-item/class-lp-user-item.php:802
6543
  msgid "Started"
6544
  msgstr ""
6545
 
6546
- #: inc/user-item/class-lp-user-item.php:810
6547
  msgid "Not Enrolled"
6548
  msgstr ""
6549
 
6550
- #: inc/user/abstract-lp-user.php:563
6551
- msgid "You can not hint question."
6552
  msgstr ""
6553
 
6554
- #: inc/user/abstract-lp-user.php:630
6555
  #: inc/user/abstract-lp-user.php:779
6556
  #: inc/user/abstract-lp-user.php:791
6557
- msgid "The role %s for user doesn't exist"
6558
  msgstr ""
6559
 
6560
  #: inc/user/abstract-lp-user.php:858
@@ -6570,224 +6537,218 @@ msgid "You have already completed this lesson."
6570
  msgstr ""
6571
 
6572
  #: inc/user/class-lp-profile.php:79
6573
- msgid "Account information updated successful."
6574
  msgstr ""
6575
 
6576
  #: inc/user/class-lp-profile.php:80
6577
- msgid "Account avatar updated successful."
6578
  msgstr ""
6579
 
6580
  #: inc/user/class-lp-profile.php:81
6581
- msgid "Password updated successful."
6582
  msgstr ""
6583
 
6584
  #: inc/user/class-lp-profile.php:82
6585
- msgid "Account privacy updated successful."
6586
  msgstr ""
6587
 
6588
- #: inc/user/class-lp-profile.php:297
6589
  msgid "Logout"
6590
  msgstr ""
6591
 
6592
- #: inc/user/class-lp-profile.php:306
6593
  msgid "Avatar"
6594
  msgstr ""
6595
 
6596
- #: inc/user/class-lp-profile.php:316
6597
  msgid "Privacy"
6598
  msgstr ""
6599
 
6600
- #: inc/user/class-lp-profile.php:601
6601
  msgid "Public your profile courses."
6602
  msgstr ""
6603
 
6604
- #: inc/user/class-lp-profile.php:608
6605
  msgid "Public your profile quizzes."
6606
  msgstr ""
6607
 
6608
- #: inc/user/class-lp-profile.php:876
6609
  msgid "Not enrolled"
6610
  msgstr ""
6611
 
6612
- #: inc/user/class-lp-profile.php:1111
6613
  msgid "User Avatar"
6614
  msgstr ""
6615
 
6616
  #: inc/user/class-lp-user.php:21
6617
  #: inc/user/class-lp-user.php:74
6618
- msgid "This content is protected, please enroll course to view this content!"
6619
  msgstr ""
6620
 
6621
  #: inc/user/class-lp-user.php:45
6622
- msgid "This content is protected, please login, enroll course to view this content!"
6623
  msgstr ""
6624
 
6625
  #: inc/user/class-lp-user.php:62
6626
- msgid "You finished this course. This content is protected, please enroll course to view this content!"
6627
  msgstr ""
6628
 
6629
  #: inc/user/class-lp-user.php:68
6630
  #: templates/global/block-content.php:16
6631
- msgid "Content of this item has blocked because the course has exceeded duration."
6632
  msgstr ""
6633
 
6634
- #: inc/user/class-lp-user.php:222
6635
- msgid "Course is not enrolled"
 
6636
  msgstr ""
6637
 
6638
- #: inc/user/class-lp-user.php:286
6639
  msgid "No Course or User available"
6640
  msgstr ""
6641
 
6642
- #: inc/user/class-lp-user.php:294
6643
- msgid "Course is External"
6644
  msgstr ""
6645
 
6646
- #: inc/user/class-lp-user.php:298
6647
- msgid "Course is full students"
6648
  msgstr ""
6649
 
6650
- #: inc/user/class-lp-user.php:302
6651
- msgid "Course is not require enrolling."
6652
  msgstr ""
6653
 
6654
- #: inc/user/class-lp-user.php:306
6655
- msgid "Course is not purchased."
6656
  msgstr ""
6657
 
6658
- #: inc/user/class-lp-user.php:310
6659
  msgid "This course is already enrolled."
6660
  msgstr ""
6661
 
6662
- #: inc/user/class-lp-user.php:369
6663
  msgid "This course is out of stock"
6664
  msgstr ""
6665
 
6666
- #: inc/user/class-lp-user.php:384
6667
  msgid "Your order is waiting for processing"
6668
  msgstr ""
6669
 
6670
- #: inc/user/class-lp-user.php:441
6671
- msgid "Course is has finished."
6672
- msgstr ""
6673
-
6674
- #: inc/user/class-lp-user.php:445
6675
- msgid "Course is not enroll."
6676
  msgstr ""
6677
 
6678
- #: inc/user/class-lp-user.php:449
6679
- msgid "Error: Course is not in-progress."
6680
  msgstr ""
6681
 
6682
- #: inc/user/class-lp-user.php:474
6683
- msgid "Error: Filter disable finish course."
6684
  msgstr ""
6685
 
6686
- #: inc/user/class-lp-user.php:499
6687
  msgid "You cannot start a quiz in preview mode."
6688
  msgstr ""
6689
 
6690
- #: inc/user/class-lp-user.php:508
6691
- msgid "Course does not exist or does not contain the quiz"
 
6692
  msgstr ""
6693
 
6694
- #: inc/user/class-lp-user.php:519
6695
  msgid "You have already finished the course of this quiz"
6696
  msgstr ""
6697
 
6698
- #: inc/user/class-lp-user.php:527
6699
- msgid "Please enroll course before starting quiz."
6700
  msgstr ""
6701
 
6702
- #: inc/user/class-lp-user.php:536
6703
- msgid "User has started or completed quiz"
6704
  msgstr ""
6705
 
6706
- #: inc/user/class-lp-user.php:545
6707
- msgid "You have to login for starting quiz."
6708
  msgstr ""
6709
 
6710
- #: inc/user/class-lp-user.php:600
6711
- msgid "User has already finished course of this quiz"
6712
  msgstr ""
6713
 
6714
- #: inc/user/class-lp-user.php:609
6715
- msgid "User has completed quiz"
6716
  msgstr ""
6717
 
6718
- #: inc/user/class-lp-user.php:648
6719
- msgid "Course does not exist or does not contain the quiz."
6720
- msgstr ""
6721
-
6722
- #: inc/user/class-lp-user.php:663
6723
  msgid "You can not redo a quiz in a finished course."
6724
  msgstr ""
6725
 
6726
- #: inc/user/class-lp-user.php:676
6727
- msgid "%1$s::%2$s - User has not completed quiz."
6728
  msgstr ""
6729
 
6730
- #: inc/user/class-lp-user.php:689
6731
- msgid "%1$s::%2$s - Your Quiz can't retake."
6732
  msgstr ""
6733
 
6734
- #: inc/user/lp-user-functions.php:378
6735
  msgid "Want to become an instructor?"
6736
  msgstr ""
6737
 
6738
- #: inc/user/lp-user-functions.php:896
6739
- msgid "Please login to enroll this course"
6740
  msgstr ""
6741
 
6742
- #: inc/user/lp-user-functions.php:914
6743
- msgid "You have already finished course"
6744
  msgstr ""
6745
 
6746
- #: inc/user/lp-user-functions.php:917
6747
  msgid "You have already enrolled in this course"
6748
  msgstr ""
6749
 
6750
- #: inc/user/lp-user-functions.php:1090
6751
- msgid "Old password incorrect!"
6752
  msgstr ""
6753
 
6754
- #: inc/user/lp-user-functions.php:1096
6755
- msgid "Confirmation password incorrect!"
6756
  msgstr ""
6757
 
6758
- #: inc/user/lp-user-functions.php:1389
6759
  msgid "Invalid item id."
6760
  msgstr ""
6761
 
6762
- #: inc/user/lp-user-functions.php:1422
6763
  msgid "Invalid item data."
6764
  msgstr ""
6765
 
6766
- #: inc/user/lp-user-functions.php:1596
6767
  msgid "Invalid Course ID."
6768
  msgstr ""
6769
 
6770
- #: inc/user/lp-user-functions.php:1616
6771
  msgid "Invalid Quiz"
6772
  msgstr ""
6773
 
6774
- #: inc/user/lp-user-functions.php:2016
6775
  msgid "Facebook Profile"
6776
  msgstr ""
6777
 
6778
- #: inc/user/lp-user-functions.php:2019
6779
  msgid "Twitter Profile"
6780
  msgstr ""
6781
 
6782
- #: inc/user/lp-user-functions.php:2022
6783
  msgid "Google Profile"
6784
  msgstr ""
6785
 
6786
- #: inc/user/lp-user-functions.php:2025
6787
  msgid "Youtube Channel"
6788
  msgstr ""
6789
 
6790
- #: inc/user/lp-user-functions.php:2028
6791
  msgid "Linkedin Profile"
6792
  msgstr ""
6793
 
@@ -6847,7 +6808,7 @@ msgid "Course Progress"
6847
  msgstr ""
6848
 
6849
  #: inc/widgets/course-progress.php:56
6850
- msgid "You need login to view Course Progress"
6851
  msgstr ""
6852
 
6853
  #: inc/widgets/course-progress.php:60
@@ -6943,12 +6904,12 @@ msgstr ""
6943
  msgid "Recent Courses"
6944
  msgstr ""
6945
 
6946
- #: learnpress.php:485
6947
  msgid "Documentation"
6948
  msgstr ""
6949
 
6950
- #: learnpress.php:497
6951
- msgid "LearnPress plugin base directory must be <strong>learnpress/learnpres.php</strong> (case sensitive) to ensure all functions work properly and fully operational (currently <strong>%s</strong>)"
6952
  msgstr ""
6953
 
6954
  #: templates/checkout/account-logged-in.php:23
@@ -7012,7 +6973,7 @@ msgid "Already had an account?"
7012
  msgstr ""
7013
 
7014
  #: templates/checkout/form.php:21
7015
- msgid "Please login to enroll the course!"
7016
  msgstr ""
7017
 
7018
  #: templates/checkout/guest-checkout-link.php:16
@@ -7033,7 +6994,7 @@ msgid "Enter your email..."
7033
  msgstr ""
7034
 
7035
  #: templates/checkout/guest-checkout.php:26
7036
- msgid "An order key to activate the course will be sent to your email after the payment proceeded successfully."
7037
  msgstr ""
7038
 
7039
  #: templates/checkout/guest-checkout.php:35
@@ -7092,7 +7053,7 @@ msgid "By completing your purchase you agree to those <a href=\"%1$s\" target=\"
7092
  msgstr ""
7093
 
7094
  #: templates/content-lesson/button-complete.php:22
7095
- msgid "Do you want to complete lesson"
7096
  msgstr ""
7097
 
7098
  #: templates/content-lesson/button-complete.php:31
@@ -7108,7 +7069,7 @@ msgid "Complete"
7108
  msgstr ""
7109
 
7110
  #: templates/content-lesson/content.php:24
7111
- msgid "Lesson content is empty."
7112
  msgstr ""
7113
 
7114
  #: templates/content-quiz/js.php:146
@@ -7151,11 +7112,11 @@ msgid "Submitting"
7151
  msgstr ""
7152
 
7153
  #: templates/global/before-main-content.php:25
7154
- msgid "LearnPress <strong>Checkout</strong> page is not set up. "
7155
  msgstr ""
7156
 
7157
  #: templates/global/before-main-content.php:28
7158
- msgid "Please contact administrator for setting up this page."
7159
  msgstr ""
7160
 
7161
  #: templates/global/before-main-content.php:30
@@ -7181,7 +7142,7 @@ msgid "Register"
7181
  msgstr ""
7182
 
7183
  #: templates/global/no-courses-found.php:15
7184
- msgid "No courses were found matching your selection."
7185
  msgstr ""
7186
 
7187
  #: templates/loop/single-course/loop-section.php:27
@@ -7231,7 +7192,7 @@ msgid "Recover"
7231
  msgstr ""
7232
 
7233
  #: templates/pages/profile.php:36
7234
- msgid "This user does not public their profile."
7235
  msgstr ""
7236
 
7237
  #: templates/profile/not-logged-in.php:16
@@ -7243,7 +7204,7 @@ msgid "Created"
7243
  msgstr ""
7244
 
7245
  #: templates/profile/tabs/courses/course-grid.php:48
7246
- #: templates/profile/tabs/courses/course-list.php:69
7247
  msgid "View more"
7248
  msgstr ""
7249
 
@@ -7255,7 +7216,7 @@ msgid "Result"
7255
  msgstr ""
7256
 
7257
  #: templates/profile/tabs/courses/general-statistic.php:26
7258
- msgid "Total courses enrolled"
7259
  msgstr ""
7260
 
7261
  #: templates/profile/tabs/courses/general-statistic.php:27
@@ -7263,7 +7224,7 @@ msgid "Enrolled Courses"
7263
  msgstr ""
7264
 
7265
  #: templates/profile/tabs/courses/general-statistic.php:30
7266
- msgid "Total courses are learning"
7267
  msgstr ""
7268
 
7269
  #: templates/profile/tabs/courses/general-statistic.php:31
@@ -7271,7 +7232,7 @@ msgid "Active Courses"
7271
  msgstr ""
7272
 
7273
  #: templates/profile/tabs/courses/general-statistic.php:34
7274
- msgid "Total courses has finished"
7275
  msgstr ""
7276
 
7277
  #: templates/profile/tabs/courses/general-statistic.php:35
@@ -7279,7 +7240,7 @@ msgid "Completed Courses"
7279
  msgstr ""
7280
 
7281
  #: templates/profile/tabs/courses/general-statistic.php:49
7282
- msgid "Total courses created"
7283
  msgstr ""
7284
 
7285
  #: templates/profile/tabs/courses/general-statistic.php:50
@@ -7287,7 +7248,7 @@ msgid "Total Courses"
7287
  msgstr ""
7288
 
7289
  #: templates/profile/tabs/courses/general-statistic.php:53
7290
- msgid "Total students attended"
7291
  msgstr ""
7292
 
7293
  #: templates/profile/tabs/courses/general-statistic.php:54
@@ -7311,11 +7272,11 @@ msgid "This order is paid by %s"
7311
  msgstr ""
7312
 
7313
  #: templates/profile/tabs/orders/recover-order.php:16
7314
- msgid "If you have a valid order key you can recover it here."
7315
  msgstr ""
7316
 
7317
  #: templates/profile/tabs/orders/recover-order.php:17
7318
- msgid "When you checkout with Guest order key will send in email, you can use order key to create order."
7319
  msgstr ""
7320
 
7321
  #: templates/profile/tabs/quizzes.php:56
@@ -7355,7 +7316,7 @@ msgid "Confirm new password"
7355
  msgstr ""
7356
 
7357
  #: templates/profile/tabs/settings/change-password.php:45
7358
- msgid "New password does not match!"
7359
  msgstr ""
7360
 
7361
  #: templates/shortcode/list-courses.php:49
@@ -7375,7 +7336,7 @@ msgid "Finish course"
7375
  msgstr ""
7376
 
7377
  #: templates/single-course/buttons/retry.php:25
7378
- msgid "Do you want to retake course"
7379
  msgstr ""
7380
 
7381
  #: templates/single-course/buttons/retry.php:40
@@ -7398,11 +7359,11 @@ msgstr ""
7398
 
7399
  #: templates/single-course/content-item/popup-sidebar.php:15
7400
  msgctxt "search course input placeholder"
7401
- msgid "Search courses content"
7402
  msgstr ""
7403
 
7404
  #: templates/single-course/content-protected.php:22
7405
- msgid "This content is protected, please <a class=\"lp-link-login\" href=\"%s\">login</a> and enroll course to view this content!"
7406
  msgstr ""
7407
 
7408
  #: templates/single-course/featured-review.php:18
@@ -7434,23 +7395,23 @@ msgstr ""
7434
  msgid "Lifetime access"
7435
  msgstr ""
7436
 
7437
- #: templates/single-course/sidebar/user-progress.php:30
7438
  msgid "Lessons completed:"
7439
  msgstr ""
7440
 
7441
- #: templates/single-course/sidebar/user-progress.php:41
7442
  msgid "Quizzes finished:"
7443
  msgstr ""
7444
 
7445
- #: templates/single-course/sidebar/user-progress.php:43
7446
  msgid "Failed %1$d, Passed %2$d"
7447
  msgstr ""
7448
 
7449
- #: templates/single-course/sidebar/user-progress.php:43
7450
  msgid "%1$d/%2$d"
7451
  msgstr ""
7452
 
7453
- #: templates/single-course/sidebar/user-progress.php:67
7454
  msgid "Passing condition: %s%%"
7455
  msgstr ""
7456
 
@@ -7473,7 +7434,7 @@ msgstr ""
7473
 
7474
  #: templates/single-course/tabs/curriculum-v2.php:39
7475
  #: templates/single-course/tabs/curriculum.php:56
7476
- msgid "Curriculum is empty"
7477
  msgstr ""
7478
 
7479
  #: templates/single-course/tabs/curriculum-v2.php:47
@@ -7485,7 +7446,7 @@ msgid "You finished this course. This course has been blocked"
7485
  msgstr ""
7486
 
7487
  #: templates/single-course/tabs/tabs.php:41
7488
- msgid "This course has been blocked reason by expire"
7489
  msgstr ""
7490
 
7491
  #: assets/js/dist/frontend/quiz.min.js:288
@@ -7515,7 +7476,7 @@ msgstr ""
7515
 
7516
  #. translators: %s is the template title
7517
  #: assets/js/dist/frontend/quiz.min.js:32
7518
- msgid "This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your course image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template."
7519
  msgstr ""
7520
 
7521
  #: assets/js/dist/frontend/quiz.min.js:13
@@ -7523,11 +7484,11 @@ msgid "Renders LearnPress PHP templates."
7523
  msgstr ""
7524
 
7525
  #: assets/js/dist/frontend/quiz.min.js:131
7526
- msgid "File size too large. You need to upload a file < 2MB"
7527
  msgstr ""
7528
 
7529
  #: assets/js/dist/frontend/quiz.min.js:133
7530
- msgid "Image size must be greater than or equal to %1$sx%2$spx"
7531
  msgstr ""
7532
 
7533
  #: assets/js/dist/frontend/quiz.min.js:146
@@ -7547,7 +7508,7 @@ msgid "LP Error: can not set answers"
7547
  msgstr ""
7548
 
7549
  #: assets/js/dist/frontend/quiz.min.js:147
7550
- msgid "Render function should be overwritten from base."
7551
  msgstr ""
7552
 
7553
  #: assets/js/dist/frontend/quiz.min.js:208
@@ -7563,7 +7524,7 @@ msgid "Question <code>%s</code> invalid!"
7563
  msgstr ""
7564
 
7565
  #: assets/js/dist/frontend/quiz.min.js:15
7566
- msgid "Last Attempted"
7567
  msgstr ""
7568
 
7569
  #: assets/js/dist/frontend/quiz.min.js:23
@@ -7575,20 +7536,20 @@ msgid "Passing grade"
7575
  msgstr ""
7576
 
7577
  #: assets/js/dist/frontend/quiz.min.js:40
7578
- msgid "Check answer"
7579
  msgstr ""
7580
 
7581
  #: assets/js/dist/frontend/quiz.min.js:43
7582
- msgid "You need to answer the question before check answer."
7583
  msgstr ""
7584
 
7585
  #: assets/js/dist/frontend/quiz.min.js:17
7586
- msgid "Are you sure you want to retake quiz?"
7587
  msgstr ""
7588
 
7589
  #: assets/js/dist/frontend/quiz.min.js:105
7590
  #: assets/js/dist/frontend/quiz.min.js:67
7591
- msgid "Are you sure to submit quiz?"
7592
  msgstr ""
7593
 
7594
  #: assets/js/dist/frontend/quiz.min.js:159
2
  # This file is distributed under the same license as the LearnPress plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LearnPress 4.1.7.3\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/lp-branch\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-11-02T10:50:22+03:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: learnpress\n"
16
 
17
  #. Plugin Name of the plugin
18
+ #: inc/admin/class-lp-admin.php:130
19
+ #: inc/admin/class-lp-admin.php:138
20
+ #: inc/admin/lp-admin-functions.php:1694
21
  #: inc/admin/settings/class-lp-settings-emails.php:154
22
  #: inc/external-plugin/elementor/class-lp-elementor.php:41
23
  #: assets/js/dist/frontend/quiz.min.js:8
41
  msgstr ""
42
 
43
  #: config/settings/course.php:8
44
+ msgid "The site will be redirected to the URL added after clicking the finish course button."
45
  msgstr ""
46
 
47
  #: config/settings/course.php:9
55
  #: inc/admin/settings/class-lp-settings-profile.php:59
56
  #: inc/admin/sub-menus/class-lp-submenu-statistics.php:26
57
  #: inc/admin/views/meta-boxes/course/settings.php:22
58
+ #: inc/user/class-lp-profile.php:281
59
  msgid "General"
60
  msgstr ""
61
 
64
  msgstr ""
65
 
66
  #: config/settings/course.php:24
67
+ msgid "Courses created by instructors will be pending review first."
68
  msgstr ""
69
 
70
  #: config/settings/course.php:30
72
  msgstr ""
73
 
74
  #: config/settings/course.php:34
75
+ msgid "Students will get started on courses immediately after successfully purchasing them."
76
  msgstr ""
77
 
78
  #: config/settings/course.php:37
79
+ msgid "Confirmation popup"
80
  msgstr ""
81
 
82
  #: config/settings/course.php:38
83
+ msgid "Show a confirmation popup before finishing the course or completing the item."
84
  msgstr ""
85
 
86
  #: config/settings/course.php:44
88
  msgstr ""
89
 
90
  #: config/settings/course.php:45
91
+ msgid "Display the List course type on the Course Archive page."
92
  msgstr ""
93
 
94
  #: config/settings/course.php:52
96
  msgstr ""
97
 
98
  #: config/settings/course.php:53
99
+ msgid "The number of displayed courses per page."
100
  msgstr ""
101
 
102
  #: config/settings/course.php:63
103
+ msgid "Loading ajax Courses"
104
  msgstr ""
105
 
106
  #: config/settings/course.php:64
107
+ msgid "On/Off <i>loading ajax courses on the Course Archive page </i>."
108
  msgstr ""
109
 
110
  #: config/settings/course.php:70
111
+ msgid "Do not run Ajax when reloading the Course Archive page"
112
  msgstr ""
113
 
114
  #: config/settings/course.php:71
115
+ msgid "Ajax is only applied when selecting pagination, filtering, searching, and sorting. Not applicable when reloading the Course Archive page."
116
  msgstr ""
117
 
118
  #: config/settings/course.php:78
120
  msgstr ""
121
 
122
  #: config/settings/course.php:84
123
+ msgid "Redirect when finishing the course"
124
  msgstr ""
125
 
126
  #: config/settings/course.php:101
132
  msgstr ""
133
 
134
  #: config/settings/course.php:109
135
+ msgid "The number of displayed sections per page (Enter -1 to display all sections)."
136
  msgstr ""
137
 
138
  #: config/settings/course.php:112
140
  msgstr ""
141
 
142
  #: config/settings/course.php:116
143
+ msgid "The number of displayed course items per page in a section (Enter -1 to display all course items)."
144
  msgstr ""
145
 
146
  #: config/settings/course.php:128
164
  #: inc/admin/settings/class-lp-settings-advanced.php:72
165
  #: inc/course/lp-course-functions.php:450
166
  #: inc/custom-post-types/lesson.php:158
167
+ #: inc/lp-template-functions.php:987
168
  msgid "Lesson"
169
  msgstr ""
170
 
173
  #: inc/course/lp-course-functions.php:451
174
  #: inc/custom-post-types/question.php:320
175
  #: inc/custom-post-types/quiz.php:87
176
+ #: inc/lp-template-functions.php:977
177
  #: templates/profile/tabs/quizzes.php:54
178
  msgid "Quiz"
179
  msgstr ""
215
  msgstr ""
216
 
217
  #: config/settings/general.php:51
218
+ msgid "The page where the user will be redirected to after logging out."
219
  msgstr ""
220
 
221
  #: config/settings/general.php:57
244
  msgstr ""
245
 
246
  #: config/settings/general.php:79
247
+ msgid "This sets the thousands separator of displayed prices."
248
  msgstr ""
249
 
250
  #: config/settings/general.php:86
251
+ #: inc/admin/views/setup/steps/currency.php:64
252
+ msgid "Decimal separator"
253
  msgstr ""
254
 
255
  #: config/settings/general.php:87
257
  msgstr ""
258
 
259
  #: config/settings/general.php:94
260
+ #: inc/admin/views/setup/steps/currency.php:71
261
+ msgid "The number of decimals"
262
  msgstr ""
263
 
264
  #: config/settings/general.php:95
265
+ msgid "This sets the number of decimal points shown in the displayed prices."
266
  msgstr ""
267
 
268
  #: config/settings/general.php:105
276
  msgstr ""
277
 
278
  #: config/settings/general.php:113
279
+ msgid "This option will add a sub-item \\\"Privacy\\\" under the Setting tab on the Profile page. If users want to publish or hide their course, or quiz tab when other users visit their profile page, they need to enable/disable that option in the Privacy section."
280
  msgstr ""
281
 
282
  #: config/settings/general.php:114
283
+ msgid "Public all user profile pages (only the overview tab)."
284
  msgstr ""
285
 
286
  #: config/settings/general.php:117
293
 
294
  #: inc/abstract-settings.php:89
295
  #: inc/settings/abstract-settings-page.php:51
296
+ msgid "No settings available."
297
  msgstr ""
298
 
299
  #: inc/abstracts/abstract-addon.php:284
300
  msgid "<strong>%1$s</strong> add-on version %2$s requires <strong>LearnPress</strong> version %3$s or higher %4$s"
301
  msgstr ""
302
 
303
+ #: inc/abstracts/abstract-addon.php:370
304
  msgid "%s plugin file does not exist."
305
  msgstr ""
306
 
307
+ #: inc/abstracts/abstract-addon.php:391
308
  msgid "%s plugin class does not exist."
309
  msgstr ""
310
 
311
+ #: inc/abstracts/abstract-object-data.php:347
312
+ msgid "The following functions %1$s do not exist in %2$s"
313
  msgstr ""
314
 
315
  #: inc/admin/class-lp-admin-ajax.php:219
316
+ msgid "Oops! ID not found"
317
  msgstr ""
318
 
319
  #: inc/admin/class-lp-admin-ajax.php:262
320
+ msgid "Duplicate post failed. Please try again"
321
  msgstr ""
322
 
323
  #: inc/admin/class-lp-admin-ajax.php:405
325
  msgstr ""
326
 
327
  #: inc/admin/class-lp-admin-ajax.php:411
328
+ msgid "Nonce check failed"
329
  msgstr ""
330
 
331
  #: inc/admin/class-lp-admin-ajax.php:417
357
  msgstr ""
358
 
359
  #: inc/admin/class-lp-admin-assets.php:32
360
+ msgid "Oops! Error."
361
  msgstr ""
362
 
363
  #: inc/admin/class-lp-admin-assets.php:33
370
  msgstr ""
371
 
372
  #: inc/admin/class-lp-admin-assets.php:39
373
+ msgid "Before taking this action, we strongly recommend you backup your site first before proceeding. If you encounter any problems, please do not hesitate to contact our support team. Are you sure to proceed with the update protocol?"
374
  msgstr ""
375
 
376
  #: inc/admin/class-lp-admin-dashboard.php:21
391
  msgid "Created by: "
392
  msgstr ""
393
 
394
+ #: inc/admin/class-lp-admin-menu.php:65
395
  msgid "View Courses"
396
  msgstr ""
397
 
398
+ #: inc/admin/class-lp-admin-menu.php:75
399
+ msgid "View Profile"
400
+ msgstr ""
401
+
402
+ #: inc/admin/class-lp-admin-menu.php:96
403
  msgid "Learning Management System"
404
  msgstr ""
405
 
406
+ #: inc/admin/class-lp-admin.php:85
407
  msgid "Available Courses"
408
  msgstr ""
409
 
410
+ #: inc/admin/class-lp-admin.php:209
411
  msgid "Shop Page"
412
  msgstr ""
413
 
414
+ #: inc/admin/class-lp-admin.php:213
415
  msgid "Cart Page"
416
  msgstr ""
417
 
418
+ #: inc/admin/class-lp-admin.php:217
419
  msgid "Checkout Page"
420
  msgstr ""
421
 
422
+ #: inc/admin/class-lp-admin.php:221
423
  msgid "My Account Page"
424
  msgstr ""
425
 
426
+ #: inc/admin/class-lp-admin.php:225
427
  msgid "Terms and Conditions Page"
428
  msgstr ""
429
 
430
+ #: inc/admin/class-lp-admin.php:242
431
  msgid "Account"
432
  msgstr ""
433
 
434
+ #: inc/admin/class-lp-admin.php:243
435
  msgid "Billing"
436
  msgstr ""
437
 
438
+ #: inc/admin/class-lp-admin.php:244
439
  #: inc/admin/views/meta-boxes/fields/date.php:39
440
  #: inc/class-lp-assets.php:73
441
+ #: inc/lp-core-functions.php:2779
442
+ #: inc/order/class-lp-order.php:952
443
  #: assets/js/dist/frontend/quiz.min.js:44
444
  msgid "Cancel"
445
  msgstr ""
446
 
447
+ #: inc/admin/class-lp-admin.php:245
448
+ #: inc/admin/class-lp-admin.php:309
449
  msgid "Checkout"
450
  msgstr ""
451
 
452
+ #: inc/admin/class-lp-admin.php:246
453
  msgid "Confirmation"
454
  msgstr ""
455
 
456
+ #: inc/admin/class-lp-admin.php:247
457
  #: inc/admin/views/meta-boxes/order/content-tab-preview-exports-invoice.php:23
458
  msgid "Invoice"
459
  msgstr ""
460
 
461
+ #: inc/admin/class-lp-admin.php:248
462
  msgid "Levels"
463
  msgstr ""
464
 
465
+ #: inc/admin/class-lp-admin.php:276
466
  msgid "Members"
467
  msgstr ""
468
 
469
+ #: inc/admin/class-lp-admin.php:277
470
  msgid "Activity"
471
  msgstr ""
472
 
473
+ #: inc/admin/class-lp-admin.php:278
474
  #: templates/global/form-register.php:51
475
  msgid "Register"
476
  msgstr ""
477
 
478
+ #: inc/admin/class-lp-admin.php:279
479
  msgid "Activate"
480
  msgstr ""
481
 
482
+ #: inc/admin/class-lp-admin.php:307
483
  #: inc/admin/lp-admin-actions.php:217
484
  #: inc/admin/settings/class-lp-settings-profile.php:150
485
  #: inc/admin/sub-menus/class-lp-submenu-statistics.php:21
489
  #: inc/custom-post-types/course.php:107
490
  #: inc/lp-template-functions.php:312
491
  #: inc/settings/class-lp-settings-courses.php:16
492
+ #: inc/user/class-lp-profile.php:248
493
+ #: inc/user/class-lp-profile.php:600
494
  msgid "Courses"
495
  msgstr ""
496
 
497
+ #: inc/admin/class-lp-admin.php:308
498
  #: inc/admin/settings/class-lp-settings-profile.php:24
499
  #: inc/admin/views/meta-boxes/order/details.php:101
500
  msgid "Profile"
501
  msgstr ""
502
 
503
+ #: inc/admin/class-lp-admin.php:310
504
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:86
505
  msgid "Become a Teacher"
506
  msgstr ""
507
 
508
+ #: inc/admin/class-lp-admin.php:354
509
  msgid "LearnPress Page"
510
  msgstr ""
511
 
512
+ #: inc/admin/class-lp-admin.php:403
513
  msgid "LearnPress Pages (%d)"
514
  msgstr ""
515
 
516
+ #: inc/admin/class-lp-admin.php:453
517
  msgctxt "pending-request"
518
  msgid "Accept"
519
  msgstr ""
520
 
521
+ #: inc/admin/class-lp-admin.php:457
522
  msgctxt "pending-request"
523
  msgid "Deny"
524
  msgstr ""
525
 
526
+ #: inc/admin/class-lp-admin.php:527
527
  msgid "Pending Request %s"
528
  msgstr ""
529
 
530
+ #: inc/admin/class-lp-admin.php:612
531
+ msgid "A user has %s to become a teacher."
532
  msgstr ""
533
 
534
+ #: inc/admin/class-lp-admin.php:652
535
+ msgid "If you like <strong>LearnPress</strong> please leave us a %1$s&#9733;&#9733;&#9733;&#9733;&#9733;%2$s rating. A huge thanks from the LearnPress team for your generosity."
536
  msgstr ""
537
 
538
+ #: inc/admin/class-lp-admin.php:656
 
 
 
 
539
  msgid "Thanks :)"
540
  msgstr ""
541
 
542
+ #: inc/admin/class-lp-admin.php:725
543
+ msgid "Failed while joining the newsletter! Please try again!"
544
  msgstr ""
545
 
546
+ #: inc/admin/class-lp-admin.php:751
547
  msgid "Something went wrong: "
548
  msgstr ""
549
 
550
+ #: inc/admin/class-lp-admin.php:753
551
+ msgid "Thank you for subscribing! Please check and click the confirmation link from the email that we've just sent to your inbox."
552
  msgstr ""
553
 
554
+ #: inc/admin/class-lp-admin.php:875
555
+ msgid "Permalink is only available if the item is already assigned to a course."
556
  msgstr ""
557
 
558
  #: inc/admin/class-lp-install-sample-data.php:68
559
+ msgid "Are you sure you want to install the sample course data?"
560
  msgstr ""
561
 
562
  #: inc/admin/class-lp-install-sample-data.php:69
563
+ msgid "Are you sure you want to delete the sample course data?"
564
  msgstr ""
565
 
566
  #: inc/admin/class-lp-install-sample-data.php:158
567
+ msgid "The Course \"%s\" has been created"
568
  msgstr ""
569
 
570
  #: inc/admin/class-lp-install-sample-data.php:159
576
  #: inc/custom-post-types/abstract.php:938
577
  #: inc/custom-post-types/abstract.php:948
578
  #: inc/custom-post-types/question.php:366
579
+ #: inc/order/class-lp-order.php:944
580
  msgid "View"
581
  msgstr ""
582
 
593
  msgstr ""
594
 
595
  #: inc/admin/class-lp-install-sample-data.php:208
596
+ msgid "The sample data was successfully deleted!"
597
  msgstr ""
598
 
599
  #: inc/admin/class-lp-install-sample-data.php:354
717
  msgstr ""
718
 
719
  #: inc/admin/class-lp-plugin-install-list-table.php:483
720
+ #: inc/class-lp-datetime.php:201
721
  #: inc/custom-post-types/order.php:762
722
+ #: inc/order/class-lp-order.php:148
723
+ #: inc/user-item/class-lp-user-item.php:218
724
  msgid "%s ago"
725
  msgstr ""
726
 
744
  msgstr ""
745
 
746
  #: inc/admin/class-lp-reset-data.php:103
747
+ msgid "Item progress is deleted"
748
  msgstr ""
749
 
750
  #: inc/admin/class-lp-reset-data.php:105
768
 
769
  #: inc/admin/class-lp-setup-wizard.php:76
770
  msgctxt "static-page"
771
+ msgid "LP Become a Teacher"
772
  msgstr ""
773
 
774
  #: inc/admin/class-lp-setup-wizard.php:77
843
  msgstr ""
844
 
845
  #: inc/admin/editor/class-lp-admin-editor-quiz.php:164
846
+ #: inc/admin/editor/class-lp-admin-editor-quiz.php:606
847
  msgid "Quiz creation failed."
848
  msgstr ""
849
 
873
  msgstr ""
874
 
875
  #: inc/admin/lp-admin-actions.php:222
876
+ #: inc/admin/sub-menus/class-lp-submenu-categories.php:11
877
+ #: inc/admin/sub-menus/class-lp-submenu-categories.php:12
878
  #: inc/custom-post-types/course.php:485
879
  msgid "Categories"
880
  msgstr ""
881
 
882
  #: inc/admin/lp-admin-actions.php:227
883
+ #: inc/admin/sub-menus/class-lp-submenu-tags.php:11
884
+ #: inc/admin/sub-menus/class-lp-submenu-tags.php:12
885
  msgid "Tags"
886
  msgstr ""
887
 
905
  msgid "Duplicate"
906
  msgstr ""
907
 
908
+ #: inc/admin/lp-admin-functions.php:201
909
  msgid "[ Add a new page ]"
910
  msgstr ""
911
 
912
+ #: inc/admin/lp-admin-functions.php:224
913
  msgid "Select Page"
914
  msgstr ""
915
 
916
+ #: inc/admin/lp-admin-functions.php:242
917
  #: inc/admin/meta-box/fields/select-page.php:24
918
  msgid "Select a page&hellip;"
919
  msgstr ""
920
 
921
+ #: inc/admin/lp-admin-functions.php:270
922
+ msgctxt "dropdown pages"
923
  msgid "or"
924
  msgstr ""
925
 
926
+ #: inc/admin/lp-admin-functions.php:273
927
  msgid "Create new"
928
  msgstr ""
929
 
930
+ #: inc/admin/lp-admin-functions.php:278
931
  msgid "New page title"
932
  msgstr ""
933
 
934
+ #: inc/admin/lp-admin-functions.php:280
935
  msgid "Ok [Enter]"
936
  msgstr ""
937
 
938
+ #: inc/admin/lp-admin-functions.php:282
939
  msgid "Cancel [ESC]"
940
  msgstr ""
941
 
942
+ #: inc/admin/lp-admin-functions.php:287
943
  msgid "Edit page"
944
  msgstr ""
945
 
946
+ #: inc/admin/lp-admin-functions.php:290
947
  msgid "View page"
948
  msgstr ""
949
 
950
+ #: inc/admin/lp-admin-functions.php:404
951
  msgid "Minutes"
952
  msgstr ""
953
 
954
+ #: inc/admin/lp-admin-functions.php:448
955
+ #: inc/admin/lp-admin-functions.php:494
956
  #: inc/admin/settings/class-lp-settings-emails.php:141
957
  msgid "Plain Text"
958
  msgstr ""
959
 
960
+ #: inc/admin/lp-admin-functions.php:449
961
+ #: inc/admin/lp-admin-functions.php:495
962
  #: inc/admin/settings/class-lp-settings-emails.php:142
963
  msgid "HTML"
964
  msgstr ""
965
 
966
+ #: inc/admin/lp-admin-functions.php:694
967
  #: inc/admin/views/addons/html-loop-theme.php:45
968
  msgid "Get it now"
969
  msgstr ""
970
 
971
+ #: inc/admin/lp-admin-functions.php:696
972
  #: inc/admin/views/addons/html-loop-theme.php:46
973
  msgid "View Demo"
974
  msgstr ""
975
 
976
+ #: inc/admin/lp-admin-functions.php:1008
977
+ #: inc/admin/lp-admin-functions.php:1202
978
+ #: inc/admin/lp-admin-functions.php:1418
979
+ #: inc/admin/lp-admin-functions.php:2279
980
  #: inc/admin/views/statistics/courses.php:27
981
  #: inc/admin/views/statistics/general.php:43
982
  #: inc/admin/views/statistics/orders.php:29
987
  #: inc/lp-deprecated.php:384
988
  #: inc/templates/class-lp-template-profile.php:100
989
  #: inc/templates/class-lp-template-profile.php:111
990
+ #: inc/user/class-lp-profile.php:843
991
+ #: inc/user/class-lp-profile.php:875
992
+ #: inc/user/class-lp-profile.php:909
993
  #: templates/widgets/course-info.php:35
994
  msgid "All"
995
  msgstr ""
996
 
997
+ #: inc/admin/lp-admin-functions.php:1013
998
  #: inc/admin/views/statistics/courses.php:9
999
  #: inc/admin/views/statistics/general.php:9
1000
  #: inc/admin/views/statistics/orders.php:9
1002
  msgid "Instructors"
1003
  msgstr ""
1004
 
1005
+ #: inc/admin/lp-admin-functions.php:1018
1006
  #: inc/admin/views/statistics/courses.php:8
1007
  #: inc/admin/views/statistics/general.php:8
1008
  #: inc/admin/views/statistics/orders.php:8
1012
  msgid "Students"
1013
  msgstr ""
1014
 
1015
+ #: inc/admin/lp-admin-functions.php:1207
1016
+ #: inc/admin/lp-admin-functions.php:2284
1017
  #: inc/templates/class-lp-template-profile.php:112
1018
+ #: inc/user/class-lp-profile.php:844
1019
  msgid "Publish"
1020
  msgstr ""
1021
 
1022
+ #: inc/admin/lp-admin-functions.php:1212
1023
+ #: inc/admin/lp-admin-functions.php:1428
1024
+ #: inc/admin/lp-admin-functions.php:2289
1025
  #: inc/templates/class-lp-template-profile.php:113
1026
+ #: inc/user/class-lp-profile.php:845
1027
  msgid "Pending"
1028
  msgstr ""
1029
 
1030
+ #: inc/admin/lp-admin-functions.php:1217
1031
+ #: inc/admin/lp-admin-functions.php:2294
1032
  msgid "Paid"
1033
  msgstr ""
1034
 
1035
+ #: inc/admin/lp-admin-functions.php:1222
1036
+ #: inc/admin/lp-admin-functions.php:2299
1037
+ #: inc/course/abstract-course.php:652
1038
+ #: inc/course/abstract-course.php:681
1039
  #: templates/order/order-details.php:43
1040
  msgid "Free"
1041
  msgstr ""
1042
 
1043
+ #: inc/admin/lp-admin-functions.php:1423
1044
  #: inc/user-item/class-lp-user-item-quiz.php:146
1045
+ #: inc/user-item/class-lp-user-item.php:760
1046
  #: templates/content-lesson/button-complete.php:37
1047
  msgid "Completed"
1048
  msgstr ""
1049
 
1050
+ #: inc/admin/lp-admin-functions.php:1456
1051
+ msgid "Pending Courses/Publish Courses"
1052
  msgstr ""
1053
 
1054
+ #: inc/admin/lp-admin-functions.php:1457
1055
+ msgid "Free Courses/Paid Courses"
1056
  msgstr ""
1057
 
1058
+ #: inc/admin/lp-admin-functions.php:1837
1059
+ msgid "Copy"
1060
  msgstr ""
1061
 
1062
+ #: inc/admin/lp-admin-functions.php:1945
1063
  msgid "Question id %s does not exist."
1064
  msgstr ""
1065
 
1066
+ #: inc/admin/lp-admin-functions.php:1949
1067
  msgid "Quiz id %s does not exist."
1068
  msgstr ""
1069
 
1104
  msgstr ""
1105
 
1106
  #: inc/admin/meta-box/fields/email-content.php:45
1107
+ msgid "General Settings"
1108
  msgstr ""
1109
 
1110
  #: inc/admin/meta-box/fields/email-content.php:95
1112
  msgstr ""
1113
 
1114
  #: inc/admin/meta-box/fields/email-content.php:135
1115
+ msgid "Click on any variables above to insert them into the email."
1116
  msgstr ""
1117
 
1118
  #: inc/admin/meta-box/fields/image-advanced.php:25
1133
  msgstr ""
1134
 
1135
  #: inc/admin/meta-box/fields/image-advanced.php:38
1136
+ msgid "Delete images"
1137
  msgstr ""
1138
 
1139
  #: inc/admin/meta-box/fields/image.php:24
1141
  msgstr ""
1142
 
1143
  #: inc/admin/meta-box/fields/image.php:24
1144
+ #: inc/admin/views/meta-boxes/fields/autocomplete.php:62
1145
  msgid "Select"
1146
  msgstr ""
1147
 
1229
  msgstr ""
1230
 
1231
  #: inc/admin/settings/class-lp-settings-advanced.php:93
1232
+ msgid "Enable debug mode for the developer."
1233
  msgstr ""
1234
 
1235
  #: inc/admin/settings/class-lp-settings-advanced.php:110
1239
  msgstr ""
1240
 
1241
  #: inc/admin/settings/class-lp-settings-advanced.php:114
1242
+ msgid "The question's navigation position is sticky. If this option is disabled, the question navigation position will be below the quiz content"
1243
  msgstr ""
1244
 
1245
  #: inc/admin/settings/class-lp-settings-emails.php:25
1290
  msgstr ""
1291
 
1292
  #: inc/admin/settings/class-lp-settings-payments.php:85
1293
+ msgid "Enable guest checkout."
1294
  msgstr ""
1295
 
1296
  #: inc/admin/settings/class-lp-settings-payments.php:88
1298
  msgstr ""
1299
 
1300
  #: inc/admin/settings/class-lp-settings-payments.php:92
1301
+ msgid "Enable the login form in the checkout."
1302
  msgstr ""
1303
 
1304
  #: inc/admin/settings/class-lp-settings-payments.php:95
1306
  msgstr ""
1307
 
1308
  #: inc/admin/settings/class-lp-settings-payments.php:99
1309
+ msgid "Enable the register form in the checkout."
1310
  msgstr ""
1311
 
1312
  #: inc/admin/settings/class-lp-settings-payments.php:108
1322
  msgstr ""
1323
 
1324
  #: inc/admin/settings/class-lp-settings-profile.php:74
1325
+ msgid "If the user is not logged in, enable login from profile."
1326
  msgstr ""
1327
 
1328
  #: inc/admin/settings/class-lp-settings-profile.php:77
1330
  msgstr ""
1331
 
1332
  #: inc/admin/settings/class-lp-settings-profile.php:81
1333
+ msgid "If the user is not logged in, enable register from profile."
1334
  msgstr ""
1335
 
1336
  #: inc/admin/settings/class-lp-settings-profile.php:84
1338
  msgstr ""
1339
 
1340
  #: inc/admin/settings/class-lp-settings-profile.php:89
1341
+ #: inc/user/lp-user-functions.php:1838
1342
+ #: inc/user/lp-user-functions.php:1840
1343
  #: templates/profile/tabs/settings/basic-information.php:33
1344
  msgid "First name"
1345
  msgstr ""
1346
 
1347
  #: inc/admin/settings/class-lp-settings-profile.php:96
1348
+ #: inc/user/lp-user-functions.php:1851
1349
+ #: inc/user/lp-user-functions.php:1853
1350
  #: templates/profile/tabs/settings/basic-information.php:39
1351
  msgid "Last name"
1352
  msgstr ""
1353
 
1354
  #: inc/admin/settings/class-lp-settings-profile.php:103
1355
  #: inc/admin/settings/class-lp-settings-profile.php:115
1356
+ #: inc/user/lp-user-functions.php:1864
1357
+ #: inc/user/lp-user-functions.php:1866
1358
  #: templates/profile/tabs/settings/basic-information.php:45
1359
  msgid "Display name"
1360
  msgstr ""
1407
  msgstr ""
1408
 
1409
  #: inc/admin/settings/class-lp-settings-profile.php:133
1410
+ msgid "Custom fields to the registration form."
1411
  msgstr ""
1412
 
1413
  #: inc/admin/settings/class-lp-settings-profile.php:158
1414
  #: inc/custom-post-types/quiz.php:85
1415
  #: inc/custom-post-types/quiz.php:86
1416
  #: inc/custom-post-types/quiz.php:90
1417
+ #: inc/user/class-lp-profile.php:255
1418
+ #: inc/user/class-lp-profile.php:607
1419
  #: templates/widgets/course-info.php:30
1420
  msgid "Quizzes"
1421
  msgstr ""
1426
  #: inc/custom-post-types/order.php:823
1427
  #: inc/custom-post-types/order.php:824
1428
  #: inc/custom-post-types/order.php:828
1429
+ #: inc/user/class-lp-profile.php:262
1430
  msgid "Orders"
1431
  msgstr ""
1432
 
1433
  #: inc/admin/settings/class-lp-settings-profile.php:174
1434
  #: inc/admin/views/meta-boxes/order/content-tab-preview-exports-invoice.php:61
1435
  #: inc/admin/views/meta-boxes/order/details.php:40
1436
+ #: inc/user/class-lp-profile.php:269
1437
  msgid "Order details"
1438
  msgstr ""
1439
 
1440
  #: inc/admin/settings/class-lp-settings-profile.php:188
1441
  #: inc/admin/sub-menus/class-lp-submenu-settings.php:18
1442
+ #: inc/user/class-lp-profile.php:276
1443
+ #: learnpress.php:483
1444
  msgid "Settings"
1445
  msgstr ""
1446
 
1499
  msgstr ""
1500
 
1501
  #: inc/admin/sub-menus/class-lp-submenu-addons.php:14
1502
+ #: learnpress.php:485
1503
  msgid "Add-ons"
1504
  msgstr ""
1505
 
1507
  msgid "LearnPress Add-ons"
1508
  msgstr ""
1509
 
1510
+ #: inc/admin/sub-menus/class-lp-submenu-addons.php:34
1511
  msgid "Get more (%d)"
1512
  msgstr ""
1513
 
1514
+ #: inc/admin/sub-menus/class-lp-submenu-addons.php:35
1515
  msgid "Installed (%d)"
1516
  msgstr ""
1517
 
1518
+ #: inc/admin/sub-menus/class-lp-submenu-addons.php:36
1519
  msgid "Themes (%d)"
1520
  msgstr ""
1521
 
1522
+ #: inc/admin/sub-menus/class-lp-submenu-addons.php:64
1523
  msgid "Search..."
1524
  msgstr ""
1525
 
1527
  msgid "LearnPress Settings"
1528
  msgstr ""
1529
 
1530
+ #: inc/admin/sub-menus/class-lp-submenu-settings.php:59
1531
  msgid "Save settings"
1532
  msgstr ""
1533
 
1534
+ #: inc/admin/sub-menus/class-lp-submenu-statistics.php:14
1535
  msgid "Statistics"
1536
  msgstr ""
1537
 
1538
+ #: inc/admin/sub-menus/class-lp-submenu-statistics.php:15
1539
  msgid "LearnPress Statistics"
1540
  msgstr ""
1541
 
1551
  msgid "LearnPress Tools"
1552
  msgstr ""
1553
 
1554
+ #: inc/admin/sub-menus/class-lp-submenu-tools.php:20
1555
  msgid "Course Data"
1556
  msgstr ""
1557
 
1558
+ #: inc/admin/sub-menus/class-lp-submenu-tools.php:21
1559
  msgid "Database"
1560
  msgstr ""
1561
 
1562
+ #: inc/admin/sub-menus/class-lp-submenu-tools.php:22
1563
  msgid "Templates"
1564
  msgstr ""
1565
 
1576
  msgstr ""
1577
 
1578
  #: inc/admin/views/addons/html-plugins-more.php:18
1579
+ msgid "There are no add-ons available."
1580
  msgstr ""
1581
 
1582
  #: inc/admin/views/addons/html-plugins-more.php:26
1607
  msgstr ""
1608
 
1609
  #: inc/admin/views/course/editor.php:41
1610
+ msgid "Something went wrong! Please reload to continue editing the curriculum."
1611
  msgstr ""
1612
 
1613
  #: inc/admin/views/course/modal-choose-items.php:54
1618
  msgstr ""
1619
 
1620
  #: inc/admin/views/course/modal-choose-items.php:71
1621
+ msgid "Type here to search for an item"
1622
  msgstr ""
1623
 
1624
  #: inc/admin/views/course/modal-choose-items.php:76
1654
 
1655
  #: inc/admin/views/course/section-item.php:27
1656
  #: inc/admin/views/quiz/question-actions.php:31
1657
+ msgid "Edit an item"
1658
  msgstr ""
1659
 
1660
  #: inc/admin/views/course/section-item.php:34
1661
+ msgid "Remove from the course"
1662
  msgstr ""
1663
 
1664
  #: inc/admin/views/course/section-item.php:37
1692
  msgstr ""
1693
 
1694
  #: inc/admin/views/dashboard/plugin-status/html-results.php:23
1695
+ msgid "Active Installation"
1696
  msgstr ""
1697
 
1698
  #: inc/admin/views/dashboard/plugin-status/html-results.php:36
1708
  msgstr ""
1709
 
1710
  #: inc/admin/views/html-admin-notice-templates.php:39
1711
+ msgid "There is a new update on LearnPress. You may need to update your theme <strong>(%s)</strong> to avoid outdated template files."
1712
  msgstr ""
1713
 
1714
  #: inc/admin/views/html-admin-notice-templates.php:44
1715
+ msgid "This is not a bug, don't worry. Read more about the outdated template files notice <a href=\\\"%s\\\" target=\\\"_blank\\\">here</a>."
1716
  msgstr ""
1717
 
1718
  #: inc/admin/views/html-admin-notice-templates.php:58
1719
+ msgid "View the list of outdated templates"
1720
  msgstr ""
1721
 
1722
  #: inc/admin/views/html-admin-notice-templates.php:61
1761
  #: inc/admin/views/meta-boxes/quiz/settings.php:17
1762
  #: inc/custom-post-types/lesson.php:227
1763
  #: inc/custom-post-types/quiz.php:239
1764
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1073
1765
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:500
1766
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:636
1767
  msgid "Duration"
1768
  msgstr ""
1769
 
1770
  #: inc/admin/views/meta-boxes/course/settings.php:76
1771
+ msgid "Set to 0 for the lifetime access."
1772
  msgstr ""
1773
 
1774
  #: inc/admin/views/meta-boxes/course/settings.php:87
1776
  msgstr ""
1777
 
1778
  #: inc/admin/views/meta-boxes/course/settings.php:88
1779
+ msgid "When the duration expires, the course is blocked."
1780
  msgstr ""
1781
 
1782
  #: inc/admin/views/meta-boxes/course/settings.php:93
1783
+ msgid "Block the course after the student finished this course."
1784
  msgstr ""
1785
 
1786
  #: inc/admin/views/meta-boxes/course/settings.php:97
1788
  msgstr ""
1789
 
1790
  #: inc/admin/views/meta-boxes/course/settings.php:98
1791
+ msgid "Allow users to repurchase this course after it has been finished or blocked (Do not apply to free courses)."
1792
  msgstr ""
1793
 
1794
  #: inc/admin/views/meta-boxes/course/settings.php:102
1820
  msgstr ""
1821
 
1822
  #: inc/admin/views/meta-boxes/course/settings.php:124
1823
+ msgid "How many students have taken this course?"
1824
  msgstr ""
1825
 
1826
  #: inc/admin/views/meta-boxes/course/settings.php:136
1828
  msgstr ""
1829
 
1830
  #: inc/admin/views/meta-boxes/course/settings.php:137
1831
+ msgid "The maximum number of students that can join a course. Set 0 for unlimited."
1832
  msgstr ""
1833
 
1834
  #: inc/admin/views/meta-boxes/course/settings.php:149
1836
  msgstr ""
1837
 
1838
  #: inc/admin/views/meta-boxes/course/settings.php:150
1839
+ msgid "The number of times a user can learn again from this course. To disable, set to 0."
1840
  msgstr ""
1841
 
1842
  #: inc/admin/views/meta-boxes/course/settings.php:162
1844
  msgstr ""
1845
 
1846
  #: inc/admin/views/meta-boxes/course/settings.php:163
1847
+ msgid "Allow showing the finish button when the student has completed all items but has not passed the course assessment yet."
1848
  msgstr ""
1849
 
1850
  #: inc/admin/views/meta-boxes/course/settings.php:167
1852
  msgstr ""
1853
 
1854
  #: inc/admin/views/meta-boxes/course/settings.php:168
1855
+ msgid "Add the course to the Featured List."
1856
  msgstr ""
1857
 
1858
  #: inc/admin/views/meta-boxes/course/settings.php:172
1868
  msgstr ""
1869
 
1870
  #: inc/admin/views/meta-boxes/course/settings.php:177
1871
+ msgid "Normally used for offline classes. Ex: link to a contact page. Format: https://google.com"
1872
  msgstr ""
1873
 
1874
  #: inc/admin/views/meta-boxes/course/settings.php:207
1906
  msgstr ""
1907
 
1908
  #: inc/admin/views/meta-boxes/course/settings.php:254
1909
+ msgid "There is no enrollment requirement"
1910
  msgstr ""
1911
 
1912
  #: inc/admin/views/meta-boxes/course/settings.php:255
1913
+ msgid "Students can see the content of all course items and take the quiz without logging in."
1914
  msgstr ""
1915
 
1916
  #: inc/admin/views/meta-boxes/course/settings.php:304
1917
+ msgid "The method of evaluating a student's performance in a course."
1918
  msgstr ""
1919
 
1920
  #: inc/admin/views/meta-boxes/course/settings.php:307
1921
+ msgid "<br /><strong>Note! </strong>There is no final quiz in the course. Please add a final quiz."
1922
  msgstr ""
1923
 
1924
  #: inc/admin/views/meta-boxes/course/settings.php:329
1936
  msgstr ""
1937
 
1938
  #: inc/admin/views/meta-boxes/course/settings.php:349
1939
+ msgid "The conditions that must be achieved to finish the course."
1940
  msgstr ""
1941
 
1942
  #: inc/admin/views/meta-boxes/course/settings.php:370
2006
  #: inc/custom-post-types/abstract.php:960
2007
  #: inc/custom-post-types/lesson.php:130
2008
  #: inc/custom-post-types/lesson.php:230
2009
+ #: inc/lp-template-functions.php:990
2010
  #: templates/loop/single-course/loop-section-item.php:32
2011
  #: templates/single-course/section/item-meta.php:32
2012
  msgid "Preview"
2021
  msgstr ""
2022
 
2023
  #: inc/admin/views/meta-boxes/order/actions.php:20
2024
+ msgid "Trigger action of the current order status"
2025
  msgstr ""
2026
 
2027
  #: inc/admin/views/meta-boxes/order/actions.php:29
2102
  msgstr ""
2103
 
2104
  #: inc/admin/views/meta-boxes/order/details.php:74
2105
+ msgid "When the Status is changed to \"Pending\", \"Cancelled\", or \"Failed\" all courses, lessons, quizzes, and other progress are deleted!"
2106
  msgstr ""
2107
 
2108
  #: inc/admin/views/meta-boxes/order/details.php:83
2112
  #: inc/admin/views/meta-boxes/order/details.php:88
2113
  #: inc/admin/views/meta-boxes/order/details.php:118
2114
  #: inc/admin/views/meta-boxes/order/details.php:241
2115
+ msgid "Add multiple users"
2116
  msgstr ""
2117
 
2118
  #: inc/admin/views/meta-boxes/order/details.php:93
2142
  msgstr ""
2143
 
2144
  #: inc/admin/views/meta-boxes/order/details.php:172
2145
+ msgid "There are no order items"
2146
  msgstr ""
2147
 
2148
  #: inc/admin/views/meta-boxes/order/details.php:183
2163
  msgstr ""
2164
 
2165
  #: inc/admin/views/meta-boxes/order/details.php:265
2166
+ msgid "Type here to search for the course"
2167
  msgstr ""
2168
 
2169
  #: inc/admin/views/meta-boxes/order/details.php:268
2227
 
2228
  #: inc/admin/views/meta-boxes/question/settings.php:31
2229
  #: inc/admin/views/quiz/question-meta.php:44
2230
+ msgid "The instructions for the user to select the right answer. The text will be shown when users click the 'Hint' button."
2231
  msgstr ""
2232
 
2233
  #: inc/admin/views/meta-boxes/question/settings.php:35
2238
 
2239
  #: inc/admin/views/meta-boxes/question/settings.php:36
2240
  #: inc/admin/views/quiz/question-meta.php:55
2241
+ msgid "The explanation will be displayed when students click the \"Check Answer\" button."
2242
  msgstr ""
2243
 
2244
  #: inc/admin/views/meta-boxes/quiz/settings.php:9
2246
  msgstr ""
2247
 
2248
  #: inc/admin/views/meta-boxes/quiz/settings.php:18
2249
+ msgid "Set to 0 for no limit, greater than 0 for a limit."
2250
  msgstr ""
2251
 
2252
  #: inc/admin/views/meta-boxes/quiz/settings.php:30
2253
+ msgid "The conditions that must be achieved in order to pass the quiz."
2254
  msgstr ""
2255
 
2256
  #: inc/admin/views/meta-boxes/quiz/settings.php:43
2266
  msgstr ""
2267
 
2268
  #: inc/admin/views/meta-boxes/quiz/settings.php:49
2269
+ msgid "For each question that students answer wrongly, the total point is deducted exactly from the question's point."
2270
  msgstr ""
2271
 
2272
  #: inc/admin/views/meta-boxes/quiz/settings.php:53
2274
  msgstr ""
2275
 
2276
  #: inc/admin/views/meta-boxes/quiz/settings.php:54
2277
+ msgid "For each question that students answer skip, the total point is deducted exactly from the question's point."
2278
  msgstr ""
2279
 
2280
  #: inc/admin/views/meta-boxes/quiz/settings.php:58
2283
  msgstr ""
2284
 
2285
  #: inc/admin/views/meta-boxes/quiz/settings.php:59
2286
+ msgid "How many times can the user re-take this quiz? Set 0 to disable. Set -1 to infinite."
2287
  msgstr ""
2288
 
2289
  #: inc/admin/views/meta-boxes/quiz/settings.php:71
2291
  msgstr ""
2292
 
2293
  #: inc/admin/views/meta-boxes/quiz/settings.php:72
2294
+ msgid "The number of displayed questions on each page."
2295
  msgstr ""
2296
 
2297
  #: inc/admin/views/meta-boxes/quiz/settings.php:85
2304
  msgstr ""
2305
 
2306
  #: inc/admin/views/meta-boxes/quiz/settings.php:90
2307
+ msgid "Show the correct answer"
2308
  msgstr ""
2309
 
2310
  #: inc/admin/views/meta-boxes/quiz/settings.php:91
2311
+ msgid "Allow students to view the correct answer to the question in reviewing this quiz."
2312
  msgstr ""
2313
 
2314
  #: inc/admin/views/question/answer.php:17
2322
  msgstr ""
2323
 
2324
  #: inc/admin/views/question/answer.php:27
2325
+ msgid "Add a new Answer"
2326
  msgstr ""
2327
 
2328
  #: inc/admin/views/question/fib-answer-editor.php:5
2329
+ msgid "Select a word in the passage above and click <strong>'Insert a new blank'</strong> to make that word a blank for filling."
2330
  msgstr ""
2331
 
2332
  #: inc/admin/views/question/fib-answer-editor.php:8
2333
+ msgid "Insert a new blank"
2334
  msgstr ""
2335
 
2336
  #: inc/admin/views/question/fib-answer-editor.php:9
2337
+ msgid "Remove all blanks"
2338
  msgstr ""
2339
 
2340
  #: inc/admin/views/question/fib-answer-editor.php:10
2370
  msgstr ""
2371
 
2372
  #: inc/admin/views/question/fib-answer-editor.php:48
2373
+ msgid "Match any number in a range. Use <code>100, 200</code> to match any value from 100 to 200."
2374
  msgstr ""
2375
 
2376
  #: inc/admin/views/question/fib-answer-editor.php:53
2378
  msgstr ""
2379
 
2380
  #: inc/admin/views/question/fib-answer-editor.php:54
2381
+ msgid "Match any value in a set of words. Use <code>fill, blank, or question</code> to match any value in the set."
2382
  msgstr ""
2383
 
2384
  #: inc/admin/views/quiz/editor.php:49
2409
  msgstr ""
2410
 
2411
  #: inc/admin/views/quiz/modal-choose-items.php:64
2412
+ msgid "Type here to search for the question"
2413
  msgstr ""
2414
 
2415
  #: inc/admin/views/quiz/question-actions.php:28
2417
  msgstr ""
2418
 
2419
  #: inc/admin/views/quiz/question-actions.php:38
2420
+ msgid "Removed from the quiz"
2421
  msgstr ""
2422
 
2423
  #: inc/admin/views/quiz/question-answer.php:29
2465
  msgstr ""
2466
 
2467
  #: inc/admin/views/setup/setup-paypal.php:22
2468
+ msgid "Your Paypal email is in live mode."
2469
  msgstr ""
2470
 
2471
  #: inc/admin/views/setup/setup-stripe.php:15
2492
  msgid "Thousands Separator"
2493
  msgstr ""
2494
 
 
 
 
 
 
 
 
 
2495
  #: inc/admin/views/setup/steps/emails.php:12
2496
  msgid "Emails system"
2497
  msgstr ""
2501
  msgstr ""
2502
 
2503
  #: inc/admin/views/setup/steps/emails.php:15
2504
+ msgid "You can enable/disable each email in your LearnPress settings later."
2505
  msgstr ""
2506
 
2507
  #: inc/admin/views/setup/steps/emails.php:16
2508
+ msgid "But right now, you can enable all emails to see how emails work."
2509
  msgstr ""
2510
 
2511
  #: inc/admin/views/setup/steps/emails.php:17
2512
+ msgid "You can skip to the next step if you don’t want to."
2513
  msgstr ""
2514
 
2515
  #: inc/admin/views/setup/steps/emails.php:22
2537
  msgstr ""
2538
 
2539
  #: inc/admin/views/setup/steps/pages.php:16
2540
+ msgid "The pages will display the content of LP's necessary pages, such as Courses, Checkout, and Profile"
2541
  msgstr ""
2542
 
2543
  #: inc/admin/views/setup/steps/pages.php:17
2545
  msgstr ""
2546
 
2547
  #: inc/admin/views/setup/steps/pages.php:22
2548
+ msgid "Page: Show a list of courses"
2549
  msgstr ""
2550
 
2551
  #: inc/admin/views/setup/steps/pages.php:30
2656
  msgstr ""
2657
 
2658
  #: inc/admin/views/updates/html-updated-latest-message.php:16
2659
+ msgid "LearnPress has just updated to the latest version."
2660
  msgstr ""
2661
 
2662
  #: inc/admin/views/updates/html-updating-message.php:15
2663
+ msgid "<strong>LearnPress update</strong> – We are running an update to upgrade your database to the latest version."
2664
  msgstr ""
2665
 
2666
  #: inc/admin/views/updates/html-upgrade-message-3.0.0.php:14
2693
  msgstr ""
2694
 
2695
  #: inc/admin/views/user/course-progress.php:35
2696
+ #: templates/single-course/sidebar/user-progress.php:47
2697
  msgid "Course progress:"
2698
  msgstr ""
2699
 
2700
  #: inc/admin/views/user/courses.php:22
2701
+ msgid "The course list of enrolled users"
2702
  msgstr ""
2703
 
2704
  #: inc/background-process/class-lp-background-query-items.php:128
2705
  #: inc/background-process/class-lp-background-query-items.php:182
2706
+ msgid "No items found!"
2707
  msgstr ""
2708
 
2709
  #: inc/background-process/class-lp-background-query-items.php:133
2715
  msgstr ""
2716
 
2717
  #: inc/background-process/class-lp-background-query-items.php:232
2718
+ msgid "No item found!"
2719
  msgstr ""
2720
 
2721
  #: inc/block-template/class-block-until.php:57
2747
  msgstr ""
2748
 
2749
  #: inc/cart/class-lp-cart.php:167
2750
+ msgid "Sorry! The number of enrolled students has reached its limit"
2751
  msgstr ""
2752
 
2753
  #: inc/cart/class-lp-cart.php:327
2754
  msgid "%s has been removed from your cart because it can no longer be purchased."
2755
  msgstr ""
2756
 
 
 
 
 
2757
  #: inc/class-lp-ajax.php:85
2758
  msgid "The order %s has been successfully recovered."
2759
  msgstr ""
2760
 
2761
  #: inc/class-lp-ajax.php:113
2762
+ msgid "Your email already exists. Do you want to continue with this email?"
2763
  msgstr ""
2764
 
2765
  #: inc/class-lp-ajax.php:120
2766
+ msgid "Create a new account with this email. The account information will be sent with this email."
2767
  msgstr ""
2768
 
2769
  #: inc/class-lp-ajax.php:146
2799
  msgstr ""
2800
 
2801
  #: inc/class-lp-assets.php:72
2802
+ #: inc/lp-core-functions.php:2778
2803
  #: assets/js/dist/frontend/quiz.min.js:41
2804
  msgid "OK"
2805
  msgstr ""
2806
 
2807
  #: inc/class-lp-assets.php:74
2808
+ #: inc/lp-core-functions.php:2780
2809
  #: templates/global/lp-modal-overlay.php:24
2810
  msgid "Yes"
2811
  msgstr ""
2812
 
2813
  #: inc/class-lp-assets.php:75
2814
+ #: inc/lp-core-functions.php:2781
2815
  #: templates/global/lp-modal-overlay.php:23
2816
  msgid "No"
2817
  msgstr ""
2842
  msgid "Place order"
2843
  msgstr ""
2844
 
 
 
 
 
 
 
 
 
2845
  #: inc/class-lp-breadcrumb.php:124
2846
  msgid "Error 404"
2847
  msgstr ""
2882
  #: inc/class-lp-checkout.php:307
2883
  #: inc/class-lp-checkout.php:311
2884
  #: inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php:121
2885
+ #: inc/user/class-lp-profile.php:288
2886
  #: templates/checkout/account-login.php:30
2887
  #: templates/checkout/account-login.php:31
2888
  #: templates/checkout/account-register.php:32
2936
  msgstr ""
2937
 
2938
  #: inc/class-lp-checkout.php:549
2939
+ msgid "%s is not exist."
2940
  msgstr ""
2941
 
2942
  #: inc/class-lp-checkout.php:563
2943
+ msgid "Your email is not valid."
2944
  msgstr ""
2945
 
2946
  #: inc/class-lp-checkout.php:652
2980
  msgstr ""
2981
 
2982
  #: inc/class-lp-forms-handler.php:80
2983
+ msgid "A username is required"
2984
  msgstr ""
2985
 
2986
  #: inc/class-lp-forms-handler.php:171
2987
+ msgid "I need to become an instructor"
2988
  msgstr ""
2989
 
2990
  #: inc/class-lp-forms-handler.php:186
2992
  msgstr ""
2993
 
2994
  #: inc/class-lp-forms-handler.php:189
2995
+ msgid "Your request to become an instructor has been sent. We will get back to you soon!"
2996
  msgstr ""
2997
 
2998
  #: inc/class-lp-forms-handler.php:226
2999
  msgid "An account is already registered with your email address."
3000
  msgstr ""
3001
 
3002
+ #: inc/class-lp-forms-handler.php:237
3003
  #: inc/curds/class-lp-user-curd.php:2142
3004
+ msgid "An account is already registered with that username. Please choose another one."
3005
  msgstr ""
3006
 
3007
+ #: inc/class-lp-forms-handler.php:247
3008
  msgid "Please enter an account password."
3009
  msgstr ""
3010
 
3011
+ #: inc/class-lp-forms-handler.php:251
3012
  msgid "Password is too short!"
3013
  msgstr ""
3014
 
3015
+ #: inc/class-lp-forms-handler.php:255
3016
+ msgid "Password can not contain spaces!"
3017
  msgstr ""
3018
 
3019
+ #: inc/class-lp-forms-handler.php:259
3020
  msgid "Please enter confirm password."
3021
  msgstr ""
3022
 
3023
+ #: inc/class-lp-forms-handler.php:263
3024
+ msgid "Password and Confirm Password does not match!"
3025
  msgstr ""
3026
 
3027
+ #: inc/class-lp-forms-handler.php:270
3028
+ #: inc/class-lp-forms-handler.php:369
3029
  msgid " is required field."
3030
  msgstr ""
3031
 
3032
+ #: inc/class-lp-forms-handler.php:347
3033
  msgid "Email is required"
3034
  msgstr ""
3035
 
3036
+ #: inc/class-lp-forms-handler.php:351
3037
  msgid "Display name is required"
3038
  msgstr ""
3039
 
3040
+ #: inc/class-lp-forms-handler.php:355
3041
+ #: inc/class-lp-forms-handler.php:359
3042
+ msgid "Due to privacy concerns, the display name cannot be changed to an email address."
3043
  msgstr ""
3044
 
3045
+ #: inc/class-lp-forms-handler.php:361
3046
  msgid "This email address is already registered."
3047
  msgstr ""
3048
 
3049
+ #: inc/class-lp-forms-handler.php:393
3050
  msgid "Enter a username or email address."
3051
  msgstr ""
3052
 
3053
+ #: inc/class-lp-forms-handler.php:413
3054
+ #: inc/class-lp-forms-handler.php:417
3055
  msgid "Invalid username or email."
3056
  msgstr ""
3057
 
3058
+ #: inc/class-lp-forms-handler.php:428
3059
  msgid "Password reset is not allowed for this user."
3060
  msgstr ""
3061
 
3096
  msgstr ""
3097
 
3098
  #: inc/class-lp-shortcodes.php:220
3099
+ msgid "Create a new account"
3100
  msgstr ""
3101
 
3102
  #: inc/class-lp-strings.php:22
3103
+ msgid "You've already completed the quiz."
3104
  msgstr ""
3105
 
3106
  #: inc/class-lp-strings.php:23
3107
+ msgid "Do you want to redo the quiz \"%s\"?"
3108
  msgstr ""
3109
 
3110
  #: inc/class-lp-strings.php:24
3111
+ msgid "Do you want to complete the quiz \"%s\"?"
3112
  msgstr ""
3113
 
3114
  #: inc/class-lp-strings.php:25
3115
+ msgid "Do you want to complete the lesson \"%s\"?"
3116
  msgstr ""
3117
 
3118
  #: inc/class-lp-strings.php:26
3119
+ msgid "Do you want to finish the course \"%s\"?"
3120
  msgstr ""
3121
 
3122
  #: inc/class-lp-strings.php:27
3123
+ msgid "Do you want to retake the course \"%s\"?"
3124
  msgstr ""
3125
 
3126
  #: inc/class-lp-thumbnail-helper.php:60
3129
  msgstr ""
3130
 
3131
  #: inc/class-lp-widget.php:247
3132
+ msgid "There are no options for this widget."
3133
  msgstr ""
3134
 
3135
+ #: inc/course/abstract-course.php:761
3136
+ #: inc/course/abstract-course.php:781
3137
  #: inc/lesson/class-lp-lesson.php:104
3138
+ #: inc/quiz/class-lp-quiz.php:633
3139
  msgid "The function %s doesn't exist"
3140
  msgstr ""
3141
 
3142
+ #: inc/course/abstract-course.php:1246
3143
+ msgid "This course will end within the next %s"
3144
  msgstr ""
3145
 
3146
+ #: inc/course/abstract-course.php:1274
3147
  msgctxt "External Link button text"
3148
  msgid "More Info"
3149
  msgstr ""
3150
 
3151
+ #: inc/course/abstract-course.php:1311
3152
  msgid "Tags: "
3153
  msgstr ""
3154
 
3172
  msgid "Unread"
3173
  msgstr ""
3174
 
3175
+ #: inc/course/lp-course-functions.php:732
3176
  msgid "Edit this item"
3177
  msgstr ""
3178
 
3179
+ #: inc/course/lp-course-functions.php:943
3180
+ #: inc/lp-core-functions.php:2418
3181
  #: inc/templates/class-lp-template-profile.php:103
3182
  #: inc/user-item/class-lp-user-item-quiz.php:147
3183
+ #: inc/user/class-lp-profile.php:877
3184
+ #: inc/user/class-lp-profile.php:911
3185
  #: assets/js/dist/frontend/quiz.min.js:167
3186
  msgid "Passed"
3187
  msgstr ""
3188
 
3189
+ #: inc/course/lp-course-functions.php:946
3190
+ #: inc/lp-core-functions.php:2421
3191
  #: inc/templates/class-lp-template-profile.php:104
3192
  #: inc/user-item/class-lp-user-item-quiz.php:148
3193
+ #: inc/user/class-lp-profile.php:878
3194
+ #: inc/user/class-lp-profile.php:912
3195
  #: assets/js/dist/frontend/quiz.min.js:169
3196
  msgid "Failed"
3197
  msgstr ""
3198
 
3199
+ #: inc/course/lp-course-functions.php:949
3200
+ #: inc/lp-core-functions.php:2424
3201
  #: inc/lp-deprecated.php:385
3202
  #: inc/templates/class-lp-template-profile.php:101
3203
  #: inc/user-item/class-lp-user-item-quiz.php:144
3205
  msgid "In Progress"
3206
  msgstr ""
3207
 
3208
+ #: inc/course/lp-course-functions.php:1027
3209
+ msgid "completed lessons per the total number of lessons."
3210
  msgstr ""
3211
 
3212
+ #: inc/course/lp-course-functions.php:1030
3213
+ msgid "passed quizzes per the total number of quizzes."
3214
  msgstr ""
3215
 
3216
+ #: inc/course/lp-course-functions.php:1033
3217
  msgid "Final Quiz"
3218
  msgstr ""
3219
 
3220
+ #: inc/course/lp-course-functions.php:1036
3221
+ msgid "correct answers per the total number of questions."
3222
  msgstr ""
3223
 
3224
+ #: inc/course/lp-course-functions.php:1039
3225
+ msgid "score achieved per the total score of the questions."
3226
  msgstr ""
3227
 
3228
+ #: inc/course/lp-course-functions.php:1048
3229
  msgid "Require"
3230
  msgstr ""
3231
 
3232
  #: inc/curds/class-lp-course-curd.php:27
3233
+ msgid "The course does not exist."
3234
  msgstr ""
3235
 
3236
  #: inc/curds/class-lp-lesson-curd.php:35
3255
  msgstr ""
3256
 
3257
  #: inc/curds/class-lp-order-curd.php:506
3258
+ msgid "Invalid User!"
3259
  msgstr ""
3260
 
3261
  #: inc/curds/class-lp-order-curd.php:510
3262
+ msgid "Invalid order key with Email!"
3263
  msgstr ""
3264
 
3265
  #: inc/curds/class-lp-question-curd.php:28
3266
+ msgid "The question does not exist."
3267
  msgstr ""
3268
 
3269
  #: inc/curds/class-lp-question-curd.php:228
3276
  msgstr ""
3277
 
3278
  #: inc/curds/class-lp-quiz-curd.php:29
3279
+ #: inc/curds/class-lp-user-item-curd.php:21
3280
+ msgid "The quiz does not exist."
3281
  msgstr ""
3282
 
3283
  #: inc/curds/class-lp-quiz-curd.php:43
3285
  msgstr ""
3286
 
3287
  #: inc/curds/class-lp-user-curd.php:1931
3288
+ msgid "There are no items in the order"
3289
  msgstr ""
3290
 
3291
  #: inc/curds/class-lp-user-curd.php:2063
3292
+ #: inc/user/class-lp-user.php:735
3293
  msgid "quiz"
3294
  msgstr ""
3295
 
3296
  #: inc/curds/class-lp-user-curd.php:2064
3297
+ #: inc/user/class-lp-user.php:736
3298
  msgid "quizzes"
3299
  msgstr ""
3300
 
3303
  msgstr ""
3304
 
3305
  #: inc/curds/class-lp-user-curd.php:2154
3306
+ msgid "Failed to create the user"
 
 
 
 
3307
  msgstr ""
3308
 
3309
  #: inc/curds/class-lp-user-item-curd.php:35
3311
  msgstr ""
3312
 
3313
  #: inc/custom-post-types/abstract.php:432
3314
+ msgid "This item has already been assigned to the course. It will be removed from the course if it is not published."
3315
  msgstr ""
3316
 
3317
  #: inc/custom-post-types/abstract.php:447
3318
+ msgid "This question has already been assigned to the quiz. It will be removed from the quiz if it is not published."
3319
  msgstr ""
3320
 
3321
  #: inc/custom-post-types/abstract.php:718
3347
 
3348
  #. translators: %s: date and time of the revision
3349
  #: inc/custom-post-types/abstract.php:923
3350
+ msgid "The lesson has been restored to revision from %s"
3351
  msgstr ""
3352
 
3353
  #: inc/custom-post-types/abstract.php:924
3380
  msgstr ""
3381
 
3382
  #: inc/custom-post-types/course.php:75
3383
+ msgid "Do you want to remove the \"{{ITEM_NAME}}\" item from the trash?"
3384
  msgstr ""
3385
 
3386
  #: inc/custom-post-types/course.php:78
3388
  msgstr ""
3389
 
3390
  #: inc/custom-post-types/course.php:80
3391
+ msgid "The course sale price must be less than the regular price"
3392
  msgstr ""
3393
 
3394
  #: inc/custom-post-types/course.php:81
3395
+ msgid "The course price must be greater than the sale price"
3396
  msgstr ""
3397
 
3398
  #: inc/custom-post-types/course.php:82
3399
+ msgid "The sale start date must be before the sale end date"
3400
  msgstr ""
3401
 
3402
  #: inc/custom-post-types/course.php:83
3403
+ msgid "The sale end date must be after the sale start date"
3404
  msgstr ""
3405
 
3406
  #: inc/custom-post-types/course.php:84
3426
  msgstr ""
3427
 
3428
  #: inc/custom-post-types/course.php:109
3429
+ msgid "Add a New Course"
3430
  msgstr ""
3431
 
3432
  #: inc/custom-post-types/course.php:110
3453
  msgstr ""
3454
 
3455
  #: inc/custom-post-types/course.php:115
3456
+ msgid "There was no course found in the trash"
3457
  msgstr ""
3458
 
3459
  #: inc/custom-post-types/course.php:118
3473
  msgstr ""
3474
 
3475
  #: inc/custom-post-types/course.php:166
3476
+ msgid "Add A New Course Category"
3477
  msgstr ""
3478
 
3479
  #: inc/custom-post-types/course.php:167
3517
  msgstr ""
3518
 
3519
  #: inc/custom-post-types/course.php:202
3520
+ msgid "Add A New Course Tag"
3521
  msgstr ""
3522
 
3523
  #: inc/custom-post-types/course.php:203
3591
  msgstr ""
3592
 
3593
  #: inc/custom-post-types/lesson.php:159
3594
+ msgid "Add A New Lesson"
3595
  msgstr ""
3596
 
3597
  #: inc/custom-post-types/lesson.php:161
3615
  msgstr ""
3616
 
3617
  #: inc/custom-post-types/lesson.php:167
3618
+ msgid "There was no lesson found in the trash"
3619
  msgstr ""
3620
 
3621
  #: inc/custom-post-types/lesson.php:226
3633
  msgstr ""
3634
 
3635
  #: inc/custom-post-types/order.php:382
3636
+ msgid "Order number, course name, etc."
3637
  msgstr ""
3638
 
3639
  #: inc/custom-post-types/order.php:581
3657
 
3658
  #: inc/custom-post-types/order.php:668
3659
  #: inc/lp-deprecated.php:354
3660
+ #: inc/user-item/class-lp-user-item.php:759
3661
  msgid "Purchased"
3662
  msgstr ""
3663
 
3664
  #: inc/custom-post-types/order.php:671
3665
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1331
3666
  #: templates/emails/order-items-table.php:72
3667
  #: templates/emails/plain/order-items-table.php:58
3668
  #: templates/profile/tabs/orders/list.php:31
3670
  msgstr ""
3671
 
3672
  #: inc/custom-post-types/order.php:721
3673
+ #: inc/order/class-lp-order.php:456
3674
  msgid "(Guest)"
3675
  msgstr ""
3676
 
3677
  #: inc/custom-post-types/order.php:777
3678
  #: templates/checkout/order-received.php:71
3679
+ msgid "The course does not exist"
3680
  msgstr ""
3681
 
3682
  #: inc/custom-post-types/order.php:779
3693
  msgstr ""
3694
 
3695
  #: inc/custom-post-types/order.php:826
3696
+ msgid "Add A New Order"
3697
  msgstr ""
3698
 
3699
  #: inc/custom-post-types/order.php:827
3715
  msgstr ""
3716
 
3717
  #: inc/custom-post-types/order.php:834
3718
+ msgid "There was no order found in the trash"
3719
  msgstr ""
3720
 
3721
  #: inc/custom-post-types/order.php:1002
3746
 
3747
  #: inc/custom-post-types/question.php:166
3748
  #: inc/custom-post-types/quiz.php:177
3749
+ msgid "Are you sure to remove all the blanks?"
3750
  msgstr ""
3751
 
3752
  #: inc/custom-post-types/question.php:183
3754
  msgstr ""
3755
 
3756
  #: inc/custom-post-types/question.php:186
3757
+ msgid "Add A New Tag"
3758
  msgstr ""
3759
 
3760
  #: inc/custom-post-types/question.php:187
3771
  msgstr ""
3772
 
3773
  #: inc/custom-post-types/question.php:210
3774
+ msgid "Add A New Question"
3775
  msgstr ""
3776
 
3777
  #: inc/custom-post-types/question.php:212
3791
  msgstr ""
3792
 
3793
  #: inc/custom-post-types/question.php:216
3794
+ msgid "There was no questions found in the trash"
3795
  msgstr ""
3796
 
3797
  #: inc/custom-post-types/question.php:498
3799
  msgstr ""
3800
 
3801
  #: inc/custom-post-types/quiz.php:88
3802
+ msgid "Add A New Quiz"
3803
  msgstr ""
3804
 
3805
  #: inc/custom-post-types/quiz.php:89
3823
  msgstr ""
3824
 
3825
  #: inc/custom-post-types/quiz.php:96
3826
+ msgid "There was no quiz found in the trash"
3827
  msgstr ""
3828
 
3829
  #: inc/custom-post-types/quiz.php:167
3831
  msgstr ""
3832
 
3833
  #: inc/custom-post-types/quiz.php:172
3834
+ msgid "Do you want to move the \"{{QUESTION_NAME}}\" question to the trash?"
3835
  msgstr ""
3836
 
3837
  #: inc/custom-post-types/quiz.php:286
3866
  #: inc/databases/class-lp-order-db.php:131
3867
  #: inc/databases/class-lp-user-items-db.php:111
3868
  #: inc/databases/class-lp-user-items-db.php:457
3869
+ msgid "Invalid user!"
3870
  msgstr ""
3871
 
3872
  #: inc/databases/class-lp-section-db.php:155
3902
  msgstr ""
3903
 
3904
  #: inc/emails/admin/class-lp-email-cancelled-order-admin.php:26
3905
+ msgid "Send an email to admin when the order has been canceled."
3906
  msgstr ""
3907
 
3908
  #: inc/emails/admin/class-lp-email-cancelled-order-admin.php:27
3909
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:28
3910
+ msgid "The order placed on {{order_date}} has been cancelled"
3911
  msgstr ""
3912
 
3913
  #: inc/emails/admin/class-lp-email-cancelled-order-admin.php:28
3914
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:29
3915
+ msgid "The user order has been cancelled"
3916
  msgstr ""
3917
 
3918
  #: inc/emails/admin/class-lp-email-completed-order-admin.php:27
3919
+ msgid "Send an email to admin when an order has been completed."
3920
  msgstr ""
3921
 
3922
  #: inc/emails/admin/class-lp-email-completed-order-admin.php:28
3923
+ msgid "The order placed on {{order_date}} has been completed"
3924
  msgstr ""
3925
 
3926
  #: inc/emails/admin/class-lp-email-completed-order-admin.php:29
3927
+ msgid "The user order has been completed"
3928
  msgstr ""
3929
 
3930
  #: inc/emails/admin/class-lp-email-enrolled-course-admin.php:29
3931
+ msgid "Send an email to admin when the user has enrolled in the course."
3932
  msgstr ""
3933
 
3934
  #: inc/emails/admin/class-lp-email-enrolled-course-admin.php:30
3935
  #: inc/emails/instructor/class-lp-email-enrolled-course-instructor.php:28
3936
+ msgid "{{user_display_name}} has enrolled in the course"
3937
  msgstr ""
3938
 
3939
  #: inc/emails/admin/class-lp-email-enrolled-course-admin.php:31
3940
  #: inc/emails/instructor/class-lp-email-enrolled-course-instructor.php:29
3941
+ msgid "The user has enrolled in the course"
3942
  msgstr ""
3943
 
3944
  #: inc/emails/admin/class-lp-email-finished-course-admin.php:27
3945
+ msgid "Send an email to admin when the user has finished the course."
3946
  msgstr ""
3947
 
3948
  #: inc/emails/admin/class-lp-email-finished-course-admin.php:28
3949
  #: inc/emails/instructor/class-lp-email-finished-course-instructor.php:28
3950
+ msgid "{{user_display_name}} has completed the course."
3951
  msgstr ""
3952
 
3953
  #: inc/emails/admin/class-lp-email-finished-course-admin.php:29
3954
  #: inc/emails/instructor/class-lp-email-finished-course-instructor.php:29
3955
+ msgid "The user has completed the course."
3956
  msgstr ""
3957
 
3958
  #: inc/emails/admin/class-lp-email-new-order-admin.php:26
3974
  msgstr ""
3975
 
3976
  #: inc/emails/class-lp-email.php:869
3977
+ msgid "Separate other recipients with commas."
3978
  msgstr ""
3979
 
3980
  #: inc/emails/class-lp-email.php:874
3986
  msgstr ""
3987
 
3988
  #: inc/emails/guest/class-lp-email-cancelled-order-guest.php:26
3989
+ msgid "Send an email to the guest when the order has been cancelled."
3990
  msgstr ""
3991
 
3992
  #: inc/emails/guest/class-lp-email-cancelled-order-guest.php:28
4001
 
4002
  #: inc/emails/guest/class-lp-email-completed-order-guest.php:30
4003
  #: inc/emails/guest/class-lp-email-new-order-guest.php:26
4004
+ msgid "Send an email to the user who has bought the course as a guest."
4005
  msgstr ""
4006
 
4007
  #: inc/emails/guest/class-lp-email-completed-order-guest.php:32
4029
  msgstr ""
4030
 
4031
  #: inc/emails/guest/class-lp-email-processing-order-guest.php:23
4032
+ msgid "When the order is processed, send an email to the user who purchased the course as a guest."
4033
  msgstr ""
4034
 
4035
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:25
4042
  msgstr ""
4043
 
4044
  #: inc/emails/instructor/class-lp-email-cancelled-order-instructor.php:26
4045
+ msgid "Send an email to the course instructor when the order has been cancelled."
4046
  msgstr ""
4047
 
4048
  #: inc/emails/instructor/class-lp-email-enrolled-course-instructor.php:26
4049
+ msgid "Send this email to the instructor when they have enrolled in the course."
4050
  msgstr ""
4051
 
4052
  #: inc/emails/instructor/class-lp-email-finished-course-instructor.php:26
4053
+ msgid "Send this email to the instructor when they have finished the course."
4054
  msgstr ""
4055
 
4056
  #: inc/emails/instructor/class-lp-email-instructor-accepted.php:28
4058
  msgstr ""
4059
 
4060
  #: inc/emails/instructor/class-lp-email-instructor-accepted.php:29
4061
+ #: inc/emails/instructor/class-lp-email-instructor-accepted.php:32
4062
+ msgid "Your email requesting to become an instructor has been accepted."
4063
  msgstr ""
4064
 
4065
  #: inc/emails/instructor/class-lp-email-instructor-accepted.php:31
4066
+ msgid "[{{site_title}}] Your request to become an instructor has been accepted"
 
 
 
 
4067
  msgstr ""
4068
 
4069
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:24
4071
  msgstr ""
4072
 
4073
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:25
4074
+ msgid "Your email requesting to become an instructor has been denied."
4075
  msgstr ""
4076
 
4077
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:27
4078
+ msgid "[{{site_title}}] Your request to become an instructor has been denied"
4079
  msgstr ""
4080
 
4081
  #: inc/emails/instructor/class-lp-email-instructor-denied.php:28
4082
+ msgid "Your request to become an instructor has been denied"
4083
  msgstr ""
4084
 
4085
  #: inc/emails/instructor/class-lp-email-new-order-instructor.php:22
4086
+ msgid "Notify instructors when a user enrolls in one of their courses."
4087
  msgstr ""
4088
 
4089
  #: inc/emails/student/class-lp-email-cancelled-order-user.php:25
4096
  msgstr ""
4097
 
4098
  #: inc/emails/student/class-lp-email-cancelled-order-user.php:26
4099
+ msgid "Send an email to the user when the order has been cancelled."
4100
  msgstr ""
4101
 
4102
  #: inc/emails/student/class-lp-email-completed-order-user.php:30
4103
+ msgid "Send an email to the user who has bought the course when the order is completed."
4104
  msgstr ""
4105
 
4106
  #: inc/emails/student/class-lp-email-enrolled-course-user.php:28
4107
+ msgid "Send this email to the user when they have enrolled in the course."
4108
  msgstr ""
4109
 
4110
  #: inc/emails/student/class-lp-email-enrolled-course-user.php:30
4111
+ msgid "[{{site_title}}] You have enrolled in the course"
4112
  msgstr ""
4113
 
4114
  #: inc/emails/student/class-lp-email-enrolled-course-user.php:31
4115
+ msgid "You have enrolled in the course"
4116
  msgstr ""
4117
 
4118
  #: inc/emails/student/class-lp-email-finished-course-user.php:27
4119
+ msgid "Send this email to the user when they have finished the course."
4120
  msgstr ""
4121
 
4122
  #: inc/emails/student/class-lp-email-finished-course-user.php:29
4123
+ msgid "[{{site_title}}] You have finished the course"
4124
  msgstr ""
4125
 
4126
  #: inc/emails/student/class-lp-email-finished-course-user.php:30
4127
+ msgid "You have finished the course"
4128
  msgstr ""
4129
 
4130
  #: inc/emails/student/class-lp-email-new-order-user.php:26
4131
+ msgid "Notify users when they successfully enroll in a course."
4132
  msgstr ""
4133
 
4134
  #: inc/emails/student/class-lp-email-processing-order-user.php:23
4135
+ msgid "Notify users when their course orders are being processed."
4136
  msgstr ""
4137
 
4138
  #: inc/emails/types/class-lp-email-reset-password.php:19
4139
+ msgid "Password Reset Email."
4140
  msgstr ""
4141
 
4142
  #: inc/emails/types/class-lp-email-reset-password.php:21
4150
 
4151
  #: inc/external-plugin/elementor/widgets/become-a-teacher.php:44
4152
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:87
4153
+ msgid "Fill in your information and send it to us to become a teacher."
4154
  msgstr ""
4155
 
4156
  #: inc/external-plugin/elementor/widgets/become-a-teacher.php:51
4232
  msgstr ""
4233
 
4234
  #: inc/external-plugin/elementor/widgets/login-form.php:31
4235
+ msgid "The login form is disabled"
4236
  msgstr ""
4237
 
4238
  #: inc/external-plugin/elementor/widgets/register-form.php:13
4240
  msgstr ""
4241
 
4242
  #: inc/external-plugin/elementor/widgets/register-form.php:33
4243
+ msgid "The registration form is disabled"
4244
  msgstr ""
4245
 
4246
  #: inc/external-plugin/elementor/widgets/widget-base.php:114
4330
  msgstr ""
4331
 
4332
  #: inc/gateways/offline-payment/class-lp-gateway-offline-payment.php:166
4333
+ msgid "Payment can be made upon delivery."
4334
  msgstr ""
4335
 
4336
  #: inc/gateways/paypal/class-lp-gateway-paypal.php:93
4337
+ msgid "Make a payment via Paypal."
4338
  msgstr ""
4339
 
4340
  #: inc/gateways/paypal/class-lp-gateway-paypal.php:97
4362
  msgstr ""
4363
 
4364
  #: inc/handle-steps/class-lp-handle-steps.php:26
4365
+ msgid "Invalid steps"
4366
  msgstr ""
4367
 
4368
  #: inc/handle-steps/class-lp-handle-steps.php:31
4369
+ msgid "Invalid step"
4370
  msgstr ""
4371
 
4372
  #: inc/handle-steps/class-lp-handle-steps.php:78
4373
+ msgid "Function not found"
4374
  msgstr ""
4375
 
4376
  #: inc/jwt/includes/class-jwt-public.php:44
4423
  msgstr ""
4424
 
4425
  #: inc/jwt/includes/class-jwt-public.php:336
4426
+ msgid "The token must have an expiration date."
4427
  msgstr ""
4428
 
4429
  #: inc/jwt/includes/class-jwt-public.php:346
4430
+ msgid "The token has expired."
4431
  msgstr ""
4432
 
4433
  #: inc/jwt/includes/class-jwt-public.php:361
4438
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:64
4439
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:89
4440
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:114
4441
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:993
4442
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:32
4443
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:58
4444
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:430
4451
  #: inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php:42
4452
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:58
4453
  #: inc/rest-api/v1/frontend/class-lp-rest-settings-controller.php:23
4454
+ msgid "A unique identifier for the resource."
4455
  msgstr ""
4456
 
4457
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:147
4463
  msgstr ""
4464
 
4465
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:262
4466
+ msgid "The secret key is empty."
4467
  msgstr ""
4468
 
4469
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:288
4470
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:314
4471
+ msgid "Cannot verify the receipt"
4472
  msgstr ""
4473
 
4474
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:294
4475
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:305
 
 
 
4476
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:331
4477
+ msgid "The course ID is invalid."
4478
  msgstr ""
4479
 
4480
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:347
4481
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:340
4482
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:488
4483
+ msgid "Error: The course cannot be added to the cart."
4484
  msgstr ""
4485
 
4486
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:365
4492
  msgstr ""
4493
 
4494
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:399
4495
+ msgid "Cannot finish this course."
4496
  msgstr ""
4497
 
4498
  #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:405
4509
  msgid "Cannot create existing %s."
4510
  msgstr ""
4511
 
4512
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:577
4513
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:296
4514
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:372
4515
  #: templates/single-course/sidebar/user-time.php:37
4516
  msgid "Lifetime"
4517
  msgstr ""
4518
 
4519
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:828
4520
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:160
4521
  msgid "%s days"
4522
  msgstr ""
4523
 
4524
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:829
4525
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:161
4526
  msgid "%s hours"
4527
  msgstr ""
4528
 
4529
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:830
4530
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:162
4531
  msgid "%s mins"
4532
  msgstr ""
4533
 
4534
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:831
4535
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:163
4536
  msgid "%s secs"
4537
  msgstr ""
4538
 
4539
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:999
4540
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:436
4541
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:203
4542
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:572
4543
  msgid "Course name."
4544
  msgstr ""
4545
 
4546
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1004
4547
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:441
4548
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:208
4549
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:577
4550
  msgid "Course slug."
4551
  msgstr ""
4552
 
4553
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1009
4554
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:446
4555
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:213
4556
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:582
4557
  msgid "Course URL."
4558
  msgstr ""
4559
 
4560
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1016
4561
  msgid "Course Image URL."
4562
  msgstr ""
4563
 
4564
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1022
4565
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:453
4566
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:220
4567
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:589
4568
  msgid "The date the Course was created, in the site's timezone."
4569
  msgstr ""
4570
 
4571
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1029
4572
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:459
4573
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:226
4574
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:595
4575
  msgid "The date the Course was created, as GMT."
4576
  msgstr ""
4577
 
4578
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1036
4579
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:465
4580
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:232
4581
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:601
4582
  msgid "The date the Course was last modified, in the site's timezone."
4583
  msgstr ""
4584
 
4585
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1043
4586
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:471
4587
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:238
4588
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:607
4589
  msgid "The date the Course was last modified, as GMT."
4590
  msgstr ""
4591
 
4592
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1050
4593
+ msgid "Display courses if they are on sale."
4594
  msgstr ""
4595
 
4596
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1056
4597
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:477
4598
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:244
4599
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:613
4600
  msgid "Course status (post status)."
4601
  msgstr ""
4602
 
4603
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1063
4604
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:484
4605
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:251
4606
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:620
4607
+ msgid "Course content."
4608
  msgstr ""
4609
 
4610
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1068
4611
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:489
4612
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:256
4613
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:625
4614
  msgid "Retrieves the course excerpt.."
4615
  msgstr ""
4616
 
4617
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1078
4618
+ msgid "Count the number of enrolled students."
4619
  msgstr ""
4620
 
4621
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1084
4622
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:494
4623
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:630
4624
+ msgid "Can finish the course"
4625
  msgstr ""
4626
 
4627
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1090
4628
+ msgid "Can retake the course"
4629
  msgstr ""
4630
 
4631
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1096
4632
+ msgid "Total retakes"
4633
  msgstr ""
4634
 
4635
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1102
4636
  msgid "Retaken"
4637
  msgstr ""
4638
 
4639
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1108
4640
  msgid "Course Review add-on"
4641
  msgstr ""
4642
 
4643
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1114
4644
  msgid "Course Price"
4645
  msgstr ""
4646
 
4647
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1120
4648
  msgid "Course Price Rendered"
4649
  msgstr ""
4650
 
4651
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1126
4652
  msgid "Course Origin Price"
4653
  msgstr ""
4654
 
4655
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1132
4656
  msgid "Course Origin Price Rendered"
4657
  msgstr ""
4658
 
4659
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1138
4660
  msgid "Course Sale Price"
4661
  msgstr ""
4662
 
4663
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1144
4664
  msgid "Course Sale Price Rendered"
4665
  msgstr ""
4666
 
4667
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1150
4668
  msgid "List of categories."
4669
  msgstr ""
4670
 
4671
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1157
4672
  msgid "Category ID."
4673
  msgstr ""
4674
 
4675
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1162
4676
  msgid "Category name."
4677
  msgstr ""
4678
 
4679
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1168
4680
  msgid "Category slug."
4681
  msgstr ""
4682
 
4683
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1177
4684
  msgid "List of tags."
4685
  msgstr ""
4686
 
4687
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1184
4688
  msgid "Tag ID."
4689
  msgstr ""
4690
 
4691
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1189
4692
  msgid "Tag name."
4693
  msgstr ""
4694
 
4695
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1195
4696
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1222
4697
  msgid "Tag slug."
4698
  msgstr ""
4699
 
4700
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1204
4701
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1237
4702
  msgid "Retrieves the course sections and items.."
4703
  msgstr ""
4704
 
4705
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1211
4706
  msgid "User ID."
4707
  msgstr ""
4708
 
4709
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1216
4710
  msgid "Display name."
4711
  msgstr ""
4712
 
4713
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1228
4714
  msgid "Social Infor."
4715
  msgstr ""
4716
 
4717
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1244
4718
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:14
4719
  msgid "Section ID."
4720
  msgstr ""
4721
 
4722
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1249
4723
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:122
4724
  msgid "Section name."
4725
  msgstr ""
4726
 
4727
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1254
4728
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:14
4729
  msgid "Course ID."
4730
  msgstr ""
4731
 
4732
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1259
4733
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:127
4734
  msgid "Section description."
4735
  msgstr ""
4736
 
4737
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1264
4738
  msgid "Section items."
4739
  msgstr ""
4740
 
4741
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1269
4742
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1284
4743
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:510
4744
  #: inc/jwt/rest-api/version1/class-lp-rest-questions-v1-controller.php:266
4745
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:646
4747
  msgid "Item ID."
4748
  msgstr ""
4749
 
4750
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1274
4751
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:687
4752
  msgid "Item Type."
4753
  msgstr ""
4754
 
4755
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1279
4756
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:692
4757
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:721
4758
  msgid "Item title."
4759
  msgstr ""
4760
 
4761
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1289
4762
  msgid "Percent."
4763
  msgstr ""
4764
 
4765
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1294
4766
  msgid "Duration."
4767
  msgstr ""
4768
 
4769
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1299
4770
  msgid "Graduation."
4771
  msgstr ""
4772
 
4773
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1304
4774
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:542
4775
  msgid "Status."
4776
  msgstr ""
4777
 
4778
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1309
4779
  msgid "Locked."
4780
  msgstr ""
4781
 
4782
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1319
4783
  msgid "List of course user data."
4784
  msgstr ""
4785
 
4786
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1326
4787
  msgid "Graduation"
4788
  msgstr ""
4789
 
4790
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1337
4791
  msgid "Start time"
4792
  msgstr ""
4793
 
4794
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1343
4795
  #: templates/profile/tabs/courses/course-list.php:25
4796
  msgid "End time"
4797
  msgstr ""
4798
 
4799
+ #: inc/jwt/rest-api/version1/class-lp-rest-courses-v1-controller.php:1349
4800
  #: templates/profile/tabs/courses/course-list.php:24
4801
  msgid "Expiration time"
4802
  msgstr ""
4806
  msgstr ""
4807
 
4808
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:207
4809
+ msgid "Error: This lesson is not assigned in the Course."
4810
  msgstr ""
4811
 
4812
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:214
4813
+ #: inc/user/class-lp-user.php:434
4814
  msgid "Error: No Course or User available."
4815
  msgstr ""
4816
 
4817
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:220
4818
+ msgid "Error: Cannot complete the Lesson"
4819
  msgstr ""
4820
 
4821
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:224
4822
+ msgid "Congrats! You have completed the lesson successfully"
4823
  msgstr ""
4824
 
4825
  #: inc/jwt/rest-api/version1/class-lp-rest-lessons-v1-controller.php:505
4869
 
4870
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:14
4871
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:475
4872
+ msgid "The method '%s' not implemented. It must be overridden in the subclass."
4873
  msgstr ""
4874
 
4875
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:19
4891
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:506
4892
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:315
4893
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:143
4894
+ msgid "The current page of the collection."
4895
  msgstr ""
4896
 
4897
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:514
4898
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:323
4899
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:151
4900
+ msgid "The maximum number of items to be returned in the result set."
4901
  msgstr ""
4902
 
4903
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:523
4917
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:541
4918
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:345
4919
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:173
4920
+ msgid "Ensure the result set excludes specific IDs."
4921
  msgstr ""
4922
 
4923
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:550
4924
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:354
4925
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:182
4926
+ msgid "Limit the result set to specific IDs."
4927
  msgstr ""
4928
 
4929
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:559
4933
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:565
4934
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:332
4935
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:160
4936
+ msgid "Sorting attributes in ascending or descending order."
4937
  msgstr ""
4938
 
4939
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:572
4940
+ msgid "Sort collections by the object attribute."
4941
  msgstr ""
4942
 
4943
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:586
4944
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:602
4945
+ msgid "Limit the result set to posts assigned to specific authors."
4946
  msgstr ""
4947
 
4948
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:594
4949
+ msgid "Ensure the result set excludes posts assigned to specific authors."
4950
  msgstr ""
4951
 
4952
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:610
4954
  msgstr ""
4955
 
4956
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:618
4957
+ msgid "Limit the result set to those of particular parent IDs."
4958
  msgstr ""
4959
 
4960
  #: inc/jwt/rest-api/version1/class-lp-rest-posts-controller.php:627
4961
+ msgid "Limit the result set to all items except those of a particular parent ID."
4962
  msgstr ""
4963
 
4964
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:58
4972
  msgstr ""
4973
 
4974
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:102
4975
+ msgid "Answer all questions."
4976
  msgstr ""
4977
 
4978
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:231
4979
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:257
4980
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:285
4981
+ msgid "There is no Quiz ID or Quiz assigned in the course."
4982
  msgstr ""
4983
 
4984
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:292
4985
+ msgid "No Answer param."
4986
  msgstr ""
4987
 
4988
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:673
4989
+ msgid "List all of the Quiz Questions."
4990
  msgstr ""
4991
 
4992
  #: inc/jwt/rest-api/version1/class-lp-rest-quiz-v1-controller.php:677
5023
  msgstr ""
5024
 
5025
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:37
5026
+ msgid "Please assign a section to the Course."
5027
  msgstr ""
5028
 
5029
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:44
5030
  #: inc/jwt/rest-api/version1/class-lp-rest-sections-v1-controller.php:40
5031
+ #: inc/user/class-lp-user.php:289
5032
+ msgid "The course is not public"
5033
  msgstr ""
5034
 
5035
  #: inc/jwt/rest-api/version1/class-lp-rest-section-items-v1-controller.php:219
5113
  msgstr ""
5114
 
5115
  #: inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php:388
5116
+ msgid "Your password has been updated. Please log in again to continue!"
5117
  msgstr ""
5118
 
5119
  #: inc/lp-core-functions.php:732
5782
  msgstr ""
5783
 
5784
  #: inc/lp-core-functions.php:1403
5785
+ #: inc/lp-template-functions.php:1529
5786
  msgid "%s week"
5787
  msgid_plural "%s weeks"
5788
  msgstr[0] ""
5789
  msgstr[1] ""
5790
 
5791
  #: inc/lp-core-functions.php:1407
5792
+ #: inc/lp-template-functions.php:1525
5793
  msgid "%s day"
5794
  msgid_plural "%s days"
5795
  msgstr[0] ""
5796
  msgstr[1] ""
5797
 
5798
  #: inc/lp-core-functions.php:1412
5799
+ #: inc/lp-template-functions.php:1520
5800
  msgid "%s hour"
5801
  msgid_plural "%s hours"
5802
  msgstr[0] ""
5803
  msgstr[1] ""
5804
 
5805
  #: inc/lp-core-functions.php:1416
5806
+ #: inc/lp-template-functions.php:1514
5807
  msgid "%s minute"
5808
  msgid_plural "%s minutes"
5809
  msgstr[0] ""
5810
  msgstr[1] ""
5811
 
5812
+ #: inc/lp-core-functions.php:2218
5813
  msgid "Cart"
5814
  msgstr ""
5815
 
5816
+ #: inc/lp-core-functions.php:2222
5817
  msgid "Enable cart"
5818
  msgstr ""
5819
 
5820
+ #: inc/lp-core-functions.php:2223
5821
+ msgid "Check this option to enable users to purchase multiple courses at one time."
5822
  msgstr ""
5823
 
5824
+ #: inc/lp-core-functions.php:2232
5825
  msgid "Add to cart redirect"
5826
  msgstr ""
5827
 
5828
+ #: inc/lp-core-functions.php:2233
5829
+ msgid "Redirect to checkout immediately after adding the course to the cart."
5830
  msgstr ""
5831
 
5832
+ #: inc/lp-core-functions.php:2239
5833
  msgid "AJAX add to cart"
5834
  msgstr ""
5835
 
5836
+ #: inc/lp-core-functions.php:2240
5837
+ msgid "Using AJAX to add the course to the cart."
5838
  msgstr ""
5839
 
5840
+ #: inc/lp-core-functions.php:2246
5841
  msgid "Cart page"
5842
  msgstr ""
5843
 
5844
+ #: inc/lp-core-functions.php:2596
5845
  msgctxt "static-page-name"
5846
  msgid "Checkout"
5847
  msgstr ""
5848
 
5849
+ #: inc/lp-core-functions.php:2597
5850
  msgctxt "static-page-name"
5851
  msgid "Courses"
5852
  msgstr ""
5853
 
5854
+ #: inc/lp-core-functions.php:2598
5855
  msgctxt "static-page-name"
5856
  msgid "Profile"
5857
  msgstr ""
5858
 
5859
+ #: inc/lp-core-functions.php:2599
5860
  msgctxt "static-page-name"
5861
  msgid "Become a Teacher"
5862
  msgstr ""
5863
 
5864
+ #: inc/lp-core-functions.php:2984
5865
  msgid "Loading..."
5866
  msgstr ""
5867
 
5868
+ #: inc/lp-core-functions.php:2987
5869
+ msgid "Get A Passing Grade"
5870
  msgstr ""
5871
 
5872
+ #: inc/lp-core-functions.php:2992
5873
+ msgid "Evaluate by the number of completed lessons per the total number of lessons."
5874
  msgstr ""
5875
 
5876
+ #: inc/lp-core-functions.php:2993
5877
+ msgid "E.g: If a course has 10 lessons and a user completes 5 lessons, then the result is 5/10 (50%)."
5878
  msgstr ""
5879
 
5880
+ #: inc/lp-core-functions.php:2995
5881
+ msgid "Evaluate by the result of the final quiz in the course. You have to add a quiz at the end of the course."
5882
  msgstr ""
5883
 
5884
+ #: inc/lp-core-functions.php:3001
5885
+ msgid "Evaluate by the number of passed quizzes per the total number of quizzes."
5886
  msgstr ""
5887
 
5888
+ #: inc/lp-core-functions.php:3002
5889
+ msgid "E.g: If the course has 10 quizzes and the user passes 5 quizzes, then the result is 5/10 (50%)."
5890
  msgstr ""
5891
 
5892
+ #: inc/lp-core-functions.php:3009
5893
+ msgid "Evaluate by the number of correct answers per the total number of questions."
5894
  msgstr ""
5895
 
5896
+ #: inc/lp-core-functions.php:3010
5897
+ msgid "E.g: If the course has 10 questions and the user corrects 5 questions, then the result is 5/10 (50%)."
5898
  msgstr ""
5899
 
5900
+ #: inc/lp-core-functions.php:3015
5901
+ msgid "Evaluate by the number of achieved scores per the total score of the questions."
5902
  msgstr ""
5903
 
5904
+ #: inc/lp-core-functions.php:3021
5905
  msgid "Evaluate via lessons"
5906
  msgstr ""
5907
 
5908
+ #: inc/lp-core-functions.php:3025
5909
  msgid "Evaluate via results of the final quiz"
5910
  msgstr ""
5911
 
5912
+ #: inc/lp-core-functions.php:3029
5913
+ msgid "Evaluate via passed quizzes"
5914
  msgstr ""
5915
 
5916
+ #: inc/lp-core-functions.php:3033
5917
  msgid "Evaluate via questions"
5918
  msgstr ""
5919
 
5920
+ #: inc/lp-core-functions.php:3037
5921
  msgid "Evaluate via mark"
5922
  msgstr ""
5923
 
5924
+ #: inc/lp-core-functions.php:3183
5925
+ msgid "Heads up! Please backup before upgrading!"
5926
  msgstr ""
5927
 
5928
+ #: inc/lp-core-functions.php:3186
5929
  msgid "The latest update includes some substantial changes across different areas of the plugin. We highly recommend you backup your site before upgrading, and make sure you first update in a staging environment"
5930
  msgstr ""
5931
 
 
 
 
 
5932
  #: inc/lp-deprecated.php:353
5933
  msgid "Learning"
5934
  msgstr ""
5936
  #: inc/lp-deprecated.php:355
5937
  #: inc/lp-deprecated.php:386
5938
  #: inc/templates/class-lp-template-profile.php:102
5939
+ #: inc/user-item/class-lp-user-item.php:762
5940
+ #: inc/user/class-lp-profile.php:876
5941
+ #: inc/user/class-lp-profile.php:910
5942
  msgid "Finished"
5943
  msgstr ""
5944
 
5953
  msgstr ""
5954
 
5955
  #: inc/lp-deprecated.php:2190
5956
+ msgid "Fill out the form and send us your request"
5957
  msgstr ""
5958
 
5959
  #: inc/lp-deprecated.php:2229
5989
  msgid "Overview"
5990
  msgstr ""
5991
 
5992
+ #: inc/lp-template-functions.php:981
5993
+ #: inc/lp-template-functions.php:1167
5994
  #: inc/templates/class-lp-template-course.php:132
5995
  msgid "Final"
5996
  msgstr ""
5997
 
5998
+ #: inc/lp-template-functions.php:1403
5999
  msgid "Course Sidebar"
6000
  msgstr ""
6001
 
6002
+ #: inc/lp-template-functions.php:1405
6003
+ msgid "Widgets in this area will be shown in a single course"
6004
  msgstr ""
6005
 
6006
+ #: inc/lp-template-functions.php:1414
6007
  msgid "All Courses"
6008
  msgstr ""
6009
 
6010
+ #: inc/lp-template-functions.php:1416
6011
+ msgid "Widgets in this area will be shown on all course pages"
6012
  msgstr ""
6013
 
6014
+ #: inc/lp-template-functions.php:1553
6015
+ #: inc/lp-template-functions.php:1562
6016
  msgid "All levels"
6017
  msgstr ""
6018
 
6019
+ #: inc/lp-template-functions.php:1563
6020
  msgid "Beginner"
6021
  msgstr ""
6022
 
6023
+ #: inc/lp-template-functions.php:1564
6024
  msgid "Intermediate"
6025
  msgstr ""
6026
 
6027
+ #: inc/lp-template-functions.php:1565
6028
  msgid "Expert"
6029
  msgstr ""
6030
 
6033
  msgstr ""
6034
 
6035
  #: inc/lp-webhooks.php:90
6036
+ msgid "The LearnPress webhook process is complete"
6037
  msgstr ""
6038
 
6039
+ #: inc/order/class-lp-order.php:186
6040
+ #: inc/order/class-lp-order.php:196
6041
  #: templates/checkout/order-received.php:38
6042
  msgid "Thank you. Your order has been received."
6043
  msgstr ""
6044
 
6045
+ #: inc/order/class-lp-order.php:345
6046
  msgid "Removed"
6047
  msgstr ""
6048
 
6049
+ #: inc/order/class-lp-order.php:454
6050
  msgid "%s (Guest)"
6051
  msgstr ""
6052
 
6053
+ #: inc/order/class-lp-order.php:1002
6054
  msgctxt "full name"
6055
  msgid "%1$s"
6056
  msgstr ""
6057
 
6058
+ #: inc/order/class-lp-order.php:1114
6059
  msgid "Order on"
6060
  msgstr ""
6061
 
6115
  msgstr[1] ""
6116
 
6117
  #: inc/order/lp-order-functions.php:743
6118
+ msgid "Order received in case a user purchases a course but doesn't finalize the order."
6119
  msgstr ""
6120
 
6121
  #: inc/order/lp-order-functions.php:744
6123
  msgstr ""
6124
 
6125
  #: inc/order/lp-order-functions.php:745
6126
+ msgid "The order is fulfilled and completed."
6127
  msgstr ""
6128
 
6129
  #: inc/order/lp-order-functions.php:746
6135
  msgstr ""
6136
 
6137
  #: inc/order/lp-order-functions.php:787
6138
+ msgid "The order is cancelled by the customer"
6139
  msgstr ""
6140
 
6141
  #: inc/order/lp-order-functions.php:790
6143
  msgstr ""
6144
 
6145
  #: inc/order/lp-order-functions.php:793
6146
+ msgid "The order number <strong>%s</strong> can not be cancelled."
6147
  msgstr ""
6148
 
6149
  #: inc/question/class-lp-question-true-or-false.php:49
6182
  msgid "Third option"
6183
  msgstr ""
6184
 
6185
+ #: inc/quiz/class-lp-quiz.php:519
6186
  msgid "Unlimited"
6187
  msgstr ""
6188
 
6189
+ #: inc/quiz/class-lp-quiz.php:574
6190
  msgid "Finish quiz"
6191
  msgstr ""
6192
 
6193
+ #: inc/quiz/class-lp-quiz.php:575
6194
  msgid "Are you sure you want to finish this quiz?"
6195
  msgstr ""
6196
 
6197
+ #: inc/quiz/class-lp-quiz.php:578
6198
  msgid "Retake quiz"
6199
  msgstr ""
6200
 
6201
+ #: inc/quiz/class-lp-quiz.php:579
6202
  msgid "Are you sure you want to retake this quiz?"
6203
  msgstr ""
6204
 
6205
+ #: inc/quiz/class-lp-quiz.php:582
6206
  msgid "Time's up!"
6207
  msgstr ""
6208
 
6209
+ #: inc/quiz/class-lp-quiz.php:583
6210
+ msgid "The time is up! Your quiz will automatically come to an end"
6211
  msgstr ""
6212
 
6213
+ #: inc/quiz/class-lp-quiz.php:585
6214
  msgid "Congrats! You have finished this quiz"
6215
  msgstr ""
6216
 
6217
+ #: inc/quiz/class-lp-quiz.php:586
6218
  msgid "Congrats! You have re-taken this quiz. Please wait a moment and the page will reload"
6219
  msgstr ""
6220
 
 
 
 
 
6221
  #: inc/rest-api/v1/admin/class-lp-admin-rest-course-controller.php:50
6222
  msgid "No Course ID available!"
6223
  msgstr ""
6268
  msgstr ""
6269
 
6270
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:300
6271
+ msgid "Error: Cannot enroll in the course."
6272
  msgstr ""
6273
 
6274
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:321
6275
+ msgid "Error: Cannot Enroll in the course."
6276
  msgstr ""
6277
 
6278
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:361
6279
+ msgid "Congrats! You have enrolled in the course successfully. Redirecting..."
6280
  msgstr ""
6281
 
6282
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:379
6283
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:503
6284
+ msgid "Error: Please set up a page for checkout."
6285
  msgstr ""
6286
 
6287
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:384
6297
  msgstr ""
6298
 
6299
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:426
6300
+ msgid "Error: Cannot purchase the course!"
6301
  msgstr ""
6302
 
6303
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:449
6321
  msgstr ""
6322
 
6323
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:541
6324
+ #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:674
6325
  #: inc/user/abstract-lp-user.php:853
6326
  msgid "Invalid course"
6327
  msgstr ""
6328
 
6329
  #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:553
6330
+ msgid "You can't retry the course"
6331
+ msgstr ""
6332
+
6333
+ #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:558
6334
+ msgid "Invalid course data of user"
6335
  msgstr ""
6336
 
6337
+ #: inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php:582
6338
  msgid "Now you can learn this course"
6339
  msgstr ""
6340
 
6341
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:67
6342
+ #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:118
6343
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:173
6344
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:178
6345
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:162
6346
+ #: inc/widgets/course-progress.php:65
6347
+ msgid "The course is invalid!"
6348
  msgstr ""
6349
 
6350
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:71
6351
+ msgid "The course is not required to enroll!"
 
 
 
 
 
6352
  msgstr ""
6353
 
6354
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:125
6355
+ msgid "You are a Guest"
6356
  msgstr ""
6357
 
6358
  #: inc/rest-api/v1/frontend/class-lp-rest-lazy-load-controller.php:257
6359
+ msgid "The section is invalid!"
6360
  msgstr ""
6361
 
6362
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:111
6369
 
6370
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:127
6371
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:182
6372
+ msgid "The upload directory is not writable"
6373
  msgstr ""
6374
 
6375
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:149
6376
+ msgid "Cannot write the file"
6377
  msgstr ""
6378
 
6379
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:155
6381
  msgstr ""
6382
 
6383
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:170
6384
+ #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:337
6385
+ msgid "The user is invalid"
6386
  msgstr ""
6387
 
6388
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:194
6389
+ msgid "The profile picture has been removed successfully"
6390
  msgstr ""
6391
 
6392
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:211
6395
  msgstr ""
6396
 
6397
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:217
6398
+ msgid "The user does not exist!"
6399
  msgstr ""
6400
 
6401
  #: inc/rest-api/v1/frontend/class-lp-rest-profile-controller.php:283
6406
  msgid "No User available!"
6407
  msgstr ""
6408
 
 
 
 
 
6409
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:95
6410
+ msgid "The ID of the course item object."
6411
  msgstr ""
6412
 
6413
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:101
6414
+ msgid "The ID of the course object."
6415
  msgstr ""
6416
 
6417
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:122
6419
  msgstr ""
6420
 
6421
  #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:166
6422
+ #: inc/rest-api/v1/frontend/class-lp-rest-users-controller.php:281
6423
+ msgid "The quiz is invalid!"
6424
  msgstr ""
6425
 
6426
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:74
6433
  msgstr ""
6434
 
6435
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:77
6436
+ msgid "You have already sent the request. Please wait for the approval."
6437
  msgstr ""
6438
 
6439
  #: inc/shortcodes/class-lp-shortcode-become-a-teacher.php:79
6450
  msgstr ""
6451
 
6452
  #: inc/shortcodes/class-lp-shortcode-profile.php:53
6453
+ msgid "You can't view the user profile"
6454
  msgstr ""
6455
 
6456
  #: inc/templates/class-lp-template-course.php:311
6494
  msgstr ""
6495
 
6496
  #: inc/user-item/class-lp-user-item-quiz.php:747
6497
+ msgid "The question is invalid!"
6498
  msgstr ""
6499
 
6500
  #: inc/user-item/class-lp-user-item-quiz.php:752
6501
+ msgid "Cannot check the answer to the question."
6502
  msgstr ""
6503
 
6504
+ #: inc/user-item/class-lp-user-item.php:758
6505
  #: templates/profile/tabs/courses.php:33
6506
  msgid "Enrolled"
6507
  msgstr ""
6508
 
6509
+ #: inc/user-item/class-lp-user-item.php:761
6510
  msgid "Started"
6511
  msgstr ""
6512
 
6513
+ #: inc/user-item/class-lp-user-item.php:769
6514
  msgid "Not Enrolled"
6515
  msgstr ""
6516
 
6517
+ #: inc/user/abstract-lp-user.php:561
6518
+ msgid "You can not hint at the question."
6519
  msgstr ""
6520
 
6521
+ #: inc/user/abstract-lp-user.php:628
6522
  #: inc/user/abstract-lp-user.php:779
6523
  #: inc/user/abstract-lp-user.php:791
6524
+ msgid "The role %s for the user doesn't exist"
6525
  msgstr ""
6526
 
6527
  #: inc/user/abstract-lp-user.php:858
6537
  msgstr ""
6538
 
6539
  #: inc/user/class-lp-profile.php:79
6540
+ msgid "Account information updated successfully."
6541
  msgstr ""
6542
 
6543
  #: inc/user/class-lp-profile.php:80
6544
+ msgid "Account avatar updated successfully."
6545
  msgstr ""
6546
 
6547
  #: inc/user/class-lp-profile.php:81
6548
+ msgid "Password updated successfully."
6549
  msgstr ""
6550
 
6551
  #: inc/user/class-lp-profile.php:82
6552
+ msgid "Account privacy updated successfully."
6553
  msgstr ""
6554
 
6555
+ #: inc/user/class-lp-profile.php:299
6556
  msgid "Logout"
6557
  msgstr ""
6558
 
6559
+ #: inc/user/class-lp-profile.php:308
6560
  msgid "Avatar"
6561
  msgstr ""
6562
 
6563
+ #: inc/user/class-lp-profile.php:318
6564
  msgid "Privacy"
6565
  msgstr ""
6566
 
6567
+ #: inc/user/class-lp-profile.php:604
6568
  msgid "Public your profile courses."
6569
  msgstr ""
6570
 
6571
+ #: inc/user/class-lp-profile.php:611
6572
  msgid "Public your profile quizzes."
6573
  msgstr ""
6574
 
6575
+ #: inc/user/class-lp-profile.php:879
6576
  msgid "Not enrolled"
6577
  msgstr ""
6578
 
6579
+ #: inc/user/class-lp-profile.php:1114
6580
  msgid "User Avatar"
6581
  msgstr ""
6582
 
6583
  #: inc/user/class-lp-user.php:21
6584
  #: inc/user/class-lp-user.php:74
6585
+ msgid "This content is protected. Please enroll in the course to view this content!"
6586
  msgstr ""
6587
 
6588
  #: inc/user/class-lp-user.php:45
6589
+ msgid "This content is protected. Please log in or enroll in the course to view this content!"
6590
  msgstr ""
6591
 
6592
  #: inc/user/class-lp-user.php:62
6593
+ msgid "You finished this course. This content is protected. Please enroll in the course to view this content!"
6594
  msgstr ""
6595
 
6596
  #: inc/user/class-lp-user.php:68
6597
  #: templates/global/block-content.php:16
6598
+ msgid "The content of this item has been blocked because the course has exceeded its duration."
6599
  msgstr ""
6600
 
6601
+ #: inc/user/class-lp-user.php:221
6602
+ #: inc/user/class-lp-user.php:444
6603
+ msgid "The course is not enrolled."
6604
  msgstr ""
6605
 
6606
+ #: inc/user/class-lp-user.php:285
6607
  msgid "No Course or User available"
6608
  msgstr ""
6609
 
6610
+ #: inc/user/class-lp-user.php:293
6611
+ msgid "The course is external"
6612
  msgstr ""
6613
 
6614
+ #: inc/user/class-lp-user.php:297
6615
+ msgid "The course is full of students."
6616
  msgstr ""
6617
 
6618
+ #: inc/user/class-lp-user.php:301
6619
+ msgid "The course is not required to enroll."
6620
  msgstr ""
6621
 
6622
+ #: inc/user/class-lp-user.php:305
6623
+ msgid "The course is not purchased."
6624
  msgstr ""
6625
 
6626
+ #: inc/user/class-lp-user.php:309
6627
  msgid "This course is already enrolled."
6628
  msgstr ""
6629
 
6630
+ #: inc/user/class-lp-user.php:368
6631
  msgid "This course is out of stock"
6632
  msgstr ""
6633
 
6634
+ #: inc/user/class-lp-user.php:383
6635
  msgid "Your order is waiting for processing"
6636
  msgstr ""
6637
 
6638
+ #: inc/user/class-lp-user.php:440
6639
+ msgid "The course has finished."
 
 
 
 
6640
  msgstr ""
6641
 
6642
+ #: inc/user/class-lp-user.php:448
6643
+ msgid "Error: The course is not in progress."
6644
  msgstr ""
6645
 
6646
+ #: inc/user/class-lp-user.php:473
6647
+ msgid "Error: Filter the disabled finished courses."
6648
  msgstr ""
6649
 
6650
+ #: inc/user/class-lp-user.php:498
6651
  msgid "You cannot start a quiz in preview mode."
6652
  msgstr ""
6653
 
6654
+ #: inc/user/class-lp-user.php:507
6655
+ #: inc/user/class-lp-user.php:647
6656
+ msgid "The course does not exist or does not contain a quiz."
6657
  msgstr ""
6658
 
6659
+ #: inc/user/class-lp-user.php:518
6660
  msgid "You have already finished the course of this quiz"
6661
  msgstr ""
6662
 
6663
+ #: inc/user/class-lp-user.php:526
6664
+ msgid "Please enroll in the course before starting the quiz."
6665
  msgstr ""
6666
 
6667
+ #: inc/user/class-lp-user.php:535
6668
+ msgid "The user has started or completed the quiz."
6669
  msgstr ""
6670
 
6671
+ #: inc/user/class-lp-user.php:544
6672
+ msgid "You have to log in to start the quiz."
6673
  msgstr ""
6674
 
6675
+ #: inc/user/class-lp-user.php:599
6676
+ msgid "The user has already finished the course of this quiz."
6677
  msgstr ""
6678
 
6679
+ #: inc/user/class-lp-user.php:608
6680
+ msgid "The user has completed the quiz"
6681
  msgstr ""
6682
 
6683
+ #: inc/user/class-lp-user.php:662
 
 
 
 
6684
  msgid "You can not redo a quiz in a finished course."
6685
  msgstr ""
6686
 
6687
+ #: inc/user/class-lp-user.php:675
6688
+ msgid "%1$s::%2$s - The ser has not completed the quiz."
6689
  msgstr ""
6690
 
6691
+ #: inc/user/class-lp-user.php:688
6692
+ msgid "%1$s::%2$s - Your quiz can't be retaken."
6693
  msgstr ""
6694
 
6695
+ #: inc/user/lp-user-functions.php:379
6696
  msgid "Want to become an instructor?"
6697
  msgstr ""
6698
 
6699
+ #: inc/user/lp-user-functions.php:889
6700
+ msgid "Please log in to enroll in this course"
6701
  msgstr ""
6702
 
6703
+ #: inc/user/lp-user-functions.php:907
6704
+ msgid "You have already finished the course"
6705
  msgstr ""
6706
 
6707
+ #: inc/user/lp-user-functions.php:910
6708
  msgid "You have already enrolled in this course"
6709
  msgstr ""
6710
 
6711
+ #: inc/user/lp-user-functions.php:1083
6712
+ msgid "The old password is incorrect!"
6713
  msgstr ""
6714
 
6715
+ #: inc/user/lp-user-functions.php:1089
6716
+ msgid "Incorrect confirmation password!"
6717
  msgstr ""
6718
 
6719
+ #: inc/user/lp-user-functions.php:1382
6720
  msgid "Invalid item id."
6721
  msgstr ""
6722
 
6723
+ #: inc/user/lp-user-functions.php:1417
6724
  msgid "Invalid item data."
6725
  msgstr ""
6726
 
6727
+ #: inc/user/lp-user-functions.php:1586
6728
  msgid "Invalid Course ID."
6729
  msgstr ""
6730
 
6731
+ #: inc/user/lp-user-functions.php:1606
6732
  msgid "Invalid Quiz"
6733
  msgstr ""
6734
 
6735
+ #: inc/user/lp-user-functions.php:2006
6736
  msgid "Facebook Profile"
6737
  msgstr ""
6738
 
6739
+ #: inc/user/lp-user-functions.php:2009
6740
  msgid "Twitter Profile"
6741
  msgstr ""
6742
 
6743
+ #: inc/user/lp-user-functions.php:2012
6744
  msgid "Google Profile"
6745
  msgstr ""
6746
 
6747
+ #: inc/user/lp-user-functions.php:2015
6748
  msgid "Youtube Channel"
6749
  msgstr ""
6750
 
6751
+ #: inc/user/lp-user-functions.php:2018
6752
  msgid "Linkedin Profile"
6753
  msgstr ""
6754
 
6808
  msgstr ""
6809
 
6810
  #: inc/widgets/course-progress.php:56
6811
+ msgid "You need to log in to view the Course Progress"
6812
  msgstr ""
6813
 
6814
  #: inc/widgets/course-progress.php:60
6904
  msgid "Recent Courses"
6905
  msgstr ""
6906
 
6907
+ #: learnpress.php:484
6908
  msgid "Documentation"
6909
  msgstr ""
6910
 
6911
+ #: learnpress.php:496
6912
+ msgid "The LearnPress plugin base directory must be <strong>learnpress/learnpres.php</strong> (case sensitive) to ensure all functions work properly and are fully operational (currently <strong>%s</strong>)"
6913
  msgstr ""
6914
 
6915
  #: templates/checkout/account-logged-in.php:23
6973
  msgstr ""
6974
 
6975
  #: templates/checkout/form.php:21
6976
+ msgid "Please log in to enroll in the course!"
6977
  msgstr ""
6978
 
6979
  #: templates/checkout/guest-checkout-link.php:16
6994
  msgstr ""
6995
 
6996
  #: templates/checkout/guest-checkout.php:26
6997
+ msgid "An order key to activate the course will be sent to your email after the payment has proceeded successfully."
6998
  msgstr ""
6999
 
7000
  #: templates/checkout/guest-checkout.php:35
7053
  msgstr ""
7054
 
7055
  #: templates/content-lesson/button-complete.php:22
7056
+ msgid "Do you want to complete the lesson?"
7057
  msgstr ""
7058
 
7059
  #: templates/content-lesson/button-complete.php:31
7069
  msgstr ""
7070
 
7071
  #: templates/content-lesson/content.php:24
7072
+ msgid "The lesson content is empty."
7073
  msgstr ""
7074
 
7075
  #: templates/content-quiz/js.php:146
7112
  msgstr ""
7113
 
7114
  #: templates/global/before-main-content.php:25
7115
+ msgid "The LearnPress <strong>Checkout</strong> page is not set up."
7116
  msgstr ""
7117
 
7118
  #: templates/global/before-main-content.php:28
7119
+ msgid "Please contact the administrator to set up this page."
7120
  msgstr ""
7121
 
7122
  #: templates/global/before-main-content.php:30
7142
  msgstr ""
7143
 
7144
  #: templates/global/no-courses-found.php:15
7145
+ msgid "No courses were found to match your selection."
7146
  msgstr ""
7147
 
7148
  #: templates/loop/single-course/loop-section.php:27
7192
  msgstr ""
7193
 
7194
  #: templates/pages/profile.php:36
7195
+ msgid "This user does not make their profile public."
7196
  msgstr ""
7197
 
7198
  #: templates/profile/not-logged-in.php:16
7204
  msgstr ""
7205
 
7206
  #: templates/profile/tabs/courses/course-grid.php:48
7207
+ #: templates/profile/tabs/courses/course-list.php:71
7208
  msgid "View more"
7209
  msgstr ""
7210
 
7216
  msgstr ""
7217
 
7218
  #: templates/profile/tabs/courses/general-statistic.php:26
7219
+ msgid "Total enrolled courses"
7220
  msgstr ""
7221
 
7222
  #: templates/profile/tabs/courses/general-statistic.php:27
7224
  msgstr ""
7225
 
7226
  #: templates/profile/tabs/courses/general-statistic.php:30
7227
+ msgid "The total number of courses is being learned"
7228
  msgstr ""
7229
 
7230
  #: templates/profile/tabs/courses/general-statistic.php:31
7232
  msgstr ""
7233
 
7234
  #: templates/profile/tabs/courses/general-statistic.php:34
7235
+ msgid "Total courses have finished"
7236
  msgstr ""
7237
 
7238
  #: templates/profile/tabs/courses/general-statistic.php:35
7240
  msgstr ""
7241
 
7242
  #: templates/profile/tabs/courses/general-statistic.php:49
7243
+ msgid "Total created courses"
7244
  msgstr ""
7245
 
7246
  #: templates/profile/tabs/courses/general-statistic.php:50
7248
  msgstr ""
7249
 
7250
  #: templates/profile/tabs/courses/general-statistic.php:53
7251
+ msgid "Total attended students"
7252
  msgstr ""
7253
 
7254
  #: templates/profile/tabs/courses/general-statistic.php:54
7272
  msgstr ""
7273
 
7274
  #: templates/profile/tabs/orders/recover-order.php:16
7275
+ msgid "If you have a valid order key, you can recover it here."
7276
  msgstr ""
7277
 
7278
  #: templates/profile/tabs/orders/recover-order.php:17
7279
+ msgid "When you checkout as a Guest, an order key will be sent to your email. You can use the order key to create an order."
7280
  msgstr ""
7281
 
7282
  #: templates/profile/tabs/quizzes.php:56
7316
  msgstr ""
7317
 
7318
  #: templates/profile/tabs/settings/change-password.php:45
7319
+ msgid "The new password does not match!"
7320
  msgstr ""
7321
 
7322
  #: templates/shortcode/list-courses.php:49
7336
  msgstr ""
7337
 
7338
  #: templates/single-course/buttons/retry.php:25
7339
+ msgid "Do you want to retake the course"
7340
  msgstr ""
7341
 
7342
  #: templates/single-course/buttons/retry.php:40
7359
 
7360
  #: templates/single-course/content-item/popup-sidebar.php:15
7361
  msgctxt "search course input placeholder"
7362
+ msgid "Search for course content"
7363
  msgstr ""
7364
 
7365
  #: templates/single-course/content-protected.php:22
7366
+ msgid "This content is protected, please <a class=\\\"lp-link-login\\\" href=\\\"%s\\\">login</a> and enroll in the course to view this content!"
7367
  msgstr ""
7368
 
7369
  #: templates/single-course/featured-review.php:18
7395
  msgid "Lifetime access"
7396
  msgstr ""
7397
 
7398
+ #: templates/single-course/sidebar/user-progress.php:25
7399
  msgid "Lessons completed:"
7400
  msgstr ""
7401
 
7402
+ #: templates/single-course/sidebar/user-progress.php:37
7403
  msgid "Quizzes finished:"
7404
  msgstr ""
7405
 
7406
+ #: templates/single-course/sidebar/user-progress.php:39
7407
  msgid "Failed %1$d, Passed %2$d"
7408
  msgstr ""
7409
 
7410
+ #: templates/single-course/sidebar/user-progress.php:39
7411
  msgid "%1$d/%2$d"
7412
  msgstr ""
7413
 
7414
+ #: templates/single-course/sidebar/user-progress.php:63
7415
  msgid "Passing condition: %s%%"
7416
  msgstr ""
7417
 
7434
 
7435
  #: templates/single-course/tabs/curriculum-v2.php:39
7436
  #: templates/single-course/tabs/curriculum.php:56
7437
+ msgid "The curriculum is empty"
7438
  msgstr ""
7439
 
7440
  #: templates/single-course/tabs/curriculum-v2.php:47
7446
  msgstr ""
7447
 
7448
  #: templates/single-course/tabs/tabs.php:41
7449
+ msgid "This course has been blocked for expiration"
7450
  msgstr ""
7451
 
7452
  #: assets/js/dist/frontend/quiz.min.js:288
7476
 
7477
  #. translators: %s is the template title
7478
  #: assets/js/dist/frontend/quiz.min.js:32
7479
+ msgid "This is an editor placeholder for the %s. This will be replaced by the template in your store and displayed with your course image(s), title, price, and so on. You can move this placeholder around and add further blocks around it to extend the template."
7480
  msgstr ""
7481
 
7482
  #: assets/js/dist/frontend/quiz.min.js:13
7484
  msgstr ""
7485
 
7486
  #: assets/js/dist/frontend/quiz.min.js:131
7487
+ msgid "The file size is too large. You need to upload a file < 2MB."
7488
  msgstr ""
7489
 
7490
  #: assets/js/dist/frontend/quiz.min.js:133
7491
+ msgid "The image size must be greater than or equal to %1$sx%2$spx"
7492
  msgstr ""
7493
 
7494
  #: assets/js/dist/frontend/quiz.min.js:146
7508
  msgstr ""
7509
 
7510
  #: assets/js/dist/frontend/quiz.min.js:147
7511
+ msgid "The render function should be overwritten from the base."
7512
  msgstr ""
7513
 
7514
  #: assets/js/dist/frontend/quiz.min.js:208
7524
  msgstr ""
7525
 
7526
  #: assets/js/dist/frontend/quiz.min.js:15
7527
+ msgid "Last Attempt"
7528
  msgstr ""
7529
 
7530
  #: assets/js/dist/frontend/quiz.min.js:23
7536
  msgstr ""
7537
 
7538
  #: assets/js/dist/frontend/quiz.min.js:40
7539
+ msgid "Check answers"
7540
  msgstr ""
7541
 
7542
  #: assets/js/dist/frontend/quiz.min.js:43
7543
+ msgid "You need to answer the question before checking the answer key."
7544
  msgstr ""
7545
 
7546
  #: assets/js/dist/frontend/quiz.min.js:17
7547
+ msgid "Are you sure you want to retake the quiz?"
7548
  msgstr ""
7549
 
7550
  #: assets/js/dist/frontend/quiz.min.js:105
7551
  #: assets/js/dist/frontend/quiz.min.js:67
7552
+ msgid "Are you sure to submit the quiz?"
7553
  msgstr ""
7554
 
7555
  #: assets/js/dist/frontend/quiz.min.js:159
learnpress.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://thimpress.com/learnpress
5
  * Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  * Author: ThimPress
7
- * Version: 4.1.7.2
8
  * Author URI: http://thimpress.com
9
  * Requires at least: 5.6
10
  * Tested up to: 6.0
@@ -348,7 +348,6 @@ if ( ! class_exists( 'LearnPress' ) ) {
348
  require_once 'inc/course/lp-course-functions.php';
349
  require_once 'inc/course/abstract-course.php';
350
  require_once 'inc/course/class-lp-course.php';
351
- //require_once 'inc/course/class-lp-course-utils.php';
352
  require_once 'inc/quiz/lp-quiz-functions.php';
353
  require_once 'inc/quiz/class-lp-quiz.php';
354
  require_once 'inc/lesson/lp-lesson-functions.php';
@@ -495,7 +494,7 @@ if ( ! class_exists( 'LearnPress' ) ) {
495
  <?php
496
  printf(
497
  __(
498
- 'LearnPress plugin base directory must be <strong>learnpress/learnpres.php</strong> (case sensitive) to ensure all functions work properly and fully operational (currently <strong>%s</strong>)',
499
  'learnpress'
500
  ),
501
  LP_PLUGIN_BASENAME
@@ -653,11 +652,10 @@ if ( ! class_exists( 'LearnPress' ) ) {
653
  * @since 3.3.0
654
  */
655
  public function template( $type = '' ) {
656
- if ( ! $this->template ) {
657
- $this->template = LP_Template::instance();
658
- }
659
 
660
- return isset( $this->template[ $type ] ) ? $this->template[ $type ] : $this->template;
661
  }
662
 
663
  /**
@@ -835,14 +833,6 @@ if ( ! class_exists( 'LearnPress' ) ) {
835
  return self::$_instance;
836
  }
837
 
838
- public function admin_notice_require_addon_version() {
839
- ?>
840
- <div class="notice notice-error">
841
- <p><?php echo( '<strong>LearnPress version ' . LEARNPRESS_VERSION . ' require Addon</strong> version 4.0.0 or higher' ); ?></p>
842
- </div>
843
- <?php
844
- }
845
-
846
  /**
847
  * Copy class-lp-mu-plugin.php to mu_plugins folder
848
  *
4
  * Plugin URI: http://thimpress.com/learnpress
5
  * Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  * Author: ThimPress
7
+ * Version: 4.1.7.3
8
  * Author URI: http://thimpress.com
9
  * Requires at least: 5.6
10
  * Tested up to: 6.0
348
  require_once 'inc/course/lp-course-functions.php';
349
  require_once 'inc/course/abstract-course.php';
350
  require_once 'inc/course/class-lp-course.php';
 
351
  require_once 'inc/quiz/lp-quiz-functions.php';
352
  require_once 'inc/quiz/class-lp-quiz.php';
353
  require_once 'inc/lesson/lp-lesson-functions.php';
494
  <?php
495
  printf(
496
  __(
497
+ 'The LearnPress plugin base directory must be <strong>learnpress/learnpres.php</strong> (case sensitive) to ensure all functions work properly and are fully operational (currently <strong>%s</strong>)',
498
  'learnpress'
499
  ),
500
  LP_PLUGIN_BASENAME
652
  * @since 3.3.0
653
  */
654
  public function template( $type = '' ) {
655
+ $this->template = LP_Template::instance();
656
+ $templates = (array) $this->template->get_templates();
 
657
 
658
+ return $templates[ $type ] ?? $this->template;
659
  }
660
 
661
  /**
833
  return self::$_instance;
834
  }
835
 
 
 
 
 
 
 
 
 
836
  /**
837
  * Copy class-lp-mu-plugin.php to mu_plugins folder
838
  *
mu-plugin/class-lp-mu-plugin.php DELETED
@@ -1,149 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_MU_Plugin
5
- *
6
- * @since 4.1.7.1
7
- * @version 1.0.0
8
- */
9
- class LP_MU_Plugin {
10
- public static $version = 1;
11
-
12
- public static function instance() {
13
- static $instance = null;
14
- if ( is_null( $instance ) ) {
15
- $instance = new self();
16
- }
17
-
18
- return $instance;
19
- }
20
-
21
- private function __construct() {
22
- add_filter( 'option_active_plugins', [ $this, 'load_plugins' ], -1 );
23
- }
24
-
25
- /**
26
- * Handle list plugins can load in REST API LP
27
- * Not handle if called from deactivate_plugins or is_plugin_active function.
28
- *
29
- * @param $plugins
30
- *
31
- * @return array|mixed
32
- */
33
- public function load_plugins( $plugins_activating ) {
34
- try {
35
- $url_load_plugins = $this->getPluginsMustLoadInUrl();
36
- if ( ! $url_load_plugins ) {
37
- return $plugins_activating;
38
- }
39
-
40
- // Not handle if call from deactivate_plugins or is_plugin_active function.
41
- $methods_called_to = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
42
- foreach ( $methods_called_to as $method ) {
43
- if ( $method['function'] === 'deactivate_plugins' || $method['function'] === 'is_plugin_active' ) {
44
- return $plugins_activating;
45
- }
46
- }
47
-
48
- remove_all_actions( 'setup_theme' );
49
- remove_all_actions( 'after_setup_theme' );
50
-
51
- $plugins_load = [];
52
-
53
- foreach ( $url_load_plugins as $plugin => $plugin_dependencies ) {
54
- if ( in_array( $plugin, $plugins_activating, true ) ) {
55
- $plugins_load[] = $plugin;
56
-
57
- foreach ( $plugin_dependencies as $dependency ) {
58
- if ( in_array( $dependency, $plugins_activating, true ) ) {
59
- $plugins_load[] = $dependency;
60
- }
61
- }
62
- }
63
- }
64
-
65
- //error_log( 'plugins_load: ' . print_r( $plugins_load, true ) );
66
-
67
- return $plugins_load;
68
- } catch ( Throwable $e ) {
69
- error_log( $e->getMessage() );
70
- }
71
-
72
- return $plugins_activating;
73
- }
74
-
75
- /**
76
- * Get the current url
77
- *
78
- * @return string
79
- * @since 3.2.6.8
80
- * @author tungnx
81
- */
82
- public static function getUrlCurrent(): string {
83
- $schema = is_ssl() ? 'https://' : 'http://';
84
- $http_host = $_SERVER['HTTP_HOST'] ?? '';
85
-
86
- return $schema . $http_host . untrailingslashit( esc_url_raw( $_SERVER['REQUEST_URI'] ?? '' ) );
87
- }
88
-
89
- /**
90
- * Check url request can apply check load plugins.
91
- * Format:
92
- * ['url' => ['plugin' => ['dependencies']]]
93
- *
94
- * @return bool|array
95
- */
96
- public function getPluginsMustLoadInUrl() {
97
- $url_load_plugins = false;
98
- $urls_apply = [
99
- 'wp-json/lp/v1/courses/archive-course' => [
100
- 'learnpress/learnpress.php' => [],
101
- 'learnpress-woo-payment/learnpress-woo-payment.php' => [
102
- 'woocommerce/woocommerce.php',
103
- ],
104
- 'learnpress-wpml/learnpress-wpml.php' => [
105
- 'sitepress-multilingual-cms/sitepress.php',
106
- ],
107
- ],
108
- 'wp-json/lp/v1/profile/course-tab' => [
109
- 'learnpress/learnpress.php' => [],
110
- 'learnpress-woo-payment/learnpress-woo-payment.php' => [
111
- 'woocommerce/woocommerce.php',
112
- ],
113
- 'learnpress-wpml/learnpress-wpml.php' => [
114
- 'sitepress-multilingual-cms/sitepress.php',
115
- ],
116
- ],
117
- 'wp-json/lp/v1/lazy-load/course-curriculum' => [
118
- 'learnpress/learnpress.php' => [],
119
- 'learnpress-assignments/learnpress-assignments.php' => [],
120
- 'learnpress-h5p/learnpress-h5p.php' => [],
121
- 'learnpress-wpml/learnpress-wpml.php' => [
122
- 'sitepress-multilingual-cms/sitepress.php',
123
- ],
124
- ],
125
- 'wp-json/lp/v1/lazy-load/course-progress' => [
126
- 'learnpress/learnpress.php' => [],
127
- 'learnpress-assignments/learnpress-assignments.php' => [],
128
- 'learnpress-h5p/learnpress-h5p.php' => [],
129
- ],
130
- 'wp-json/lp/v1/lazy-load/items-progress' => [
131
- 'learnpress/learnpress.php' => [],
132
- ],
133
- 'wp-json/lp/v1/profile/statistic' => [
134
- 'learnpress/learnpress.php' => [],
135
- ],
136
- ];
137
-
138
- foreach ( $urls_apply as $url => $plugins_load ) {
139
- if ( false !== strpos( self::getUrlCurrent(), $url ) ) {
140
- $url_load_plugins = $plugins_load;
141
- break;
142
- }
143
- }
144
-
145
- return $url_load_plugins;
146
- }
147
- }
148
-
149
- LP_MU_Plugin::instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: elearning, education, course, lms, learning management system
5
  Requires at least: 5.6
6
  Tested up to: 6.0
7
  Requires PHP: 7.0
8
- Stable tag: 4.1.7.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -203,6 +203,16 @@ https://www.transifex.com/projects/p/learnpress/
203
 
204
  == Changelog ==
205
 
 
 
 
 
 
 
 
 
 
 
206
  = 4.1.7.2 (2022-10-03) =
207
  ~ Removed: delete file mu-plugin (Moved to the plugin Thim Optimize).
208
  ~ Fixed: CVE-2022-3360 security.
5
  Requires at least: 5.6
6
  Tested up to: 6.0
7
  Requires PHP: 7.0
8
+ Stable tag: 4.1.7.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
203
 
204
  == Changelog ==
205
 
206
+ = 4.1.7.3 (2022-11-02) =
207
+ ~ Updated: text grammar.
208
+ ~ Modified: LP_DateTime class.
209
+ ~ Added: Course category and tag to menu.
210
+ ~ Changed: input type regular price, sale price to text.
211
+ ~ Call quiz get_questions function to get_question_ids.
212
+ ~ Fixed: upgrade LP3 to LP4 missing result of lesson.
213
+ ~ Remove file class-lp-backward-plugins.php, class-lp-factory.php, class-lp-query-search.php, class-lp-course-utils.php, class-lp-rest-authentication.php
214
+ ~ Remove code deprecated before.
215
+
216
  = 4.1.7.2 (2022-10-03) =
217
  ~ Removed: delete file mu-plugin (Moved to the plugin Thim Optimize).
218
  ~ Fixed: CVE-2022-3360 security.
templates/checkout/form.php CHANGED
@@ -18,7 +18,7 @@ learn_press_print_messages();
18
  if ( ! is_user_logged_in() ) {
19
  ?>
20
  <div class="learn-press-message error">
21
- <?php _e( 'Please login to enroll the course!', 'learnpress' ); ?>
22
  </div>
23
  <?php
24
  }
18
  if ( ! is_user_logged_in() ) {
19
  ?>
20
  <div class="learn-press-message error">
21
+ <?php _e( 'Please log in to enroll in the course!', 'learnpress' ); ?>
22
  </div>
23
  <?php
24
  }
templates/checkout/guest-checkout.php CHANGED
@@ -23,7 +23,7 @@ $is_exists = $checkout->checkout_email_exists();
23
  <li class="form-field">
24
  <input size="30" placeholder="<?php esc_attr_e( 'Enter your email...', 'learnpress' ); ?>" type="text" id="guest_email" name="guest_email" autocomplete="off">
25
  <div class="lp-guest-checkout-notice">
26
- <?php esc_html_e( 'An order key to activate the course will be sent to your email after the payment proceeded successfully.', 'learnpress' ); ?>
27
  </div>
28
 
29
  <?php
23
  <li class="form-field">
24
  <input size="30" placeholder="<?php esc_attr_e( 'Enter your email...', 'learnpress' ); ?>" type="text" id="guest_email" name="guest_email" autocomplete="off">
25
  <div class="lp-guest-checkout-notice">
26
+ <?php esc_html_e( 'An order key to activate the course will be sent to your email after the payment has proceeded successfully.', 'learnpress' ); ?>
27
  </div>
28
 
29
  <?php
templates/checkout/order-received.php CHANGED
@@ -68,7 +68,7 @@ echo wp_sprintf(
68
  if ( empty( $item['course_id'] ) || get_post_type( $item['course_id'] ) !== LP_COURSE_CPT ) {
69
  $links[] = apply_filters(
70
  'learn-press/order-item-not-course-id',
71
- __( 'Course does not exist', 'learnpress' ),
72
  $item
73
  );
74
  } else {
68
  if ( empty( $item['course_id'] ) || get_post_type( $item['course_id'] ) !== LP_COURSE_CPT ) {
69
  $links[] = apply_filters(
70
  'learn-press/order-item-not-course-id',
71
+ __( 'The course does not exist', 'learnpress' ),
72
  $item
73
  );
74
  } else {
templates/content-lesson/button-complete.php CHANGED
@@ -19,7 +19,7 @@ if ( $item->is_preview() && ! $user->has_enrolled_course( $course->get_id() ) )
19
  return;
20
  }
21
 
22
- $message_confirm_complete_item = sprintf( '%s "%s"?', __( 'Do you want to complete lesson', 'learnpress' ), $item->get_title() );
23
  $completed = $user->has_completed_item( $item->get_id(), $course->get_id() );
24
 
25
  if ( $completed ) :
19
  return;
20
  }
21
 
22
+ $message_confirm_complete_item = sprintf( '%s "%s"?', __( 'Do you want to complete the lesson?', 'learnpress' ), $item->get_title() );
23
  $completed = $user->has_completed_item( $item->get_id(), $course->get_id() );
24
 
25
  if ( $completed ) :
templates/content-lesson/content.php CHANGED
@@ -21,7 +21,7 @@ if ( ! isset( $lesson ) ) {
21
  $content = $lesson->get_content();
22
 
23
  if ( ! $content ) {
24
- $message = esc_html__( 'Lesson content is empty.', 'learnpress' );
25
 
26
  if ( $lesson->current_user_can_edit() ) {
27
  $message .= sprintf( '<a href="%s" class="edit-content">%s</a>', esc_url_raw( $lesson->get_edit_link() ), esc_html__( 'Edit', 'learnpress' ) );
21
  $content = $lesson->get_content();
22
 
23
  if ( ! $content ) {
24
+ $message = esc_html__( 'The lesson content is empty.', 'learnpress' );
25
 
26
  if ( $lesson->current_user_can_edit() ) {
27
  $message .= sprintf( '<a href="%s" class="edit-content">%s</a>', esc_url_raw( $lesson->get_edit_link() ), esc_html__( 'Edit', 'learnpress' ) );
templates/global/before-main-content.php CHANGED
@@ -22,10 +22,10 @@ defined( 'ABSPATH' ) || exit();
22
  <?php if ( ! learn_press_get_page_link( 'checkout' ) && ( $user->is_admin() || $user->is_instructor() ) ) { ?>
23
 
24
  <?php
25
- $message = __( 'LearnPress <strong>Checkout</strong> page is not set up. ', 'learnpress' );
26
 
27
  if ( $user->is_instructor() ) {
28
- $message .= __( 'Please contact administrator for setting up this page.', 'learnpress' );
29
  } else {
30
  $message .= sprintf( __( 'Please <a href=\"%s\" target=\"_blank\">setup</a> it so users can purchase courses.', 'learnpress' ), admin_url( 'admin.php?page=learn-press-settings&tab=checkout' ) );
31
  }
22
  <?php if ( ! learn_press_get_page_link( 'checkout' ) && ( $user->is_admin() || $user->is_instructor() ) ) { ?>
23
 
24
  <?php
25
+ $message = __( 'The LearnPress <strong>Checkout</strong> page is not set up.', 'learnpress' );
26
 
27
  if ( $user->is_instructor() ) {
28
+ $message .= __( 'Please contact the administrator to set up this page.', 'learnpress' );
29
  } else {
30
  $message .= sprintf( __( 'Please <a href=\"%s\" target=\"_blank\">setup</a> it so users can purchase courses.', 'learnpress' ), admin_url( 'admin.php?page=learn-press-settings&tab=checkout' ) );
31
  }
templates/global/block-content.php CHANGED
@@ -13,5 +13,5 @@ defined( 'ABSPATH' ) || exit();
13
  ?>
14
 
15
  <div class="learn-press-content-protected-message content-item-block">
16
- <?php esc_html_e( 'Content of this item has blocked because the course has exceeded duration.', 'learnpress' ); ?>
17
  </div>
13
  ?>
14
 
15
  <div class="learn-press-content-protected-message content-item-block">
16
+ <?php esc_html_e( 'The content of this item has been blocked because the course has exceeded its duration.', 'learnpress' ); ?>
17
  </div>
templates/global/no-courses-found.php CHANGED
@@ -12,4 +12,4 @@
12
  defined( 'ABSPATH' ) || exit;
13
  ?>
14
 
15
- <p class="learn-press-message error"><?php esc_html_e( 'No courses were found matching your selection.', 'learnpress' ); ?></p>
12
  defined( 'ABSPATH' ) || exit;
13
  ?>
14
 
15
+ <p class="learn-press-message error"><?php esc_html_e( 'No courses were found to match your selection.', 'learnpress' ); ?></p>
templates/pages/profile.php CHANGED
@@ -33,7 +33,7 @@ if ( ! isset( $profile ) ) {
33
  </div>
34
  <?php else : ?>
35
  <div class="lp-content-area">
36
- <?php esc_html_e( 'This user does not public their profile.', 'learnpress' ); ?>
37
  </div>
38
  <?php endif; ?>
39
 
33
  </div>
34
  <?php else : ?>
35
  <div class="lp-content-area">
36
+ <?php esc_html_e( 'This user does not make their profile public.', 'learnpress' ); ?>
37
  </div>
38
  <?php endif; ?>
39
 
templates/profile/content.php CHANGED
@@ -23,7 +23,7 @@ if ( ! isset( $user ) || ! isset( $tab_key ) || ! isset( $profile ) || ! isset(
23
 
24
  <?php
25
  if ( empty( $profile_tab['sections'] ) ) {
26
- if ( is_callable( $profile_tab['callback'] ) ) {
27
  echo call_user_func_array( $profile_tab['callback'], array( $tab_key, $profile_tab, $user ) );
28
  } else {
29
  do_action( 'learn-press/profile-content', $tab_key, $profile_tab, $user );
23
 
24
  <?php
25
  if ( empty( $profile_tab['sections'] ) ) {
26
+ if ( isset( $profile_tab['callback'] ) && is_callable( $profile_tab['callback'] ) ) {
27
  echo call_user_func_array( $profile_tab['callback'], array( $tab_key, $profile_tab, $user ) );
28
  } else {
29
  do_action( 'learn-press/profile-content', $tab_key, $profile_tab, $user );
templates/profile/tabs/courses/course-list.php CHANGED
@@ -31,7 +31,6 @@ if ( ! isset( $user ) || ! isset( $course_ids ) || ! isset( $current_page ) || !
31
 
32
  foreach ( $course_ids as $id ) {
33
  $course = learn_press_get_course( $id );
34
-
35
  if ( ! $course ) {
36
  continue;
37
  }
@@ -39,7 +38,10 @@ if ( ! isset( $user ) || ! isset( $course_ids ) || ! isset( $current_page ) || !
39
  $post = get_post( $id );
40
  setup_postdata( $post );
41
 
42
- $course_data = $user->get_course_data( $id );
 
 
 
43
  $course_result = $course_data->get_result();
44
  ?>
45
  <div class="lp_profile_course_progress__item">
31
 
32
  foreach ( $course_ids as $id ) {
33
  $course = learn_press_get_course( $id );
 
34
  if ( ! $course ) {
35
  continue;
36
  }
38
  $post = get_post( $id );
39
  setup_postdata( $post );
40
 
41
+ $course_data = $user->get_course_data( $id );
42
+ if ( ! $course_data ) {
43
+ continue;
44
+ }
45
  $course_result = $course_data->get_result();
46
  ?>
47
  <div class="lp_profile_course_progress__item">
templates/profile/tabs/courses/general-statistic.php CHANGED
@@ -23,15 +23,15 @@ if ( empty( $statistic ) || empty( $user ) ) {
23
 
24
  <?php do_action( 'learn-press/before-profile-dashboard-user-general-statistic' ); ?>
25
 
26
- <div class="statistic-box" title="<?php esc_html_e( 'Total courses enrolled', 'learnpress' ); ?>">
27
  <p class="statistic-box__text"><?php esc_html_e( 'Enrolled Courses', 'learnpress' ); ?></p>
28
  <span class="statistic-box__number"><?php echo esc_html( $statistic['enrolled_courses'] ); ?></span>
29
  </div>
30
- <div class="statistic-box" title="<?php esc_html_e( 'Total courses are learning', 'learnpress' ); ?>">
31
  <p class="statistic-box__text"><?php esc_html_e( 'Active Courses', 'learnpress' ); ?></p>
32
  <span class="statistic-box__number"><?php echo esc_html( $statistic['active_courses'] ); ?></span>
33
  </div>
34
- <div class="statistic-box" title="<?php esc_html_e( 'Total courses has finished', 'learnpress' ); ?>">
35
  <p class="statistic-box__text"><?php esc_html_e( 'Completed Courses', 'learnpress' ); ?></p>
36
  <span class="statistic-box__number"><?php echo esc_html( $statistic['completed_courses'] ); ?></span>
37
  </div>
@@ -46,11 +46,11 @@ if ( empty( $statistic ) || empty( $user ) ) {
46
  <div class="dashboard-general-statistic__row">
47
 
48
  <?php do_action( 'learn-press/before-profile-dashboard-instructor-general-statistic' ); ?>
49
- <div class="statistic-box" title="<?php esc_html_e( 'Total courses created', 'learnpress' ); ?>">
50
  <p class="statistic-box__text"><?php esc_html_e( 'Total Courses', 'learnpress' ); ?></p>
51
  <span class="statistic-box__number"><?php echo esc_html( $statistic['total_courses'] ); ?></span>
52
  </div>
53
- <div class="statistic-box" title="<?php esc_html_e( 'Total students attended', 'learnpress' ); ?>">
54
  <p class="statistic-box__text"><?php esc_html_e( 'Total Students', 'learnpress' ); ?></p>
55
  <span class="statistic-box__number"><?php echo esc_html( $statistic['total_users'] ); ?></span>
56
  </div>
23
 
24
  <?php do_action( 'learn-press/before-profile-dashboard-user-general-statistic' ); ?>
25
 
26
+ <div class="statistic-box" title="<?php esc_html_e( 'Total enrolled courses', 'learnpress' ); ?>">
27
  <p class="statistic-box__text"><?php esc_html_e( 'Enrolled Courses', 'learnpress' ); ?></p>
28
  <span class="statistic-box__number"><?php echo esc_html( $statistic['enrolled_courses'] ); ?></span>
29
  </div>
30
+ <div class="statistic-box" title="<?php esc_html_e( 'The total number of courses is being learned', 'learnpress' ); ?>">
31
  <p class="statistic-box__text"><?php esc_html_e( 'Active Courses', 'learnpress' ); ?></p>
32
  <span class="statistic-box__number"><?php echo esc_html( $statistic['active_courses'] ); ?></span>
33
  </div>
34
+ <div class="statistic-box" title="<?php esc_html_e( 'Total courses have finished', 'learnpress' ); ?>">
35
  <p class="statistic-box__text"><?php esc_html_e( 'Completed Courses', 'learnpress' ); ?></p>
36
  <span class="statistic-box__number"><?php echo esc_html( $statistic['completed_courses'] ); ?></span>
37
  </div>
46
  <div class="dashboard-general-statistic__row">
47
 
48
  <?php do_action( 'learn-press/before-profile-dashboard-instructor-general-statistic' ); ?>
49
+ <div class="statistic-box" title="<?php esc_html_e( 'Total created courses', 'learnpress' ); ?>">
50
  <p class="statistic-box__text"><?php esc_html_e( 'Total Courses', 'learnpress' ); ?></p>
51
  <span class="statistic-box__number"><?php echo esc_html( $statistic['total_courses'] ); ?></span>
52
  </div>
53
+ <div class="statistic-box" title="<?php esc_html_e( 'Total attended students', 'learnpress' ); ?>">
54
  <p class="statistic-box__text"><?php esc_html_e( 'Total Students', 'learnpress' ); ?></p>
55
  <span class="statistic-box__number"><?php echo esc_html( $statistic['total_users'] ); ?></span>
56
  </div>
templates/profile/tabs/orders/recover-order.php CHANGED
@@ -13,8 +13,8 @@ defined( 'ABSPATH' ) || exit();
13
  ?>
14
 
15
  <div class="profile-recover-order">
16
- <p class="recover-order__title"><?php esc_html_e( 'If you have a valid order key you can recover it here.', 'learnpress' ); ?></p>
17
- <p class="recover-order__description"><?php esc_html_e( 'When you checkout with Guest order key will send in email, you can use order key to create order.', 'learnpress' ); ?></p>
18
 
19
  <?php learn_press_get_template( 'order/recover-form.php' ); ?>
20
  </div>
13
  ?>
14
 
15
  <div class="profile-recover-order">
16
+ <p class="recover-order__title"><?php esc_html_e( 'If you have a valid order key, you can recover it here.', 'learnpress' ); ?></p>
17
+ <p class="recover-order__description"><?php esc_html_e( 'When you checkout as a Guest, an order key will be sent to your email. You can use the order key to create an order.', 'learnpress' ); ?></p>
18
 
19
  <?php learn_press_get_template( 'order/recover-form.php' ); ?>
20
  </div>
templates/profile/tabs/settings/change-password.php CHANGED
@@ -42,7 +42,7 @@ if ( ! isset( $section ) ) {
42
  <label for="pass2"><?php esc_html_e( 'Confirm new password', 'learnpress' ); ?></label>
43
  <div class="form-field-input">
44
  <input name="pass2" type="password" id="pass2" class="regular-text" value=""/>
45
- <p id="lp-password-not-match" class="description lp-field-error-message hide-if-js"><?php esc_html_e( 'New password does not match!', 'learnpress' ); ?></p>
46
  </div>
47
  </li>
48
 
42
  <label for="pass2"><?php esc_html_e( 'Confirm new password', 'learnpress' ); ?></label>
43
  <div class="form-field-input">
44
  <input name="pass2" type="password" id="pass2" class="regular-text" value=""/>
45
+ <p id="lp-password-not-match" class="description lp-field-error-message hide-if-js"><?php esc_html_e( 'The new password does not match!', 'learnpress' ); ?></p>
46
  </div>
47
  </li>
48
 
templates/single-course/buttons/retry.php CHANGED
@@ -22,7 +22,7 @@ if ( ! $course ) {
22
 
23
  $message_data_confirm = sprintf(
24
  '%s "%s"',
25
- esc_html__( 'Do you want to retake course', 'learnpress' ),
26
  $course->get_title()
27
  );
28
  ?>
22
 
23
  $message_data_confirm = sprintf(
24
  '%s "%s"',
25
+ esc_html__( 'Do you want to retake the course', 'learnpress' ),
26
  $course->get_title()
27
  );
28
  ?>
templates/single-course/content-item/popup-sidebar.php CHANGED
@@ -12,7 +12,7 @@ defined( 'ABSPATH' ) || exit;
12
 
13
  <div id="popup-sidebar">
14
  <form method="post" class="search-course">
15
- <input type="text" name="s" autocomplete="off" placeholder="<?php echo esc_attr_x( 'Search courses content', 'search course input placeholder', 'learnpress' ); ?>">
16
  <button name="submit"></button>
17
  <button type="button" class="clear"></button>
18
  </form>
12
 
13
  <div id="popup-sidebar">
14
  <form method="post" class="search-course">
15
+ <input type="text" name="s" autocomplete="off" placeholder="<?php echo esc_attr_x( 'Search for course content', 'search course input placeholder', 'learnpress' ); ?>">
16
  <button name="submit"></button>
17
  <button type="button" class="clear"></button>
18
  </form>
templates/single-course/content-protected.php CHANGED
@@ -20,7 +20,7 @@ $message = '';
20
  if ( ! is_user_logged_in() ) {
21
  $message = sprintf(
22
  __(
23
- 'This content is protected, please <a class="lp-link-login" href="%s">login</a> and enroll course to view this content!',
24
  'learnpress'
25
  ),
26
  learn_press_get_login_url( learn_press_get_current_url() )
20
  if ( ! is_user_logged_in() ) {
21
  $message = sprintf(
22
  __(
23
+ 'This content is protected, please <a class=\"lp-link-login\" href=\"%s\">login</a> and enroll in the course to view this content!',
24
  'learnpress'
25
  ),
26
  learn_press_get_login_url( learn_press_get_current_url() )
templates/single-course/sidebar/user-progress.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThimPress
6
  * @package Learnpress/Templates
7
- * @version 4.0.1
8
  */
9
 
10
  defined( 'ABSPATH' ) || exit();
@@ -14,16 +14,11 @@ if ( ! isset( $user ) || ! isset( $course ) || ! isset( $course_data ) || ! isse
14
  }
15
 
16
  $passing_condition = $course->get_passing_condition();
17
- $quiz_false = 0;
18
-
19
- if ( ! empty( $course_results['items'] ) ) {
20
- $quiz_false = $course_results['items']['quiz']['completed'] - $course_results['items']['quiz']['passed'];
21
- }
22
  ?>
23
 
24
  <div class="course-results-progress">
25
  <?php
26
- if ( $course_results['items']['lesson']['total'] ) :
27
  ?>
28
  <div class="items-progress">
29
  <h4 class="items-progress__heading">
@@ -34,7 +29,8 @@ if ( ! empty( $course_results['items'] ) ) {
34
  <?php endif; ?>
35
 
36
  <?php
37
- if ( $course_results['items']['quiz']['total'] ) :
 
38
  ?>
39
  <div class="items-progress">
40
  <h4 class="items-progress__heading">
4
  *
5
  * @author ThimPress
6
  * @package Learnpress/Templates
7
+ * @version 4.0.2
8
  */
9
 
10
  defined( 'ABSPATH' ) || exit();
14
  }
15
 
16
  $passing_condition = $course->get_passing_condition();
 
 
 
 
 
17
  ?>
18
 
19
  <div class="course-results-progress">
20
  <?php
21
+ if ( ! empty( $course_results['items'] ) && $course_results['items']['lesson']['total'] ) :
22
  ?>
23
  <div class="items-progress">
24
  <h4 class="items-progress__heading">
29
  <?php endif; ?>
30
 
31
  <?php
32
+ if ( ! empty( $course_results['items'] ) && $course_results['items']['quiz']['total'] ) :
33
+ $quiz_false = $course_results['items']['quiz']['completed'] - $course_results['items']['quiz']['passed'];
34
  ?>
35
  <div class="items-progress">
36
  <h4 class="items-progress__heading">
templates/single-course/sidebar/user-time.php CHANGED
@@ -9,15 +9,15 @@
9
 
10
  defined( 'ABSPATH' ) || exit;
11
 
12
- /**
13
- * @var string $status
14
- * @var LP_Datetime $start_time
15
- * @var LP_Datetime $end_time
16
- * @var LP_Datetime $expiration_time
17
- */
18
- $time = current_time( 'mysql', true );
19
- $user = learn_press_get_current_user();
20
- $course = learn_press_get_course();
21
  ?>
22
 
23
  <div class="course-time">
9
 
10
  defined( 'ABSPATH' ) || exit;
11
 
12
+ if ( ! isset( $data ) || ! isset( $data['start_time'] ) || ! isset( $data['end_time'] )
13
+ || ! isset( $data['status'] ) || ! isset( $data['expiration_time'] ) ) {
14
+ return;
15
+ }
16
+
17
+ $start_time = $data['start_time'];
18
+ $end_time = $data['end_time'];
19
+ $status = $data['status'];
20
+ $expiration_time = $data['expiration_time'];
21
  ?>
22
 
23
  <div class="course-time">
templates/single-course/tabs/curriculum-v2.php CHANGED
@@ -36,7 +36,7 @@ if ( isset( $args['sections'] ) && isset( $args['filters'] ) ) {
36
  </ul>
37
  <?php else : ?>
38
  <?php
39
- echo wp_kses_post( apply_filters( 'learnpress/course/curriculum/empty', esc_html__( 'Curriculum is empty', 'learnpress' ) ) );
40
  ?>
41
  <?php endif; ?>
42
  </div>
36
  </ul>
37
  <?php else : ?>
38
  <?php
39
+ echo wp_kses_post( apply_filters( 'learnpress/course/curriculum/empty', esc_html__( 'The curriculum is empty', 'learnpress' ) ) );
40
  ?>
41
  <?php endif; ?>
42
  </div>
templates/single-course/tabs/curriculum.php CHANGED
@@ -53,7 +53,7 @@ $can_view_content_course = $user->can_view_content_course( $course->get_id() );
53
  echo wp_kses_post(
54
  apply_filters(
55
  'learnpress/course/curriculum/empty',
56
- esc_html__( 'Curriculum is empty', 'learnpress' )
57
  )
58
  );
59
  ?>
53
  echo wp_kses_post(
54
  apply_filters(
55
  'learnpress/course/curriculum/empty',
56
+ esc_html__( 'The curriculum is empty', 'learnpress' )
57
  )
58
  );
59
  ?>
templates/single-course/tabs/tabs.php CHANGED
@@ -38,7 +38,7 @@ if ( $lp_user && ! $lp_user instanceof LP_User_Guest ) {
38
  );
39
  } elseif ( LP_BLOCK_COURSE_DURATION_EXPIRE === $can_view_course->key ) {
40
  learn_press_display_message(
41
- esc_html__( 'This course has been blocked reason by expire', 'learnpress' ),
42
  'warning'
43
  );
44
  }
38
  );
39
  } elseif ( LP_BLOCK_COURSE_DURATION_EXPIRE === $can_view_course->key ) {
40
  learn_press_display_message(
41
+ esc_html__( 'This course has been blocked for expiration', 'learnpress' ),
42
  'warning'
43
  );
44
  }