78% woo-pakettikauppa

Code Review | WooCommerce Pakettikauppa

WordPress plugin WooCommerce Pakettikauppa scored78%from 54 tests.

About plugin

  • Plugin page: woo-pakettikauppa
  • Plugin version: 3.9.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2017
  • Latest release: Sep 20, 2023
  • Number of updates: 122
  • Update frequency: every 17.6 days
  • Top authors: deployer (52.46%)pakettikauppa (22.13%)seravo (22.13%)ottok (5.74%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /26,231 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.03ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Pakettikauppa
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1038.09 ▲0.94
Dashboard /wp-admin3.39 ▲0.0942.92 ▼2.68
Posts /wp-admin/edit.php3.44 ▲0.0943.89 ▼1.28
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.08 ▼8.20
Media Library /wp-admin/upload.php3.25 ▲0.0330.86 ▲0.03

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 89 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Pakettikauppa
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.16 ▼1.431.86 ▲0.0342.08 ▼2.10
Dashboard /wp-admin2,210 ▲195.80 ▼0.2396.35 ▼4.0938.25 ▼1.96
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0335.16 ▼4.6433.21 ▼2.43
Add New Post /wp-admin/post-new.php1,537 ▲923.25 ▲5.05651.01 ▲20.7759.83 ▲12.27
Media Library /wp-admin/upload.php1,389 ▲44.29 ▲0.0994.04 ▼18.4743.32 ▲0.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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 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 take a closer look at the following
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/get-pickup-point-info.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/create-shipment.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/log-api-requests.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/find-city-by-postcode.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/list-additional-services.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/search-pickup-points.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/search-pickup-points-text.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/get-shipment-status.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/list-shipping-methods.php
    • > /wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/estimate-price.php
  • 26× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/estimate-price.php on line 10
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/list-additional-services.php on line 10
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/get-shipment-status.php on line 9
    • > PHP Warning
      require(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/find-city-by-postcode.php on line 5
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/get-pickup-point-info.php on line 5
    • > PHP Warning
      require(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/get-pickup-point-info.php on line 5
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/list-shipping-methods.php on line 10
    • > PHP Warning
      Declaration of Pakettikauppa\\SimpleXMLElement::addChild(string $qualifiedName, ?string $value = NULL, ?string $namespace = NULL): ?Pakettikauppa\\SimpleXMLElement should be compatible with SimpleXMLElement::addChild($name, $value = NULL, $ns = NULL) in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/src/Pakettikauppa/SimpleXMLElement.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/woo-pakettikauppa/templates/pakettikauppa/tracking-email-html.php:11
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-pakettikauppa/vendor/pakettikauppa/api-library/examples/log-api-requests.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

woo-pakettikauppa/wc-pakettikauppa.php 92% from 13 tests

The main file in "WooCommerce Pakettikauppa" v. 3.9.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-pakettikauppa.php" instead of "wc-pakettikauppa.php")

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
Everything looks great! No dangerous files found in this plugin11,645 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,5742,1207,816
PO File49071,0972,339
CSS6509550
JavaScript57810494
JSON310154
XML33564118
Markdown2630114
YAML331860

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity39.04
▷ Minimum class complexity1.00
▷ Maximum class complexity262.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity61.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes26
▷ Abstract classes13.85%
▷ Concrete classes2596.15%
▷ Final classes00.00%
Methods536
▷ Static methods295.41%
▷ Public methods47488.43%
▷ Protected methods122.24%
▷ Private methods509.33%
Functions25
▷ Named functions00.00%
▷ Anonymous functions25100.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.github/travis-ci-repo-active.png6.28KB3.72KB▼ 40.80%
assets/img/pakettikauppa-logo-black.png5.70KB4.81KB▼ 15.66%
.github/travis-ci-sync.png4.08KB2.59KB▼ 36.49%
assets/img/pakettikauppa-logo.png20.62KB4.81KB▼ 76.70%
.github/travis-ci-manual-trigger.png19.37KB9.48KB▼ 51.07%