83% manage-enrollment-learndash

Code Review | Manage Enrollment for LearnDash

WordPress plugin Manage Enrollment for LearnDash scored83%from 54 tests.

About plugin

  • Plugin page: manage-enrollment...
  • Plugin version: 1.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 5, 2021
  • Latest release: Jun 5, 2023
  • Number of updates: 14
  • Update frequency: every 46.9 days
  • Top authors: liveaspankaj (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /4,153 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.48ms] Passed 4 tests

Analyzing server-side resources used by Manage Enrollment for LearnDash
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1039.77 ▼1.67
Dashboard /wp-admin3.43 ▲0.0851.03 ▼10.98
Posts /wp-admin/edit.php3.48 ▲0.1248.91 ▼2.42
Add New Post /wp-admin/post-new.php6.01 ▲0.1285.71 ▼10.85
Media Library /wp-admin/upload.php3.35 ▲0.1236.14 ▲1.18
Manage Enrollment LearnDash /wp-admin/admin.php?page=grassblade-manage-enrollment-learndash3.3230.71
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings3.3234.18

Server storage [IO: ▲0.63MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 78 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Manage Enrollment for LearnDash
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.34 ▼0.021.70 ▲0.0640.44 ▲2.47
Dashboard /wp-admin2,209 ▲295.56 ▼0.1083.96 ▼6.5276.32 ▲33.44
Posts /wp-admin/edit.php2,126 ▲261.99 ▲0.0136.36 ▲0.9134.31 ▼1.72
Add New Post /wp-admin/post-new.php1,548 ▲2223.60 ▲0.82753.17 ▲156.0349.59 ▼4.21
Media Library /wp-admin/upload.php1,417 ▲174.21 ▲0.0197.07 ▼9.3870.65 ▲24.08
Manage Enrollment LearnDash /wp-admin/admin.php?page=grassblade-manage-enrollment-learndash8941.7726.9440.48
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings8941.8524.5631.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/manage-enrollment-learndash/functions.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

manage-enrollment-learndash/functions.php 85% from 13 tests

The main PHP file in "Manage Enrollment for LearnDash" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("manage-enrollment-learndash.php" instead of "functions.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 230 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin11,364 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript642,66579210,173
PHP29036649
CSS3590542

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity157.00
▷ Minimum class complexity157.00
▷ Maximum class complexity157.00
Average method complexity10.18
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon_128x128.png22.67KB6.87KB▼ 69.71%
img/no.png1.01KB0.62KB▼ 39.05%
img/check.png0.98KB0.47KB▼ 52.44%
img/icon_30x30.png4.58KB1.60KB▼ 65.15%
img/icon-gb.png3.43KB0.84KB▼ 75.48%