10% free-woo-shipping-bar

Code Review | Free Shipping Bar and Message for WooCommerce

WordPress plugin Free Shipping Bar and Message for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: free-woo-shipping...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Nov 12, 2020
  • Latest release: Jun 23, 2022
  • Number of updates: 11
  • Update frequency: every 55.0 days
  • Top authors: v2websolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 697 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/free-woo-shipping-bar/includes/traits/Generator.php+42
    Undefined index: fwsb_pro_options

Server metrics [RAM: ▲2.05MB] [CPU: ▲8.48ms] Passed 4 tests

An overview of server-side resources used by Free Shipping Bar and Message for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.57 ▲2.1158.21 ▲15.22
Dashboard /wp-admin5.39 ▲2.0958.22 ▲6.07
Posts /wp-admin/edit.php5.44 ▲2.0964.81 ▲13.39
Add New Post /wp-admin/post-new.php7.91 ▲2.0296.86 ▼0.78
Media Library /wp-admin/upload.php5.25 ▲2.0250.60 ▲15.89

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 145 new files
Database: no new tables, 9 new options
New WordPress options
fwsb_enable_shipping_bar
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
fwsb_version
fwsb_options_save_settings
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Free Shipping Bar and Message for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.22 ▼1.161.75 ▼0.0542.29 ▼1.60
Dashboard /wp-admin2,243 ▲554.85 ▼0.05102.66 ▼5.1741.56 ▼0.77
Posts /wp-admin/edit.php2,128 ▲362.15 ▲0.1539.46 ▼2.2237.84 ▲2.66
Add New Post /wp-admin/post-new.php1,570 ▲5623.10 ▲5.51667.80 ▲4.5263.01 ▲12.67
Media Library /wp-admin/upload.php1,425 ▲374.21 ▼0.1898.06 ▲0.8543.80 ▲1.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/free-woo-shipping-bar/appsero/src/Client.php+163
    require_once(wp-content/plugins/free-woo-shipping-bar/appsero/src/License.php): failed to open stream: No such file or directory
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphp/src/Formatter/Crunched.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/free-woo-shipping-bar/templates/admin/general.php:65
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\ode' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphpb/src/Node/Number.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\ode' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphp/src/Node/Number.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/free-woo-shipping-bar/templates/admin/design.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphp/src/Formatter/Nested.php:23
    • > PHP Warning
      Use of undefined constant FWSB_PLUGIN_URL - assumed 'FWSB_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/free-woo-shipping-bar/templates/admin/general.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphpb/src/Formatter/Compact.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphp/src/Formatter/Compressed.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/free-woo-shipping-bar/assets/admin/vendor/scssphpb/src/Formatter/Compressed.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: widgets, promotion bar, woocommerce free shipping, shipping, woocommerce

free-woo-shipping-bar/free-woo-shipping-bar.php 92% from 13 tests

The primary PHP file in "Free Shipping Bar and Message for WooCommerce" version 1.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 154 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin31,013 lines of code in 134 files:
LanguageFilesBlank linesComment linesLines of code
PHP825,3997,64220,214
JavaScript41,0007586,157
SVG3421123,240
CSS858271,215
JSON20095
Markdown445092

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,169)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 163)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity57.35
▷ Minimum class complexity1.00
▷ Maximum class complexity1,169.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity163.00
Code structure
Namespaces17
Interfaces0
Traits7
Classes65
▷ Abstract classes46.15%
▷ Concrete classes6193.85%
▷ Final classes00.00%
Methods961
▷ Static methods262.71%
▷ Public methods30531.74%
▷ Protected methods59862.23%
▷ Private methods586.04%
Functions36
▷ Named functions25.56%
▷ Anonymous functions3494.44%
Constants140
▷ Global constants75.00%
▷ Class constants13395.00%
▷ Public constants133100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.43MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/admin/images/pt-featured.png24.60KB0.00KB▼ 100.00%
assets/admin/images/fwsb-banner.png396.49KB142.13KB▼ 64.15%
assets/admin/images/pt-logo.png8.17KB2.56KB▼ 68.63%
assets/admin/images/fwsb-logo.png8.17KB2.56KB▼ 68.63%
assets/admin/images/gift-icon.png6.15KB2.36KB▼ 61.62%