72% stulab-download-manager

Code Review | STUlab Download Manager

WordPress plugin STUlab Download Manager scored72%from 54 tests.

About plugin

  • Plugin page: stulab-download-m...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: Apr 3, 2020
  • Number of updates: 20
  • Update frequency: every 0.5 days
  • Top authors: stulab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /731 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
Installer ran successfully

Server metrics [RAM: ▲1.48MB] [CPU: ▲6.76ms] Passed 4 tests

Analyzing server-side resources used by STUlab Download Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.94 ▲1.4854.29 ▲8.16
Dashboard /wp-admin4.78 ▲1.4863.39 ▲5.68
Posts /wp-admin/edit.php4.88 ▲1.5261.86 ▲8.93
Add New Post /wp-admin/post-new.php7.37 ▲1.48106.55 ▲4.26
Media Library /wp-admin/upload.php4.71 ▲1.4848.89 ▲10.77
Add New /wp-admin/post-new.php?post_type=stu_download_manager4.8258.41
Download List /wp-admin/edit.php?post_type=stu_download_manager4.7448.20
Options /wp-admin/edit.php?post_type=stu_download_manager&page=stu_download_manager_Options4.7551.38

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for STUlab Download Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.35 ▼0.052.16 ▲0.4044.80 ▲0.43
Dashboard /wp-admin2,226 ▲555.64 ▲0.1191.58 ▼8.6641.45 ▼9.37
Posts /wp-admin/edit.php2,131 ▲312.02 ▲0.0535.56 ▼4.2934.81 ▼1.34
Add New Post /wp-admin/post-new.php1,561 ▲2318.36 ▼4.57621.62 ▼20.4287.58 ▲28.48
Media Library /wp-admin/upload.php1,428 ▲314.17 ▲0.08101.50 ▼14.9445.95 ▼1.41
Add New /wp-admin/post-new.php?post_type=stu_download_manager2,2367.31145.2965.19
Download List /wp-admin/edit.php?post_type=stu_download_manager1,1571.9736.9532.02
Options /wp-admin/edit.php?post_type=stu_download_manager&page=stu_download_manager_Options1,7006.99136.4031.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/stulab-download-manager/stu-download.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/stulab-download-manager/class.studl-downloadmanager.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/stulab-download-manager/classes/class-studl-Shortcodes.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/stulab-download-manager/classes/class-studl-CustomType.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/stulab-download-manager/layout/stu_download_manager_options_page.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/stulab-download-manager/classes/class-studl-Setting.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/edit.php?post_type=stu_download_manager&page=stu_download_manager_Options
    • > Network (severe)
    wp-admin/[studl_thumbnail%20post_id=1] - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: upload, posts, files, download, download manager

stulab-download-manager/stu-download.php 92% from 13 tests

The main PHP script in "STUlab Download Manager" version 1.0.2 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("stulab-download-manager.php" instead of "stu-download.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin3,006 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP920421,3862,886
PO File1323676
JavaScript14128
HTML141316

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity13.12
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes675.00%
▷ Concrete classes225.00%
▷ Final classes00.00%
Methods44
▷ Static methods4397.73%
▷ Public methods44100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2,087
▷ Global constants160.77%
▷ Class constants2,07199.23%
▷ Public constants2,071100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin