78% z-downloads

Code Review | Z-Downloads

WordPress plugin Z-Downloads scored78%from 54 tests.

About plugin

  • Plugin page: z-downloads
  • Plugin version: 1.11.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Mar 4, 2019
  • Latest release: Oct 13, 2023
  • Number of updates: 92
  • Update frequency: every 18.3 days
  • Top authors: urbanbase (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active /4,640 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.34MB] [CPU: ▼1.13ms] Passed 4 tests

Server-side resources used by Z-Downloads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3341.24 ▲0.18
Dashboard /wp-admin3.67 ▲0.3754.25 ▲8.89
Posts /wp-admin/edit.php3.75 ▲0.3945.48 ▼2.85
Add New Post /wp-admin/post-new.php6.21 ▲0.3392.71 ▼7.03
Media Library /wp-admin/upload.php3.56 ▲0.3342.14 ▲5.18
Help /wp-admin/admin.php?page=z-downloads-help3.7533.90
Z-Downloads /wp-admin/admin.php?page=z-downloads3.6439.47
Archives /wp-admin/admin.php?page=z-downloads-ziparchive3.9534.08
Create archive /wp-admin/admin.php?page=z-downloads-add-archive3.5933.91
Settings /wp-admin/admin.php?page=z-downloads-settings3.8231.54
Premium /wp-admin/admin.php?page=z-downloads-premium3.5932.28
Add file /wp-admin/admin.php?page=z-downloads-add-file3.5432.70
Files /wp-admin/admin.php?page=z-downloads-files4.0331.18
Logs /wp-admin/admin.php?page=z-downloads-log3.5933.29

Server storage [IO: ▲0.60MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 46 new files
Database: 4 new tables, 7 new options
New tables
wp_zdm_archives
wp_zdm_log
wp_zdm_files_rel
wp_zdm_files
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
zdm_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Z-Downloads
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲23114.21 ▼0.161.56 ▼0.0843.38 ▲1.02
Dashboard /wp-admin2,392 ▲2155.66 ▲0.0885.74 ▼0.7152.95 ▲10.79
Posts /wp-admin/edit.php2,201 ▲1012.17 ▲0.1836.99 ▲2.7137.58 ▲1.32
Add New Post /wp-admin/post-new.php1,610 ▲7918.25 ▼5.07671.40 ▲40.2669.67 ▲17.42
Media Library /wp-admin/upload.php1,498 ▲984.22 ▲0.03110.87 ▲11.0155.00 ▲14.81
Help /wp-admin/admin.php?page=z-downloads-help1,0971.8031.1974.01
Z-Downloads /wp-admin/admin.php?page=z-downloads1,2891.7030.6350.96
Archives /wp-admin/admin.php?page=z-downloads-ziparchive1,1221.9826.8539.80
Create archive /wp-admin/admin.php?page=z-downloads-add-archive1,1601.8725.9565.72
Settings /wp-admin/admin.php?page=z-downloads-settings1,9901.8328.6480.55
Premium /wp-admin/admin.php?page=z-downloads-premium1,3821.8426.2440.50
Add file /wp-admin/admin.php?page=z-downloads-add-file1,1481.8727.0344.05
Files /wp-admin/admin.php?page=z-downloads-files1,1161.8426.7035.45
Logs /wp-admin/admin.php?page=z-downloads-log1,1041.8226.1936.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=z-downloads-add-archive
    • > Notice in wp-content/plugins/z-downloads/templates/admin_menu_add_archive.php+152
    Undefined index: name
    • > GET request to /wp-admin/admin.php?page=z-downloads-add-archive
    • > Notice in wp-content/plugins/z-downloads/templates/admin_menu_add_archive.php+159
    Undefined index: zip-name
    • > GET request to /wp-admin/admin.php?page=z-downloads-add-archive
    • > Notice in wp-content/plugins/z-downloads/templates/admin_menu_add_archive.php+216
    Undefined index: description
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=z-downloads-log
    • > Notice in wp-content/plugins/z-downloads/templates/admin_hidden_log.php+198
    Undefined variable: zdm_log_filter_type

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 fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ZDMCore' not found in wp-content/plugins/z-downloads/templates/admin_dashboard_widget.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

z-downloads/z-downloads.php 92% from 13 tests

"Z-Downloads" version 1.11.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected9,013 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP311,0718646,821
PO File15177431,451
CSS411673741

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.41
Average class complexity38.50
▷ Minimum class complexity1.00
▷ Maximum class complexity198.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods63
▷ Static methods3555.56%
▷ Public methods63100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants36100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png4.27KB1.99KB▼ 53.51%
assets/z-downloads-premium-backend-mini.png5.09KB4.17KB▼ 18.19%