10% a2z-fedex-shipping

Code Review | Automated FedEx live/manual rates with shipping labels.

WordPress plugin Automated FedEx live/manual rates with shipping labels. scored 10% from 54 tests.

About plugin

  • Plugin page: a2z-fedex-shipping
  • Plugin version: 3.1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.9
  • WordPress version: 5.9.2
  • First release: Nov 13, 2018
  • Latest release: Mar 22, 2022
  • Number of updates: 70
  • Update frequency: every 17.5 days
  • Top authors: hitstacks (94.29%)a2zplugins (7.14%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active / 21,460 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Error in wp-content/plugins/a2z-fedex-shipping/a2zfedex_basic.php+32
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/a2z-fedex-shipping/a2zfedex_basic.php:32
    Stack trace:
    #0 wp-includes/class-wp-hook.php(309): hit_woo_fedex_plugin_activation()
    #1 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(474): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(716): do_action()

Server metrics [RAM: ▲0.46MB] [CPU: ▼311.24ms] Passed 4 tests

An overview of server-side resources used by Automated FedEx live/manual rates with shipping labels.
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.4956.00 ▲4.20
Dashboard /wp-admin3.89 ▲0.4834.95 ▲1.36
Posts /wp-admin/edit.php4.13 ▲0.4840.06 ▲0.87
Add New Post /wp-admin/post-new.php7.36 ▲0.3995.33 ▼1,247.89
Media Library /wp-admin/upload.php3.78 ▲0.4824.75 ▲0.72

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Automated FedEx live/manual rates with shipping labels.
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4116.42 ▲0.516.50 ▲0.292.81 ▼0.02
Dashboard /wp-admin2,892 ▲316.35 ▼0.07121.85 ▼17.18158.12 ▼8.75
Posts /wp-admin/edit.php2,694 ▲33.43 ▲0.0065.37 ▲0.99142.57 ▼4.66
Add New Post /wp-admin/post-new.php1,660 ▼116.32 ▲0.21416.57 ▼41.58158.72 ▼6.10
Media Library /wp-admin/upload.php1,698 ▼05.73 ▼0.01135.14 ▼10.26186.06 ▼0.49

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

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
Everything seems fine, however 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-fedex-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-simple.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-fedex-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-ascend.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-fedex-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-descend.php:28

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: woocommerce fedex, shipping, fedex shipping, fedex woocommerce, fedex

a2z-fedex-shipping/a2zfedex_basic.php 77% from 13 tests

"Automated FedEx live/manual rates with shipping labels." version 3.1.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("a2z-fedex-shipping.php" instead of "a2zfedex_basic.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.1" instead of "2.6")
  • Text Domain: The text domain should only use lowercase characters and dashes

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
Success! There were no dangerous files found in this plugin6,366 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP136997105,499
XML400867

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 195)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity63.50
▷ Minimum class complexity1.00
▷ Maximum class complexity404.00
Average method complexity8.50
▷ Minimum method complexity1.00
▷ Maximum method complexity195.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods101
▷ Static methods00.00%
▷ Public methods9291.09%
▷ Protected methods00.00%
▷ Private methods98.91%
Functions1
▷ Named functions1100.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
2 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
controllors/views/fedex.png71.44KB18.16KB▼ 74.58%
controllors/views/hfedex.png5.93KB3.08KB▼ 48.01%