84% advanced-usps-shipping-method

Code Review | Advanced USPS Shipping Method

WordPress plugin Advanced USPS Shipping Method scored 84% from 54 tests.

About plugin

  • Plugin page: advanced-usps-shi...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9.2
  • WordPress version: 5.9.2
  • First release: Mar 15, 2022
  • Latest release: Mar 16, 2022
  • Number of updates: 5
  • Update frequency: every 1.4 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 33 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼297.47ms] Passed 4 tests

Analyzing server-side resources used by Advanced USPS Shipping Method
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0153.20 ▲4.55
Dashboard /wp-admin3.41 ▲0.0132.86 ▲0.44
Posts /wp-admin/edit.php3.64 ▲0.0134.82 ▼0.47
Add New Post /wp-admin/post-new.php6.88 ▼0.09108.31 ▼1,191.37
Media Library /wp-admin/upload.php3.30 ▲0.0024.76 ▲1.51

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 220 new files
Database: no new tables, 4 new options
New WordPress options

Browser metrics Passed 4 tests

Advanced USPS Shipping Method: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4116.19 ▲0.625.78 ▼0.712.19 ▲0.03
Dashboard /wp-admin2,892 ▲346.14 ▲0.01119.47 ▼16.49158.22 ▼0.74
Posts /wp-admin/edit.php2,691 ▼03.25 ▲0.0165.54 ▼3.08154.42 ▲3.56
Add New Post /wp-admin/post-new.php1,708 ▲4720.48 ▲4.09501.67 ▲76.22175.25 ▲19.68
Media Library /wp-admin/upload.php1,695 ▼35.54 ▲0.09146.33 ▲10.78198.00 ▲8.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_debug_mode
    • fs_active_plugins
    • fs_gdpr
    • fs_accounts

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
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/advanced-usps-shipping-method/public/partials/advanced-usps-shipping-method-public-display.php
    • > /wp-content/plugins/advanced-usps-shipping-method/admin/partials/advanced-usps-shipping-method-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Enable/Disable USPS shipping API), #2 (Developer mode), #3 (Connection with USPS shipping), #4 (Verify API connection), #5 (Postcode of warehouse/store), #6 (Cheapest shipping rates), #7 (Shipping services settings), #8 (Services on cart page)
You can take inspiration from this readme.txt

advanced-usps-shipping-method/advanced-usps-shipping-method.php Passed 13 tests

"Advanced USPS Shipping Method" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
84 characters long description:
This plugin will help you to connect with USPS API and fetch shipping services rate.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected34,549 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity79.06
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
▷ Static methods17514.76%
▷ Public methods83870.66%
▷ Protected methods151.26%
▷ Private methods33328.08%
▷ Named functions98100.00%
▷ Anonymous functions00.00%
▷ Global constants11081.48%
▷ Class constants2518.52%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 0.35MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/images/advanced-usps-shipping-method.png10.88KB4.33KB▼ 60.23%