83% woo-ups-shipping-method

Code Review | Shipping Methods for UPS on WooCommerce

WordPress plugin Shipping Methods for UPS on WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-ups-shipping-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.0
  • WordPress version: 6.3.1
  • First release: Sep 11, 2019
  • Latest release: Sep 11, 2019
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: pluginfence (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /458 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 gracefully, with no errors

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

This is a short check of server-side resources used by Shipping Methods for UPS on WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0241.27 ▲0.62
Dashboard /wp-admin3.33 ▼0.0248.11 ▼16.13
Posts /wp-admin/edit.php3.38 ▲0.0248.65 ▼3.79
Add New Post /wp-admin/post-new.php5.91 ▲0.0282.54 ▼19.61
Media Library /wp-admin/upload.php3.25 ▲0.0237.23 ▲5.15

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Shipping Methods for UPS on WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.38 ▲0.021.92 ▼0.1243.27 ▼3.74
Dashboard /wp-admin2,198 ▲215.61 ▼0.0784.75 ▼8.8941.06 ▼2.04
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0841.21 ▼2.4434.67 ▼2.14
Add New Post /wp-admin/post-new.php1,526 ▼023.26 ▲0.18694.86 ▲33.2767.13 ▲11.42
Media Library /wp-admin/upload.php1,400 ▼34.16 ▼0.01104.60 ▲4.0147.77 ▲1.38

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/woo-ups-shipping-method/ups-woocommerce-shipping.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

woo-ups-shipping-method/ups-woocommerce-shipping.php 77% from 13 tests

The entry point to "Shipping Methods for UPS on WooCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-ups-shipping-method.php" instead of "ups-woocommerce-shipping.php")
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "2.6.0")

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
Everything looks great! No dangerous files found in this plugin574 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP556132574

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity11.50
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods23
▷ Static methods313.04%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin