78% toolkit-for-learndash-lms

Code Review | Toolkit for Learndash LMS

WordPress plugin Toolkit for Learndash LMS scored78%from 54 tests.

About plugin

  • Plugin page: toolkit-for-learn...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2
  • WordPress version: 6.3.1
  • First release: May 11, 2021
  • Latest release: May 24, 2023
  • Number of updates: 11
  • Update frequency: every 67.6 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,689 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: ▲0.02MB] [CPU: ▼4.67ms] Passed 4 tests

A check of server-side resources used by Toolkit for Learndash LMS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1740.41 ▼1.36
Dashboard /wp-admin3.32 ▲0.0248.09 ▲0.54
Posts /wp-admin/edit.php3.38 ▲0.0249.30 ▼2.56
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.20 ▼15.30
Media Library /wp-admin/upload.php3.25 ▲0.0236.42 ▲0.69
Toolkit for Learndash LMS /wp-admin/options-general.php?page=tkflld3.3538.96

Server storage [IO: ▲4.02MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
tkflld_options
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Toolkit for Learndash LMS: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲9813.51 ▼1.058.98 ▲7.0845.17 ▼0.17
Dashboard /wp-admin2,202 ▲285.64 ▲0.0399.70 ▲11.4542.63 ▲1.25
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0334.22 ▼5.9334.23 ▼5.63
Add New Post /wp-admin/post-new.php1,532 ▲423.22 ▼0.07627.81 ▼13.6452.98 ▼1.30
Media Library /wp-admin/upload.php1,401 ▲44.15 ▲0.0095.56 ▼11.2345.77 ▲0.76
Toolkit for Learndash LMS /wp-admin/options-general.php?page=tkflld3,9636.36163.9685.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • tkflld_options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/toolkit-for-learndash-lms/index.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      array_key_exists() expects parameter 2 to be array, null given in wp-content/plugins/toolkit-for-learndash-lms/inc/tkflld_settings.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toolkit-for-learndash-lms/inc/functions.php:83
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/toolkit-for-learndash-lms/inc/tkflld_settings.php:26
    • > PHP Warning
      array_key_exists() expects parameter 2 to be array, null given in wp-content/plugins/toolkit-for-learndash-lms/inc/tkflld_settings.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 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
1 plugin tags: toolkit for learndash lms

toolkit-for-learndash-lms/index.php 77% from 13 tests

The main PHP script in "Toolkit for Learndash LMS" version 1.0.8 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("toolkit-for-learndash-lms.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected11,196 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
SVG30129,445
CSS615714663
JavaScript4164109549
PHP428322539

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1386.67%
▷ Anonymous functions213.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.35MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
skins/img/standard.png251.49KB86.40KB▼ 65.65%
skins/img/default.png0.12KB0.09KB▼ 24.60%
img/ci-example-1.png5.11KB3.62KB▼ 29.23%
img/cic-example.png5.03KB3.56KB▼ 29.28%
img/cic-example-1.png5.23KB3.61KB▼ 30.94%