90% uploads-for-woocommerce

Code Review | Uploads for WooCommerce

WordPress plugin Uploads for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: uploads-for-wooco...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.1.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Nov 17, 2020
  • Latest release: Nov 7, 2022
  • Number of updates: 12
  • Update frequency: every 60.0 days
  • Top authors: europadns (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /961 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.32MB] [CPU: ▼4.63ms] Passed 4 tests

Server-side resources used by Uploads for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3742.54 ▼4.34
Dashboard /wp-admin3.66 ▲0.3251.96 ▼17.41
Posts /wp-admin/edit.php3.72 ▲0.3656.33 ▲0.78
Add New Post /wp-admin/post-new.php6.19 ▲0.30103.20 ▲2.46
Media Library /wp-admin/upload.php3.52 ▲0.3041.47 ▲3.22

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Uploads for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.23 ▼1.151.60 ▼0.2739.24 ▼4.19
Dashboard /wp-admin2,224 ▲215.91 ▲1.0799.37 ▼1.5643.28 ▼1.83
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0140.92 ▲4.4235.36 ▲1.96
Add New Post /wp-admin/post-new.php1,526 ▼017.71 ▲0.05701.73 ▼52.3257.51 ▼0.13
Media Library /wp-admin/upload.php1,397 ▼64.23 ▲0.0897.44 ▼10.1043.57 ▼7.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: upload, picture, file, image, ajax upload...

uploads-for-woocommerce/uploads-for-woocommerce.php Passed 13 tests

The primary PHP file in "Uploads for WooCommerce" version 1.0.2 is used by WordPress to initiate all plugin functionality
134 characters long description:
Let customers upload files to your WooCommerce products. Perfect for online photo or document processing services. Developer friendly.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,967 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP29239841,216
JavaScript2188364
CSS2610323
Markdown127064

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity6.58
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces9
Interfaces0
Traits4
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes00.00%
Methods82
▷ Static methods22.44%
▷ Public methods7996.34%
▷ Protected methods11.22%
▷ Private methods22.44%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants337.50%
▷ Class constants562.50%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/upload.png0.91KB1.05KB0.00%
assets/images/default_thumbnail.png3.63KB1.84KB▼ 49.34%