84% bsdownloads

Code Review | BSDownloads

WordPress plugin BSDownloads scored84%from 54 tests.

About plugin

  • Plugin page: bsdownloads
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.3.4
  • WordPress version: 6.3.1
  • First release: Nov 29, 2012
  • Latest release: Nov 29, 2012
  • Number of updates: 5
  • Update frequency: every 129.6 days
  • Top authors: mnezerka (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼11.42ms] Passed 4 tests

Analyzing server-side resources used by BSDownloads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.12 ▼4.94
Dashboard /wp-admin3.34 ▼0.0154.04 ▼9.61
Posts /wp-admin/edit.php3.46 ▲0.1046.38 ▼10.88
Add New Post /wp-admin/post-new.php5.93 ▲0.0388.98 ▼20.24
Media Library /wp-admin/upload.php3.27 ▲0.0335.34 ▼0.89

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by BSDownloads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.081.83 ▼0.0138.29 ▼5.05
Dashboard /wp-admin2,198 ▲185.59 ▼0.0694.71 ▲6.2443.69 ▼2.03
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0235.35 ▼3.9533.60 ▼9.25
Add New Post /wp-admin/post-new.php1,526 ▼1417.44 ▼5.60681.30 ▲55.0361.31 ▲3.77
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0698.00 ▼10.5942.40 ▼7.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bsdownloads/bsdownloads.php:295

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
2 plugin tags: download, attachments

bsdownloads/bsdownloads.php 92% from 13 tests

Analyzing the main PHP file in "BSDownloads" version 1.0
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/lang" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin224 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14627224

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.35
Average class complexity19.00
▷ Minimum class complexity14.00
▷ Maximum class complexity24.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16.25%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/image.png0.63KB0.68KB0.00%
icons/xml.png0.59KB0.59KB0.50%
icons/excel.png0.65KB0.63KB▼ 2.41%
icons/powerpoint.png0.57KB0.61KB0.00%
icons/word.png0.64KB0.70KB0.00%