83% files-download-delay

Code Review | Files Download Delay

WordPress plugin Files Download Delay scored 83% from 54 tests.

About plugin

  • Plugin page: files-download-delay
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 15, 2022
  • Latest release: Jan 26, 2023
  • Number of updates: 13
  • Update frequency: every 38.6 days
  • Top authors: blueberry.acc (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 1,430 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
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.86ms] Passed 4 tests

Analyzing server-side resources used by Files Download Delay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1244.04 ▼7.68
Dashboard /wp-admin3.38 ▲0.0746.64 ▲0.61
Posts /wp-admin/edit.php3.43 ▲0.0748.86 ▼0.49
Add New Post /wp-admin/post-new.php6.00 ▲0.1193.76 ▼7.89
Media Library /wp-admin/upload.php3.30 ▲0.0743.83 ▲9.86
Files Download Delay /wp-admin/options-general.php?page=files-download-delay3.2831.35

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Files Download Delay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲14713.99 ▼0.398.62 ▲6.5035.67 ▼8.87
Dashboard /wp-admin2,210 ▲254.81 ▼1.04116.31 ▲10.5746.26 ▲2.02
Posts /wp-admin/edit.php2,093 ▲11.99 ▼0.0039.00 ▼0.1735.89 ▲0.85
Add New Post /wp-admin/post-new.php1,679 ▲16521.79 ▼1.62661.99 ▲59.9765.23 ▲2.59
Media Library /wp-admin/upload.php1,392 ▲74.20 ▼0.0294.69 ▼8.1343.56 ▼2.20
Files Download Delay /wp-admin/options-general.php?page=files-download-delay1,2288.19233.6062.30

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-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/files-download-delay/redirect-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/files-download-delay/main.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Contributors: Contributors not specified
You can look at the official readme.txt

files-download-delay/main.php 77% from 13 tests

The principal PHP file in "Files Download Delay" v. 1.0.9 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 174 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("files-download-delay.php" instead of "main.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
There were no executable files found in this plugin3,344 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41673382,606
PHP116427550
PO File185131174
HTML1007
CSS3003
JSON2002
SVG2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity3.20
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods21
▷ Static methods314.29%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants0
▷ Global constants00.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
5 PNG files occupy 0.33MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png6.42KB3.69KB▼ 42.46%
assets/screenshot-3.png20.53KB11.56KB▼ 43.68%
assets/screenshot-1.png279.24KB73.24KB▼ 73.77%
img/icon-256x256.png20.41KB7.90KB▼ 61.32%
img/buy_beer.png16.03KB6.71KB▼ 58.12%