73% small-package-quotes-ups-edition

Code Review | Small Package Quotes - UPS Edition

WordPress plugin Small Package Quotes - UPS Edition scored73%from 54 tests.

About plugin

  • Plugin page: small-package-quo...
  • Plugin version: 4.3.10
  • PHP version: 7.4.16
  • WordPress compatibility: 6.4-6.4
  • WordPress version: 6.3.1
  • First release: May 18, 2017
  • Latest release: Nov 22, 2023
  • Number of updates: 79
  • Update frequency: every 30.2 days
  • Top authors: enituretechnology (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /3,706 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.84MB] [CPU: ▼32.76ms] Passed 4 tests

This is a short check of server-side resources used by Small Package Quotes - UPS Edition
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0939.95 ▼1.54
Dashboard /wp-admin3.11 ▼0.2026.76 ▼27.15
Posts /wp-admin/edit.php3.11 ▼0.2530.74 ▼20.21
Add New Post /wp-admin/post-new.php3.11 ▼2.7826.61 ▼73.61
Media Library /wp-admin/upload.php3.11 ▼0.1224.15 ▼10.08

Server storage [IO: ▲0.63MB] [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: 51 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
en_ups_small_update_now
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Small Package Quotes - UPS Edition
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5214.34 ▼0.371.51 ▼0.2441.26 ▼3.12
Dashboard /wp-admin2,219 ▲455.66 ▲0.0293.64 ▼9.3840.26 ▼8.49
Posts /wp-admin/edit.php2,125 ▲222.02 ▲0.0240.79 ▼4.1436.23 ▼8.35
Add New Post /wp-admin/post-new.php1,550 ▲2423.71 ▲0.45596.30 ▼26.5059.49 ▲5.57
Media Library /wp-admin/upload.php1,427 ▲274.21 ▲0.0197.36 ▼5.8044.16 ▲1.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/woocommerce): failed to open dir: No such file or directory
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • ups_small_web_hook_plan_requests
    • en_ups_small_update_now
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/small-package-quotes-ups-edition/order-details/en-order-widget.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/small-package-quotes-ups-edition/order-details/en-order-export.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/small-package-quotes-ups-edition/product/en-common-product-detail.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/small-package-quotes-ups-edition/product/en-product-detail.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/small-package-quotes-ups-edition/template/csv-export.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/small-package-quotes-ups-edition/order-details/rates/order-rates.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/small-package-quotes-ups-edition/fdo/en-sbs.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

small-package-quotes-ups-edition/small-package-quotes-ups-edition.php 85% from 13 tests

"Small Package Quotes - UPS Edition" version 4.3.10's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("6.2" instead of "6.4")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected9,921 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP381,0831,2476,760
JavaScript54866352,207
CSS214045954

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 120)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity41.68
▷ Minimum class complexity2.00
▷ Maximum class complexity321.00
Average method complexity7.06
▷ Minimum method complexity1.00
▷ Maximum method complexity120.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods168
▷ Static methods21.19%
▷ Public methods168100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions48
▷ Named functions4695.83%
▷ Anonymous functions24.17%
Constants5
▷ Global constants5100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
warehouse-dropship/wild/assets/images/delete.png3.49KB0.86KB▼ 75.41%
warehouse-dropship/wild/assets/images/edit.png3.09KB0.70KB▼ 77.43%