Skip to content
Merged

v4.0.4 #2942

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm exec lint-staged
pnpm exec lint-staged --no-revert
4 changes: 3 additions & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"*.{ts,tsx}": ["pnpm exec eslint --fix", "bash -c 'pnpm exec tsc --noEmit'"],
"*.{ts,tsx,jsonc,md}": ["pnpm exec prettier --write"],
"*.php": ["./vendor/bin/phpstan analyze --memory-limit=-1"]
"*.php": [
"bash -c 'if [ ! -x ./vendor/bin/phpstan ]; then printf \"\\nError: PHPStan is not installed.\\n\\nInstall it with:\\n composer install\\n\\nThen retry your commit.\\n\\n\" >&2; exit 1; fi; exec ./vendor/bin/phpstan analyze --memory-limit=-1 \"$@\"' --"
]
}
4 changes: 2 additions & 2 deletions assets/core/scss/components/_calendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
}

.tutor-range-calendar-popover {
width: 700px;
max-width: 700px;
min-width: 700px;
max-width: 750px;

@include tutor-breakpoint-down(md) {
width: 300px;
Expand Down
12 changes: 9 additions & 3 deletions assets/core/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import collapse from '@alpinejs/collapse';
import focus from '@alpinejs/focus';
import { setLocaleData } from '@wordpress/i18n';
import Alpine from 'alpinejs';

import { TutorComponentRegistry } from '@Core/ts/ComponentRegistry';
Expand Down Expand Up @@ -75,11 +76,16 @@ const initializePlugin = async () => {
});

TutorComponentRegistry.registerLazy({
calendar: () =>
import(
calendar: () => {
if (tutorConfig.calendar_locales) {
setLocaleData(tutorConfig.calendar_locales, 'tutor');
}

return import(
/* webpackChunkName: "tutor-calendar" */
'@Core/ts/components/calendar'
).then(({ calendarMeta }) => calendarMeta),
).then(({ calendarMeta }) => calendarMeta);
},

form: () =>
import(
Expand Down
3 changes: 3 additions & 0 deletions classes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ public function modify_localize_data( $localize_data ) {
}
}
} else {
if ( 'en_US' !== $localize_data['local'] ) {
$localize_data['calendar_locales'] = tutils()->get_script_locale_data( 'tutor-calendar', $localize_data['local'] );
}

// Assign quiz option.
if ( ! empty( $post->post_type ) && 'tutor_quiz' === $post->post_type ) {
Expand Down
9 changes: 6 additions & 3 deletions classes/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,22 +800,25 @@ public function ajax_switch_profile() {
}

$switch_mode = '';
$switch_label = '';
$current_mode = Input::post( 'current_mode' );

if ( ! in_array( $current_mode, array( self::VIEW_AS_INSTRUCTOR, self::VIEW_AS_STUDENT ), true ) ) {
$this->response_bad_request( tutor_utils()->error_message( 'invalid_req' ) );
}

if ( self::VIEW_AS_INSTRUCTOR === $current_mode ) {
$switch_mode = self::VIEW_AS_STUDENT;
$switch_mode = self::VIEW_AS_STUDENT;
$switch_label = __( 'Student', 'tutor' );
} elseif ( self::VIEW_AS_STUDENT === $current_mode ) {
$switch_mode = self::VIEW_AS_INSTRUCTOR;
$switch_mode = self::VIEW_AS_INSTRUCTOR;
$switch_label = __( 'Instructor', 'tutor' );
}

update_user_meta( $user_id, self::VIEW_MODE_USER_META, $switch_mode );

// translators:%s for switching mode.
$this->response_success( sprintf( __( 'Profile switched to %s!', 'tutor' ), $switch_mode ) );
$this->response_success( sprintf( __( 'Profile switched to %s!', 'tutor' ), $switch_label ) );
}

/**
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: lms, course, elearning, education, learning management system
Requires at least: 5.3
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 4.0.3
Stable tag: 4.0.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -338,6 +338,13 @@ Tutor LMS allows you to offer certificates to your students upon course completi

== Changelog ==

= 4.0.4 - 31 July, 2026

Fix: Resolved the dark theme compatibility issue in the Course Builder.
Fix: Added translation support for some previously untranslatable strings.
Fix: Fixed the incorrect update notification in Tutor LMS Pro. (Pro)
Fix: Prevented certificates from appearing for courses with no assigned certificate. (Pro)

= 4.0.3 - 24 July, 2026

Fix: Resolved an issue where quiz submissions failed in Legacy Mode.
Expand Down
2 changes: 1 addition & 1 deletion templates/dashboard/account/billing/order-history.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<?php
if ( empty( $orders ) ) :
EmptyState::make()
->title( 'No Orders Found!' )
->title( __( 'No Orders Found!', 'tutor' ) )
->icon( tutor_utils()->get_themed_svg( 'images/illustrations/order-empty.svg' ) )
->render();
else :
Expand Down
2 changes: 1 addition & 1 deletion templates/dashboard/discussions/comment-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<?php if ( empty( $lesson_comments ) ) : ?>
<?php
EmptyState::make()
->title( 'No Comments Found!' )
->title( __( 'No Comments Found!', 'tutor' ) )
->icon( tutor_utils()->get_themed_svg( 'images/illustrations/comments-empty.svg' ) )
->render();
?>
Expand Down
2 changes: 1 addition & 1 deletion templates/dashboard/discussions/qna-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<?php if ( empty( $questions ) ) : ?>
<?php
EmptyState::make()
->title( 'No Questions Found!' )
->title( __( 'No Questions Found!', 'tutor' ) )
->icon( tutor_utils()->get_themed_svg( 'images/illustrations/qna-empty.svg' ) )
->render();
?>
Expand Down
8 changes: 4 additions & 4 deletions templates/dashboard/instructor/logged-in.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if ( 'try_again' === $instructor_status ) {
Alert::make()
->text( 'You have been rejected from being an instructor.' )
->text( __( 'You have been rejected from being an instructor.', 'tutor' ) )
->variant( Alert::WARNING )
->icon( Icon::WARNING )
->render();
Expand All @@ -34,11 +34,11 @@
<?php
$instructor_status_text = '';
if ( 'pending' === $instructor_status ) {
$instructor_status_text = 'Your application will be reviewed and the results will be sent to you by email.';
$instructor_status_text = __( 'Your application will be reviewed and the results will be sent to you by email.', 'tutor' );
} elseif ( 'approved' === $instructor_status ) {
$instructor_status_text = 'Your application has been accepted. Further necessary details have been sent to your registered email account.';
$instructor_status_text = __( 'Your application has been accepted. Further necessary details have been sent to your registered email account.', 'tutor' );
} elseif ( 'blocked' === $instructor_status ) {
$instructor_status_text = 'You have been blocked from being an instructor.';
$instructor_status_text = __( 'You have been blocked from being an instructor.', 'tutor' );
}
Alert::make()
->text( $instructor_status_text )
Expand Down
2 changes: 1 addition & 1 deletion templates/dashboard/my-courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class="tutor-btn tutor-btn-primary tutor-btn-small tutor-gap-2"
<?php if ( empty( $results ) ) : ?>
<?php
EmptyState::make()
->title( 'No Courses Found' )
->title( __( 'No Courses Found', 'tutor' ) )
->icon( tutor_utils()->get_themed_svg( 'images/illustrations/learning-empty.svg' ) )
->render();
?>
Expand Down
4 changes: 2 additions & 2 deletions templates/learning-area/lesson/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class="tutor-flex tutor-items-center tutor-justify-between tutor-px-6 tutor-py-5
<?php
ConfirmationModal::make()
->id( 'delete-comment-modal' )
->title( 'Delete This Item?' )
->message( 'This action cannot be undone.' )
->title( __( 'Delete This Item?', 'tutor' ) )
->message( __( 'This action cannot be undone.', 'tutor' ) )
->icon( Icon::DELETE_2, 80 )
->mutation_state( 'deleteCommentMutation' )
->confirm_handler( 'deleteCommentMutation?.mutate({ comment_id: payload?.commentId })' )
Expand Down
2 changes: 1 addition & 1 deletion templates/learning-area/subpages/qna.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<?php if ( empty( $questions ) ) : ?>
<?php
EmptyState::make()
->title( 'No Questions Found!' )
->title( __( 'No Questions Found!', 'tutor' ) )
->icon( tutor_utils()->get_themed_svg( 'images/illustrations/qna-empty.svg' ) )
->render();
?>
Expand Down
4 changes: 2 additions & 2 deletions tutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://tutorlms.com
* Description: Build and manage professional online courses with unlimited lessons, a flexible quiz engine, and a complete student learning experience. No coding needed.
* Author: Themeum
* Version: 4.0.3
* Version: 4.0.4
* Author URI: https://themeum.com
* Requires PHP: 7.4
* Requires at least: 5.3
Expand All @@ -26,7 +26,7 @@
*
* @since 1.0.0
*/
define( 'TUTOR_VERSION', '4.0.3' );
define( 'TUTOR_VERSION', '4.0.4' );
define( 'TUTOR_FILE', __FILE__ );
define( 'TUTOR_ENV', 'PROD' ); // DEV || PROD.

Expand Down
2 changes: 1 addition & 1 deletion views/pages/course-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<body data-tutor-theme='light' <?php body_class(); ?>>
<div id="tutor-course-builder"></div>
<?php do_action( 'tutor_course_builder_footer' ); ?>
<?php wp_footer(); ?>
Expand Down
Loading