62% academy

Code Review | Academy LMS – eLearning and online course solution for WordPress

WordPress plugin Academy LMS – eLearning and online course solution for WordPress scored 62% from 54 tests.

About plugin

  • Plugin page: academy
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9
  • WordPress version: 5.9.2
  • First release: Jun 5, 2021
  • Latest release: Mar 21, 2022
  • Number of updates: 44
  • Update frequency: every 8.7 days
  • Top authors: academylms (93.18%)wpmicrolab (9.09%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 2,416 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.63MB] [CPU: ▼275.45ms] 75% from 4 tests

This is a short check of server-side resources used by Academy LMS – eLearning and online course solution for WordPress
The following require your attention
  • RAM: You should keep total memory usage under 10MB (currently 10.14MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php)
PageMemory (MB)CPU Time (ms)
Home /5.21 ▲1.6966.72 ▲15.02
Dashboard /wp-admin4.98 ▲1.5751.36 ▲17.87
Posts /wp-admin/edit.php5.27 ▲1.6349.88 ▲14.60
Add New Post /wp-admin/post-new.php9.56 ▲2.59109.89 ▼1,140.32
Media Library /wp-admin/upload.php4.93 ▲1.6332.54 ▲8.92
All Courses /wp-admin/admin.php?page=academy-courses5.0435.49
Tags /wp-admin/admin.php?page=academy-tag5.0434.73
All Lessons /wp-admin/admin.php?page=academy-lessons5.0435.70
Question & Answer /wp-admin/admin.php?page=academy-question_answer5.0434.76
Add New Course /wp-admin/admin.php?page=academy-course5.0443.59
Category /wp-admin/admin.php?page=academy-category5.0436.36
Students /wp-admin/admin.php?page=academy-students5.0435.65
Settings /wp-admin/admin.php?page=academy-settings5.0434.13
Analytics /wp-admin/admin.php?page=academy5.0435.12
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php10.1472.93

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 167 new files
Database: 4 new tables, 6 new options
New tables
wp_academy_withdraws
wp_academy_lessonmeta
wp_academy_earnings
wp_academy_lessons
New WordPress options
academy_first_install_time
academy_db_version
academy_version
widget_recent-comments
widget_recent-posts
academyut_notification_times

Browser metrics Passed 4 tests

Checking browser requirements for Academy LMS – eLearning and online course solution for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,882 ▲12816.14 ▲0.015.89 ▼0.242.43 ▼0.64
Dashboard /wp-admin2,976 ▲1226.13 ▲0.03123.66 ▼8.22160.43 ▲3.95
Posts /wp-admin/edit.php2,772 ▲783.25 ▼0.0069.42 ▲3.58146.05 ▲1.30
Add New Post /wp-admin/post-new.php1,719 ▲2921.16 ▼0.82421.71 ▼17.56160.39 ▲8.35
Media Library /wp-admin/upload.php1,786 ▲855.46 ▼0.06140.05 ▼4.14187.17 ▲6.71
All Courses /wp-admin/admin.php?page=academy-courses1,65512.53320.16202.65
Tags /wp-admin/admin.php?page=academy-tag1,68812.71234.43126.10
All Lessons /wp-admin/admin.php?page=academy-lessons1,56414.08172.53146.64
Question & Answer /wp-admin/admin.php?page=academy-question_answer1,56612.24175.36136.86
Add New Course /wp-admin/admin.php?page=academy-course1,95215.64261.32231.68
Category /wp-admin/admin.php?page=academy-category1,69812.85157.72129.63
Students /wp-admin/admin.php?page=academy-students1,53713.23161.76127.48
Settings /wp-admin/admin.php?page=academy-settings1,58313.28163.77118.77
Analytics /wp-admin/admin.php?page=academy1,53313.96184.16110.31
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php15,06626.651,133.56268.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_academy_lessonmeta
    • wp_academy_withdraws
    • wp_academy_lessons
    • wp_academy_earnings
  • The uninstall procedure has failed, leaving 6 options in the database
    • academyut_notification_times
    • academy_first_install_time
    • widget_recent-posts
    • widget_recent-comments
    • academy_version
    • academy_db_version

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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/academy/includes/database/create-quiz-meta-table.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/academy/templates/instructor/header.php:2
    • > PHP Notice
      Undefined variable: is_enrolled in wp-content/plugins/academy/templates/single-course/enroll/content.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/academy/templates/instructor/reviews.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/academy/templates/instructor/tab-navbar.php:2
    • > PHP Notice
      Undefined variable: is_paid in wp-content/plugins/academy/templates/single-course/enroll/content.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/academy/templates/global/login.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/academy/templates/global/courses.php:4
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/academy/templates/instructor/reviews.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/academy/templates/single-course/enroll/content.php:13
    • > PHP Notice
      Undefined variable: reviews in wp-content/plugins/academy/templates/instructor/reviews.php on line 3

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
Please take inspiration from this readme.txt

academy/academy.php Passed 13 tests

"Academy LMS – eLearning and online course solution for WordPress" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
51 characters long description:
Share your knowledge by launching an online course.

Code Analysis 97% from 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
No dangerous file extensions were detected21,527 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1332,4002,52318,130
SVG5002,821
JavaScript7126374
CSS647202

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 228)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity24.42
▷ Minimum class complexity1.00
▷ Maximum class complexity362.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity228.00
Code structure
Namespaces20
Interfaces2
Traits6
Classes63
▷ Abstract classes23.17%
▷ Concrete classes6196.83%
▷ Final classes11.64%
Methods484
▷ Static methods16934.92%
▷ Public methods43088.84%
▷ Protected methods489.92%
▷ Private methods61.24%
Functions48
▷ Named functions4797.92%
▷ Anonymous functions12.08%
Constants14
▷ Global constants1285.71%
▷ Class constants214.29%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/thumbnail-placeholder.png10.99KB5.45KB▼ 50.41%
(invalid) assets/images/profile.png2.08KB0.00KB▼ 100.00%
assets/images/add-review.png2.72KB1.40KB▼ 48.76%