73% flagship-woocommerce-shipping

Code Review | FlagShip WooCommerce Shipping

WordPress plugin FlagShip WooCommerce Shipping scored73%from 54 tests.

About plugin

  • Plugin page: flagship-woocomme...
  • Plugin version: 3.0.23
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0.1
  • WordPress version: 6.3.1
  • First release: May 2, 2019
  • Latest release: Nov 7, 2023
  • Number of updates: 91
  • Update frequency: every 18.1 days
  • Top authors: flagshipit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /9,333 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.87ms] Passed 4 tests

Server-side resources used by FlagShip WooCommerce Shipping
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0744.98 ▼0.71
Dashboard /wp-admin3.43 ▲0.1249.35 ▼0.76
Posts /wp-admin/edit.php3.54 ▲0.1849.06 ▼0.80
Add New Post /wp-admin/post-new.php6.01 ▲0.1291.13 ▼13.22
Media Library /wp-admin/upload.php3.35 ▲0.1235.66 ▲1.73

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 157 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
flagship_shipping_method_data_migrations
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

FlagShip WooCommerce Shipping: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.67 ▼0.041.65 ▼0.3145.76 ▲0.68
Dashboard /wp-admin2,195 ▲215.51 ▼0.1687.36 ▼16.7240.06 ▼7.16
Posts /wp-admin/edit.php2,100 ▲182.02 ▼0.0233.89 ▼6.7733.24 ▼1.86
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▲0.03652.34 ▼18.4050.81 ▼7.17
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.04102.45 ▼1.4644.50 ▲0.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/functions.php+6691
    file_get_contents(wp-content/plugins/flagship-woocommerce-shipping/flagship-for-woocommerce.php): failed to open stream: No such file or directory
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • flagship_shipping_method_data_migrations
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 107× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FS\\Components\\AbstractComponent' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Components/Shipping/RateProcessor/ProcessRateProcessor.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'FS\\Components\\Validation\\AbstractValidator' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Components/Validation/PhoneValidator.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FS\\Components\\AbstractComponent' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Components/Shipping/Request/Builder/Order/ShippingServiceBuilder.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'FS\\Injection\\InjectorInterface' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Injection/Injector/Asset.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FS\\Components\\Shipping\\Request\\Factory\\AbstractRequestFactory' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Components/Shipping/Request/Factory/ShoppingCartRate.php:8
    • > PHP Notice
      Undefined variable: packing_box_field_name in wp-content/plugins/flagship-woocommerce-shipping/templates/option/box-split.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'FS\\Components\\AbstractComponent' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Components/Model/AbstractModel.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FS\\Components\\AbstractComponent' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Components/Shipping/Request/Builder/AbstractPackageItemsBuilder.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'FS\\Context\\ApplicationContextAwareInterface' not found in wp-content/plugins/flagship-woocommerce-shipping/src/Context/Support/AbstractApplicationObjectSupport.php:5
    • > PHP Notice
      Undefined variable: tooltip_html in wp-content/plugins/flagship-woocommerce-shipping/templates/option/box-split.php on line 3

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

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
6 plugin tags: courier, woocommerce, e-commerce, shipping, ecommerce...

flagship-woocommerce-shipping/flagship-for-woocommerce.php 77% from 13 tests

The primary PHP file in "FlagShip WooCommerce Shipping" version 3.0.23 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("flagship-woocommerce-shipping.php" instead of "flagship-for-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 339 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin10,442 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
PHP1442,2194359,343
PO File2439585886
Bourne Shell121799
JSON20058
XML22136
JavaScript12011
Markdown1309

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.65
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces44
Interfaces21
Traits3
Classes107
▷ Abstract classes109.35%
▷ Concrete classes9790.65%
▷ Final classes00.00%
Methods533
▷ Static methods468.63%
▷ Public methods44483.30%
▷ Protected methods8816.51%
▷ Private methods10.19%
Functions62
▷ Named functions11.61%
▷ Anonymous functions6198.39%
Constants31
▷ Global constants26.45%
▷ Class constants2993.55%
▷ Public constants29100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin