78% flexible-shipping

Code Review | Table Rate Shipping Method for WooCommerce by Flexible Shipping

WordPress plugin Table Rate Shipping Method for WooCommerce by Flexible Shipping scored78%from 54 tests.

About plugin

  • Plugin page: flexible-shipping
  • Plugin version: 4.23.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Jun 14, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 435
  • Update frequency: every 6.3 days
  • Top authors: wpdesk (48.97%)jablonowski (29.89%)octolize (21.61%)

Code review

54 tests

User reviews

603 reviews

Install metrics

100,000+ active /4,993,396 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.53MB] [CPU: ▼6.14ms] Passed 4 tests

Analyzing server-side resources used by Table Rate Shipping Method for WooCommerce by Flexible Shipping
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5538.50 ▲0.66
Dashboard /wp-admin3.85 ▲0.5047.83 ▼16.14
Posts /wp-admin/edit.php3.91 ▲0.5450.80 ▲1.81
Add New Post /wp-admin/post-new.php6.44 ▲0.5488.09 ▼10.79
Media Library /wp-admin/upload.php3.78 ▲0.5437.29 ▲1.70

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 864 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
wpdesk_requirements_plugins_data
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
plugin_activation_flexible-shipping/flexible-shipping.php

Browser metrics Passed 4 tests

An overview of browser requirements for Table Rate Shipping Method for WooCommerce by Flexible Shipping
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7314.27 ▼0.052.02 ▲0.3536.86 ▼5.36
Dashboard /wp-admin2,200 ▲205.62 ▼0.0293.04 ▼7.0642.41 ▼3.53
Posts /wp-admin/edit.php2,108 ▲51.99 ▲0.0343.06 ▲7.1438.61 ▲9.84
Add New Post /wp-admin/post-new.php1,531 ▼323.19 ▼1.96654.84 ▲12.3348.96 ▼28.57
Media Library /wp-admin/upload.php1,405 ▲84.22 ▲0.0799.21 ▲1.4742.81 ▼0.22

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • plugin_activation_flexible-shipping/flexible-shipping.php
    • widget_theysaidso_widget
    • wpdesk_requirements_plugins_data

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)
Good news, no errors were detected

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 take a closer look at the following
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/ShippingMethod/Convert/views/move-notices.php
    • > /wp-content/plugins/flexible-shipping/classes/table-rate/views/html-shipping-method-scripts.php
    • > /wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/ShippingMethod/BlockEditing/views/block-settings.php
    • > /wp-content/plugins/flexible-shipping/src/WPDesk/FS/Onboarding/TableRate/views/before-table-method-rules-settings.php
    • > /wp-content/plugins/flexible-shipping/vendor_prefixed/wpdesk/wp-forms/templates/form-end.php
    • > /wp-content/plugins/flexible-shipping/classes/table-rate/views/html-shipping-settings-info-description.php
    • > /wp-content/plugins/flexible-shipping/classes/table-rate/views/html-menu-icon.php
  • 452× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'FSVendor\\WPDesk\\Forms\\Serializer' not found in wp-content/plugins/flexible-shipping/vendor_prefixed/wpdesk/wp-forms/src/Serializer/NoSerialize.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'FSVendor\\Octolize\\Tracker\\OptInNotice\\ShouldDisplay' not found in wp-content/plugins/flexible-shipping/vendor_prefixed/octolize/wp-octolize-tracker/src/OptInNotice/ShouldDisplayAndConditions.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'FSVendor\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/flexible-shipping/vendor_prefixed/monolog/monolog/src/Monolog/Handler/PsrHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'FSVendor\\Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/flexible-shipping/vendor_prefixed/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php:24
    • > PHP Fatal error
      Uncaught Error: Call to a member function output_render() on null in wp-content/plugins/flexible-shipping/vendor_prefixed/wpdesk/wp-forms/templates/input-text.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'FSVendor\\Octolize\\Tracker\\OptInNotice\\ShouldDisplay' not found in wp-content/plugins/flexible-shipping/vendor_prefixed/octolize/wp-octolize-tracker/src/OptInNotice/ShouldDisplayGetParameterPresent.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WPDesk\\FS\\TableRate\\ShippingMethod\\MethodSettings' not found in wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FSVendor\\Monolog\\Handler\\AbstractSyslogHandler' not found in wp-content/plugins/flexible-shipping/vendor_prefixed/monolog/monolog/src/Monolog/Handler/SyslogHandler.php:29
    • > PHP Notice
      Undefined variable: metaboxes in wp-content/plugins/flexible-shipping/classes/table-rate/views/html-shipping-settings-info-description.php on line 14
    • > PHP Fatal error
      Uncaught Error: Interface 'FSVendor\\WPDesk\\PluginBuilder\\Plugin\\HookablePluginDependant' not found in wp-content/plugins/flexible-shipping/classes/table-rate/class-shortcode-unit-dimension.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

flexible-shipping/flexible-shipping.php Passed 13 tests

"Table Rate Shipping Method for WooCommerce by Flexible Shipping" version 4.23.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
99 characters long description:
Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.

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 plugin34,107 lines of code in 805 files:
LanguageFilesBlank linesComment linesLines of code
PHP7133,94719,32431,411
JSON30001,510
JavaScript187067561
SVG2501281
CSS14443265
XML27042
Markdown38037

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.47
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces132
Interfaces75
Traits17
Classes530
▷ Abstract classes275.09%
▷ Concrete classes50394.91%
▷ Final classes142.78%
Methods2,747
▷ Static methods1244.51%
▷ Public methods2,11176.85%
▷ Protected methods2197.97%
▷ Private methods41715.18%
Functions83
▷ Named functions3946.99%
▷ Anonymous functions4453.01%
Constants370
▷ Global constants30.81%
▷ Class constants36799.19%
▷ Public constants33190.19%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
31 PNG files occupy 0.37MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/new-rules-table-popup/delivery@3x.png4.90KB2.60KB▼ 46.90%
assets/images/new-rules-table-popup/configuration@2x.png5.41KB3.30KB▼ 38.88%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%
assets/images/new-rules-table-popup/configuration@3x.png8.70KB4.63KB▼ 46.74%
assets/images/onboarding/arrows-blue@2x.png4.56KB1.18KB▼ 74.11%