89% collapsible-content-for-sensei-lms

Code Review | Collapsible Content for Sensei LMS

WordPress plugin Collapsible Content for Sensei LMS scored89%from 54 tests.

About plugin

  • Plugin page: collapsible-conte...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.7
  • WordPress version: 6.3.1
  • First release: May 6, 2019
  • Latest release: Mar 14, 2021
  • Number of updates: 12
  • Update frequency: every 56.5 days
  • Top authors: donnapep (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active /7,162 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Collapsible Content for Sensei LMS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.98 ▼7.86
Dashboard /wp-admin3.34 ▲0.0448.02 ▼6.33
Posts /wp-admin/edit.php3.39 ▲0.0453.27 ▼0.98
Add New Post /wp-admin/post-new.php5.92 ▲0.0486.81 ▼7.75
Media Library /wp-admin/upload.php3.26 ▲0.0438.67 ▲3.00

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Collapsible Content for Sensei LMS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.32 ▲0.371.64 ▼0.2841.02 ▼0.71
Dashboard /wp-admin2,206 ▲265.59 ▼0.0291.10 ▼3.5239.17 ▼6.77
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0440.85 ▼0.9036.70 ▼8.49
Add New Post /wp-admin/post-new.php1,527 ▲123.01 ▼0.56651.33 ▼9.7053.43 ▲2.06
Media Library /wp-admin/upload.php1,397 ▼34.22 ▼0.00104.92 ▼2.2943.07 ▼4.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: sensei lms, online course

collapsible-content-for-sensei-lms/sensei-collapsible-content.php 85% from 13 tests

The entry point to "Collapsible Content for Sensei LMS" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("collapsible-content-for-sensei-lms.php" instead of "sensei-collapsible-content.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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin221 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4102186219
CSS1001
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.50
▷ Minimum class complexity10.00
▷ Maximum class complexity11.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods14
▷ Static methods964.29%
▷ Public methods1178.57%
▷ Protected methods00.00%
▷ Private methods321.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin