LearnPress – WordPress LMS Plugin - Version 3.2.6.4

Version Description

~ Fixed some errors.

Download this release

Release Info

Developer tunnhn
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 3.2.6.4
Comparing to
See all releases

Code changes from version 3.2.6.3 to 3.2.6.4

inc/admin/editor/class-lp-admin-editor-question.php CHANGED
@@ -64,6 +64,10 @@ class LP_Admin_Editor_Question extends LP_Admin_Editor {
64
  $question = LP_Question::get_question( $question );
65
  }
66
 
 
 
 
 
67
  // question id
68
  $question_id = $question->get_id();
69
 
64
  $question = LP_Question::get_question( $question );
65
  }
66
 
67
+ if ( ! $question ) {
68
+ return array();
69
+ }
70
+
71
  // question id
72
  $question_id = $question->get_id();
73
 
inc/class-lp-request-handler.php CHANGED
@@ -823,7 +823,7 @@ class LP_Request {
823
 
824
  LP_Request::init();
825
 
826
- // Backward compatibility for 3.2.6.3
827
  class LP_Request_Handler extends LP_Request {
828
 
829
  }
823
 
824
  LP_Request::init();
825
 
826
+ // Backward compatibility for 3.2.6.4
827
  class LP_Request_Handler extends LP_Request {
828
 
829
  }
inc/lp-constants.php CHANGED
@@ -2,9 +2,12 @@
2
  /**
3
  * Define common constants used by LearnPress
4
  */
5
- $upload_dir = wp_upload_dir();
 
 
 
6
  // version
7
- define( 'LEARNPRESS_VERSION', '3.2.6.3' );
8
 
9
  define( 'LP_WP_CONTENT', basename( WP_CONTENT_DIR ) );
10
 
2
  /**
3
  * Define common constants used by LearnPress
4
  */
5
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
6
+ $upload_dir = wp_upload_dir();
7
+ $plugin_info = get_plugin_data( LP_PLUGIN_FILE );
8
+
9
  // version
10
+ define( 'LEARNPRESS_VERSION', $plugin_info['Version'] );
11
 
12
  define( 'LP_WP_CONTENT', basename( WP_CONTENT_DIR ) );
13
 
inc/lp-core-functions.php CHANGED
@@ -544,6 +544,8 @@ function learn_press_get_post_by_name( $name, $type, $single = true ) {
544
 
545
  /**
546
  * Cache static pages
 
 
547
  */
548
  function learn_press_setup_pages() {
549
  global $wpdb;
@@ -554,7 +556,7 @@ function learn_press_setup_pages() {
554
 
555
  foreach ( $pages as $page ) {
556
  $id = get_option( 'learn_press_' . $page . '_page_id' );
557
- if ( $id ) {
558
  $page_ids[] = $id;
559
  }
560
  }
@@ -583,10 +585,6 @@ function learn_press_setup_pages() {
583
  }
584
  }
585
 
586
- add_action( 'init', 'learn_press_setup_pages' );
587
-
588
- //add_action( 'init', 'learn_press_setup_pages' );
589
-
590
  function learn_press_get_course_item_object( $post_type ) {
591
  switch ( $post_type ) {
592
  case 'lp_quiz':
544
 
545
  /**
546
  * Cache static pages
547
+ *
548
+ * @deprecated
549
  */
550
  function learn_press_setup_pages() {
551
  global $wpdb;
556
 
557
  foreach ( $pages as $page ) {
558
  $id = get_option( 'learn_press_' . $page . '_page_id' );
559
+ if ( absint( $id ) > 0 ) {
560
  $page_ids[] = $id;
561
  }
562
  }
585
  }
586
  }
587
 
 
 
 
 
588
  function learn_press_get_course_item_object( $post_type ) {
589
  switch ( $post_type ) {
590
  case 'lp_quiz':
inc/lp-template-functions.php CHANGED
@@ -3758,8 +3758,8 @@ function learn_press_filter_can_view_item( $view, $item_id, $user_id, $course_id
3758
  add_filter( 'learn_press_get_template', 'learn_press_filter_block_content_template', 10, 5 );
3759
 
3760
  function learn_press_filter_block_content_template( $located, $template_name, $args, $template_path, $default_path ) {
3761
-
3762
- if ( $template_name == 'global/block-content.php' ) {
3763
  if ( ! is_user_logged_in() ) {
3764
  $can_view_item = 'not-logged-in';
3765
  } elseif ( ! learn_press_current_user_enrolled_course() ) {
3758
  add_filter( 'learn_press_get_template', 'learn_press_filter_block_content_template', 10, 5 );
3759
 
3760
  function learn_press_filter_block_content_template( $located, $template_name, $args, $template_path, $default_path ) {
3761
+ if ( $template_name == 'global/block-content.php' ) {
3762
+ $can_view_item = false;
3763
  if ( ! is_user_logged_in() ) {
3764
  $can_view_item = 'not-logged-in';
3765
  } elseif ( ! learn_press_current_user_enrolled_course() ) {
inc/user-item/class-lp-user-item-course.php CHANGED
@@ -843,7 +843,7 @@ class LP_User_Item_Course extends LP_User_Item implements ArrayAccess {
843
  public function get_item_at( $at = 0 ) {
844
  $items = $this->read_items();
845
  $item_id = ! empty( $this->_items_by_order[ $at ] ) ? $this->_items_by_order[ $at ] : 0;
846
- if ( ! $item_id ) {
847
  $items = array_values( $items );
848
  $item_id = $items[ $at ]->get_id();
849
  }
843
  public function get_item_at( $at = 0 ) {
844
  $items = $this->read_items();
845
  $item_id = ! empty( $this->_items_by_order[ $at ] ) ? $this->_items_by_order[ $at ] : 0;
846
+ if ( ! $item_id && $items ) {
847
  $items = array_values( $items );
848
  $item_id = $items[ $at ]->get_id();
849
  }
inc/user/abstract-lp-user.php CHANGED
@@ -1531,6 +1531,8 @@ if ( ! class_exists( 'LP_Abstract_User' ) ) {
1531
  $can = $count;
1532
  }
1533
 
 
 
1534
  $can = absint( $can );
1535
  }
1536
  }
1531
  $can = $count;
1532
  }
1533
 
1534
+ $can = max( $can, 0 );
1535
+
1536
  $can = absint( $can );
1537
  }
1538
  }
learnpress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: LearnPress
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: 3.2.6.3
8
  Author URI: http://thimpress.com
9
  Requires at least: 3.8
10
  Tested up to: 5.0.2
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: 3.2.6.4
8
  Author URI: http://thimpress.com
9
  Requires at least: 3.8
10
  Tested up to: 5.0.2
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: thimpress, tunnhn, phonglq.foobla, thongta, kendy73, leehld
3
  Donate link:
4
  Tags: WordPress LMS, LMS, eLearning, e-Learning, Learning Management System, LMS WordPress, Course, Courses, Quiz, Quizzes, Training, Guru, Sell Courses
5
  Requires at least: 3.8
6
- Tested up to: 5.2.2
7
- Stable tag: 3.2.6.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -199,6 +199,9 @@ https://www.transifex.com/projects/p/learnpress/
199
  8. Add-ons of LearnPress.
200
 
201
  == Changelog ==
 
 
 
202
  = 3.2.6.3 =
203
  ~ Fixed css conflict with text block of vc.
204
  ~ Fixed show message 'Out of stock' for course reached limitation users.
3
  Donate link:
4
  Tags: WordPress LMS, LMS, eLearning, e-Learning, Learning Management System, LMS WordPress, Course, Courses, Quiz, Quizzes, Training, Guru, Sell Courses
5
  Requires at least: 3.8
6
+ Tested up to: 5.0.2
7
+ Stable tag: 3.2.6.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
199
  8. Add-ons of LearnPress.
200
 
201
  == Changelog ==
202
+ = 3.2.6.4 =
203
+ ~ Fixed some errors.
204
+
205
  = 3.2.6.3 =
206
  ~ Fixed css conflict with text block of vc.
207
  ~ Fixed show message 'Out of stock' for course reached limitation users.