10% file-uploader-for-woocommerce

Code Review | File Uploader for WooCommerce

WordPress plugin File Uploader for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: file-uploader-for...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 3, 2023
  • Latest release: May 2, 2023
  • Number of updates: 29
  • Update frequency: every 3.0 days
  • Top authors: snowray (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /658 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/file-uploader-for-woocommerce/src/Models/class-optionsmodel.php+244
    Invalid argument supplied for foreach()

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.60ms] Passed 4 tests

A check of server-side resources used by File Uploader for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.77 ▼7.46
Dashboard /wp-admin3.31 ▼0.0443.20 ▼17.83
Posts /wp-admin/edit.php3.36 ▲0.0046.47 ▼0.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.43 ▼17.06
Media Library /wp-admin/upload.php3.23 ▲0.0034.31 ▲1.35

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 175 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for File Uploader for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.19 ▼1.121.66 ▼0.4939.93 ▼13.25
Dashboard /wp-admin2,206 ▲155.86 ▼0.01102.55 ▲0.4137.92 ▼3.67
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0638.54 ▲0.4335.38 ▲4.83
Add New Post /wp-admin/post-new.php1,534 ▲123.26 ▲4.82673.71 ▲20.5963.97 ▲8.48
Media Library /wp-admin/upload.php1,382 ▼34.18 ▼0.2396.13 ▼7.3043.43 ▼3.46

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 53× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\MessageFormatterInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/guzzle/src/MessageFormatter.php:38
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/promises/src/TaskQueue.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\BodySummarizerInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/guzzle/src/BodySummarizer.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/psr/http-client/src/RequestExceptionInterface.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/file-uploader-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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: You are using too many tags: 17 tag instead of maximum 10
Please take inspiration from this readme.txt

file-uploader-for-woocommerce/file-uploader-woocommerce.php 92% from 13 tests

"File Uploader for WooCommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("file-uploader-for-woocommerce.php" instead of "file-uploader-woocommerce.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
Good job! No executable or dangerous file extensions detected16,031 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PHP1362,2926,48311,319
Markdown151,27803,664
JSON9001,040
YAML1007
JavaScript1011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.86
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces18
Interfaces26
Traits3
Classes89
▷ Abstract classes11.12%
▷ Concrete classes8898.88%
▷ Final classes3640.91%
Methods814
▷ Static methods15118.55%
▷ Public methods68183.66%
▷ Protected methods202.46%
▷ Private methods11313.88%
Functions130
▷ Named functions3930.00%
▷ Anonymous functions9170.00%
Constants69
▷ Global constants22.90%
▷ Class constants6797.10%
▷ Public constants5683.58%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin