93% course-completed-for-learndash

Code Review | Course Completed for Learndash

WordPress plugin Course Completed for Learndash scored 93% from 54 tests.

About plugin

  • Plugin page: course-completed-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 5.8.1
  • First release: Jul 2, 2021
  • Latest release: Jul 3, 2021
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: maurolopes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 143 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼140.30ms] Passed 4 tests

Analyzing server-side resources used by Course Completed for Learndash
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0538.75 ▲4.94
Dashboard /wp-admin3.11 ▲0.0543.36 ▲4.97
Posts /wp-admin/edit.php3.16 ▲0.0545.74 ▼0.59
Add New Post /wp-admin/post-new.php5.46 ▲0.0384.12 ▼566.84
Media Library /wp-admin/upload.php3.05 ▲0.0531.65 ▲1.31
Course Completed /wp-admin/admin.php?page=learndash-course-completed3.0227.99

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Course Completed for Learndash
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.90 ▲0.297.16 ▼2.3149.25 ▲0.99
Dashboard /wp-admin2,970 ▲395.93 ▲0.00133.83 ▼19.98109.32 ▼12.14
Posts /wp-admin/edit.php2,739 ▼02.70 ▲0.0164.04 ▼0.0891.17 ▼4.65
Add New Post /wp-admin/post-new.php1,672 ▼018.82 ▼0.15349.18 ▼36.99105.70 ▲2.25
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.00157.32 ▲10.53118.47 ▼4.80
Course Completed /wp-admin/admin.php?page=learndash-course-completed1,2152.0956.61101.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/course-completed-for-learndash/admin/trcc-settings.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: learning, education, learndash, lms, elearning

course-completed-for-learndash/learndash-course-completed.php 77% from 13 tests

This is the main PHP file of "Course Completed for Learndash" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("course-completed-for-learndash.php" instead of "learndash-course-completed.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected435 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35732265
CSS1202170

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
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%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin