78% students-count-for-learndash

Code Review | Students Count for LearnDash

WordPress plugin Students Count for LearnDash scored78%from 54 tests.

About plugin

  • Plugin page: students-count-fo...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 22, 2021
  • Latest release: Aug 19, 2021
  • Number of updates: 9
  • Update frequency: every 6.4 days
  • Top authors: maurolopes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,667 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
Installer ran successfully

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

A check of server-side resources used by Students Count for LearnDash
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.88 ▼4.66
Dashboard /wp-admin3.31 ▲0.0049.54 ▼5.68
Posts /wp-admin/edit.php3.36 ▲0.0047.51 ▼2.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.58 ▼12.93
Media Library /wp-admin/upload.php3.23 ▲0.0034.17 ▼3.79
Students Count /wp-admin/admin.php?page=learndash-students-count3.0025.88

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Students Count for LearnDash
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.21 ▲0.051.76 ▼3.4843.71 ▼1.87
Dashboard /wp-admin2,206 ▲184.84 ▼0.27111.67 ▼6.1944.32 ▼0.29
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0135.97 ▲1.0035.93 ▲1.02
Add New Post /wp-admin/post-new.php1,514 ▼017.71 ▲0.19680.57 ▼3.8853.79 ▼8.99
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0596.48 ▼10.5742.05 ▼1.49
Students Count /wp-admin/admin.php?page=learndash-students-count280.440.094.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/students-count-for-learndash/admin/trsc-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/students-count-for-learndash/includes/functions.php:282

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=learndash-students-count
    • > Network (severe)
    wp-admin/admin.php?page=learndash-students-count - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: lms, learning, elearning, learndash, education

students-count-for-learndash/learndash-students-count.php 85% from 13 tests

The principal PHP file in "Students Count for LearnDash" v. 1.0.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("students-count-for-learndash.php" instead of "learndash-students-count.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,023 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP38845736
CSS2222191
PO File1354096

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants15100.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
PNG images were not found in this plugin