67% file-upload-for-woocommerce

Code Review | File Upload For WooCommerce

WordPress plugin File Upload For WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: file-upload-for-w...
  • Plugin version: 1.0.1
  • PHP compatiblity: 6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 8, 2022
  • Latest release: Oct 19, 2022
  • Number of updates: 4
  • Update frequency: every 4.8 days
  • Top authors: ammarahmad786 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /341 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by File Upload For WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.63 ▲0.63
Dashboard /wp-admin3.33 ▼0.0143.61 ▼18.05
Posts /wp-admin/edit.php3.38 ▲0.0341.57 ▼7.67
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.13 ▼17.06
Media Library /wp-admin/upload.php3.26 ▲0.0332.51 ▲0.06
File Upload Settings /wp-admin/admin.php?page=fufw_file_upload_settings_page3.5934.46

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
recovery_mode_email_last_sent
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for File Upload For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.151.81 ▼0.0743.03 ▼3.25
Dashboard /wp-admin2,203 ▲125.97 ▲1.0893.78 ▼6.4437.80 ▼4.91
Posts /wp-admin/edit.php2,089 ▼31.99 ▼0.0434.17 ▼7.7631.78 ▼3.06
Add New Post /wp-admin/post-new.php1,533 ▲1423.15 ▼0.32644.35 ▼18.9249.83 ▼2.53
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0194.78 ▼5.2341.82 ▼5.95
File Upload Settings /wp-admin/admin.php?page=fufw_file_upload_settings_page1,4141.536.8737.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fufw_file_upload_settings_page
    • > Warning in wp-content/plugins/file-upload-for-woocommerce/templates/fufw-admin-settings.php+265
    in_array() expects parameter 2 to be array, string given
    • > GET request to /wp-admin/admin.php?page=fufw_file_upload_settings_page
    • > Error in wp-content/plugins/file-upload-for-woocommerce/inc/admin.php+89
    Uncaught Error: Call to undefined function wc_get_orders() in wp-content/plugins/file-upload-for-woocommerce/inc/admin.php:89
    Stack trace:
    #0 wp-content/plugins/file-upload-for-woocommerce/templates/fufw-admin-settings.php(588): fufw_get_orders_with_image_paths()
    #1 wp-content/plugins/file-upload-for-woocommerce/inc/helpers.php(11): include('/var/www/wordpr...')
    #2 wp-content/plugins/file-upload-for-woocommerce/inc/admin.php(11): fufw_load_templates()
    #3 wp-includes/class-wp-hook.php(310): fufw_file_upload_settings()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP 0% from 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/file-upload-for-woocommerce/file-upload-for-woocommerce.php
  • 3× 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/file-upload-for-woocommerce/inc/admin.php:103
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/file-upload-for-woocommerce/templates/fufw-front-end-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/file-upload-for-woocommerce/templates/fufw-admin-settings.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=fufw_file_upload_settings_page
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=fufw_file_upload_settings_page 355 The specified value "white" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=fufw_file_upload_settings_page
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=fufw_file_upload_settings_page 371 The specified value "lightgrey" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: woocommerce checkout, woocommerce image upload, woocommerce, woocommerce file upload, woocommerce files...

file-upload-for-woocommerce/file-upload-for-woocommerce.php Passed 13 tests

This is the main PHP file of "File Upload For WooCommerce" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
83 characters long description:
A plugin For Uploading The Files On Product Pages And Checkout Pages of WooCommerce

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
No dangerous file extensions were detected2,761 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS550601,450
PHP5309781,056
JavaScript47515255

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity87.00
▷ Minimum class complexity87.00
▷ Maximum class complexity87.00
Average method complexity5.53
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods210.53%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_444444_256x240.png3.69KB4.18KB0.00%