84% dashboard-widgets-learndash

Code Review | Dashboard Widgets for LearnDash

WordPress plugin Dashboard Widgets for LearnDash scored84%from 54 tests.

About plugin

  • Plugin page: dashboard-widgets...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9
  • WordPress version: 6.3.1
  • First release: Jan 15, 2019
  • Latest release: Jan 24, 2022
  • Number of updates: 27
  • Update frequency: every 40.9 days
  • Top authors: escapecreative (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active /9,668 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.03ms] Passed 4 tests

An overview of server-side resources used by Dashboard Widgets for LearnDash
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.82 ▲3.62
Dashboard /wp-admin3.30 ▲0.0045.80 ▼1.86
Posts /wp-admin/edit.php3.36 ▲0.0045.07 ▼5.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.98 ▼7.51
Media Library /wp-admin/upload.php3.23 ▲0.0030.87 ▼1.44

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Dashboard Widgets for LearnDash
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.131.82 ▼0.2744.34 ▲4.74
Dashboard /wp-admin2,206 ▲205.88 ▼0.03108.88 ▼7.0541.22 ▼0.37
Posts /wp-admin/edit.php2,092 ▼02.09 ▲0.0638.65 ▲2.5934.23 ▲1.47
Add New Post /wp-admin/post-new.php1,533 ▼023.37 ▲0.37630.87 ▼19.8654.46 ▼1.39
Media Library /wp-admin/upload.php1,388 ▼34.26 ▲0.0499.58 ▲5.6145.52 ▲6.15

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dashboard-widgets-learndash/inc/widgets/learndash-courses.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dashboard-widgets-learndash/inc/widgets/learndash-recently-updated.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dashboard-widgets-learndash/inc/widgets/learndash-links.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dashboard-widgets-learndash/inc/widgets/learndash-overview.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: lms, learndash, learning management system, dashboard widget

dashboard-widgets-learndash/dashboard-widgets-learndash.php 92% from 13 tests

"Dashboard Widgets for LearnDash" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 165 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
There were no executable files found in this plugin594 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6390163590
SVG1003
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity18.75
▷ Minimum class complexity11.00
▷ Maximum class complexity26.00
Average method complexity6.92
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-learndash.png13.43KB6.24KB▼ 53.53%