90% download-media-file

Code Review | Download Media File

WordPress plugin Download Media File scored90%from 54 tests.

About plugin

  • Plugin page: download-media-file
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 6, 2018
  • Latest release: Jul 14, 2022
  • Number of updates: 5
  • Update frequency: every 275.6 days
  • Top authors: shamimmoeen (80%)coderbloc (40%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /2,939 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.03MB] [CPU: ▼2.06ms] Passed 4 tests

Server-side resources used by Download Media File
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.22 ▼4.05
Dashboard /wp-admin3.33 ▲0.0343.78 ▼2.19
Posts /wp-admin/edit.php3.38 ▲0.0346.16 ▼2.14
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.40 ▲4.84
Media Library /wp-admin/upload.php3.26 ▲0.0336.88 ▲0.13

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Download Media File
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.141.62 ▲0.0241.12 ▼1.05
Dashboard /wp-admin2,195 ▲155.48 ▼0.1581.55 ▼10.8838.01 ▼2.93
Posts /wp-admin/edit.php2,097 ▼32.01 ▲0.0535.32 ▼4.2533.38 ▼0.39
Add New Post /wp-admin/post-new.php1,526 ▼223.13 ▲0.13608.89 ▲2.1569.16 ▲13.76
Media Library /wp-admin/upload.php1,397 ▲34.16 ▼0.04101.75 ▲5.6043.10 ▲0.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 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
1 plugin tags: download-media-file

download-media-file/download-media-file.php Passed 13 tests

The primary PHP file in "Download Media File" version 1.0.1 is used by WordPress to initiate all plugin functionality
60 characters long description:
Adds a button to the media modal to download the media file.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected160 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP657200160

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods333.33%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected