87% zigzag-delivery-for-woocommerce

Code Review | ZigZag Delivery for WooCommerce

WordPress plugin ZigZag Delivery for WooCommerce scored 87% from 54 tests.

About plugin

  • Plugin page: zigzag-delivery-f...
  • Plugin version: 1.2.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.2
  • WordPress version: 5.8.1
  • First release: Jun 13, 2021
  • Latest release: Jan 23, 2022
  • Number of updates: 64
  • Update frequency: every 3.5 days
  • Top authors: parallaxltd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 521 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼183.72ms] Passed 4 tests

A check of server-side resources used by ZigZag Delivery for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0031.74 ▲5.67
Dashboard /wp-admin3.06 ▼0.0032.87 ▼12.44
Posts /wp-admin/edit.php3.11 ▲0.0033.57 ▼1.24
Add New Post /wp-admin/post-new.php5.43 ▼0.0273.66 ▼724.22
Media Library /wp-admin/upload.php3.01 ▲0.0028.15 ▲3.03

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 183 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by ZigZag Delivery for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲515.97 ▼0.026.20 ▼4.4675.29 ▼0.21
Dashboard /wp-admin2,933 ▲385.98 ▼0.18113.77 ▼16.89168.58 ▼4.06
Posts /wp-admin/edit.php2,706 ▼313.24 ▲0.0265.66 ▼0.99136.88 ▼2.91
Add New Post /wp-admin/post-new.php3,743 ▲1,41919.22 ▲3.22464.88 ▲33.03165.77 ▲2.82
Media Library /wp-admin/upload.php1,749 ▼35.50 ▼0.03138.12 ▲2.39181.89 ▼2.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/TCPDF/tools/tcpdf_addfont.php
  • 55× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Picqer\\Barcode\\Types\\TypeInterface' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeCode39.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Exceptions\\BarcodeException' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/Exceptions/UnknownTypeException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/tests/TypesTest.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Picqer\\Barcode\\Types\\TypeInterface' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeStandard2of5.php:15
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/generate-verified-files.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Picqer\\Barcode\\Types\\TypeInterface' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeRms4cc.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\BarcodeGeneratorPNG' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/BarcodeGeneratorJPG.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/tests/BarcodePngTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeUpcExtension2' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeUpcExtension5.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeCode39' not found in wp-content/plugins/zigzag-delivery-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeCode39Extended.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: You can look at the official readme.txt

zigzag-delivery-for-woocommerce/zigzag-delivery-for-woocommerce.php 85% from 13 tests

Analyzing the main PHP file in "ZigZag Delivery for WooCommerce" version 1.2.9
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 149 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin58,688 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP1052,56312,34251,533
CSS41,207154,517
SVG30001,505
Markdown51630392
PO File1158251240
HTML400194
JSON300182
JavaScript225180
XML10023
YAML29022

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,379)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity84.84
▷ Minimum class complexity1.00
▷ Maximum class complexity4,379.00
Average method complexity8.55
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes82
▷ Abstract classes22.44%
▷ Concrete classes8097.56%
▷ Final classes00.00%
Methods924
▷ Static methods12713.74%
▷ Public methods61866.88%
▷ Protected methods29732.14%
▷ Private methods90.97%
Functions8
▷ Named functions675.00%
▷ Anonymous functions225.00%
Constants139
▷ Global constants10676.26%
▷ Class constants3323.74%
▷ Public constants3296.97%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png1.70KB0.56KB▼ 67.05%
assets/images/logo.png2.65KB2.73KB0.00%