61% learny-lms

Code Review | Learny LMS

WordPress plugin Learny LMS scored61%from 54 tests.

About plugin

  • Plugin page: learny-lms
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9
  • WordPress version: 6.3.1
  • First release: Nov 18, 2021
  • Latest release: May 18, 2022
  • Number of updates: 22
  • Update frequency: every 8.3 days
  • Top authors: creativeitem (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,226 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.17MB] [CPU: ▼5.78ms] Passed 4 tests

A check of server-side resources used by Learny LMS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.59 ▲1.1341.87 ▲2.50
Dashboard /wp-admin4.52 ▲1.1849.21 ▼12.83
Posts /wp-admin/edit.php4.55 ▲1.2053.46 ▲5.45
Add New Post /wp-admin/post-new.php7.32 ▲1.4386.77 ▼18.25
Media Library /wp-admin/upload.php4.39 ▲1.1642.84 ▲8.92
Learny LMS Pro /wp-admin/admin.php?page=learny-pro_lms4.3240.23
Course Category /wp-admin/edit-tags.php?taxonomy=learny_category&post_type=learny-courses4.5060.74
Instructor /wp-admin/admin.php?page=learny-instructor4.5145.03
Report /wp-admin/admin.php?page=learny-report4.5142.46
Student /wp-admin/admin.php?page=learny-student4.5145.04
Plugin Settings /wp-admin/admin.php?page=learny-settings4.4747.14
Courses /wp-admin/edit.php?post_type=learny-courses4.6049.83
Payout /wp-admin/admin.php?page=learny-payout4.5044.78
Course Tags /wp-admin/edit-tags.php?taxonomy=learny_tag&post_type=learny-courses4.4940.82

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 1,352 new files
Database: 7 new tables, 10 new options
New tables
wp_learny_currencies
wp_learny_watch_history
wp_learny_payment
wp_learny_payout
wp_learny_review
wp_learny_enrolment
wp_learny_wishlist
New WordPress options
ly_dashboard_page
ly_checkout_page
ly_auth_page
theysaidso_admin_options
ly_course_player_page
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics 50% from 4 tests

Learny LMS: an overview of browser usage
Please improve the following
  • Memory: Browser memory usage must be limited to 75.00MB (currently 156.16MB on /wp-admin/admin.php?page=learny-pro_lms)
  • Script duration: Total JavaScript execution time should be lower than 1,500.00ms (currently 4,363.92ms on /wp-admin/admin.php?page=learny-pro_lms)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10114.25 ▼0.031.61 ▼0.0042.35 ▼1.15
Dashboard /wp-admin2,241 ▲615.56 ▼0.1188.46 ▼9.9340.26 ▲0.88
Posts /wp-admin/edit.php2,155 ▲521.98 ▲0.0232.60 ▼11.2033.58 ▼3.29
Add New Post /wp-admin/post-new.php1,581 ▲5518.20 ▼5.07653.39 ▼35.5080.23 ▼8.65
Media Library /wp-admin/upload.php1,455 ▲554.20 ▲0.0196.63 ▼2.0145.15 ▲1.88
Learny LMS Pro /wp-admin/admin.php?page=learny-pro_lms12,504156.164,363.92101.79
Course Category /wp-admin/edit-tags.php?taxonomy=learny_category&post_type=learny-courses1,7565.0673.0675.56
Instructor /wp-admin/admin.php?page=learny-instructor1,5544.9361.2239.00
Report /wp-admin/admin.php?page=learny-report1,6215.3663.7938.56
Student /wp-admin/admin.php?page=learny-student1,5504.9470.5243.64
Plugin Settings /wp-admin/admin.php?page=learny-settings1,5604.8957.8283.57
Courses /wp-admin/edit.php?post_type=learny-courses1,5805.0572.6842.15
Payout /wp-admin/admin.php?page=learny-payout1,5484.9469.3039.69
Course Tags /wp-admin/edit-tags.php?taxonomy=learny_tag&post_type=learny-courses1,7225.0271.0742.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 7 tables
    • wp_learny_review
    • wp_learny_currencies
    • wp_learny_payment
    • wp_learny_enrolment
    • wp_learny_payout
    • wp_learny_wishlist
    • wp_learny_watch_history
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-comments
    • ly_course_player_page
    • ly_dashboard_page
    • ly_checkout_page
    • theysaidso_admin_options
    • ly_auth_page
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 205× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/learny-lms/templates/frontend/shortcode/student-pages/footer.php
    • > /wp-content/plugins/learny-lms/vendor/paypal/rest-api-sdk-php/sample/payments/ListPayments.php
    • > /wp-content/plugins/learny-lms/templates/backend/instructor/payout/create.php
    • > /wp-content/plugins/learny-lms/views/custom-meta-box/course/sub-section/sections.php
    • > /wp-content/plugins/learny-lms/vendor/paypal/rest-api-sdk-php/sample/notifications/ValidateWebhookEvent.php
    • > /wp-content/plugins/learny-lms/inc/base/Activate.php
    • > /wp-content/plugins/learny-lms/inc/base/Deactivate.php
    • > /wp-content/plugins/learny-lms/views/custom-meta-box/course/section/media.php
    • > /wp-content/plugins/learny-lms/inc/base/Enqueue.php
    • > /wp-content/plugins/learny-lms/templates/frontend/shortcode/student-pages/403.php
  • 545× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/learny-lms/vendor/dompdf/dompdf/lib/php-svg-lib/src/Svg/Tag/Rect.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/learny-lms/vendor/dompdf/dompdf/lib/php-css-parser/tests/Sabberworm/CSS/RuleSet/DeclarationBlockTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/learny-lms/vendor/dompdf/dompdf/lib/php-svg-lib/src/Svg/Tag/RadialGradient.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/learny-lms/vendor/paypal/rest-api-sdk-php/tests/PayPal/Test/Api/ParticipantTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/learny-lms/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Authorization.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/learny-lms/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/ProcessorResponse.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/learny-lms/vendor/dompdf/dompdf/lib/php-font-lib/src/FontLib/Header.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/learny-lms/vendor/dompdf/dompdf/src/FrameReflower/Page.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/learny-lms/vendor/dompdf/dompdf/lib/php-css-parser/tests/Sabberworm/CSS/RuleSet/LenientParsingTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/learny-lms/vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=learny_tag&post_type=learny-courses
    • > Network (severe)
    wp-content/plugins/learny-lms/assets/admin/images/texture.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #20, #21, #22, #23, #24, #25, #26, #27 in learny-lms/assets to your readme.txt
You can look at the official readme.txt

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

The main file in "Learny LMS" v. 1.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("learny-lms.php" instead of "learny.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin131,921 lines of code in 1,057 files:
LanguageFilesBlank linesComment linesLines of code
PHP77816,98138,60176,799
JavaScript2064071433,984
CSS661,4231596,646
JSON702305,396
SVG10014,700
HTML85241152,581
Markdown1137601,357
XML8112258
YAML5192116
Ruby215853
INI2186731

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.60
▷ Minimum class complexity1.00
▷ Maximum class complexity797.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces73
Interfaces14
Traits2
Classes669
▷ Abstract classes243.59%
▷ Concrete classes64596.41%
▷ Final classes10.16%
Methods6,158
▷ Static methods6079.86%
▷ Public methods5,68392.29%
▷ Protected methods3125.07%
▷ Private methods1632.65%
Functions63
▷ Named functions2031.75%
▷ Anonymous functions4368.25%
Constants279
▷ Global constants31.08%
▷ Class constants27698.92%
▷ Public constants276100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 0.57MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/paypal/rest-api-sdk-php/sample/images/pp_v_rgb.png7.53KB4.59KB▼ 39.12%
assets/admin/images/logo.png10.19KB5.18KB▼ 49.19%
assets/admin/images/100X100.png0.25KB0.23KB▼ 8.24%
assets/public/images/stripe.png141.06KB44.64KB▼ 68.35%
assets/public/images/paypal.png94.75KB29.19KB▼ 69.20%