67% tutor

Code Review | Tutor LMS - eLearning and online course solution

WordPress plugin Tutor LMS - eLearning and online course solution scored67%from 54 tests.

About plugin

  • Plugin page: tutor
  • Plugin version: 2.4.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Feb 6, 2019
  • Latest release: Oct 16, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

503 reviews

Install metrics

70,000+ active /1,750,425 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.25MB] [CPU: ▲32.87ms] 75% from 4 tests

Analyzing server-side resources used by Tutor LMS - eLearning and online course solution
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.25MB on /wp-admin/edit-tags.php?taxonomy=course-tag&post_type=courses)
PageMemory (MB)CPU Time (ms)
Home /8.52 ▲5.0671.72 ▲34.18
Dashboard /wp-admin8.60 ▲5.2580.09 ▲22.60
Posts /wp-admin/edit.php8.68 ▲5.3291.89 ▲46.91
Add New Post /wp-admin/post-new.php11.37 ▲5.49132.72 ▲40.09
Media Library /wp-admin/upload.php8.59 ▲5.3674.28 ▲34.61
/wp-admin/index.php?page=tutor-setup8.5968.63
Quiz Attempts /wp-admin/admin.php?page=tutor_quiz_attempts8.7068.17
Course Categories /wp-admin/edit-tags.php?taxonomy=course-category&post_type=courses8.6567.04
Add-ons /wp-admin/admin.php?page=tutor-addons8.5965.24
Tools /wp-admin/admin.php?page=tutor-tools8.6370.67
Categories /wp-admin/edit-tags.php?taxonomy=course-category&post_type=courses8.6571.61
Add New /wp-admin/post-new.php?post_type=courses8.7684.86
Announcements /wp-admin/admin.php?page=tutor_announcements8.6072.32
Courses /wp-admin/edit.php?post_type=courses8.6171.50
Tags /wp-admin/edit-tags.php?taxonomy=course-tag&post_type=courses8.6566.34

Server storage [IO: ▲6.82MB] [DB: ▲0.15MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 600 new files
Database: 6 new tables, 11 new options
New tables
wp_tutor_earnings
wp_tutor_quiz_questions
wp_tutor_quiz_attempts
wp_tutor_quiz_question_answers
wp_tutor_quiz_attempt_answers
wp_tutor_withdraws
New WordPress options
tutor_wizard
db_upgraded
tutor_first_activation_time
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_tutor_course_widget
widget_recent-posts
can_compress_scripts
tutor_version
...

Browser metrics Passed 4 tests

An overview of browser requirements for Tutor LMS - eLearning and online course solution
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,258 ▲51219.06 ▲4.3320.27 ▲18.6737.07 ▼2.86
Dashboard /wp-admin2,507 ▲3328.02 ▲2.36154.74 ▲55.0741.12 ▼2.40
Posts /wp-admin/edit.php2,440 ▲3435.64 ▲3.6867.63 ▲32.3131.87 ▼4.50
Add New Post /wp-admin/post-new.php6,477 ▲4,94230.31 ▲12.18887.48 ▲252.2637.43 ▼28.30
Media Library /wp-admin/upload.php1,580 ▲1835.92 ▲1.70100.20 ▲6.2240.15 ▼1.94
/wp-admin/index.php?page=tutor-setup1,1691.8330.3425.63
Quiz Attempts /wp-admin/admin.php?page=tutor_quiz_attempts1,7925.7576.6184.12
Course Categories /wp-admin/edit-tags.php?taxonomy=course-category&post_type=courses1,7215.5661.03100.90
Add-ons /wp-admin/admin.php?page=tutor-addons2,1805.4861.3090.23
Tools /wp-admin/admin.php?page=tutor-tools2,1365.5356.07114.61
Categories /wp-admin/edit-tags.php?taxonomy=course-category&post_type=courses1,7065.4560.34110.80
Add New /wp-admin/post-new.php?post_type=courses3,5249.68280.6690.00
Announcements /wp-admin/admin.php?page=tutor_announcements1,8445.6268.36108.98
Courses /wp-admin/edit.php?post_type=courses1,4635.6462.4229.47
Tags /wp-admin/edit-tags.php?taxonomy=course-tag&post_type=courses1,6495.4861.4391.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.15MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 6 tables in the database
    • wp_tutor_earnings
    • wp_tutor_quiz_attempts
    • wp_tutor_quiz_questions
    • wp_tutor_quiz_attempt_answers
    • wp_tutor_quiz_question_answers
    • wp_tutor_withdraws
  • Zombie WordPress options were found after uninstall: 11 options
    • tutor_version
    • tutor_wizard
    • theysaidso_admin_options
    • tutor_first_activation_time
    • can_compress_scripts
    • widget_recent-comments
    • tutor_option
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tutor/views/options/template/common/field_heading.php
    • > /wp-content/plugins/tutor/templates/loop/end_content_wrap.php
    • > /wp-content/plugins/tutor/views/pages/tutor-pro-addons.php
    • > /wp-content/plugins/tutor/templates/loop/start_content_wrap.php
    • > /wp-content/plugins/tutor/views/fragments/attachments.php
    • > /wp-content/plugins/tutor/templates/single/next-previous-pagination.php
    • > /wp-content/plugins/tutor/views/pages/welcome.php
    • > /wp-content/plugins/tutor/views/pages/enable_disable_addons.php
  • 308× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tutor/views/options/field-types/toggle_switch_button.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/tutor/templates/dashboard/my-courses.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/tutor/views/options/field-types/media.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'TUTOR\\Input' not found in wp-content/plugins/tutor/templates/dashboard/quiz-attempts/quiz-reviews.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/tutor/templates/single/common/footer.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/tutor/views/options/field-types/email.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/tutor/views/metabox/course/field-types/groups/text.php:12
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/tutor/views/options/field-types/toggle_switch_button_thumb.php on line 12
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/tutor/views/options/field-types/toggle_switch_button.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/tutor/views/options/field-types/groups/ratio.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: course, lms, education, learning management system, elearning

tutor/tutor.php 92% from 13 tests

The main file in "Tutor LMS - eLearning and online course solution" v. 2.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 313 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected43,696 lines of code in 510 files:
LanguageFilesBlank linesComment linesLines of code
PHP3997,06214,95041,368
SVG69001,313
JavaScript1941155536
CSS216114468
JSON20011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity33.93
▷ Minimum class complexity1.00
▷ Maximum class complexity736.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces7
Interfaces0
Traits3
Classes71
▷ Abstract classes11.41%
▷ Concrete classes7098.59%
▷ Final classes22.86%
Methods922
▷ Static methods14916.16%
▷ Public methods87995.34%
▷ Protected methods50.54%
▷ Private methods384.12%
Functions191
▷ Named functions13771.73%
▷ Anonymous functions5428.27%
Constants51
▷ Global constants23.92%
▷ Class constants4996.08%
▷ Public constants4591.84%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
43 PNG files occupy 0.56MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/addons/tutor-assignments/thumbnail.png1.01KB1.05KB0.00%
assets/images/instructor-thankyou.png9.77KB10.49KB0.00%
(invalid) assets/images/profile-photo.png1.53KB0.00KB▼ 100.00%
assets/addons/enrollments/thumbnail.png1.20KB1.25KB0.00%
assets/addons/tutor-report/thumbnail.png1.38KB1.42KB0.00%