83% advanced-usps-shipping-method

Code Review | Advanced USPS Shipping Method

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

About plugin

  • Plugin page: advanced-usps-shi...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 15, 2022
  • Latest release: Jul 25, 2023
  • Number of updates: 9
  • Update frequency: every 55.9 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 900 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.17ms] Passed 4 tests

An overview of server-side resources used by Advanced USPS Shipping Method
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0136.12 ▼3.52
Dashboard /wp-admin3.31 ▲0.0144.00 ▼4.38
Posts /wp-admin/edit.php3.36 ▲0.0049.38 ▲1.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.47 ▲0.04
Media Library /wp-admin/upload.php3.23 ▲0.0033.41 ▼0.81

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 245 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
fs_accounts
widget_recent-posts
fs_active_plugins
widget_recent-comments
widget_theysaidso_widget
fs_debug_mode

Browser metrics Passed 4 tests

A check of browser resources used by Advanced USPS Shipping Method
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.43 ▼0.031.63 ▼0.2838.70 ▼14.71
Dashboard /wp-admin2,200 ▲155.85 ▲0.9495.89 ▼17.0238.65 ▼2.59
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0739.36 ▼4.8434.18 ▼1.11
Add New Post /wp-admin/post-new.php1,542 ▲918.15 ▼4.90635.63 ▼31.0649.73 ▼7.01
Media Library /wp-admin/upload.php1,388 ▲34.21 ▼0.0198.01 ▼8.3940.16 ▼6.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • fs_accounts
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_active_plugins
    • db_upgraded
    • can_compress_scripts
    • fs_debug_mode
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-usps-shipping-method/admin/partials/advanced-usps-shipping-method-admin-display.php
    • > /wp-content/plugins/advanced-usps-shipping-method/public/partials/advanced-usps-shipping-method-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #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 look at the official readme.txt

advanced-usps-shipping-method/advanced-usps-shipping-method.php 92% from 13 tests

"Advanced USPS Shipping Method" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.9" instead of "3.0")

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
Everything looks great! No dangerous files found in this plugin38,080 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1378,25618,02635,297
PO File46047591,528
SVG500689
JavaScript754136313
CSS181943252
Markdown1001

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity82.09
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,313
▷ Static methods19915.16%
▷ Public methods91669.76%
▷ Protected methods171.29%
▷ Private methods38028.94%
Functions103
▷ Named functions103100.00%
▷ Anonymous functions00.00%
Constants157
▷ Global constants11070.06%
▷ Class constants4729.94%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 PNG files occupy 0.41MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/thedotstore-images/popular-plugins/Product-Attachment-For-WooCommerce.png10.81KB4.42KB▼ 59.06%
admin/images/getting-started/Screenshot-1.png77.25KB24.34KB▼ 68.49%
admin/images/thedotstore-images/popular-plugins/Product-Sample-for-WooCommerce.png11.96KB4.80KB▼ 59.83%
admin/images/thedotstore-images/popular-plugins/WooCommerce-Category-Banner-Management.png3.00KB3.00KB0.10%
admin/images/plugin-videodemo.png20.62KB9.30KB▼ 54.90%