Skip to content

Commit

Permalink
Merge pull request #2871 from gocodebox/dev
Browse files Browse the repository at this point in the history
Release 8.0.1
  • Loading branch information
brianhogg authored Feb 6, 2025
2 parents 7dc84b5 + 8ee69d2 commit 6457aee
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 76 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
LifterLMS Changelog
===================

v8.0.1 - 2025-02-06
-------------------

##### New Features

+ Setting to increase the frequency user tracked events are saved.

##### Bug Fixes

+ Additional escaping for form permalinks.
+ Allow quiz question to be retrieved even if attempt limit reached when resuming a quiz. [#2865](https://github.com/gocodebox/lifterlms/issues/2865)
+ Avoid grades table wrapping in the My Grades section of the student dashboard. [#2869](https://github.com/gocodebox/lifterlms/issues/2869)
+ Open the lesson panel after adding a new lesson in the Course Builder. [#2855](https://github.com/gocodebox/lifterlms/issues/2855)
+ Fixed PHP >= 8.3 warning when using WP CLI. Thanks [@jv-mtrz](https://github.com/jv-mtrz)!

##### Deprecations

+ Fixed issues with viewing quiz attempts when questions were deleted.

##### Updated Templates

+ [templates/myaccount/my-grades-single.php](https://github.com/gocodebox/lifterlms/blob/8.0.1/templates/myaccount/my-grades-single.php)
+ [templates/quiz/results-attempt-questions-list.php](https://github.com/gocodebox/lifterlms/blob/8.0.1/templates/quiz/results-attempt-questions-list.php)


v8.0.0 - 2025-01-20
-------------------

Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/llms-tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ LLMS.Tracking = function( settings ) {
store.set( 'events', all );

// If couldn't store the latest event because of size limits.
if ( all.length > store.get( 'events', [] ).length ) {
if ( settings.saving_frequency === 'always' || all.length > store.get( 'events', [] ).length ) {

// Copy the cookie in a temporary variable.
var _temp = store.getAll();
Expand Down
17 changes: 13 additions & 4 deletions assets/js/builder/Views/Lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ define( [
* @version 3.16.12
*/
events: _.defaults( {
'click .edit-lesson': 'open_lesson_editor',
'click .llms-headline': 'open_lesson_editor',
'click .edit-lesson': 'edit_lesson',
'click .llms-headline': 'edit_lesson',
'click .edit-quiz': 'open_quiz_editor',
'click .edit-assignment': 'open_assignment_editor',
'click .section-prev': 'section_prev',
Expand Down Expand Up @@ -88,7 +88,7 @@ define( [
this.listenTo( this.model, 'change', this.render );

Backbone.pubSub.on( 'lesson-selected', this.on_select, this );
Backbone.pubSub.on( 'new-lesson-added', this.on_select, this );
Backbone.pubSub.on( 'new-lesson-added', this.maybe_open_editor, this );

},

Expand Down Expand Up @@ -139,16 +139,25 @@ define( [
* @since 3.16.0
* @version 3.27.0
*/
open_lesson_editor: function( event ) {
edit_lesson: function( event ) {

if ( event ) {
event.preventDefault();
}

this.open_lesson_editor();
},

open_lesson_editor: function() {
Backbone.pubSub.trigger( 'lesson-selected', this.model, 'lesson' );
this.model.set( '_selected', true );
this.set_hash( false );
},

maybe_open_editor: function( model ) {
if ( this.model.id === model.id ) {
this.open_lesson_editor();
}
},

/**
Expand Down
2 changes: 2 additions & 0 deletions assets/js/builder/Views/LessonEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ define( [

this.render_points_percentage();

this.$('.llms-editable-title').focus();

return this;

},
Expand Down
2 changes: 1 addition & 1 deletion class-lifterlms.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class LifterLMS {
*
* @var string
*/
public $version = '8.0.0';
public $version = '8.0.1';

/**
* LLMS_Assets instance
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"composer/installers": "~1.9.0",
"deliciousbrains/wp-background-processing": "1.0.2",
"lifterlms/lifterlms-blocks": "2.5.9",
"lifterlms/lifterlms-cli": "0.0.4",
"lifterlms/lifterlms-cli": "0.0.5",
"lifterlms/lifterlms-helper": "3.5.4",
"lifterlms/lifterlms-rest": "1.0.2",
"woocommerce/action-scheduler": "3.5.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public function manage_post_row_actions( $actions, $post ) {

$link = get_permalink( $post );
if ( $link ) {
$label = sprintf( esc_attr__( 'View "%s"', 'lifterlms' ), $post->post_title );
$actions['view'] = sprintf( '<a href="%1$s" rel="bookmark" aria-label="%2$s">%3$s</a>', $link, $label, __( 'View', 'lifterlms' ) );
$label = sprintf( __( 'View "%s"', 'lifterlms' ), $post->post_title );
$actions['view'] = sprintf( '<a href="%1$s" rel="bookmark" aria-label="%2$s">%3$s</a>', esc_url( $link ), esc_attr( $label ), esc_html__( 'View', 'lifterlms' ) );
}

return $actions;
Expand Down
16 changes: 12 additions & 4 deletions includes/admin/settings/class.llms.settings.general.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function __construct() {
add_filter( 'lifterlms_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
add_action( 'lifterlms_settings_' . $this->id, array( $this, 'output' ) );
add_action( 'lifterlms_settings_save_' . $this->id, array( $this, 'save' ) );

}

/**
Expand Down Expand Up @@ -115,13 +114,24 @@ function ( $role ) {
'type' => 'checkbox',
);

$settings[] = array(
'title' => __( 'Frequency of Saving Tracked Events', 'lifterlms' ),
'default' => 'minimum',
'desc' => __( 'Specifies how often tracked events are sent to the server. "Minimum" sends only when local storage is almost full (fewer network calls). "Always" sends each event immediately (higher accuracy, more server load).', 'lifterlms' ),
'id' => 'lifterlms_tracked_event_saving_frequency',
'type' => 'select',
'options' => array(
'minimum' => __( 'Minimum', 'lifterlms' ),
'always' => __( 'Always', 'lifterlms' ),
),
);

$settings[] = array(
'id' => 'general_settings',
'type' => 'sectionend',
);

return apply_filters( 'lifterlms_general_settings', $settings );

}

/**
Expand All @@ -133,9 +143,7 @@ public function save() {

$settings = $this->get_settings();
LLMS_Admin_Settings::save_fields( $settings );

}

}

return new LLMS_Settings_General();
16 changes: 3 additions & 13 deletions includes/class-llms-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private function __construct() {

add_action( 'init', array( $this, 'register_events' ), 9 );
add_action( 'init', array( $this, 'store_cookie' ) );

}

/**
Expand Down Expand Up @@ -74,11 +73,11 @@ public function get_client_settings() {
return apply_filters(
'llms_events_get_client_settings',
array(
'nonce' => wp_create_nonce( 'llms-tracking' ),
'events' => $events,
'nonce' => wp_create_nonce( 'llms-tracking' ),
'events' => $events,
'saving_frequency' => get_option( 'lifterlms_tracked_event_saving_frequency', 'minimum' ),
)
);

}

/**
Expand All @@ -104,7 +103,6 @@ public function get_registered_events() {
protected function is_event_valid( $event ) {

return array_key_exists( $event, $this->get_registered_events() );

}

/**
Expand Down Expand Up @@ -149,7 +147,6 @@ public function prepare_event( $raw_event = array() ) {
}

return $prepared;

}

/**
Expand Down Expand Up @@ -221,7 +218,6 @@ public function record( $args = array() ) {
}

return $llms_event;

}

/**
Expand Down Expand Up @@ -260,7 +256,6 @@ public function record_many( $events = array() ) {
$wpdb->query( 'COMMIT' );

return $recorded;

}

/**
Expand Down Expand Up @@ -297,7 +292,6 @@ public function register_events() {
* @param array $events Array of events. Array key is the event name and array value is used to determine if the key is a client-side event.
*/
$this->registered_events = apply_filters( 'llms_get_registered_events', $events );

}

/**
Expand Down Expand Up @@ -333,7 +327,6 @@ protected function sanitize_raw_event( $raw ) {
}

return $clean;

}

/**
Expand Down Expand Up @@ -391,7 +384,6 @@ protected function should_track_client_events() {
* @param string[] $post_types Array of post types that should be tracked.
*/
return apply_filters( 'llms_tracking_should_track_client_events', $ret, $post_types );

}

/**
Expand Down Expand Up @@ -419,7 +411,6 @@ public function store_cookie() {

// Cookie reset.
llms_setcookie( 'llms-tracking', '', time() - 60, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, llms_is_site_https() && is_ssl() );

}

/**
Expand Down Expand Up @@ -453,5 +444,4 @@ public function store_tracking_events( $tracking ) {

return true;
}

}
2 changes: 1 addition & 1 deletion includes/class.llms.ajax.handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ public static function quiz_get_question( $request ) {
$attempt = $student_quizzes->get_attempt_by_key( $attempt_key );

// Don't allow the question to be retrieved if the attempt is not open or can't be resumed.
if ( ! $attempt || ! $attempt->get_quiz()->is_open() || ( $attempt->get_quiz()->can_be_resumed() && ! $attempt->can_be_resumed() ) ) {
if ( ! $attempt || ( ! $attempt->get_quiz()->is_open() && ( ! $attempt->get_quiz()->can_be_resumed() || ! $attempt->can_be_resumed() ) ) ) {
$err->add( 500, __( 'There was an error retrieving the question. Please return to the lesson and try again.', 'lifterlms' ) );
return $err;
}
Expand Down
2 changes: 1 addition & 1 deletion lifterlms.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: LifterLMS
* Plugin URI: https://lifterlms.com/
* Description: Complete e-learning platform to sell online courses, protect lessons, offer memberships, and quiz students. WP Learning Management System.
* Version: 8.0.0
* Version: 8.0.1
* Author: LifterLMS
* Author URI: https://lifterlms.com/
* Text Domain: lifterlms
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lifterlms",
"version": "8.0.0",
"version": "8.0.1",
"description": "LifterLMS by codeBOX",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 6457aee

Please sign in to comment.