78% flexible-shipping-fedex

Code Review | Flexible Shipping for FedEx and WooCommerce

WordPress plugin Flexible Shipping for FedEx and WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: flexible-shipping...
  • Plugin version: 1.6.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 5.8.1
  • First release: Sep 4, 2019
  • Latest release: Nov 8, 2021
  • Number of updates: 55
  • Update frequency: every 14.6 days
  • Top authors: wpdesk (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active / 32,203 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼147.40ms] Passed 4 tests

An overview of server-side resources used by Flexible Shipping for FedEx and WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0935.15 ▼0.35
Dashboard /wp-admin3.15 ▲0.0949.53 ▼7.10
Posts /wp-admin/edit.php3.20 ▲0.0946.09 ▼4.82
Add New Post /wp-admin/post-new.php5.44 ▲0.0187.70 ▼577.32
Media Library /wp-admin/upload.php3.09 ▲0.0934.80 ▲5.14

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2,765 new files
Database: no new tables, 1 new option
New WordPress options
plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php

Browser metrics Passed 4 tests

A check of browser resources used by Flexible Shipping for FedEx and WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲11115.84 ▲0.369.04 ▼0.4449.94 ▼0.57
Dashboard /wp-admin2,971 ▲405.87 ▼0.07134.18 ▼13.90108.40 ▼0.97
Posts /wp-admin/edit.php2,743 ▲42.68 ▲0.0068.14 ▼5.4788.68 ▼11.90
Add New Post /wp-admin/post-new.php3,692 ▲1,82015.03 ▼4.14425.17 ▲65.60110.80 ▲2.77
Media Library /wp-admin/upload.php1,811 ▲45.03 ▲0.04152.55 ▼4.36120.32 ▼8.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-origin.php
    • > /wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-fallback.php
    • > /wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-free-shipping.php
    • > /wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-services.php
  • 2482× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractSimpleType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/RateService/SimpleType/RateRequestType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractSimpleType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/ShipService/SimpleType/FreightChargeBasisType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractComplexType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/TrackService/ComplexType/Address.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractSimpleType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/ValidationAvailabilityAndCommitmentService/SimpleType/CarrierCodeType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractComplexType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/RateService/ComplexType/Party.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractComplexType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/RateService/ComplexType/RequestedPackageLineItem.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractSimpleType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/ShipService/SimpleType/StringBarcodeType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractSimpleType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/PickupService/SimpleType/ServiceType.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractComplexType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/CloseService/ComplexType/WebAuthenticationCredential.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'FedExVendor\\FedEx\\AbstractComplexType' not found in wp-content/plugins/flexible-shipping-fedex/vendor_prefixed/jeremy-dunn/php-fedex-api-wrapper/src/FedEx/UploadDocumentService/ComplexType/UploadDocumentStatusDetail.php:24

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
10 plugin tags: fedex woocommerce, flexible shipping, fedex api, live rates, shipping method...

flexible-shipping-fedex/flexible-shipping-fedex.php 92% from 13 tests

The main PHP file in "Flexible Shipping for FedEx and WooCommerce" ver. 1.6.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.5" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected79,020 lines of code in 2,744 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,7075,64281,87276,260
XML2001,496
JSON21001,003
CSS6374172
JavaScript62064
Markdown25025

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity1.74
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces139
Interfaces61
Traits21
Classes2,590
▷ Abstract classes180.69%
▷ Concrete classes2,57299.31%
▷ Final classes110.43%
Methods7,982
▷ Static methods891.12%
▷ Public methods7,50594.02%
▷ Protected methods1922.41%
▷ Private methods2853.57%
Functions75
▷ Named functions1520.00%
▷ Anonymous functions6080.00%
Constants5,822
▷ Global constants30.05%
▷ Class constants5,81999.95%
▷ Public constants5,819100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%