77% flexible-shipping-ups

Code Review | WooCommerce UPS Shipping – Live Rates and Access Points

WordPress plugin WooCommerce UPS Shipping – Live Rates and Access Points scored77%from 54 tests.

About plugin

  • Plugin page: flexible-shipping...
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Feb 8, 2018
  • Latest release: Nov 10, 2023
  • Number of updates: 224
  • Update frequency: every 9.6 days
  • Top authors: wpdesk (42.86%)octolize (35.27%)jablonowski (22.77%)

Code review

54 tests

User reviews

62 reviews

Install metrics

9,000+ active /414,759 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by WooCommerce UPS Shipping – Live Rates and Access Points
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1044.06 ▲5.77
Dashboard /wp-admin3.40 ▲0.0545.06 ▼14.48
Posts /wp-admin/edit.php3.45 ▲0.0947.75 ▲2.24
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.29 ▼10.91
Media Library /wp-admin/upload.php3.26 ▲0.0334.49 ▲2.19

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 1,037 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
plugin_activation_flexible-shipping-ups/flexible-shipping-ups.php
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce UPS Shipping – Live Rates and Access Points
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4614.24 ▼0.111.81 ▲0.0838.24 ▼6.09
Dashboard /wp-admin2,192 ▲125.49 ▼0.1788.01 ▼12.5639.99 ▼4.54
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0138.96 ▲1.2235.21 ▲2.88
Add New Post /wp-admin/post-new.php1,529 ▲323.36 ▼0.15665.68 ▼35.8655.62 ▼5.13
Media Library /wp-admin/upload.php1,406 ▲34.24 ▲0.0098.48 ▼2.0942.92 ▼0.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • plugin_activation_flexible-shipping-ups/flexible-shipping-ups.php
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-free-shipping.php
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-fallback.php
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-services.php
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-origin.php
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-ups-shipping-method/src/WooCommerceShipping/Ups/view/surepost-shipping-method-script.php
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-forms/templates/form-end.php
    • > /wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-ups-shipping-method/src/WooCommerceShipping/Ups/view/shipping-method-script.php
  • 508× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'UpsFreeVendor\\GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'UpsFreeVendor\\WPDesk\\Persistence\\PersistentContainer' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-persistence/src/DeferredPersistentContainer.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'UpsFreeVendor\\Ups\odeInterface' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/ups-api/src/Entity/InternationalForms.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'UpsFreeVendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'UpsFreeVendor\\Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/monolog/monolog/src/Monolog/Handler/SlackHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'UpsFreeVendor\\WPDesk\\WooCommerceShipping\\CustomOrigin\\CustomOriginFields' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/CustomOrigin/InstanceCustomOriginFields.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'UpsFreeVendor\\Ups\odeInterface' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/ups-api/src/Entity/GeoCode.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'UpsFreeVendor\\Ups\odeInterface' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/ups-api/src/Entity/DeliveryTimeInformation.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'UpsFreeVendor\\WPDesk\\WooCommerceShipping\\ShippingBuilder\\AddressProvider' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingBuilder/CustomOriginAddressSender.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'UpsFreeVendor\\GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/flexible-shipping-ups/vendor_prefixed/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: A description for screenshot #8 is missing in flexible-shipping-ups/assets to your readme.txt
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

flexible-shipping-ups/flexible-shipping-ups.php 85% from 13 tests

The main PHP script in "WooCommerce UPS Shipping – Live Rates and Access Points" version 2.1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.3" instead of "7.4")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.5" instead of "5.8")

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
No dangerous file extensions were detected48,072 lines of code in 1,003 files:
LanguageFilesBlank linesComment linesLines of code
PHP8892,14528,51643,873
JSON37001,923
Sass81330785
JSX15101114573
JavaScript19648454
SVG2301306
CSS10252133
Markdown25025

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.42
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces129
Interfaces110
Traits30
Classes675
▷ Abstract classes202.96%
▷ Concrete classes65597.04%
▷ Final classes446.72%
Methods4,104
▷ Static methods2295.58%
▷ Public methods3,37682.26%
▷ Protected methods2506.09%
▷ Private methods47811.65%
Functions199
▷ Named functions7035.18%
▷ Anonymous functions12964.82%
Constants768
▷ Global constants30.39%
▷ Class constants76599.61%
▷ Public constants72995.29%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.19MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.net.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%