83% upload-add-on-for-woocommerce

Code Review | Upload Add-on for Woocommerce

WordPress plugin Upload Add-on for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: upload-add-on-for...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-5.6
  • WordPress version: 6.3.1
  • First release: Sep 5, 2020
  • Latest release: Sep 14, 2020
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: crystalwebpro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /621 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Upload Add-on for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0149.39 ▲8.98
Dashboard /wp-admin3.31 ▲0.0148.23 ▼1.51
Posts /wp-admin/edit.php3.36 ▲0.0155.42 ▼1.31
Add New Post /wp-admin/post-new.php5.89 ▲0.01102.48 ▼5.46
Media Library /wp-admin/upload.php3.24 ▲0.0145.43 ▲7.57

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
woo_ua_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Upload Add-on for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6514.47 ▲0.101.79 ▲0.1044.87 ▼0.07
Dashboard /wp-admin2,220 ▲384.83 ▼0.03108.58 ▼2.3142.40 ▼4.63
Posts /wp-admin/edit.php2,100 ▲112.12 ▲0.1343.00 ▲1.5437.29 ▲1.26
Add New Post /wp-admin/post-new.php1,525 ▲617.68 ▼5.44680.96 ▼34.5758.39 ▼14.16
Media Library /wp-admin/upload.php1,399 ▲114.22 ▼0.03103.75 ▼12.8258.01 ▲8.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/upload-add-on-for-woocommerce/wooua.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 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
5 plugin tags: uploads, addon, file upload, woocommerce file upload, woocommerce

upload-add-on-for-woocommerce/wooua.php 77% from 13 tests

The entry point to "Upload Add-on for Woocommerce" version 1.1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "4.2.0")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Name the main plugin file the same as the plugin slug ("upload-add-on-for-woocommerce.php" instead of "wooua.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
There were no executable files found in this plugin526 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9175107486
Markdown111021
JavaScript12115
CSS1024

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.11
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.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
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/order-preview.PNG14.75KB8.15KB▼ 44.77%
assets/img/setting-preview.PNG23.74KB11.95KB▼ 49.69%
assets/img/single product preview.PNG12.71KB7.09KB▼ 44.19%