84% octolize-shipping-cost-on-product-page

Code Review | Shipping Cost on Product Page Calculator for WooCommerce

WordPress plugin Shipping Cost on Product Page Calculator for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: octolize-shipping...
  • Plugin version: 1.4.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Aug 4, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 41
  • Update frequency: every 11.4 days
  • Top authors: octolize (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /5,424 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▲1.43ms] Passed 4 tests

An overview of server-side resources used by Shipping Cost on Product Page Calculator for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4747.03 ▲5.56
Dashboard /wp-admin3.77 ▲0.4650.21 ▼1.36
Posts /wp-admin/edit.php3.82 ▲0.4656.79 ▲4.62
Add New Post /wp-admin/post-new.php6.35 ▲0.4694.71 ▼3.12
Media Library /wp-admin/upload.php3.69 ▲0.4642.89 ▲8.37

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 441 new files
Database: no new tables, 8 new options
New WordPress options
wpdesk_requirements_plugins_data
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
plugin_activation_octolize-shipping-cost-on-product-page/octolize-shipping-cost-on-product-page.php
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Shipping Cost on Product Page Calculator for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3314.25 ▼0.461.85 ▲0.1541.17 ▼5.31
Dashboard /wp-admin2,200 ▲265.60 ▲0.0691.43 ▼0.5343.12 ▲3.50
Posts /wp-admin/edit.php2,105 ▲52.02 ▲0.0040.76 ▲2.7338.81 ▲2.18
Add New Post /wp-admin/post-new.php1,533 ▼223.19 ▼1.96600.10 ▼30.8752.40 ▼22.13
Media Library /wp-admin/upload.php1,396 ▼74.19 ▲0.0198.60 ▲1.7341.94 ▼0.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • wpdesk_requirements_plugins_data
    • plugin_activation_octolize-shipping-cost-on-product-page/octolize-shipping-cost-on-product-page.php

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
Please take a closer look at the following
  • 186× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingCostOnProductPageVendor\\Psr\\Log\\AbstractLogger' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/psr/log/Psr/Log/Test/TestLogger.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Handler\\MailHandler' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Processor/GitProcessor.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingCostOnProductPageVendor\\WPDesk\\PluginBuilder\\Plugin\\Hookable' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/octolize/wp-shipping-cost-on-product-page/src/Octolize/Shipping/CostOnProductPage/Assets.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingCostOnProductPageVendor\\Octolize\\Shipping\\CostOnProductPage\\SettingsFields' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/octolize/wp-shipping-cost-on-product-page/src/Octolize/Shipping/CostOnProductPage/WooCommerceSettings/GeneralSettingsFields.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Handler\\Handler' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Handler/FilterHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'OctolizeShippingCostOnProductPageVendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/octolize-shipping-cost-on-product-page/vendor_prefixed/monolog/monolog/src/Monolog/Handler/StreamHandler.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: shipping estimate, shipping calculator, woocommerce product page shipping calculator, woocommerce product page, product page shipping calculator...

octolize-shipping-cost-on-product-page/octolize-shipping-cost-on-product-page.php 92% from 13 tests

The entry point to "Shipping Cost on Product Page Calculator for WooCommerce" version 1.4.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.7" instead of "5.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected17,295 lines of code in 426 files:
LanguageFilesBlank linesComment linesLines of code
PHP36898311,97515,783
JSON23001,063
SVG2000157
JavaScript7135142
CSS6242125
Markdown25025

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity5.61
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces59
Interfaces68
Traits12
Classes258
▷ Abstract classes114.26%
▷ Concrete classes24795.74%
▷ Final classes62.43%
Methods1,448
▷ Static methods956.56%
▷ Public methods1,10676.38%
▷ Protected methods18112.50%
▷ Private methods16111.12%
Functions50
▷ Named functions1428.00%
▷ Anonymous functions3672.00%
Constants164
▷ Global constants31.83%
▷ Class constants16198.17%
▷ Public constants12376.40%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.net.png2.36KB2.43KB0.00%
assets/img/bg-upsell-metabox.png4.56KB1.18KB▼ 74.11%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%