10% braft-woo-shipping-packer

Code Review | WooCommerce Shipping Packer

WordPress plugin WooCommerce Shipping Packer scored10%from 54 tests.

About plugin

  • Plugin page: braft-woo-shippin...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.7.1
  • WordPress version: 6.3.1
  • First release: May 20, 2021
  • Latest release: Oct 27, 2022
  • Number of updates: 5
  • Update frequency: every 105.2 days
  • Top authors: camilluskillus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /353 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/braft-woo-shipping-packer/braft-woo-shipping-packer.php+27
    copy(wp-content/languages/plugins/braft-woo-shipping-packer-pl_PL.mo): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.18MB] [CPU: ▼4.15ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Shipping Packer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1539.75 ▼4.08
Dashboard /wp-admin3.49 ▲0.1950.00 ▲1.32
Posts /wp-admin/edit.php3.63 ▲0.2846.41 ▼3.53
Add New Post /wp-admin/post-new.php5.99 ▲0.1083.73 ▼10.31
Media Library /wp-admin/upload.php3.57 ▲0.3436.85 ▲2.15

Server storage [IO: ▲6.62MB] [DB: ▲0.05MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 140 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Shipping Packer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,533 ▲79813.29 ▼1.391.10 ▼0.7647.80 ▲5.94
Dashboard /wp-admin2,947 ▲7624.92 ▼0.17115.17 ▲4.2242.14 ▼0.60
Posts /wp-admin/edit.php2,812 ▲7202.14 ▲0.1440.26 ▼0.2833.58 ▼2.22
Add New Post /wp-admin/post-new.php1,521 ▼1217.76 ▼5.45659.17 ▼18.7557.19 ▲3.89
Media Library /wp-admin/upload.php2,129 ▲7474.30 ▲0.1698.87 ▲3.8042.00 ▲0.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 42× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DVDoug\\BoxPacker\\Test\\TestBox' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/Test/LimitedSupplyTestBox.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'DVDoug\\BoxPacker\\Box' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/Test/TestBox.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/PackedBoxListTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/VolumePackerTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/PackedLayerTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/src/OrientatedItemFactory.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/ItemListTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/PackerTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/tests/PackedItemTest.php:17

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: packer, shipping costs, accurate shipping, shipping, woocommerce...

braft-woo-shipping-packer/braft-woo-shipping-packer.php Passed 13 tests

The main PHP file in "WooCommerce Shipping Packer" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
60 characters long description:
Woocommerce addon to calculate shipping container and costs.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/braft-woo-shipping-packer/vendor/dvdoug/boxpacker/docs/build.ps1
7,686 lines of code in 107 files:
LanguageFilesBlank linesComment linesLines of code
PHP691,0792,1725,224
Markdown31100515
JavaScript36031507
HTML1310234
YAML5483211
reStructuredText9151287201
JSON500186
Cucumber3220165
PO File14749136
SVG200118
CSS120109
Python1399240
XML15126
make14610
Dockerfile1102
PowerShell1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity5.58
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces7
Traits2
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods370
▷ Static methods143.78%
▷ Public methods34292.43%
▷ Protected methods71.89%
▷ Private methods215.68%
Functions29
▷ Named functions1241.38%
▷ Anonymous functions1758.62%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin