78% ps-lms

Code Review | Perception LMS

WordPress plugin Perception LMS scored78%from 54 tests.

About plugin

  • Plugin page: ps-lms
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2019
  • Latest release: Feb 8, 2023
  • Number of updates: 13
  • Update frequency: every 89.9 days
  • Top authors: uvesh123 (92.31%)perceptionsystemlabs (15.38%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /554 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.38MB] [CPU: ▲0.69ms] Passed 4 tests

This is a short check of server-side resources used by Perception LMS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3649.93 ▲3.48
Dashboard /wp-admin3.72 ▲0.4257.87 ▲4.42
Posts /wp-admin/edit.php3.77 ▲0.4159.76 ▲6.40
Add New Post /wp-admin/post-new.php6.27 ▲0.3893.15 ▼11.56
Media Library /wp-admin/upload.php3.58 ▲0.3647.51 ▲9.21
Course Categories /wp-admin/edit-tags.php?taxonomy=ps_lms_category&post_type=ps_lms_course3.5845.87
Courses /wp-admin/edit.php?post_type=ps_lms_course3.6444.29
Lessons /wp-admin/edit.php?post_type=ps_lms_lesson3.6447.11
PS Courses /wp-admin/admin.php?page=psys_options3.6146.15
Teachers /wp-admin/edit.php?post_type=ps_lms_teacher3.6448.54

Server storage [IO: ▲0.42MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 38 new files
Database: no new tables, 21 new options
New WordPress options
psys_primary_button_hover_color
psys_show_viewed_lessons
widget_theysaidso_widget
psys_show_completed_lessons
widget_recent-posts
psys_primary_button_hover_text_color
db_upgraded
psys_primary_button_color
psys_courses_per_page
psys_teachers_per_page
...

Browser metrics Passed 4 tests

Perception LMS: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲25013.77 ▼0.545.70 ▲3.8841.92 ▼4.15
Dashboard /wp-admin2,282 ▲945.09 ▲0.23110.15 ▲6.0843.82 ▼0.17
Posts /wp-admin/edit.php2,164 ▲752.32 ▲0.3341.83 ▲0.1333.70 ▼2.66
Add New Post /wp-admin/post-new.php1,574 ▲6017.90 ▼5.65685.54 ▲23.8537.38 ▼14.09
Media Library /wp-admin/upload.php1,464 ▲734.33 ▼0.04103.28 ▲2.4744.63 ▼1.78
Course Categories /wp-admin/edit-tags.php?taxonomy=ps_lms_category&post_type=ps_lms_course1,3142.0534.3329.62
Courses /wp-admin/edit.php?post_type=ps_lms_course1,1452.2434.0728.45
Lessons /wp-admin/edit.php?post_type=ps_lms_lesson1,1792.2534.2029.07
PS Courses /wp-admin/admin.php?page=psys_options2,5427.79166.7955.69
Teachers /wp-admin/edit.php?post_type=ps_lms_teacher1,1342.2636.7331.39

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 21 options
    • psys_primary_button_hover_text_color
    • psys_primary_button_hover_color
    • db_upgraded
    • psys_show_lesson_nav_icons
    • psys_primary_button_border_color
    • widget_recent-comments
    • widget_theysaidso_widget
    • psys_primary_button_hover_border_color
    • psys_courses_per_page
    • psys_primary_button_active_color
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ps-lms/admin/partials/ps_lms-admin-display.php
    • > /wp-content/plugins/ps-lms/public/partials/ps_lms-public-display.php
    • > /wp-content/plugins/ps-lms/public/partials/ps_lms-options.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ps-lms/templates/psys-single-lesson.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Psys_Courses' not found in wp-content/plugins/ps-lms/templates/template-parts/course-meta.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/ps-lms/templates/template-parts/course-video.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ps-lms/templates/psys-single-teacher.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ps-lms/templates/psys-archive-course.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/ps-lms/templates/psys-options.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ps-lms/templates/psys-archive-teacher.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ps-lms/templates/category-course-category.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_permalink() in wp-content/plugins/ps-lms/templates/template-parts/course-details.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ps-lms/templates/psys-single-course.php:1

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: lms, wplms, learnpress, lessons, coursepress...

ps-lms/ps_lms.php 85% from 13 tests

This is the main PHP file of "Perception LMS" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ps-lms.php" instead of "ps_lms.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,522 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP232665671,455
CSS419746987
JavaScript316880

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity10.60
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods67
▷ Static methods22.99%
▷ Public methods6292.54%
▷ Protected methods00.00%
▷ Private methods57.46%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin