10% hittech-fedex-shipping-with-live-rates-and-shipping-labels

Code Review | Fedex Shipping With Live rates and shipping labels.

WordPress plugin Fedex Shipping With Live rates and shipping labels. scored10%from 54 tests.

About plugin

  • Plugin page: hittech-fedex-shi...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.8
  • WordPress version: 6.3.1
  • First release: Aug 10, 2021
  • Latest release: Aug 10, 2021
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: hitstacks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /321 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/hittech-fedex-shipping-with-live-rates-and-shipping-labels/hittech_fedex_basic.php+32
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/hittech-fedex-shipping-with-live-rates-and-shipping-labels/hittech_fedex_basic.php:32
    Stack trace:
    #0 wp-includes/class-wp-hook.php(312): hittech_hit_woo_fedex_plugin_activation()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(720): do_action()

Server metrics [RAM: ▲0.42MB] [CPU: ▲2.13ms] Passed 4 tests

Server-side resources used by Fedex Shipping With Live rates and shipping labels.
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4244.49 ▲3.31
Dashboard /wp-admin3.73 ▲0.4251.17 ▲2.91
Posts /wp-admin/edit.php3.78 ▲0.4246.85 ▲2.18
Add New Post /wp-admin/post-new.php6.31 ▲0.4295.55 ▲0.13
Media Library /wp-admin/upload.php3.65 ▲0.4237.31 ▲5.21

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fedex Shipping With Live rates and shipping labels.
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.73 ▼0.862.14 ▲0.4842.21 ▲1.03
Dashboard /wp-admin2,209 ▲244.86 ▼0.03101.83 ▼3.4741.20 ▼0.58
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0033.86 ▼2.4634.09 ▲0.24
Add New Post /wp-admin/post-new.php1,536 ▲323.19 ▼0.01621.64 ▼43.7052.34 ▲1.97
Media Library /wp-admin/upload.php1,382 ▼64.19 ▲0.0798.55 ▲1.6941.07 ▼0.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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 | 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 take a closer look at the following
  • 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/hittech-fedex-shipping-with-live-rates-and-shipping-labels/controllors/classes/weight_pack/class-hit-weight-strategy-ascend.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/hittech-fedex-shipping-with-live-rates-and-shipping-labels/controllors/classes/weight_pack/class-hit-weight-strategy-simple.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/hittech-fedex-shipping-with-live-rates-and-shipping-labels/controllors/classes/weight_pack/class-hit-weight-strategy-descend.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: fedex, woocommerce fedex, shipping, fedex shipping, fedex woocommerce

hittech-fedex-shipping-with-live-rates-and-shipping-labels/hittech_fedex_basic.php 77% from 13 tests

The entry point to "Fedex Shipping With Live rates and shipping labels." 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 follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("hittech-fedex-shipping-with-live-rates-and-shipping-labels.php" instead of "hittech_fedex_basic.php")
  • Requires at least: Required version must match the one declared in readme.txt ("4.0.1" instead of "2.6")

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 detected5,836 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP126225214,969
XML400867

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 174)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity51.58
▷ Minimum class complexity1.00
▷ Maximum class complexity282.00
Average method complexity7.01
▷ Minimum method complexity1.00
▷ Maximum method complexity174.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods102
▷ Static methods00.00%
▷ Public methods9391.18%
▷ Protected methods00.00%
▷ Private methods98.82%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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%