79% lucidlms

Code Review | LucidLMS

WordPress plugin LucidLMS scored79%from 54 tests.

About plugin

  • Plugin page: lucidlms
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.7.3
  • WordPress version: 6.3.1
  • First release: Feb 17, 2017
  • Latest release: Apr 26, 2017
  • Number of updates: 17
  • Update frequency: every 4.0 days
  • Top authors: N3wNormal (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /3,084 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.57MB] [CPU: ▲11.87ms] Passed 4 tests

A check of server-side resources used by LucidLMS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.84 ▲1.3855.03 ▲9.29
Dashboard /wp-admin4.93 ▲1.6368.29 ▲12.92
Posts /wp-admin/edit.php5.00 ▲1.6474.37 ▲23.35
Add New Post /wp-admin/post-new.php7.55 ▲1.67103.52 ▲1.92
Media Library /wp-admin/upload.php4.85 ▲1.6268.21 ▲28.06
Score Cards /wp-admin/edit.php?post_type=score_card4.9468.45
Settings /wp-admin/admin.php?page=lucid-settings5.0255.50
Instructors /wp-admin/edit.php?post_type=instructors4.9359.48
Question Pool /wp-admin/admin.php?page=lucid-question-pool4.9255.12
Dashboard /wp-admin/admin.php?page=lucid-dashboard4.7654.87
Categories /wp-admin/edit-tags.php?taxonomy=course_cat&post_type=course4.8550.92
Add Course /wp-admin/post-new.php?post_type=course5.1176.90
Add Instructor /wp-admin/post-new.php?post_type=instructors5.0267.99
Courses /wp-admin/edit.php?post_type=course4.9358.87
LucidLMS /wp-admin/admin.php?page=lucidlms5.0252.85

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 315 new files
Database: no new tables, 21 new options
New WordPress options
db_upgraded
lucidlms_db_version
widget_theysaidso_widget
lucidlms_bbpress_integration_enabled
lucidlms_organization_name
lucidlms_course_category_hide
widget_recent-comments
_lucid_opt_in
lucidlms_quiz_default_threshold
lucidlms_emails_from_address
...

Browser metrics Passed 4 tests

A check of browser resources used by LucidLMS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲15914.30 ▼0.061.99 ▼0.1737.95 ▼7.33
Dashboard /wp-admin2,336 ▲1625.65 ▲0.0288.69 ▼53.7775.75 ▲26.16
Posts /wp-admin/edit.php2,244 ▲1412.20 ▲0.1641.46 ▼0.7135.76 ▼1.49
Add New Post /wp-admin/post-new.php1,645 ▲10017.50 ▼5.92756.11 ▲139.2456.52 ▲8.42
Media Library /wp-admin/upload.php1,532 ▲1324.24 ▼0.01115.14 ▲14.2874.70 ▲32.07
Score Cards /wp-admin/edit.php?post_type=score_card1,4802.7865.7137.54
Settings /wp-admin/admin.php?page=lucid-settings1,1902.4842.4833.43
Instructors /wp-admin/edit.php?post_type=instructors1,2052.1132.8632.16
Question Pool /wp-admin/admin.php?page=lucid-question-pool1,0322.4134.5547.72
Dashboard /wp-admin/admin.php?page=lucid-dashboard9712.2931.6029.60
Categories /wp-admin/edit-tags.php?taxonomy=course_cat&post_type=course1,4482.6532.8031.05
Add Course /wp-admin/post-new.php?post_type=course2,8127.87194.75131.84
Add Instructor /wp-admin/post-new.php?post_type=instructors2,4138.30174.58119.72
Courses /wp-admin/edit.php?post_type=course1,2472.5538.4430.41
LucidLMS /wp-admin/admin.php?page=lucidlms1,1532.4536.4528.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 21 options in the database
    • lucidlms_course_default_availability_time
    • lucidlms_emails_subject_course_completed
    • lucidlms_version
    • lucidlms_quiz_default_threshold
    • db_upgraded
    • lucidlms_emails_from_address
    • lucidlms_course_category_hide
    • _lucid_needs_pages
    • lucid_meta_box_errors
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/lucidlms/includes/libs/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/lucidlms/includes/admin/post-types/meta-boxes/views/html-course-elements-question.php
  • 35× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: course in wp-content/plugins/lucidlms/includes/admin/views/dashboard/html-admin-page-dashboard-course-meta.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lucidlms/includes/admin/views/question-pool/html-admin-question-pool-categories.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_type() on null in wp-content/plugins/lucidlms/includes/admin/views/dashboard/html-admin-page-dashboard-course-meta.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lucidlms/includes/admin/views/html-admin-page-dashboard.php:4
    • > PHP Notice
      Undefined variable: questions in wp-content/plugins/lucidlms/includes/admin/post-types/meta-boxes/views/html-course-elements-question.php on line 1
    • > PHP Notice
      Undefined variable: course in wp-content/plugins/lucidlms/includes/admin/views/dashboard/html-admin-page-dashboard-course.php on line 6
    • > PHP Notice
      Trying to get property 'post_status' of non-object in wp-content/plugins/lucidlms/includes/admin/views/dashboard/html-admin-page-dashboard-course.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lucidlms/includes/admin/views/question-pool/html-admin-question-pool-courses.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lucidlms/includes/lucid-course-functions.php:42
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/lucidlms/includes/admin/views/dashboard/html-admin-page-dashboard-courses.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: study, quiz, questions, course, learning...

lucidlms/lucidlms.php Passed 13 tests

The primary PHP file in "LucidLMS" version 1.0.5 is used by WordPress to initiate all plugin functionality
40 characters long description:
A beautiful learning management toolkit.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin28,193 lines of code in 257 files:
LanguageFilesBlank linesComment linesLines of code
PHP1553,6205,47714,456
HTML6213606,403
JavaScript246625924,095
CSS13157601,805
PO File15086111,181
SVG100229
JSON10024

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity32.47
▷ Minimum class complexity1.00
▷ Maximum class complexity338.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes11.89%
▷ Concrete classes5298.11%
▷ Final classes11.92%
Methods580
▷ Static methods478.10%
▷ Public methods52590.52%
▷ Protected methods467.93%
▷ Private methods91.55%
Functions160
▷ Named functions160100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.32MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/edit.png0.34KB0.24KB▼ 30.97%
assets/images/placeholder.png19.40KB8.04KB▼ 58.56%
assets/chosen/chosen-sprite.png0.53KB0.88KB0.00%
includes/libs/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%
assets/chosen/docsupport/oss-credit.png4.30KB3.26KB▼ 24.02%