62% namaste-lms

Code Review | Namaste! LMS

WordPress plugin Namaste! LMS scored62%from 54 tests.

About plugin

  • Plugin page: namaste-lms
  • Plugin version: 2.6.1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 15, 2013
  • Latest release: Nov 6, 2023
  • Number of updates: 394
  • Update frequency: every 9.9 days
  • Top authors: prasunsen (100%)

Code review

54 tests

User reviews

69 reviews

Install metrics

600+ active /167,618 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲1.76MB] [CPU: ▲9.62ms] Passed 4 tests

Server-side resources used by Namaste! LMS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.22 ▲1.7548.92 ▲7.54
Dashboard /wp-admin5.06 ▲1.7656.66 ▲6.09
Posts /wp-admin/edit.php5.13 ▲1.7767.31 ▲23.22
Add New Post /wp-admin/post-new.php7.85 ▲1.9699.81 ▲4.43
Media Library /wp-admin/upload.php4.98 ▲1.7554.18 ▲20.43
Help /wp-admin/admin.php?page=namaste_help5.0144.19
Assignments /wp-admin/admin.php?page=namaste_homeworks4.9348.59
Courses /wp-admin/edit.php?post_type=namaste_course5.0549.23
My Certificates /wp-admin/admin.php?page=namaste_my_certificates4.9547.39
Submit solution /wp-admin/admin.php?page=namaste_submit_solution4.9340.48
Students Earned Certificate /wp-admin/admin.php?page=namaste_student_certificates4.9346.02
Download solution /wp-admin/admin.php?page=namaste_download_solution4.9342.03
Students /wp-admin/admin.php?page=namaste_students5.1544.83
My Courses /wp-admin/admin.php?page=namaste_my_courses4.9344.96
Certificates /wp-admin/admin.php?page=namaste_certificates4.9339.63

Server storage [IO: ▲1.86MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 146 new files
Database: 14 new tables, 10 new options
New tables
wp_namaste_student_homeworks
wp_namaste_student_courses
wp_namaste_history
wp_namaste_payments
wp_namaste_solution_files
wp_namaste_student_modules
wp_namaste_student_lessons
wp_namaste_homework_notes
wp_namaste_webhooks
wp_namaste_course_reviews
...
New WordPress options
namaste_need_login_text_module
namaste_version
widget_recent-posts
db_upgraded
can_compress_scripts
namaste_need_login_text_course
widget_recent-comments
namaste_need_login_text_lesson
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Namaste! LMS
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,982 ▲22013.85 ▼0.478.13 ▲6.3536.83 ▼7.29
Dashboard /wp-admin2,296 ▲1165.64 ▲0.0396.64 ▼2.3940.76 ▼1.95
Posts /wp-admin/edit.php2,201 ▲982.03 ▲0.0138.26 ▲2.9636.10 ▼0.73
Add New Post /wp-admin/post-new.php1,607 ▲8123.35 ▲0.23694.45 ▲9.2255.18 ▲2.67
Media Library /wp-admin/upload.php1,492 ▲924.23 ▼0.0197.73 ▼8.7342.86 ▼2.45
Help /wp-admin/admin.php?page=namaste_help1,1721.9622.8433.57
Assignments /wp-admin/admin.php?page=namaste_homeworks1,0661.8223.1730.16
Courses /wp-admin/edit.php?post_type=namaste_course1,2551.9835.1232.23
My Certificates /wp-admin/admin.php?page=namaste_my_certificates8561.8424.6926.66
Submit solution /wp-admin/admin.php?page=namaste_submit_solution7631.546.6414.04
Students Earned Certificate /wp-admin/admin.php?page=namaste_student_certificates8631.7023.0624.78
Download solution /wp-admin/admin.php?page=namaste_download_solution7631.546.9317.11
Students /wp-admin/admin.php?page=namaste_students8901.8523.3526.07
My Courses /wp-admin/admin.php?page=namaste_my_courses8641.8924.9725.12
Certificates /wp-admin/admin.php?page=namaste_certificates1,0572.0225.1225.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 14 tables
    • wp_namaste_homeworks
    • wp_namaste_student_modules
    • wp_namaste_homework_notes
    • wp_namaste_history
    • wp_namaste_student_courses
    • wp_namaste_course_reviews
    • wp_namaste_student_lessons
    • wp_namaste_visits
    • wp_namaste_certificates
    • wp_namaste_student_homeworks
    • ...
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • namaste_version
    • db_upgraded
    • widget_recent-posts
    • namaste_need_login_text_lesson
    • namaste_need_login_text_course
    • widget_theysaidso_widget
    • namaste_need_login_text_module

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=namaste_homeworks
    • > Notice in wp-content/plugins/namaste-lms/models/homework-model.php+61
    Undefined index: award_points
    • > GET request to /wp-admin/admin.php?page=namaste_homeworks
    • > Notice in wp-content/plugins/namaste-lms/models/homework-model.php+66
    Undefined index: do
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=namaste_download_solution
    • > Notice in wp-content/plugins/namaste-lms/controllers/homeworks.php+410
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=namaste_submit_solution
    • > Notice in wp-content/plugins/namaste-lms/models/homework-model.php+282
    Trying to get property 'course_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=namaste_submit_solution
    • > Notice in wp-content/plugins/namaste-lms/controllers/homeworks.php+208
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/admin.php?page=namaste_submit_solution
    • > Notice in wp-content/plugins/namaste-lms/models/homework-model.php+284
    Trying to get property 'lesson_id' of non-object
    • > GET request to /wp-admin/admin.php?page=namaste_submit_solution
    • > Notice in wp-content/plugins/namaste-lms/models/lesson-model.php+215
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=namaste_download_solution
    • > Notice in wp-content/plugins/namaste-lms/controllers/homeworks.php+412
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/admin.php?page=namaste_student_certificates
    • > Notice in wp-content/plugins/namaste-lms/views/students-earned-certificate.html.php+2
    Trying to get property 'title' of non-object
    • > GET request to /wp-admin/admin.php?page=namaste_download_solution
    • > Notice in wp-content/plugins/namaste-lms/controllers/homeworks.php+412
    Undefined index: file_id
    • > GET request to /wp-admin/admin.php?page=namaste_my_courses
    • > Notice in wp-content/plugins/namaste-lms/controllers/courses.php+73
    Undefined variable: stripe
    • > GET request to /wp-admin/admin.php?page=namaste_certificates
    • > Notice in wp-content/plugins/namaste-lms/controllers/certificates.php+19
    Undefined index: action

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/namaste-lms/views/list-reviews.html.php
    • > /wp-content/plugins/namaste-lms/views/plugins.php
    • > /wp-content/plugins/namaste-lms/views/lesson-todo.php
  • 99× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/namaste-lms/lib/lib/SKU.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/namaste-lms/views/reviews.html.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\InvalidRequest' not found in wp-content/plugins/namaste-lms/lib/lib/Error/RateLimit.php:5
    • > PHP Notice
      Undefined variable: in_shortcode in wp-content/plugins/namaste-lms/views/my-certificates.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/namaste-lms/lib/lib/Error/Card.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/namaste-lms/lib/lib/Coupon.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/namaste-lms/lib/lib/Source.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/namaste-lms/lib/lib/ThreeDSecure.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/namaste-lms/lib/lib/SubscriptionItem.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/namaste-lms/lib/lib/InvoiceItem.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: learning, lms, courses, wpmu, lessons...

namaste-lms/namaste.php 85% from 13 tests

"Namaste! LMS" version 2.6.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("namaste-lms.php" instead of "namaste.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected22,265 lines of code in 136 files:
LanguageFilesBlank linesComment linesLines of code
PO File63,6743,96511,227
PHP1272,4262,64010,816
CSS1187126
JavaScript281596

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity20.41
▷ Minimum class complexity1.00
▷ Maximum class complexity259.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces4
Interfaces3
Traits0
Classes80
▷ Abstract classes56.25%
▷ Concrete classes7593.75%
▷ Final classes00.00%
Methods472
▷ Static methods31466.53%
▷ Public methods44894.92%
▷ Protected methods91.91%
▷ Private methods153.18%
Functions28
▷ Named functions1760.71%
▷ Anonymous functions1139.29%
Constants33
▷ Global constants2575.76%
▷ Class constants824.24%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin