83% automated-usps-shipping-with-shipping-label

Code Review | Automated USPS Shipping

WordPress plugin Automated USPS Shipping scored83%from 54 tests.

About plugin

  • Plugin page: automated-usps-sh...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.1
  • WordPress version: 6.3.1
  • First release: Mar 2, 2021
  • Latest release: Nov 17, 2022
  • Number of updates: 7
  • Update frequency: every 89.4 days
  • Top authors: hitstacks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /720 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼4.32ms] Passed 4 tests

A check of server-side resources used by Automated USPS Shipping
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2636.87 ▼5.48
Dashboard /wp-admin3.57 ▲0.2649.93 ▼3.51
Posts /wp-admin/edit.php3.62 ▲0.2654.09 ▲6.33
Add New Post /wp-admin/post-new.php6.15 ▲0.2695.03 ▼9.45
Media Library /wp-admin/upload.php3.49 ▲0.2638.25 ▲1.17

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Automated USPS Shipping
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.081.94 ▲0.0942.75 ▼0.71
Dashboard /wp-admin2,195 ▲185.65 ▲0.0590.82 ▼11.1542.17 ▼4.84
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0439.68 ▲5.5533.69 ▲1.10
Add New Post /wp-admin/post-new.php1,545 ▲1223.00 ▼0.09661.76 ▼29.7171.13 ▲5.97
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.01106.66 ▼6.3544.26 ▼7.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/automated-usps-shipping-with-shipping-label/controllors/classes/weight_pack/class-hit-weight-strategy-descend.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/automated-usps-shipping-with-shipping-label/controllors/classes/weight_pack/class-hit-weight-strategy-ascend.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/automated-usps-shipping-with-shipping-label/controllors/classes/weight_pack/class-hit-weight-strategy-simple.php:28

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt is a good inspiration

automated-usps-shipping-with-shipping-label/a2z_usps_basic.php 77% from 13 tests

The main PHP script in "Automated USPS Shipping" version 1.0.3 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.1" instead of "2.6")
  • Main file name: The principal plugin file should be the same as the plugin slug ("automated-usps-shipping-with-shipping-label.php" instead of "a2z_usps_basic.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected4,150 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP113926593,953
XML400197

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 209)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity34.83
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity5.14
▷ Minimum method complexity1.00
▷ Maximum method complexity209.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods99
▷ Static methods00.00%
▷ Public methods9191.92%
▷ Protected methods00.00%
▷ Private methods88.08%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin