10% download-directory

Code Review | Download Directory

WordPress plugin Download Directory scored 10% from 54 tests.

About plugin

  • Plugin page: download-directory
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Aug 6, 2016
  • Latest release: Aug 6, 2016
  • Number of updates: 12
  • Update frequency: every 0.1 days
  • Top authors: eoni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 3,747 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/download-directory/includes/class-dwn-repo-pro-activator.php+28
    Non-static method Dwn_Repo_Pro_Admin::down_repo_taxonomy() should not be called statically

Server metrics [RAM: ▲0.20MB] [CPU: ▼134.67ms] Passed 4 tests

Server-side resources used by Download Directory
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.05 ▲0.3349.22 ▲24.70
Dashboard /wp-admin3.31 ▲0.2562.67 ▲4.56
Posts /wp-admin/edit.php3.36 ▲0.2556.61 ▲10.34
Add New Post /wp-admin/post-new.php5.58 ▲0.15104.03 ▼564.33
Media Library /wp-admin/upload.php3.17 ▲0.1745.63 ▲10.75
Downloads License /wp-admin/edit-tags.php?taxonomy=down_license&post_type=down_repo3.2645.18
Downloads Category /wp-admin/edit-tags.php?taxonomy=down_cat&post_type=down_repo3.2654.79
Downloads Tag /wp-admin/edit-tags.php?taxonomy=down_tag&post_type=down_repo3.2644.88
All Downloads /wp-admin/edit.php?post_type=down_repo3.3054.36
Add New /wp-admin/post-new.php?post_type=down_repo3.1448.84

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 144 new files
Database: 1 new table, 2 new options
New tables
wp_dwrp_alert
New WordPress options
widget_down_repo_cat
dwrp_db_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Download Directory
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,093 ▲49718.11 ▲2.5417.93 ▲9.7251.98 ▼4.72
Dashboard /wp-admin3,217 ▲2837.93 ▲1.98166.77 ▲15.67125.19 ▲2.01
Posts /wp-admin/edit.php3,015 ▲2764.28 ▲1.59126.45 ▲58.6788.81 ▼15.08
Add New Post /wp-admin/post-new.php1,651 ▲6021.32 ▲2.46268.98 ▼123.20122.60 ▼1.66
Media Library /wp-admin/upload.php1,861 ▲544.80 ▼0.24120.98 ▼38.33126.46 ▼6.06
Downloads License /wp-admin/edit-tags.php?taxonomy=down_license&post_type=down_repo1,9883.8984.0987.86
Downloads Category /wp-admin/edit-tags.php?taxonomy=down_cat&post_type=down_repo2,0193.8687.3678.95
Downloads Tag /wp-admin/edit-tags.php?taxonomy=down_tag&post_type=down_repo1,9913.7978.4786.54
All Downloads /wp-admin/edit.php?post_type=down_repo1,7564.2289.2075.49
Add New /wp-admin/post-new.php?post_type=down_repo3,8948.60258.76168.28

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_dwrp_alert
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • dwrp_db_version
    • widget_down_repo_cat

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=down_repo
    • > Notice in wp-content/plugins/download-directory/public/class-dwn-repo-template-functions.php+167
    Undefined offset: 0
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=down_repo
    • > Notice in wp-content/plugins/download-directory/public/class-dwn-repo-template-functions.php+167
    Trying to get property 'term_id' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=down_repo
    • > Notice in wp-content/plugins/download-directory/public/class-dwn-repo-template-functions.php+170
    Undefined property: WP_Error::$parent
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=down_repo
    • > Notice in wp-content/plugins/download-directory/public/class-dwn-repo-template-functions.php+173
    Undefined property: WP_Error::$term_id
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=down_repo
    • > Notice in wp-content/plugins/download-directory/public/class-dwn-repo-template-functions.php+184
    Undefined variable: taxonomy_name

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/download-directory/trunk/admin/partials/dwn-repo-pro-admin-display.php
    • > /wp-content/plugins/download-directory/admin/partials/dwn-repo-pro-admin-display.php
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/download-directory/admin/custom-category.php:23
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/download-directory/public/templates/down_repo-downloading.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_widget() in wp-content/plugins/download-directory/admin/widget-category.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/download-directory/admin/post-type.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/download-directory/admin/metabox.php:83
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/download-directory/admin/custom-tag.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/download-directory/includes/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_widget() in wp-content/plugins/download-directory/trunk/admin/widget-category.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/download-directory/trunk/admin/custom-tag.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/download-directory/trunk/admin/metabox.php:83

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Requires at least: Version not formatted correctly
You can take inspiration from this readme.txt

download-directory/dwn-repo-pro.php 92% from 13 tests

The main PHP file in "Download Directory" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("download-directory.php" instead of "dwn-repo-pro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin8,775 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PO File181,5272,0935,035
PHP217042,6052,852
CSS21010791
JavaScript2321497

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity25.06
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes36
▷ Abstract classes00.00%
▷ Concrete classes36100.00%
▷ Final classes00.00%
Methods350
▷ Static methods185.14%
▷ Public methods29082.86%
▷ Protected methods4613.14%
▷ Private methods144.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.82MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png122.67KB50.64KB▼ 58.72%
banner-772x250.png168.02KB56.59KB▼ 66.32%
trunk/screenshot-3.png87.73KB31.32KB▼ 64.30%
screenshot-3.png87.73KB31.32KB▼ 64.30%
screenshot-1.png40.16KB19.46KB▼ 51.53%