Tutor Enhancements Documentation

Documentation โ€” Tutor LMS Enhancements
Tutor LMS Enhancements โ€” Documentation
Plugin Documentation

Tutor LMS
Enhancements

A suite of three integrated upgrades for the Tutor LMS lesson comment system: a full WYSIWYG rich-text editor, a thumbs-up/thumbs-down voting system, and HTML email notifications for comments and replies.

๐Ÿ“ฆ Version 2.2.0 ๐Ÿ”Œ Requires: Tutor LMS โœ๏ธ Rich text ยท Voting ยท Notifications

Ready to get started?

One-time payment of $99 ยท Lifetime updates ยท Secure checkout via WooCommerce

Purchase the Plugin โ€” $99 โ†’
Section 1

Overview

Tutor LMS Enhancements extends the Tutor LMS lesson comment system with three integrated features. It works by deploying custom template files into your active WordPress theme, overriding Tutor LMS’s default comment rendering without touching any core plugin files. This means updates to Tutor LMS will never break your enhanced comment experience.

โœ๏ธ

WYSIWYG Editor

Replaces the plain textarea with a TinyMCE editor. Students can bold, italicize, add lists, links, and attach images to their comments and replies.

๐Ÿ‘

Comment Voting

Thumbs-up and thumbs-down buttons on every comment and reply. Helps the most helpful contributions rise to the top in active courses.

๐Ÿ“ง

Email Notifications

HTML email alerts sent to enrolled students and instructors whenever a new comment or reply is posted on a lesson.

๐Ÿ—‘๏ธ

Comment Deletion

Comment authors can delete their own comments and replies directly from the lesson page โ€” no need to contact an admin.

โ„น๏ธ

Non-destructive by design. Uninstalling the plugin removes all template files from your theme automatically, leaving no traces behind.

Section 2

Requirements

RequirementDetails
WordPress5.0 or higher
PHP7.4 or higher
Tutor LMSAny current version (Free or Pro) โ€” lesson comments must be enabled in Tutor LMS settings
User RoleAdministrator access required for settings and license management
โš ๏ธ

Lesson comments must be enabled in Tutor LMS โ†’ Settings โ†’ Course for the WYSIWYG editor and voting features to appear on lesson pages.

Section 3

Installation

Step 1: Upload the plugin

  1. Log in to your WordPress admin dashboard
  2. Navigate to Plugins โ†’ Add New โ†’ Upload Plugin
  3. Click Choose File and select the downloaded ZIP file
  4. Click Install Now, then Activate Plugin

Step 2: Activate your license

After activation, navigate to the License Management page. Its location depends on whether other Ksajie plugins are installed:

  • If the Ksajie hub is present: Ksajie โ†’ TLE License
  • If no Ksajie hub is present: TLE License in the main WordPress admin sidebar

Enter your license key and click Activate License. The plugin will block all functionality until the license is active.

Step 3: Verify template deployment

After license activation, browse to any lesson page on the frontend. The comment form should display the TinyMCE editor with a toolbar instead of a plain textarea. If the editor does not appear, check that lesson comments are enabled in Tutor LMS settings and that the template files have been created in your active theme at {theme}/tutor/single/lesson/.

โ„น๏ธ

Your license is tied to the domain of the site where it is activated. To move it to a different domain, deactivate it on the current site first.

Section 4

Settings

Navigate to Tutor โ†’ Enhancements in the WordPress admin to access the plugin settings. All three options are toggle switches โ€” changes take effect immediately after clicking Save Settings.

Email Notifications

When enabled, sends HTML email alerts to enrolled students and course instructors when a new comment or reply is posted on a lesson. The comment author is excluded from the recipient list.

Off by default

Restrict Image Uploads to Instructors Only

When enabled, hides the image attach button for students and blocks file uploads server-side. Only course instructors can attach images to their comments.

Off by default

Open Comments Tab by Default

When enabled, automatically redirects to the Comments tab on lesson load โ€” but only if the lesson has no Overview tab. Prevents the Comments tab from becoming the default on lessons that have overview content.

Off by default
Section 5

WYSIWYG Comment Editor

The plugin replaces the standard Tutor LMS plain text comment input with a WordPress TinyMCE editor on all lesson and assignment comment forms. The editor works on both the main comment form and all reply forms.

Toolbar

The editor toolbar includes one row of formatting controls: Bold, Italic, Underline, Bullet List, Numbered List, Link, Unlink. The Visual/Text tab switcher is hidden for a cleaner appearance. The editor height is fixed at 200px.

How submission works

When the Submit button is clicked, the plugin intercepts the form submission, syncs the TinyMCE content to the underlying textarea, validates that the comment is not empty (unless an image is attached), then posts the data to Tutor LMS’s AJAX endpoint. On success the page reloads to prevent comment duplication. On error an alert is shown and the submit button is re-enabled.

HTML preservation

WordPress’s default comment system strips most HTML tags. The plugin hooks into WordPress’s comment filters to selectively allow safe formatting tags โ€” bold, italic, underline, lists, and links โ€” to pass through on lesson and assignment comments. All other HTML is still stripped as normal.

Reply box behavior

Each comment has a Reply link. Clicking it shows the reply form below that comment. Clicking it again, or clicking Reply on a different comment, hides the current form. Only one reply box is open at a time.

Image attachments

A paperclip button below each comment and reply form allows attaching a single image. Accepted formats are JPEG, PNG, GIF, and WebP with a maximum size of 2MB per file โ€” enforced in the browser before upload and again on the server. After selecting a file, the name and size are shown next to the button with a Remove link.

Uploaded images are stored in the WordPress Media Library as standard attachments and embedded in the comment as an image. If the Restrict Image Uploads to Instructors Only setting is enabled, students see no attach button and server-side uploads from non-instructors are blocked.

Section 6

Comment Voting

Thumbs-up and thumbs-down buttons appear on every comment and reply, letting the community surface the most helpful contributions. Vote counts are rendered in the page HTML and visible to all visitors including guests โ€” but casting or changing a vote requires being logged in.

Voting rules

ActionResult
Click upvote (no existing vote)Upvote is added; upvote count increases by 1
Click upvote (already upvoted)Upvote is removed; upvote count decreases by 1 (toggle)
Click downvote (already upvoted)Vote type switches from upvote to downvote; both counts adjust
Click vote on own commentNo action โ€” buttons are visually disabled for comment authors
Click vote while not logged inServer returns an error; no change recorded

Vote counts update immediately via AJAX without a page reload. The database uses a unique constraint on the combination of comment ID and user ID to prevent duplicate votes at the database level.

โš ๏ธ

All vote data is stored in a custom database table (wp_tutor_comment_votes). This table is permanently dropped when the plugin is uninstalled via Plugins โ†’ Delete. Export the table first if you need to preserve the data.

Section 7

Email Notifications

Email notifications are disabled by default. Enable them by going to Tutor โ†’ Enhancements and toggling the Email Notifications switch on, then clicking Save Settings.

When notifications are sent

  • When a new top-level comment is posted on a lesson
  • When a reply is posted on a lesson comment (reply notifications are sent after the page response completes to avoid interfering with Tutor LMS’s AJAX handling)

Who receives notifications

  • All students enrolled in the course at the time the comment is posted
  • The course author (primary instructor)
  • Any additional instructors assigned to the course via Tutor LMS
  • The comment author is excluded โ€” they do not receive a notification about their own comment
  • All recipient addresses are de-duplicated before sending
โš ๏ธ

For large courses with hundreds or thousands of enrolled students, enabling this feature will send one email per enrolled student on every comment. Consider using a transactional email service (SendGrid, Mailgun, etc.) via an SMTP plugin to handle the volume reliably.

Email content

Each notification is an HTML email with inline styles for broad email client compatibility. It includes a colored header banner (“New Comment Posted” or “New Reply Posted”), the commenter’s display name, course name, lesson name, a blockquote showing up to 150 characters of the comment text, and a “View Lesson & Reply” button linking directly to the lesson. The subject line format is: [Course Name] New comment on "Lesson Name".

Section 8

Comments Tab Default

When the Open Comments Tab by Default setting is enabled, the plugin automatically redirects to the Comments tab when a lesson page loads. This only activates on lessons that have no Overview tab โ€” if an Overview tab is present, no redirect occurs. This prevents the Comments tab from becoming the default on lessons that have existing overview content, while still encouraging engagement on discussion-focused lessons.

Section 9

Comment Deletion

Comment authors can delete their own comments directly from the lesson page using a Delete link below the comment. Deleting a parent comment also soft-deletes all of its replies. The deletion is handled via AJAX โ€” the comment fades out and is removed from the DOM without a page reload. Deleted comments are moved to the WordPress trash rather than permanently deleted.

Section 10

Template System

Tutor LMS allows themes to override its default templates by placing files in a /tutor/ directory inside the active theme. The plugin uses this system to deliver the enhanced comment experience without modifying any Tutor LMS core files.

How templates are deployed

On every page load, the plugin checks whether its template files exist in the active theme and whether they match the current plugin version. If they are missing or outdated, they are copied automatically. The three files deployed are:

File in themePurpose
{theme}/tutor/single/lesson/comment.phpMain comment form with WYSIWYG editor and image attach button
{theme}/tutor/single/lesson/comments-loop.phpRenders each comment and reply with voting buttons and delete links
{theme}/tutor/single/lesson/parts/comments.phpWrapper tab panel that includes comment.php

Automatic updates

The plugin stores the deployed template version in the WordPress options table. On each page load, if the current plugin version is newer than the stored version, the template files are automatically re-deployed to keep them current with new features.

โš ๏ธ

If you have manually customized the deployed template files in your theme, those changes will be overwritten when the plugin updates. Keep custom modifications in a child theme to avoid losing them on update.

Template cleanup

When the license is deactivated, or when the plugin is deactivated or uninstalled, the plugin automatically deletes the deployed template files from the theme and removes any empty parent directories it created. Your theme is left exactly as it was before the plugin was installed.

Developer Reference

Custom Email Template

The plugin sends HTML email notifications when a student or instructor posts a comment or reply on a lesson. By default it uses its own built-in template. The tle_comment_notification_email_template WordPress filter allows developers to completely replace this template with their own custom HTML โ€” useful when you need to match your brand identity, integrate with a third-party email service, or change the structure and content of the notification email.

โ„น๏ธ

This is a developer-facing feature. Implementing a custom template requires adding PHP code to your theme or a custom plugin. No settings page or visual editor is provided.

The Filter

Hook into the filter using the name tle_comment_notification_email_template. It accepts two parameters:

ParameterTypeDescription
$html string The complete default HTML email generated by the plugin. Your callback receives this and should return a string in its place.
$data array An associative array of data about the comment and lesson. Use these values to populate your custom template. See the $data Reference below for all available keys.

$data Reference

The second parameter passed to your filter callback is an associative array containing all the information you need to build your custom template.

KeyTypeDescription
course_name string The title of the course the lesson belongs to.
lesson_name string The title of the lesson where the comment was posted.
author_name string The display name of the user who posted the comment or reply.
comment_excerpt string A plain-text excerpt of the comment content, stripped of HTML, maximum 150 characters. If the comment contained only an image, this will be [Image or media content].
lesson_url string The full URL to the lesson page.
is_reply boolean true if this notification was triggered by a reply to an existing comment. false if it is a new top-level comment.
โš ๏ธ

All string values in $data originate from your WordPress database and are not escaped. Always use esc_html() when outputting text values into HTML, and esc_url() when outputting lesson_url.

Where to Add Your Code

Add your filter code to one of the following locations:

  • Your active theme’s functions.php file
  • A child theme’s functions.php file (recommended โ€” survives theme updates)
  • A custom site-specific plugin
โš ๏ธ

Do not add this code to the Tutor LMS Enhancements plugin files directly. Your changes will be overwritten the next time you update the plugin.

Basic Example โ€” Replacing the Entire Template

The following example replaces the entire default email with a minimal custom template:

add_filter(
    'tle_comment_notification_email_template',
    function( $html, $data ) {

        $comment_type = $data['is_reply'] ? 'reply' : 'comment';

        ob_start();
        ?>
        <!DOCTYPE html>
        <html>
        <body style="font-family: Arial, sans-serif; color: #333;">

            <h2>New <?php echo esc_html( $comment_type ); ?> posted</h2>

            <p>
                <strong><?php echo esc_html( $data['author_name'] ); ?></strong>
                posted a new <?php echo esc_html( $comment_type ); ?>
                on the lesson <strong><?php echo esc_html( $data['lesson_name'] ); ?></strong>
                in the course <strong><?php echo esc_html( $data['course_name'] ); ?></strong>.
            </p>

            <blockquote>
                <?php echo esc_html( $data['comment_excerpt'] ); ?>
            </blockquote>

            <p>
                <a href="<?php echo esc_url( $data['lesson_url'] ); ?>">
                    View Lesson
                </a>
            </p>

        </body>
        </html>
        <?php
        return ob_get_clean();

    },
    10,
    2 // Important: must be 2 to receive $data as second argument
);
โ„น๏ธ

The third argument to add_filter() is the priority (10) and the fourth is the number of arguments your callback accepts. This must be 2 โ€” otherwise WordPress will not pass $data to your function and it will be unavailable.

Modifying the Default Template

If you only need to make small adjustments rather than replacing the template entirely, you can manipulate the $html string the plugin passes in. The following example changes the header background colour:

add_filter(
    'tle_comment_notification_email_template',
    function( $html, $data ) {

        // Replace the default blue header colour with your brand colour
        $html = str_replace(
            'background-color: #3e64de',
            'background-color: #e84393',
            $html
        );

        return $html;

    },
    10,
    2
);

Distinguishing Comments from Replies

Use the is_reply key in $data to change your template content depending on whether the notification was triggered by a new comment or a reply:

add_filter(
    'tle_comment_notification_email_template',
    function( $html, $data ) {

        if ( $data['is_reply'] ) {
            $heading = 'Someone replied to a comment on ' . esc_html( $data['lesson_name'] );
        } else {
            $heading = 'New comment on ' . esc_html( $data['lesson_name'] );
        }

        // Build your template using $heading ...

        return $html; // return your custom HTML

    },
    10,
    2
);
โ„น๏ธ

The filter controls the email body only. The email subject line is not filterable and is generated separately by the plugin.

Important Rules

  • Always return a string. Your callback must always return a string. Returning null, false, or nothing will result in a blank email being sent.
  • Always escape output. Use esc_html() for all text values and esc_url() for lesson_url when building your template.
  • Set the correct argument count. The fourth argument to add_filter() must be 2 so WordPress passes both $html and $data to your callback.
  • Use inline CSS. Email clients have limited CSS support. All styles must be written inline using the style attribute on each HTML element. External stylesheets and <style> blocks in the <head> are ignored by most email clients.
  • Use table-based layouts. For consistent rendering across email clients including Outlook, use HTML tables for layout rather than CSS flexbox or grid.
Section 11

Frequently Asked Questions

Check these four things in order: (1) Confirm the license is active on the License Management page. (2) Confirm that lesson comments are enabled in Tutor LMS โ†’ Settings โ†’ Course. (3) Confirm the user viewing the lesson is logged in โ€” the editor does not load for guests. (4) Check that the template files have been deployed to the theme by looking for files at {theme}/tutor/single/lesson/.
The plugin automatically re-copies its template files to the theme whenever its version number changes, to keep the templates current with new plugin features. To safely customize the templates without losing changes on update, make your modifications in a child theme rather than directly in the parent theme’s tutor directory.
Yes. Any logged-in user who is not the comment author can vote. The only restriction is that users cannot vote on their own comments โ€” vote buttons are visually disabled for comment authors.
Yes. Vote counts are rendered in the page HTML server-side and are visible to all visitors. However, clicking a vote button requires being logged in โ€” guests who attempt to vote receive an error and no vote is recorded.
The wp_tutor_comment_votes database table is permanently dropped during uninstall. All vote records are lost and cannot be recovered. If you need to preserve the data, export the table using phpMyAdmin or a database tool before uninstalling.
The WYSIWYG editor and voting buttons are rendered as part of the page HTML, so page caching can cause the logged-in vs. logged-out state to be served inconsistently. Ensure your caching plugin is configured to serve different cached versions to logged-in and logged-out users, or to exclude lesson pages from caching entirely.
All uploaded images are stored as standard WordPress attachments in the Media Library. They are visible and manageable from Media โ†’ Library in the WordPress admin, just like any other uploaded file.
Yes โ€” one email per enrolled student and instructor on every comment. For very large courses this can result in a high volume of outgoing emails. It is strongly recommended to use a transactional email service (SendGrid, Mailgun, Postmark) configured through an SMTP plugin to handle the volume reliably and avoid hitting your server’s email limits.
Section 12

Troubleshooting

Before contacting support, work through these steps. Most issues are caused by one of the common conditions below.

! WYSIWYG editor or voting buttons not appearing
  • Confirm the license is active and shows “Valid” on the License Management page
  • Confirm Tutor LMS is installed and that lesson comments are enabled in Tutor LMS โ†’ Settings โ†’ Course
  • Confirm the user is logged in โ€” the editor and voting buttons do not load for guests
  • Check that the template files exist at {theme}/tutor/single/lesson/
  • Temporarily deactivate other plugins to check for JavaScript or AJAX conflicts
  • Check the browser console for JavaScript errors
! Email notifications not being received

All emails are sent via WordPress’s built-in wp_mail(). If notifications are not arriving:

  • Confirm email notifications are toggled on in Tutor โ†’ Enhancements โ†’ Settings
  • Verify your WordPress installation can send email at all by testing with a plugin like Check Email
  • Install and configure an SMTP plugin (WP Mail SMTP, Postman, etc.) โ€” server-based email is unreliable for bulk sending
  • Check your server mail logs to confirm whether emails are being sent but blocked or filtered by the recipient’s mail provider
! Template files being overwritten after updates

This is expected behavior โ€” the plugin re-deploys its templates whenever its version changes to keep features current. To preserve your customizations, move your template modifications to a child theme. Changes in {child-theme}/tutor/single/lesson/ take priority over the parent theme files and will not be overwritten by the plugin.

! Comment formatting (bold, links, etc.) being stripped

WordPress strips most HTML from comments by default. The plugin hooks in to preserve safe formatting tags on lesson and assignment comments specifically. If formatting is still being stripped:

  • Confirm the template files are deployed correctly โ€” if comments are being handled by Tutor LMS’s default templates instead of the plugin’s, the HTML preservation hooks will not apply
  • Check if another plugin or theme is applying additional comment sanitization that runs after this plugin’s filters
! Image upload rejected or not saving
  • Confirm the file is a JPEG, PNG, GIF, or WebP โ€” other file types are blocked
  • Confirm the file is under 2MB โ€” files larger than this are rejected both in the browser and on the server
  • If the Restrict Image Uploads to Instructors Only setting is enabled, students will not be able to upload images โ€” check whether this is the intended behavior
  • Check that your server’s upload_max_filesize and post_max_size PHP settings are at least 2MB
Section 13

Support

๐Ÿ’ฌ

Need help? Visit the support portal

If you’re experiencing an issue not covered in this documentation or the troubleshooting section, submit a support request through the portal. Please include the details below to help resolve your issue as quickly as possible.

Open Support Portal โ†’
Your WordPress version
Your PHP version
Your Tutor LMS version
Your active theme name
A description of the issue and the steps to reproduce it
Any relevant JavaScript console errors