84% simply-international-by-ups

Code Review | UPS International Shipping for WooCommerce

WordPress plugin UPS International Shipping for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: simply-internatio...
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.8
  • WordPress version: 6.3.1
  • First release: Apr 11, 2021
  • Latest release: Oct 26, 2021
  • Number of updates: 30
  • Update frequency: every 7.7 days
  • Top authors: shartmanups (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /657 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼8.27ms] Passed 4 tests

This is a short check of server-side resources used by UPS International Shipping for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.03 ▼4.61
Dashboard /wp-admin3.42 ▲0.0751.67 ▼16.93
Posts /wp-admin/edit.php3.53 ▲0.1849.04 ▼3.32
Add New Post /wp-admin/post-new.php6.00 ▲0.1194.74 ▼8.22
Media Library /wp-admin/upload.php3.34 ▲0.1137.72 ▲3.35

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for UPS International Shipping for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.62 ▼0.973.89 ▲1.4438.38 ▼4.45
Dashboard /wp-admin2,209 ▲245.88 ▲0.02102.38 ▼20.8240.26 ▼5.49
Posts /wp-admin/edit.php2,086 ▼62.04 ▲0.0438.27 ▲2.9132.57 ▼3.68
Add New Post /wp-admin/post-new.php1,546 ▲918.38 ▼4.89634.25 ▼6.8069.43 ▲21.29
Media Library /wp-admin/upload.php1,388 ▼04.28 ▲0.04106.29 ▼0.4444.27 ▼4.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/simply-international-by-ups/ups-ikb.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/simply-international-by-ups/inc/ups-ikb-shipping.php:3

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 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: shipping methods, shipping, international shipping methods, ups international shipping

simply-international-by-ups/ups-ikb.php 92% from 13 tests

"UPS International Shipping for WooCommerce" version 2.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simply-international-by-ups.php" instead of "ups-ikb.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
No dangerous file extensions were detected2,595 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP71554592,590
XML1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity47.00
▷ Minimum class complexity47.00
▷ Maximum class complexity47.00
Average method complexity24.00
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions37
▷ Named functions3491.89%
▷ Anonymous functions38.11%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/ups-icon.png1.66KB0.88KB▼ 46.70%
assets/UPS_logo_250.png12.28KB5.24KB▼ 57.32%