67% learning-management-system

Code Review | LMS by Masteriyo - WordPress Learning Management System, eLearning Platform, Online Education System & Online Course Builder

WordPress plugin LMS by Masteriyo - WordPress Learning Management System, eLearning Platform, Online Education System & Online Course Builder scored67%from 54 tests.

About plugin

  • Plugin page: learning-manageme...
  • Plugin version: 1.7.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 16, 2021
  • Latest release: Nov 28, 2023
  • Number of updates: 109
  • Update frequency: every 7.4 days
  • Top authors: masteriyo (100%)

Code review

54 tests

User reviews

59 reviews

Install metrics

2,000+ active /95,918 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲7.78MB] [CPU: ▲183.89ms] 50% from 4 tests

Analyzing server-side resources used by LMS by Masteriyo - WordPress Learning Management System, eLearning Platform, Online Education System & Online Course Builder
Please fix the following
  • RAM: Total memory usage must be kept under 10MB (currently 11.26MB on /wp-admin/tools.php?page=action-scheduler)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 7.78MB on /wp-admin/admin.php?page=masteriyo#/users/students)
PageMemory (MB)CPU Time (ms)
Home /11.21 ▲7.75209.50 ▲169.57
Dashboard /wp-admin11.02 ▲7.71233.57 ▲187.56
Posts /wp-admin/edit.php11.16 ▲7.80241.83 ▲193.97
Add New Post /wp-admin/post-new.php18.87 ▲12.98278.62 ▲184.47
Media Library /wp-admin/upload.php11.09 ▲7.86276.19 ▲244.21
Scheduled Actions /wp-admin/tools.php?page=action-scheduler11.26196.55

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 1,211 new files
Database: 14 new tables, 17 new options
New tables
wp_actionscheduler_actions
wp_masteriyo_order_itemmeta
wp_masteriyo_notifications
wp_masteriyo_sessions
wp_masteriyo_user_activitymeta
wp_actionscheduler_groups
wp_actionscheduler_logs
wp_masteriyo_user_itemmeta
wp_actionscheduler_claims
wp_masteriyo_user_items
...
New WordPress options
action_scheduler_hybrid_store_demarkation
can_compress_scripts
action_scheduler_lock_async-request-runner
schema-ActionScheduler_LoggerSchema
widget_recent-comments
theysaidso_admin_options
masteriyo_flush_rewrite_rules
masteriyo_install_date
masteriyo_settings
schema-ActionScheduler_StoreSchema
...

Browser metrics Passed 4 tests

Checking browser requirements for LMS by Masteriyo - WordPress Learning Management System, eLearning Platform, Online Education System & Online Course Builder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,114 ▲35216.31 ▲1.971.51 ▼0.2033.79 ▼12.00
Dashboard /wp-admin2,521 ▲3446.94 ▲1.27135.66 ▲41.5448.60 ▲9.23
Posts /wp-admin/edit.php2,596 ▲4934.74 ▲2.7368.11 ▲28.7843.93 ▲7.21
Add New Post /wp-admin/post-new.php1,629 ▲10318.78 ▼4.33600.66 ▼94.0838.16 ▼16.66
Media Library /wp-admin/upload.php1,777 ▲3835.24 ▲1.05110.10 ▲8.8552.14 ▲7.33
Courses /wp-admin/admin.php?page=masteriyo#/courses2,19923.82767.1377.16
Webhooks /wp-admin/admin.php?page=masteriyo#/webhooks1,95020.88593.8161.24
Quiz Attempts /wp-admin/admin.php?page=masteriyo#/quiz-attempts1,79019.78554.1158.53
Question & Answers /wp-admin/admin.php?page=masteriyo#/question-answers1,76920.27519.2553.77
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,7644.4958.7935.79
Analytics /wp-admin/admin.php?page=masteriyo#/analytics2,87220.57482.8859.08
Categories /wp-admin/admin.php?page=masteriyo#/courses/categories1,58322.37442.3753.49
Addons /wp-admin/admin.php?page=masteriyo#/add-ons2,17024.12571.6862.79
Reviews /wp-admin/admin.php?page=masteriyo#/reviews1,94423.41606.5362.31
Users /wp-admin/admin.php?page=masteriyo#/users/students1,30115.74460.5653.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 14 tables in the database
    • wp_masteriyo_sessions
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
    • wp_actionscheduler_actions
    • wp_masteriyo_migrations
    • wp_masteriyo_quiz_attempts
    • wp_masteriyo_order_itemmeta
    • wp_masteriyo_order_items
    • wp_masteriyo_notifications
    • wp_masteriyo_user_items
    • ...
  • Zombie WordPress options detected upon uninstall: 17 options
    • widget_theysaidso_widget
    • masteriyo_settings
    • action_scheduler_hybrid_store_demarkation
    • course_difficulty_children
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • masteriyo_install_date
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/learning-management-system/templates/masteriyo.php
  • 241× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: argv in wp-content/plugins/learning-management-system/vendor/halaxa/json-machine/build/update-changelog.php on line 5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/learning-management-system/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'JsonMachine\\JsonDecoder\\ItemDecoder' not found in wp-content/plugins/learning-management-system/vendor/halaxa/json-machine/src/JsonDecoder/ErrorWrappingDecoder.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/learning-management-system/vendor/symfony/css-selector/Node/SelectorNode.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/learning-management-system/templates/checkout/fields/address-1.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Masteriyo\\Repository\\AbstractRepository' not found in wp-content/plugins/learning-management-system/includes/Repository/CourseReviewRepository.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/learning-management-system/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/learning-management-system/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_MonthField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/learning-management-system/vendor/symfony/css-selector/Node/PseudoNode.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Masteriyo\\Database\\Migration' not found in wp-content/plugins/learning-management-system/database/migrations/2021_12_07_070414_create_user_items_meta_table.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #10, #11, #12, #13, #14, #15, #16, #17, #2, #3, #4, #5, #6, #7, #8, #9 in learning-management-system/assets to your readme.txt
Please take inspiration from this readme.txt

learning-management-system/lms.php 85% from 13 tests

The entry point to "LMS by Masteriyo - WordPress Learning Management System, eLearning Platform, Online Education System & Online Course Builder" version 1.7.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("learning-management-system.php" instead of "lms.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected136,090 lines of code in 1,110 files:
LanguageFilesBlank linesComment linesLines of code
PHP85319,30665,89390,163
YAML12,371018,050
TypeScript100630138,619
JSON111207,981
CSS616126,225
JavaScript264243172,436
SVG93111,102
Markdown71960827
Sass8851533
make122087
Bourne Shell417267

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity11.44
▷ Minimum class complexity1.00
▷ Maximum class complexity139.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces106
Interfaces34
Traits4
Classes631
▷ Abstract classes446.97%
▷ Concrete classes58793.03%
▷ Final classes50.85%
Methods5,033
▷ Static methods3747.43%
▷ Public methods3,77274.95%
▷ Protected methods1,04120.68%
▷ Private methods2204.37%
Functions785
▷ Named functions47961.02%
▷ Anonymous functions30638.98%
Constants279
▷ Global constants4415.77%
▷ Class constants23584.23%
▷ Public constants235100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
62 PNG files occupy 0.34MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/course-announcement/thumbnail.png2.26KB0.94KB▼ 58.67%
assets/img/multiple-instructors.png0.92KB0.92KB0.00%
addons/gamipress-integration/img/dashboard-card-location.png2.70KB1.09KB▼ 59.64%
assets/img/course-attachment.png0.84KB0.84KB0.00%
assets/img/course-per-row-3.png0.11KB0.11KB0.00%