72% flagship-shipping-extension-for-woocommerce

Code Review | FlagShip WooCommerce Extension

WordPress plugin FlagShip WooCommerce Extension scored72%from 54 tests.

About plugin

  • Plugin page: flagship-shipping...
  • Plugin version: 1.0.23
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8.3
  • WordPress version: 6.3.1
  • First release: Sep 28, 2020
  • Latest release: Jan 27, 2023
  • Number of updates: 44
  • Update frequency: every 19.4 days
  • Top authors: flagshipit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,082 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.88MB] [CPU: ▼4.97ms] Passed 4 tests

Server-side resources used by FlagShip WooCommerce Extension
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.52 ▲1.0647.01 ▲7.48
Dashboard /wp-admin4.37 ▲1.0753.92 ▲0.87
Posts /wp-admin/edit.php4.42 ▲1.0655.59 ▼1.12
Add New Post /wp-admin/post-new.php6.20 ▲0.3271.47 ▼27.12
Media Library /wp-admin/upload.php4.29 ▲1.0645.85 ▲11.95
Package boxes /wp-admin/admin.php?page=flagship/boxes4.2936.49
Shipment /wp-admin/admin.php?page=flagship/ship4.2737.35
Manage shipment /wp-admin/admin.php?page=flagship/manage4.2741.23

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

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

Browser metrics Passed 4 tests

A check of browser resources used by FlagShip WooCommerce Extension
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.21 ▼1.141.71 ▼0.0640.72 ▲0.20
Dashboard /wp-admin2,276 ▲855.88 ▼0.02108.03 ▼2.0340.75 ▲0.18
Posts /wp-admin/edit.php2,159 ▲702.06 ▲0.0541.29 ▼0.1334.93 ▼1.45
Add New Post /wp-admin/post-new.php45 ▼1,4740.44 ▼23.110.07 ▼696.0010.81 ▼44.32
Media Library /wp-admin/upload.php1,455 ▲674.25 ▼0.0699.98 ▼16.9779.22 ▲29.84
Package boxes /wp-admin/admin.php?page=flagship/boxes1,3502.5851.3328.82
Shipment /wp-admin/admin.php?page=flagship/ship1,4878.95340.2371.57
Manage shipment /wp-admin/admin.php?page=flagship/manage1,4848.91305.5643.09
Settings /wp-admin/admin.php?page=flagship\/settings280.440.073.95
Visit FlagShip site /wp-admin/admin.php?page=flagship\/site280.440.094.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=flagship/boxes
    • > Notice in wp-content/plugins/flagship-shipping-extension-for-woocommerce/templates/list_boxes.php+83
    Trying to get property 'name' of non-object

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 items
  • 156× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Tests/PrepareShipmentTests.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Tests/CancelManifestByIdTests.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/symfony/var-dumper/Dumper/AbstractDumper.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Flagship\\Shipping\\Exceptions\\SmartshipException' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Exceptions/ConfirmManifestByIdException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Tests/AvailableServicesCollectionTests.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Flagship\\Apis\\Requests\\ApiRequest' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Requests/CreatePickupRequest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Flagship\\Apis\\Requests\\ApiRequest' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Requests/GetManifestsListRequest.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/flagship-shipping-extension-for-woocommerce/templates/_order_filter.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/symfony/var-dumper/Command/ServerDumpCommand.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Collection' not found in wp-content/plugins/flagship-shipping-extension-for-woocommerce/vendor/flagshipcompany/flagship-api-sdk/Shipping/Collections/ManifestListCollection.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=flagship/manage
    • > Console-api (warning) in unknown
    https://connect.facebook.net/en_US/fbevents.js 23:44173 "[Meta Pixel] - Duplicate Pixel ID: 716045552184381."
    • > GET request to /wp-admin/admin.php?page=flagship\/settings
    • > Network (severe)
    wp-admin/admin.php?page=flagship\/settings - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=flagship\/site
    • > Network (severe)
    wp-admin/admin.php?page=flagship\/site - Failed to load resource: the server responded with a status of 403 (Forbidden)

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

flagship-shipping-extension-for-woocommerce/flagship-woocommerce-shipping-method.php 92% from 13 tests

The main PHP script in "FlagShip WooCommerce Extension" version 1.0.23 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("flagship-shipping-extension-for-woocommerce.php" instead of "flagship-woocommerce-shipping-method.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin38,429 lines of code in 282 files:
LanguageFilesBlank linesComment linesLines of code
PHP2514,5554,96327,192
JavaScript51,1591,4949,441
JSON700597
Markdown6900374
PO File2176176372
Bourne Shell23919145
CSS210138
YAML321085
XML21155
HTML11015
SVG10015

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.03
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces30
Interfaces11
Traits4
Classes212
▷ Abstract classes41.89%
▷ Concrete classes20898.11%
▷ Final classes104.81%
Methods1,906
▷ Static methods27514.43%
▷ Public methods1,66887.51%
▷ Protected methods19510.23%
▷ Private methods432.26%
Functions196
▷ Named functions5829.59%
▷ Anonymous functions13870.41%
Constants67
▷ Global constants710.45%
▷ Class constants6089.55%
▷ Public constants4066.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected