Skip to content

Commit 6457aee

Browse files
authored
Merge pull request #2871 from gocodebox/dev
Release 8.0.1
2 parents 7dc84b5 + 8ee69d2 commit 6457aee

File tree

15 files changed

+114
-76
lines changed

15 files changed

+114
-76
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
LifterLMS Changelog
22
===================
33

4+
v8.0.1 - 2025-02-06
5+
-------------------
6+
7+
##### New Features
8+
9+
+ Setting to increase the frequency user tracked events are saved.
10+
11+
##### Bug Fixes
12+
13+
+ Additional escaping for form permalinks.
14+
+ Allow quiz question to be retrieved even if attempt limit reached when resuming a quiz. [#2865](https://github.com/gocodebox/lifterlms/issues/2865)
15+
+ Avoid grades table wrapping in the My Grades section of the student dashboard. [#2869](https://github.com/gocodebox/lifterlms/issues/2869)
16+
+ Open the lesson panel after adding a new lesson in the Course Builder. [#2855](https://github.com/gocodebox/lifterlms/issues/2855)
17+
+ Fixed PHP >= 8.3 warning when using WP CLI. Thanks [@jv-mtrz](https://github.com/jv-mtrz)!
18+
19+
##### Deprecations
20+
21+
+ Fixed issues with viewing quiz attempts when questions were deleted.
22+
23+
##### Updated Templates
24+
25+
+ [templates/myaccount/my-grades-single.php](https://github.com/gocodebox/lifterlms/blob/8.0.1/templates/myaccount/my-grades-single.php)
26+
+ [templates/quiz/results-attempt-questions-list.php](https://github.com/gocodebox/lifterlms/blob/8.0.1/templates/quiz/results-attempt-questions-list.php)
27+
28+
429
v8.0.0 - 2025-01-20
530
-------------------
631

assets/js/app/llms-tracking.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ LLMS.Tracking = function( settings ) {
7878
store.set( 'events', all );
7979

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

8383
// Copy the cookie in a temporary variable.
8484
var _temp = store.getAll();

assets/js/builder/Views/Lesson.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ define( [
4343
* @version 3.16.12
4444
*/
4545
events: _.defaults( {
46-
'click .edit-lesson': 'open_lesson_editor',
47-
'click .llms-headline': 'open_lesson_editor',
46+
'click .edit-lesson': 'edit_lesson',
47+
'click .llms-headline': 'edit_lesson',
4848
'click .edit-quiz': 'open_quiz_editor',
4949
'click .edit-assignment': 'open_assignment_editor',
5050
'click .section-prev': 'section_prev',
@@ -88,7 +88,7 @@ define( [
8888
this.listenTo( this.model, 'change', this.render );
8989

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

9393
},
9494

@@ -139,16 +139,25 @@ define( [
139139
* @since 3.16.0
140140
* @version 3.27.0
141141
*/
142-
open_lesson_editor: function( event ) {
142+
edit_lesson: function( event ) {
143143

144144
if ( event ) {
145145
event.preventDefault();
146146
}
147147

148+
this.open_lesson_editor();
149+
},
150+
151+
open_lesson_editor: function() {
148152
Backbone.pubSub.trigger( 'lesson-selected', this.model, 'lesson' );
149153
this.model.set( '_selected', true );
150154
this.set_hash( false );
155+
},
151156

157+
maybe_open_editor: function( model ) {
158+
if ( this.model.id === model.id ) {
159+
this.open_lesson_editor();
160+
}
152161
},
153162

154163
/**

assets/js/builder/Views/LessonEditor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ define( [
118118

119119
this.render_points_percentage();
120120

121+
this.$('.llms-editable-title').focus();
122+
121123
return this;
122124

123125
},

class-lifterlms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class LifterLMS {
3434
*
3535
* @var string
3636
*/
37-
public $version = '8.0.0';
37+
public $version = '8.0.1';
3838

3939
/**
4040
* LLMS_Assets instance

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"composer/installers": "~1.9.0",
3131
"deliciousbrains/wp-background-processing": "1.0.2",
3232
"lifterlms/lifterlms-blocks": "2.5.9",
33-
"lifterlms/lifterlms-cli": "0.0.4",
33+
"lifterlms/lifterlms-cli": "0.0.5",
3434
"lifterlms/lifterlms-helper": "3.5.4",
3535
"lifterlms/lifterlms-rest": "1.0.2",
3636
"woocommerce/action-scheduler": "3.5.4"

includes/admin/post-types/post-tables/class-llms-admin-post-table-forms.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ public function manage_post_row_actions( $actions, $post ) {
113113

114114
$link = get_permalink( $post );
115115
if ( $link ) {
116-
$label = sprintf( esc_attr__( 'View "%s"', 'lifterlms' ), $post->post_title );
117-
$actions['view'] = sprintf( '<a href="%1$s" rel="bookmark" aria-label="%2$s">%3$s</a>', $link, $label, __( 'View', 'lifterlms' ) );
116+
$label = sprintf( __( 'View "%s"', 'lifterlms' ), $post->post_title );
117+
$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' ) );
118118
}
119119

120120
return $actions;

includes/admin/settings/class.llms.settings.general.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function __construct() {
3535
add_filter( 'lifterlms_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
3636
add_action( 'lifterlms_settings_' . $this->id, array( $this, 'output' ) );
3737
add_action( 'lifterlms_settings_save_' . $this->id, array( $this, 'save' ) );
38-
3938
}
4039

4140
/**
@@ -115,13 +114,24 @@ function ( $role ) {
115114
'type' => 'checkbox',
116115
);
117116

117+
$settings[] = array(
118+
'title' => __( 'Frequency of Saving Tracked Events', 'lifterlms' ),
119+
'default' => 'minimum',
120+
'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' ),
121+
'id' => 'lifterlms_tracked_event_saving_frequency',
122+
'type' => 'select',
123+
'options' => array(
124+
'minimum' => __( 'Minimum', 'lifterlms' ),
125+
'always' => __( 'Always', 'lifterlms' ),
126+
),
127+
);
128+
118129
$settings[] = array(
119130
'id' => 'general_settings',
120131
'type' => 'sectionend',
121132
);
122133

123134
return apply_filters( 'lifterlms_general_settings', $settings );
124-
125135
}
126136

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

134144
$settings = $this->get_settings();
135145
LLMS_Admin_Settings::save_fields( $settings );
136-
137146
}
138-
139147
}
140148

141149
return new LLMS_Settings_General();

includes/class-llms-events.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ private function __construct() {
4545

4646
add_action( 'init', array( $this, 'register_events' ), 9 );
4747
add_action( 'init', array( $this, 'store_cookie' ) );
48-
4948
}
5049

5150
/**
@@ -74,11 +73,11 @@ public function get_client_settings() {
7473
return apply_filters(
7574
'llms_events_get_client_settings',
7675
array(
77-
'nonce' => wp_create_nonce( 'llms-tracking' ),
78-
'events' => $events,
76+
'nonce' => wp_create_nonce( 'llms-tracking' ),
77+
'events' => $events,
78+
'saving_frequency' => get_option( 'lifterlms_tracked_event_saving_frequency', 'minimum' ),
7979
)
8080
);
81-
8281
}
8382

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

106105
return array_key_exists( $event, $this->get_registered_events() );
107-
108106
}
109107

110108
/**
@@ -149,7 +147,6 @@ public function prepare_event( $raw_event = array() ) {
149147
}
150148

151149
return $prepared;
152-
153150
}
154151

155152
/**
@@ -221,7 +218,6 @@ public function record( $args = array() ) {
221218
}
222219

223220
return $llms_event;
224-
225221
}
226222

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

262258
return $recorded;
263-
264259
}
265260

266261
/**
@@ -297,7 +292,6 @@ public function register_events() {
297292
* @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.
298293
*/
299294
$this->registered_events = apply_filters( 'llms_get_registered_events', $events );
300-
301295
}
302296

303297
/**
@@ -333,7 +327,6 @@ protected function sanitize_raw_event( $raw ) {
333327
}
334328

335329
return $clean;
336-
337330
}
338331

339332
/**
@@ -391,7 +384,6 @@ protected function should_track_client_events() {
391384
* @param string[] $post_types Array of post types that should be tracked.
392385
*/
393386
return apply_filters( 'llms_tracking_should_track_client_events', $ret, $post_types );
394-
395387
}
396388

397389
/**
@@ -419,7 +411,6 @@ public function store_cookie() {
419411

420412
// Cookie reset.
421413
llms_setcookie( 'llms-tracking', '', time() - 60, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, llms_is_site_https() && is_ssl() );
422-
423414
}
424415

425416
/**
@@ -453,5 +444,4 @@ public function store_tracking_events( $tracking ) {
453444

454445
return true;
455446
}
456-
457447
}

includes/class.llms.ajax.handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ public static function quiz_get_question( $request ) {
792792
$attempt = $student_quizzes->get_attempt_by_key( $attempt_key );
793793

794794
// Don't allow the question to be retrieved if the attempt is not open or can't be resumed.
795-
if ( ! $attempt || ! $attempt->get_quiz()->is_open() || ( $attempt->get_quiz()->can_be_resumed() && ! $attempt->can_be_resumed() ) ) {
795+
if ( ! $attempt || ( ! $attempt->get_quiz()->is_open() && ( ! $attempt->get_quiz()->can_be_resumed() || ! $attempt->can_be_resumed() ) ) ) {
796796
$err->add( 500, __( 'There was an error retrieving the question. Please return to the lesson and try again.', 'lifterlms' ) );
797797
return $err;
798798
}

0 commit comments

Comments
 (0)