62% sensei-lms

Code Review | Sensei LMS - Online Courses, Quizzes, & Learning

WordPress plugin Sensei LMS - Online Courses, Quizzes, & Learning scored62%from 54 tests.

About plugin

  • Plugin page: sensei-lms
  • Plugin version: 4.19.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: May 1, 2019
  • Latest release: Nov 23, 2023
  • Number of updates: 180
  • Update frequency: every 9.3 days
  • Top authors: donnapep (31.11%)renathoc (13.33%)m1r0 (8.33%)gabrielcaires (7.78%)alexsanford1 (7.78%)

Code review

54 tests

User reviews

31 reviews

Install metrics

10,000+ active /578,066 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲9.54MB] [CPU: ▲76.31ms] 25% from 4 tests

Analyzing server-side resources used by Sensei LMS - Online Courses, Quizzes, & Learning
Please take the time to fix the following items
  • RAM: You should keep total memory usage under 10MB (currently 13.04MB on /wp-admin/admin.php?page=sensei_reports)
  • CPU: Total CPU usage should be kept under 500.00ms (currently 562.17ms on /wp-admin/options.php?page=sensei_setup_wizard)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 9.54MB on /wp-admin/admin.php?page=sensei_reports)
PageMemory (MB)CPU Time (ms)
Home /13.53 ▲10.07122.25 ▲80.49
Dashboard /wp-admin12.64 ▲9.33123.82 ▲64.45
Posts /wp-admin/edit.php12.78 ▲9.42140.81 ▲91.50
Add New Post /wp-admin/post-new.php16.63 ▲10.74176.01 ▲85.40
Media Library /wp-admin/upload.php12.57 ▲9.34110.64 ▲74.90
Questions /wp-admin/edit.php?post_type=question12.64115.70
Groups Pro /wp-admin/admin.php?page=student_groups12.581,624.61
Sensei LMS - Setup Wizard /wp-admin/options.php?page=sensei_setup_wizard15.61562.17
Tools /wp-admin/admin.php?page=sensei-tools12.64116.09
Order Courses /wp-admin/admin.php?page=course-order12.55105.96
Editor /wp-admin/site-editor.php?postType=wp_template17.01143.52
Order Lessons /wp-admin/admin.php?page=lesson-order12.55103.18
Lessons /wp-admin/edit.php?post_type=lesson12.67106.80
Order Modules /wp-admin/admin.php?page=module-order12.55100.43
Reports /wp-admin/admin.php?page=sensei_reports13.04109.33

Server storage [IO: ▲20.89MB] [DB: ▲0.06MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 1,690 new files
Database: 4 new tables, 23 new options
New tables
wp_actionscheduler_actions
wp_actionscheduler_claims
wp_actionscheduler_logs
wp_actionscheduler_groups
New WordPress options
sensei-scheduler-calculation-version
widget_sensei_lesson_component
schema-ActionScheduler_LoggerSchema
sensei_suggest_setup_wizard
widget_sensei_category_courses
can_compress_scripts
sensei_flush_rewrite_rules
widget_recent-comments
sensei_course_theme_query_var_flushed
sensei_course_enrolment_site_salt
...

Browser metrics Passed 4 tests

Checking browser requirements for Sensei LMS - Online Courses, Quizzes, & Learning
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,997 ▲21014.39 ▼0.312.86 ▲0.9337.53 ▼8.48
Dashboard /wp-admin2,347 ▲1675.69 ▲0.1596.58 ▼3.1445.13 ▼2.70
Posts /wp-admin/edit.php2,214 ▲1142.09 ▲0.0741.21 ▼3.1235.67 ▼3.66
Add New Post /wp-admin/post-new.php1,610 ▲8420.88 ▼2.63725.56 ▲101.0360.64 ▲8.95
Media Library /wp-admin/upload.php1,514 ▲1144.27 ▲0.0896.40 ▼2.2643.51 ▼3.01
Questions /wp-admin/edit.php?post_type=question1,2852.1235.1433.26
Groups Pro /wp-admin/admin.php?page=student_groups9722.0827.3345.10
Sensei LMS - Setup Wizard /wp-admin/options.php?page=sensei_setup_wizard9089.17201.1239.78
Tools /wp-admin/admin.php?page=sensei-tools1,1282.2228.4330.86
Order Courses /wp-admin/admin.php?page=course-order9232.1028.2023.19
Editor /wp-admin/site-editor.php?postType=wp_template5,30024.54905.5038.83
Order Lessons /wp-admin/admin.php?page=lesson-order9822.4741.9925.70
Lessons /wp-admin/edit.php?post_type=lesson1,3082.1937.2935.66
Order Modules /wp-admin/admin.php?page=module-order1,0022.4735.4827.05
Reports /wp-admin/admin.php?page=sensei_reports1,2212.5258.2342.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
  • The uninstall procedure has failed, leaving 24 options in the database
    • widget_sensei_lesson_component
    • action_scheduler_migration_status
    • sensei_installed_at
    • widget_sensei_course_component
    • widget_recent-comments
    • sensei-version
    • theysaidso_admin_options
    • db_upgraded
    • sensei_course_theme_query_var_flushed
    • schema-ActionScheduler_LoggerSchema
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Notice in wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php+726
    Undefined property: stdClass::$modified

SRP 50% 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
Please fix the following items
  • 132× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Sensei_Home_Task' not found in wp-content/plugins/sensei-lms/includes/admin/home/tasks/task/class-sensei-home-task-configure-learning-mode.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Sensei\\ThirdParty\\Symfony\\Component\\CssSelector\\Parser\\Handler\\HandlerInterface' not found in wp-content/plugins/sensei-lms/third-party/symfony/css-selector/Parser/Handler/IdentifierHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Sensei_Home_Task' not found in wp-content/plugins/sensei-lms/includes/admin/home/tasks/task/class-sensei-home-task-customize-course-theme.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Sensei\\ThirdParty\\Symfony\\Component\\CssSelector\\Parser\\Handler\\HandlerInterface' not found in wp-content/plugins/sensei-lms/third-party/symfony/css-selector/Parser/Handler/StringHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Sensei\\ThirdParty\\Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/sensei-lms/third-party/symfony/css-selector/Node/CombinedSelectorNode.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Sensei\\ThirdParty\\Sabberworm\\CSS\\Value\\PrimitiveValue' not found in wp-content/plugins/sensei-lms/third-party/sabberworm/php-css-parser/src/Value/Size.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/sensei-lms/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Sensei\\ThirdParty\\Sabberworm\\CSS\\CSSList\\CSSList' not found in wp-content/plugins/sensei-lms/third-party/sabberworm/php-css-parser/src/CSSList/KeyFrame.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\LogMigrator' not found in wp-content/plugins/sensei-lms/vendor/woocommerce/action-scheduler/classes/migration/DryRun_LogMigrator.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Sensei\\ThirdParty\\Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/sensei-lms/third-party/sabberworm/php-css-parser/src/Comment/Comment.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Console-api (warning) in unknown
    /wp-includes/js/dist/block-editor.min.js?ver=0cd49e3f951fc97cabb7 25:219944 "sensei-shared-blocks-editor-style-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe." link#sensei-shared-blocks-editor-style-css
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Console-api (warning) in unknown
    /wp-includes/js/dist/block-editor.min.js?ver=0cd49e3f951fc97cabb7 25:219944 "sensei-learning-mode-compat-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe." link#sensei-learning-mode-compat-css
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Console-api (warning) in unknown
    /wp-includes/js/dist/block-editor.min.js?ver=0cd49e3f951fc97cabb7 25:219944 "sensei-learning-mode-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe." link#sensei-learning-mode-css
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Console-api (warning) in unknown
    /wp-includes/js/dist/block-editor.min.js?ver=0cd49e3f951fc97cabb7 25:219944 "sensei-learning-mode-editor-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe." link#sensei-learning-mode-editor-css
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Console-api (warning) in unknown
    /wp-includes/js/dist/block-editor.min.js?ver=0cd49e3f951fc97cabb7 25:219944 "sensei-email-editor-style-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe." link#sensei-email-editor-style-css
    • > GET request to /wp-admin/site-editor.php?postType=wp_template
    • > Console-api (warning) in unknown
    /wp-includes/js/dist/block-editor.min.js?ver=0cd49e3f951fc97cabb7 25:219944 "sensei-global-blocks-editor-style-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe." link#sensei-global-blocks-editor-style-css

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: woocommerce, teach, elearning, lms, online courses

sensei-lms/sensei-lms.php Passed 13 tests

The primary PHP file in "Sensei LMS - Online Courses, Quizzes, & Learning" version 4.19.2 is used by WordPress to initiate all plugin functionality
97 characters long description:
Share your knowledge, grow your network, and strengthen your brand by launching an online course.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin129,570 lines of code in 1,495 files:
LanguageFilesBlank linesComment linesLines of code
PHP86519,88753,87779,606
JavaScript4634,36911,87337,886
CSS1037624179,394
JSON48101,908
Markdown52720622
TypeScript2143474
HTML4116842
XML10029
SVG4009

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity15.53
▷ Minimum class complexity1.00
▷ Maximum class complexity618.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces55
Interfaces37
Traits4
Classes602
▷ Abstract classes447.31%
▷ Concrete classes55892.69%
▷ Final classes40.72%
Methods5,085
▷ Static methods64412.66%
▷ Public methods3,93277.33%
▷ Protected methods3045.98%
▷ Private methods84916.70%
Functions250
▷ Named functions11445.60%
▷ Anonymous functions13654.40%
Constants375
▷ Global constants51.33%
▷ Class constants37098.67%
▷ Public constants34894.05%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
41 PNG files occupy 5.95MB with 1.94MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/images/content-drip-promo-desktop.png247.51KB204.74KB▼ 17.28%
assets/dist/images/sensei-pro-ad-stars.png0.87KB0.51KB▼ 40.94%
assets/dist/images/showcase-courses-upsell-illustration.png652.51KB198.03KB▼ 69.65%
assets/dist/images/ui-icons_cc0000_256x240-dc29114100c22b4660e3.png4.52KB4.18KB▼ 7.56%
assets/dist/images/purchase-sensei-pro-desktop.png287.28KB207.77KB▼ 27.68%