78% gls-woocommerce

Code Review | GLS Netherlands Shipping for WooCommerce

WordPress plugin GLS Netherlands Shipping for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: gls-woocommerce
  • Plugin version: 1.5.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-5.8.2
  • WordPress version: 6.3.1
  • First release: Nov 20, 2020
  • Latest release: Dec 30, 2021
  • Number of updates: 19
  • Update frequency: every 21.4 days
  • Top authors: servicedesktignl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,224 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.65ms] Passed 4 tests

Server-side resources used by GLS Netherlands Shipping for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.50 ▼8.18
Dashboard /wp-admin3.32 ▼0.0254.64 ▼5.48
Posts /wp-admin/edit.php3.37 ▲0.0249.00 ▼3.53
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.60 ▼17.42
Media Library /wp-admin/upload.php3.25 ▲0.0237.18 ▲1.40

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 231 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for GLS Netherlands Shipping for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.021.80 ▼0.2844.63 ▼0.54
Dashboard /wp-admin2,198 ▲185.66 ▼0.0684.50 ▼9.1739.09 ▼2.24
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0538.54 ▼3.1833.42 ▼5.36
Add New Post /wp-admin/post-new.php1,546 ▲1423.50 ▲0.24686.36 ▲59.4847.71 ▼2.91
Media Library /wp-admin/upload.php1,400 ▲34.11 ▼0.13106.93 ▲1.4745.57 ▼2.23

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/tutorial/tuto7.php
  • 48× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdiException' not found in wp-content/plugins/gls-woocommerce/vendor/setasign/fpdi/src/PdfReader/PdfReaderException.php:19
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/gls-woocommerce/vendor/setasign/fpdf/makefont/ttfparser.php on line 382
    • > PHP Fatal error
      Uncaught Error: Class 'GLS_Delivery_Option' not found in wp-content/plugins/gls-woocommerce/includes/options/class-gls-option-s9.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Frontend_Scripts' not found in wp-content/plugins/gls-woocommerce/includes/class-gls-frontend-scripts.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/gls-woocommerce/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/gls-woocommerce/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85Exception.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/gls-woocommerce/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/gls-woocommerce/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'GLS_Delivery_Option' not found in wp-content/plugins/gls-woocommerce/includes/options/class-gls-option-t17.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'GlsApiCallInterface' not found in wp-content/plugins/gls-woocommerce/includes/api/class-gls-api-get-delivery-options.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: netherlands, label, woocommerce, checkout, pdf...

gls-woocommerce/gls-woocommerce.php 85% from 13 tests

The main PHP file in "GLS Netherlands Shipping for WooCommerce" ver. 1.5.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "3.8.1")
  • Description: Please don't use more than 140 characters for the plugin description (currently 161 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected14,563 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1161,6784,8719,661
HTML597203,240
JavaScript29397447
PO File1154174405
CSS67349325
JSON500260
Markdown4710211
SVG10114

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity15.65
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces10
Interfaces3
Traits2
Classes86
▷ Abstract classes33.49%
▷ Concrete classes8396.51%
▷ Final classes11.20%
Methods550
▷ Static methods9417.09%
▷ Public methods43278.55%
▷ Protected methods7714.00%
▷ Private methods417.45%
Functions29
▷ Named functions2172.41%
▷ Anonymous functions827.59%
Constants70
▷ Global constants57.14%
▷ Class constants6592.86%
▷ Public constants65100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/gls-logo.png3.15KB1.66KB▼ 47.32%
vendor/setasign/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%
assets/images/tig-logo.png10.54KB7.40KB▼ 29.79%