diff --git a/includes_class-sensei-admin.php.html b/includes_class-sensei-admin.php.html
index d21d8f9ed8..8cfbb005a2 100644
--- a/includes_class-sensei-admin.php.html
+++ b/includes_class-sensei-admin.php.html
@@ -799,7 +799,7 @@
Source: includes/class-sensei-admin.php
}
// Persist new lesson order to course meta.
- $new_lesson_order_string = join( ',', $new_lesson_order );
+ $new_lesson_order_string = implode( ',', $new_lesson_order );
update_post_meta( $course_id, '_lesson_order', $new_lesson_order_string );
}
@@ -917,7 +917,7 @@ Source: includes/class-sensei-admin.php
if ( ! is_wp_error( $new_post_id ) ) {
$post_meta = get_post_custom( $post->ID );
- if ( $post_meta && count( $post_meta ) > 0 ) {
+ if ( $post_meta ) {
/**
* Ignored meta fields when duplicating a post.
@@ -1121,7 +1121,7 @@ Source: includes/class-sensei-admin.php
$html = '';
- if ( 0 == count( $settings ) ) {
+ if ( ! $settings ) {
return $html;
}
@@ -1412,7 +1412,7 @@ Source: includes/class-sensei-admin.php
$courses = Sensei()->course->get_all_courses();
- if ( 0 < count( $courses ) ) {
+ if ( $courses ) {
// order the courses as set by the users
$all_course_ids = array();
diff --git a/includes_class-sensei-course.php.html b/includes_class-sensei-course.php.html
index 0d36e5c270..66121f41a8 100644
--- a/includes_class-sensei-course.php.html
+++ b/includes_class-sensei-course.php.html
@@ -1917,7 +1917,7 @@ Source: includes/class-sensei-course.php
// Get Course Categories
$category_output = get_the_term_list( $course_item->ID, 'course-category', '', ', ', '' );
- $active_html .= '<article class="' . esc_attr( join( ' ', get_post_class( [ 'course', 'post' ], $course_item->ID ) ) ) . '">';
+ $active_html .= '<article class="' . esc_attr( implode( ' ', get_post_class( [ 'course', 'post' ], $course_item->ID ) ) ) . '">';
// Image
$active_html .= Sensei()->course->course_image( absint( $course_item->ID ), '100', '100', true );
@@ -2058,7 +2058,7 @@ Source: includes/class-sensei-course.php
// Get Course Categories
$category_output = get_the_term_list( $course_item->ID, 'course-category', '', ', ', '' );
- $complete_html .= '<article class="' . esc_attr( join( ' ', get_post_class( [ 'course', 'post' ], $course_item->ID ) ) ) . '">';
+ $complete_html .= '<article class="' . esc_attr( implode( ' ', get_post_class( [ 'course', 'post' ], $course_item->ID ) ) ) . '">';
// Image
$complete_html .= Sensei()->course->course_image( absint( $course_item->ID ), 100, 100, true );
@@ -4089,9 +4089,10 @@ Source: includes/class-sensei-course.php
public function log_initial_publish_event( $course ) {
$product_ids = get_post_meta( $course->ID, '_course_woocommerce_product', false );
$product_count = empty( $product_ids ) ? 0 : count( array_filter( $product_ids, 'is_numeric' ) );
+ $modules = wp_get_post_terms( $course->ID, 'module' );
$event_properties = [
- 'module_count' => count( wp_get_post_terms( $course->ID, 'module' ) ),
+ 'module_count' => is_countable( $modules ) ? count( $modules ) : 0,
'lesson_count' => $this->course_lesson_count( $course->ID ),
'product_count' => $product_count,
'sample_course' => Sensei_Data_Port_Manager::SAMPLE_COURSE_SLUG === $course->post_name ? 1 : 0,
@@ -4181,6 +4182,7 @@ Source: includes/class-sensei-course.php
$content = $post->post_content;
$product_ids = get_post_meta( $course_id, '_course_woocommerce_product', false );
$product_count = empty( $product_ids ) ? 0 : count( array_filter( $product_ids, 'is_numeric' ) );
+ $modules = wp_get_post_terms( $course_id, 'module' );
$event_properties = [
'course_id' => $course_id,
@@ -4189,7 +4191,7 @@ Source: includes/class-sensei-course.php
'has_take_course_block' => has_block( 'sensei-lms/button-take-course', $content ) ? 1 : 0,
'has_contact_teacher_block' => has_block( 'sensei-lms/button-contact-teacher', $content ) ? 1 : 0,
'has_conditional_content_block' => has_block( 'sensei-lms/conditional-content', $content ) ? 1 : 0,
- 'module_count' => count( wp_get_post_terms( $course_id, 'module' ) ),
+ 'module_count' => is_countable( $modules ) ? count( $modules ) : 0,
'lesson_count' => $this->course_lesson_count( $course_id ),
'product_count' => $product_count,
'sample_course' => Sensei_Data_Port_Manager::SAMPLE_COURSE_SLUG === $post->post_name ? 1 : 0,
diff --git a/includes_class-sensei-frontend.php.html b/includes_class-sensei-frontend.php.html
index 19ad2dd70d..783cb3ba57 100644
--- a/includes_class-sensei-frontend.php.html
+++ b/includes_class-sensei-frontend.php.html
@@ -596,7 +596,7 @@ Source: includes/class-sensei-frontend.php
public function lesson_tags_display( $lesson_id = 0 ) {
if ( $lesson_id ) {
$tags = wp_get_post_terms( $lesson_id, 'lesson-tag' );
- if ( $tags && count( $tags ) > 0 ) {
+ if ( $tags ) {
$tag_list = '';
foreach ( $tags as $tag ) {
$tag_link = get_term_link( $tag, 'lesson-tag' );
@@ -1031,7 +1031,7 @@ Source: includes/class-sensei-frontend.php
the_post();
?>
- <article class="<?php echo esc_attr( join( ' ', get_post_class( array( 'course', 'post' ), get_the_ID() ) ) ); ?>">
+ <article class="<?php echo esc_attr( implode( ' ', get_post_class( array( 'course', 'post' ), get_the_ID() ) ) ); ?>">
<?php do_action( 'sensei_course_archive_meta' ); ?>
diff --git a/includes_class-sensei-grading-user-quiz.php.html b/includes_class-sensei-grading-user-quiz.php.html
index ec4cfb9257..7a31f36169 100644
--- a/includes_class-sensei-grading-user-quiz.php.html
+++ b/includes_class-sensei-grading-user-quiz.php.html
@@ -279,7 +279,7 @@ Source: includes/class-sensei-grading-user-quiz.php
*/
$possibly_new_args = apply_filters( 'sensei_grading_display_quiz_question', null, $type, $question_id, $right_answer, $user_answer_content );
- if ( null !== $possibly_new_args && 0 < count( $possibly_new_args ) ) {
+ if ( null !== $possibly_new_args && $possibly_new_args ) {
$type_name = $possibly_new_args['type_name'] ?? $type_name;
$right_answer = $possibly_new_args['right_answer'] ?? $right_answer;
$user_answer_content = $possibly_new_args['user_answer_content'] ?? $user_answer_content;
diff --git a/includes_class-sensei-guest-user.php.html b/includes_class-sensei-guest-user.php.html
index dcb155926a..28889a2479 100644
--- a/includes_class-sensei-guest-user.php.html
+++ b/includes_class-sensei-guest-user.php.html
@@ -194,7 +194,7 @@ Source: includes/class-sensei-guest-user.php
public function log_guest_user_out_before_all_actions() {
if (
is_user_logged_in() &&
- $this->is_current_user_guest()
+ self::is_current_user_guest()
) {
$this->guest_user_id = get_current_user_id();
wp_set_current_user( 0 );
diff --git a/includes_class-sensei-learner.php.html b/includes_class-sensei-learner.php.html
index b2c94628f7..e688eb7d82 100644
--- a/includes_class-sensei-learner.php.html
+++ b/includes_class-sensei-learner.php.html
@@ -781,21 +781,17 @@ Source: includes/class-sensei-learner.php
$learner_manager = self::instance();
$controller = new Sensei_Learners_Admin_Bulk_Actions_Controller( new Sensei_Learner_Management( '' ), $learner_manager );
$base_query_args = [ 'posts_per_page' => -1 ];
- $posts = $learner_manager->get_enrolled_courses_query( $user_id, $base_query_args )->posts;
- $courses = 0;
- if ( $posts ) {
- // We only want to show courses after the third one in the UI.
- $courses = array_slice( $posts, 3 );
- }
+ $courses_query = $learner_manager->get_enrolled_courses_query( $user_id, $base_query_args );
+
+ // We only want to show courses after the third one in the UI.
+ $courses = array_slice( $courses_query->posts, 3 );
$html_items = [];
- if ( count( $courses ) > 0 ) {
- foreach ( $courses as $course ) {
- $html_items[] = '<a href="' . esc_url( $controller->get_learner_management_course_url( $course->ID ) ) .
- '" class="sensei-students__enrolled-course" data-course-id="' . esc_attr( $course->ID ) . '">' .
- esc_html( $course->post_title ) .
- '</a>';
- }
+ foreach ( $courses as $course ) {
+ $html_items[] = '<a href="' . esc_url( $controller->get_learner_management_course_url( $course->ID ) ) .
+ '" class="sensei-students__enrolled-course" data-course-id="' . intval( $course->ID ) . '">' .
+ esc_html( $course->post_title ) .
+ '</a>';
}
wp_send_json_success( $html_items );
exit();
diff --git a/includes_class-sensei-lesson.php.html b/includes_class-sensei-lesson.php.html
index fe7a073c3d..c0afbe82d5 100644
--- a/includes_class-sensei-lesson.php.html
+++ b/includes_class-sensei-lesson.php.html
@@ -850,7 +850,7 @@ Source: includes/class-sensei-lesson.php
$post = get_post( $post_id );
$blocks = parse_blocks( $post->post_content );
- if ( 0 === count( $blocks ) || 'sensei-lms/featured-video' !== $blocks[0]['blockName'] ) {
+ if ( ! $blocks || 'sensei-lms/featured-video' !== $blocks[0]['blockName'] ) {
return null;
}
@@ -1057,7 +1057,7 @@ Source: includes/class-sensei-lesson.php
update_post_meta( $post_id, '_lesson_quiz', $quiz_id );
// Mark if the Lesson Quiz has questions
$quiz_questions = Sensei()->lesson->lesson_quiz_questions( $quiz_id );
- if ( 0 < count( $quiz_questions ) ) {
+ if ( $quiz_questions ) {
update_post_meta( $post_id, '_quiz_has_questions', '1' );
} else {
delete_post_meta( $post_id, '_quiz_has_questions' );
@@ -1438,7 +1438,7 @@ Source: includes/class-sensei-lesson.php
$html = '';
- if ( count( $questions ) > 0 ) {
+ if ( $questions ) {
$question_counter = 1;
foreach ( $questions as $question ) {
@@ -1488,9 +1488,18 @@ Source: includes/class-sensei-lesson.php
public function quiz_panel_question( $question_type = '', $question_counter = 0, $question_id = 0, $context = 'quiz', $multiple_data = array() ) {
global $row_counter;
- $html = '';
+ $random_order = null;
+ $question_grade = null;
+ $question_media_add_button = '';
+ $question_media_delete_class = '';
+ $question_media_link_class = '';
+ $question_media_link = '';
+ $question_media_thumb_class = '';
+ $question_media_thumb = '';
+ $question_media = '';
+ $html = '';
+ $question_class = '';
- $question_class = '';
if ( 'quiz' == $context ) {
if ( ! $row_counter || ! isset( $row_counter ) ) {
$row_counter = 1;
@@ -1558,7 +1567,7 @@ Source: includes/class-sensei-lesson.php
$question = get_post( $question_id );
$html .= '<td class="table-count question-number question-count-column"><span class="number">' . esc_html( $question_counter ) . '</span></td>';
$html .= '<td>' . esc_html( $question->post_title ) . '</td>';
- $html .= '<td class="question-grade-column">' . esc_html( $question_grade ) . '</td>';
+ $html .= '<td class="question-grade-column">' . esc_html( (string) $question_grade ) . '</td>';
$question_types_filtered = ucwords( str_replace( array( 'boolean', 'multiple-choice', 'gap-fill', 'single-line', 'multi-line', 'file-upload' ), array( __( 'True/False', 'sensei-lms' ), __( 'Multiple Choice', 'sensei-lms' ), __( 'Gap Fill', 'sensei-lms' ), __( 'Single Line', 'sensei-lms' ), __( 'Multi Line', 'sensei-lms' ), __( 'File Upload', 'sensei-lms' ) ), $question_type ) );
$html .= '<td>' . esc_html( $question_types_filtered ) . '</td>';
@@ -1616,7 +1625,7 @@ Source: includes/class-sensei-lesson.php
// Question grade
$html .= '<div>';
$html .= '<label for="question_' . esc_attr( $question_counter ) . '_grade">' . esc_html__( 'Grade:', 'sensei-lms' ) . '</label> ';
- $html .= '<input type="number" id="question_' . esc_attr( $question_counter ) . '_grade" class="question_grade small-text" name="question_grade" min="0" value="' . esc_attr( $question_grade ) . '" />';
+ $html .= '<input type="number" id="question_' . esc_attr( $question_counter ) . '_grade" class="question_grade small-text" name="question_grade" min="0" value="' . esc_attr( (string) $question_grade ) . '" />';
$html .= '</div>';
// Random order
@@ -1632,7 +1641,7 @@ Source: includes/class-sensei-lesson.php
$html .= '<button id="question_' . esc_attr( $question_counter ) . '_media_button" class="upload_media_file_button button-secondary" data-uploader-title="' . esc_attr__( 'Add file to question', 'sensei-lms' ) . '" data-uploader-button-text="' . esc_attr__( 'Add to question', 'sensei-lms' ) . '">' . esc_html( $question_media_add_button ) . '</button>';
$html .= '<button id="question_' . esc_attr( $question_counter ) . '_media_button_delete" class="delete_media_file_button button-secondary ' . esc_attr( $question_media_delete_class ) . '">' . esc_html__( 'Delete file', 'sensei-lms' ) . '</button><br/>';
$html .= '<span id="question_' . esc_attr( $question_counter ) . '_media_link" class="question_media_link ' . esc_attr( $question_media_link_class ) . '">' . wp_kses_post( $question_media_link ) . '</span>';
- $html .= '<br/><img id="question_' . esc_attr( $question_counter ) . '_media_preview" class="question_media_preview ' . esc_attr( $question_media_thumb_class ) . '" src="' . esc_url( $question_media_thumb ) . '" /><br/>';
+ $html .= '<br/><img id="question_' . esc_attr( $question_counter ) . '_media_preview" class="question_media_preview ' . esc_attr( $question_media_thumb_class ) . '" src="' . esc_url( (string) $question_media_thumb ) . '" /><br/>';
$html .= '<input type="hidden" id="question_' . esc_attr( $question_counter ) . '_media" class="question_media" name="question_media" value="' . esc_attr( $question_media ) . '" />';
$html .= '</div>';
@@ -2900,6 +2909,7 @@ Source: includes/class-sensei-lesson.php
* @access public
*/
public function lesson_update_question() {
+ $nonce = '';
// Add nonce security to the request.
if ( isset( $_POST['lesson_update_question_nonce'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification
@@ -3184,6 +3194,7 @@ Source: includes/class-sensei-lesson.php
}
public function lesson_update_grade_type() {
+ $nonce = '';
// Add nonce security to the request
if ( isset( $_POST['lesson_update_grade_type_nonce'] ) ) {
@@ -3208,6 +3219,7 @@ Source: includes/class-sensei-lesson.php
}
public function lesson_update_question_order() {
+ $nonce = '';
// Add nonce security to the request
if ( isset( $_POST['lesson_update_question_order_nonce'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification
@@ -3241,6 +3253,7 @@ Source: includes/class-sensei-lesson.php
}
public function lesson_update_question_order_random() {
+ $nonce = '';
// Add nonce security to the request
if ( isset( $_POST['lesson_update_question_order_random_nonce'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification
@@ -3277,6 +3290,7 @@ Source: includes/class-sensei-lesson.php
$question_wrong_answers = $question_right_answers = array();
$question_type = 'multiple-choice';
$question_category = '';
+ $question_grade = null;
// Handle Question Type
if ( isset( $data['question_type'] ) && ( '' != $data['question_type'] ) ) {
@@ -3398,7 +3412,7 @@ Source: includes/class-sensei-lesson.php
}
}
- $wrong_answer_count = count( $question_wrong_answers );
+ $wrong_answer_count = is_countable( $question_wrong_answers ) ? count( $question_wrong_answers ) : 0;
// Only save if there is a valid title
if ( $post_title != '' ) {
@@ -3695,7 +3709,7 @@ Source: includes/class-sensei-lesson.php
// If viewing quiz on the frontend then show questions in random order if set.
if ( ! is_admin() ) {
$random_order = get_post_meta( $quiz_id, '_random_question_order', true );
- if ( $random_order && 'yes' === $random_order ) {
+ if ( 'yes' === $random_order ) {
$orderby = 'rand';
}
}
@@ -3821,13 +3835,15 @@ Source: includes/class-sensei-lesson.php
// Negative amount is considered as All (same as zero).
if ( $show_questions > 0 ) {
// Get random set of array keys from selected questions array.
+ $questions_count = is_countable( $questions_array ) ? count( $questions_array ) : 0;
$selected_questions = array_rand(
$questions_array,
- $show_questions > count( $questions_array ) ? count( $questions_array ) : $show_questions
+ $show_questions > $questions_count ? $questions_count : $show_questions
);
- // Loop through all questions and pick the the ones to be shown based on the random key selection.
+ // Loop through all questions and pick the ones to be shown based on the random key selection.
$questions = [];
+
foreach ( $questions_array as $k => $question ) {
// Random keys will always be an array, unless only one question is to be shown.
diff --git a/includes_class-sensei-messages.php.html b/includes_class-sensei-messages.php.html
index f02df03023..46f7163ea1 100644
--- a/includes_class-sensei-messages.php.html
+++ b/includes_class-sensei-messages.php.html
@@ -637,6 +637,7 @@ Source: includes/class-sensei-messages.php
return false;
}
+ $user_login = null;
if ( $user_id == 0 ) {
global $current_user;
wp_get_current_user();
diff --git a/includes_class-sensei-modules.php.html b/includes_class-sensei-modules.php.html
index 88b2fcd2a6..d53164dd1d 100644
--- a/includes_class-sensei-modules.php.html
+++ b/includes_class-sensei-modules.php.html
@@ -1220,7 +1220,7 @@ Source: includes/class-sensei-modules.php
);
$lessons = get_posts( $args );
- if ( is_wp_error( $lessons ) || 0 >= count( $lessons ) ) {
+ if ( is_wp_error( $lessons ) || ! $lessons ) {
return 0;
}
@@ -2579,10 +2579,12 @@ Source: includes/class-sensei-modules.php
*/
public function filter_course_selected_terms( $terms, $course_ids_array, $taxonomies ) {
+ $taxonomies_count = is_countable( $taxonomies ) ? count( $taxonomies ) : 0;
+
// dont limit for admins and other taxonomies. This should also only apply to admin
if ( current_user_can( 'manage_options' ) || ! is_admin() || empty( $terms )
// only apply this to module only taxonomy queries so 1 taxonomy only:
- || count( $taxonomies ) > 1 || ! in_array( 'module', $taxonomies ) ) {
+ || $taxonomies_count > 1 || ! in_array( 'module', $taxonomies ) ) {
return $terms;
}
diff --git a/includes_class-sensei-question.php.html b/includes_class-sensei-question.php.html
index 2e27982e30..69121dae55 100644
--- a/includes_class-sensei-question.php.html
+++ b/includes_class-sensei-question.php.html
@@ -417,7 +417,7 @@ Source: includes/class-sensei-question.php
$quizzes = array_unique( array_filter( $quizzes ) );
}
- if ( 0 == count( $quizzes ) ) {
+ if ( ! $quizzes ) {
echo wp_kses_post( $no_lessons );
return;
}
diff --git a/includes_class-sensei-quiz.php.html b/includes_class-sensei-quiz.php.html
index b317b9c865..85ec710fe1 100644
--- a/includes_class-sensei-quiz.php.html
+++ b/includes_class-sensei-quiz.php.html
@@ -1706,7 +1706,7 @@ Source: includes/class-sensei-quiz.php
}
$sensei_question_loop['questions_asked'] = wp_list_pluck( $all_questions, 'ID' );
- $sensei_question_loop['total'] = count( $all_questions );
+ $sensei_question_loop['total'] = is_countable( $all_questions ) ? count( $all_questions ) : 0;
// Paginate the questions.
if ( $sensei_question_loop['posts_per_page'] > 0 ) {
@@ -2410,7 +2410,7 @@ Source: includes/class-sensei-quiz.php
return;
}
- $quiz_available = $this->is_quiz_available( $quiz_id, $user_id );
+ $quiz_available = static::is_quiz_available( $quiz_id, $user_id );
if ( ! $quiz_available ) {
return;
}
diff --git a/includes_class-sensei-utils.php.html b/includes_class-sensei-utils.php.html
index 8093f3bc3f..440b172c7a 100644
--- a/includes_class-sensei-utils.php.html
+++ b/includes_class-sensei-utils.php.html
@@ -1513,11 +1513,11 @@ Source: includes/class-sensei-utils.php
return 0;
}
- return self::as_absolute_rounded_number( doubleval( $numerator ) / ( $denominator ), $decimal_places_to_round );
+ return self::as_absolute_rounded_number( floatval( $numerator ) / ( $denominator ), $decimal_places_to_round );
}
public static function as_absolute_rounded_number( $number, $decimal_places_to_round = 0 ) {
- return abs( round( ( doubleval( $number ) ), $decimal_places_to_round ) );
+ return abs( round( ( floatval( $number ) ), $decimal_places_to_round ) );
}
/**
@@ -2164,8 +2164,7 @@ Source: includes/class-sensei-utils.php
$drop_down_element .= '<option value="">' . esc_html__( 'None', 'sensei-lms' ) . '</option>';
}
- if ( count( $options ) > 0 ) {
-
+ if ( $options ) {
foreach ( $options as $value => $option ) {
$element = '';
diff --git a/includes_data-port_class-sensei-import-csv-reader.php.html b/includes_data-port_class-sensei-import-csv-reader.php.html
index 6ef7ee651b..ba141b4191 100644
--- a/includes_data-port_class-sensei-import-csv-reader.php.html
+++ b/includes_data-port_class-sensei-import-csv-reader.php.html
@@ -173,14 +173,14 @@ Source: includes/data-port/class-sensei-import-csv-reader
*/
private function get_columns_number() {
$this->file->seek( 0 );
- $first_line_columns = count( $this->file->current() );
+ $first_line_columns = is_countable( $this->file->current() ) ? count( $this->file->current() ) : 0;
// Skip the header.
$this->file->next();
while ( ! $this->file->eof() ) {
$second_line = $this->file->current();
- $second_line_columns = count( $second_line );
+ $second_line_columns = is_countable( $second_line ) ? count( $second_line ) : 0;
// SplFileObject->current() returns [ 0 => null ] on empty lines.
if ( 1 === $second_line_columns && empty( $second_line[0] ) ) {
@@ -230,7 +230,7 @@ Source: includes/data-port/class-sensei-import-csv-reader
while ( $lines_processed < $this->lines_per_batch ) {
$lines_processed++;
- $indexed_line = $this->file->current();
+ $indexed_line = is_array( $this->file->current() ) ? $this->file->current() : [];
// SplFileObject->current() returns [ 0 => null ] on empty lines.
if ( 1 < count( $indexed_line ) || ( 1 === count( $indexed_line ) && ! empty( $indexed_line[0] ) ) ) {
diff --git a/includes_internal_emails_class-email-sender.php.html b/includes_internal_emails_class-email-sender.php.html
index 1765b9dac8..0636c9f074 100644
--- a/includes_internal_emails_class-email-sender.php.html
+++ b/includes_internal_emails_class-email-sender.php.html
@@ -163,8 +163,7 @@ Source: includes/internal/emails/class-email-sender.php
$recipient,
$subject,
$message,
- $this->get_email_headers(),
- null
+ $this->get_email_headers()
);
sensei_log_event( 'email_send', [ 'type' => $usage_tracking_type ] );
}
diff --git a/includes_template-functions.php.html b/includes_template-functions.php.html
index 466042ae80..205f80d9be 100644
--- a/includes_template-functions.php.html
+++ b/includes_template-functions.php.html
@@ -187,7 +187,7 @@ Source: includes/template-functions.php
foreach ( (array) $course_modules as $module ) {
$module_lessons = Sensei()->modules->get_lessons( $course_id, $module->term_id );
- if ( count( $module_lessons ) === 0 ) {
+ if ( ! $module_lessons ) {
continue;
}
@@ -716,7 +716,11 @@ Source: includes/template-functions.php
global $sensei_question_loop;
- $questions_count = count( $sensei_question_loop['questions'] );
+ if ( empty( $sensei_question_loop['questions'] ) ) {
+ return false;
+ }
+
+ $questions_count = is_countable( $sensei_question_loop['questions'] ) ? count( $sensei_question_loop['questions'] ) : 0;
if ( 0 === $questions_count ) {
return false;
diff --git a/sensei_existing_questions_query_results.html b/sensei_existing_questions_query_results.html
index 5ea9673928..ba81457a06 100644
--- a/sensei_existing_questions_query_results.html
+++ b/sensei_existing_questions_query_results.html
@@ -144,7 +144,7 @@ Parameters:
Source:
diff --git a/sensei_filter_category_questions_by_author.html b/sensei_filter_category_questions_by_author.html
index 4e51e7a086..17c1110562 100644
--- a/sensei_filter_category_questions_by_author.html
+++ b/sensei_filter_category_questions_by_author.html
@@ -146,7 +146,7 @@ Parameters:
Source:
diff --git a/sensei_filter_module_terms_by_owner.html b/sensei_filter_module_terms_by_owner.html
index 4937e4caa0..f94476b22b 100644
--- a/sensei_filter_module_terms_by_owner.html
+++ b/sensei_filter_module_terms_by_owner.html
@@ -193,7 +193,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_archive_title.html b/sensei_lesson_archive_title.html
index 747923233f..6d6e579577 100644
--- a/sensei_lesson_archive_title.html
+++ b/sensei_lesson_archive_title.html
@@ -141,7 +141,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_count.html b/sensei_lesson_count.html
index 2e8e1c1cd5..7e2517c029 100644
--- a/sensei_lesson_count.html
+++ b/sensei_lesson_count.html
@@ -141,7 +141,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_course_signup_notice_level.html b/sensei_lesson_course_signup_notice_level.html
index d48c31737c..192f15cb5e 100644
--- a/sensei_lesson_course_signup_notice_level.html
+++ b/sensei_lesson_course_signup_notice_level.html
@@ -167,7 +167,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_course_signup_notice_message.html b/sensei_lesson_course_signup_notice_message.html
index a1354f9219..24160fcab2 100644
--- a/sensei_lesson_course_signup_notice_message.html
+++ b/sensei_lesson_course_signup_notice_message.html
@@ -190,7 +190,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_excerpt.html b/sensei_lesson_excerpt.html
index ffa3653d0f..3868940915 100644
--- a/sensei_lesson_excerpt.html
+++ b/sensei_lesson_excerpt.html
@@ -141,7 +141,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_placeholder_image_url.html b/sensei_lesson_placeholder_image_url.html
index 7129c81dc0..f21b1553cd 100644
--- a/sensei_lesson_placeholder_image_url.html
+++ b/sensei_lesson_placeholder_image_url.html
@@ -141,7 +141,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_prerequisite.html b/sensei_lesson_prerequisite.html
index 81e7964c88..93b1b27bca 100644
--- a/sensei_lesson_prerequisite.html
+++ b/sensei_lesson_prerequisite.html
@@ -172,7 +172,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_quiz_questions.html b/sensei_lesson_quiz_questions.html
index a4a625c3cd..21d05978be 100644
--- a/sensei_lesson_quiz_questions.html
+++ b/sensei_lesson_quiz_questions.html
@@ -167,7 +167,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_show_course_signup_notice.html b/sensei_lesson_show_course_signup_notice.html
index 715b39fb95..af2c0b4d83 100644
--- a/sensei_lesson_show_course_signup_notice.html
+++ b/sensei_lesson_show_course_signup_notice.html
@@ -167,7 +167,7 @@ Parameters:
Source:
diff --git a/sensei_lesson_take_course_url.html b/sensei_lesson_take_course_url.html
index 81cffeefde..7ec6e96999 100644
--- a/sensei_lesson_take_course_url.html
+++ b/sensei_lesson_take_course_url.html
@@ -169,7 +169,7 @@ Parameters:
Source:
diff --git a/sensei_quiz_panel_add.html b/sensei_quiz_panel_add.html
index 60a3770e8b..8d1312aa2b 100644
--- a/sensei_quiz_panel_add.html
+++ b/sensei_quiz_panel_add.html
@@ -168,7 +168,7 @@ Parameters:
Source:
diff --git a/sensei_quiz_question_ai_upsell_scripts.html b/sensei_quiz_question_ai_upsell_scripts.html
index d2d67c3cea..2d15885041 100644
--- a/sensei_quiz_question_ai_upsell_scripts.html
+++ b/sensei_quiz_question_ai_upsell_scripts.html
@@ -144,7 +144,7 @@ Parameters:
Source:
diff --git a/sensei_quiz_question_answers_inside_after.html b/sensei_quiz_question_answers_inside_after.html
index 0825e805bf..09b7088853 100644
--- a/sensei_quiz_question_answers_inside_after.html
+++ b/sensei_quiz_question_answers_inside_after.html
@@ -144,7 +144,7 @@ Parameters:
Source:
diff --git a/sensei_quiz_question_answers_inside_before.html b/sensei_quiz_question_answers_inside_before.html
index 46a1d3e418..bc77f16a4b 100644
--- a/sensei_quiz_question_answers_inside_before.html
+++ b/sensei_quiz_question_answers_inside_before.html
@@ -144,7 +144,7 @@ Parameters:
Source:
diff --git a/sensei_quiz_settings.html b/sensei_quiz_settings.html
index 74016d7345..2f6af52c8d 100644
--- a/sensei_quiz_settings.html
+++ b/sensei_quiz_settings.html
@@ -141,7 +141,7 @@ Parameters:
Source:
diff --git a/sensei_scripts_allowed_pages.html b/sensei_scripts_allowed_pages.html
index f369c6e992..a9ed219d1b 100644
--- a/sensei_scripts_allowed_pages.html
+++ b/sensei_scripts_allowed_pages.html
@@ -141,7 +141,7 @@ Parameters:
Source:
diff --git a/sensei_scripts_allowed_post_type_pages.html b/sensei_scripts_allowed_post_type_pages.html
index 3ef2c26ff4..d0970443da 100644
--- a/sensei_scripts_allowed_post_type_pages.html
+++ b/sensei_scripts_allowed_post_type_pages.html
@@ -141,7 +141,7 @@ Parameters:
Source:
@@ -315,7 +315,7 @@ Parameters:
Source:
diff --git a/sensei_scripts_allowed_post_types.html b/sensei_scripts_allowed_post_types.html
index 3c8901bd38..3e63ff804a 100644
--- a/sensei_scripts_allowed_post_types.html
+++ b/sensei_scripts_allowed_post_types.html
@@ -141,7 +141,7 @@ Parameters:
Source:
@@ -315,7 +315,7 @@ Parameters:
Source:
diff --git a/sensei_show_lesson_numbers.html b/sensei_show_lesson_numbers.html
index 4a40994643..5ecef3f55b 100644
--- a/sensei_show_lesson_numbers.html
+++ b/sensei_show_lesson_numbers.html
@@ -144,7 +144,7 @@ Parameters:
Source:
diff --git a/sensei_the_question_number.html b/sensei_the_question_number.html
index 4987469bb0..6eb1c2ac8e 100644
--- a/sensei_the_question_number.html
+++ b/sensei_the_question_number.html
@@ -190,7 +190,7 @@ Parameters:
Source:
diff --git a/sensei_wpcom_product_slugs.html b/sensei_wpcom_product_slugs.html
index 784d8e0fda..14cfafd565 100644
--- a/sensei_wpcom_product_slugs.html
+++ b/sensei_wpcom_product_slugs.html
@@ -144,7 +144,7 @@ Parameters:
Source: