10% woo-jtl-connector

Code Review | WooCommerce JTL-Connector

WordPress plugin WooCommerce JTL-Connector scored10%from 54 tests.

About plugin

  • Plugin page: woo-jtl-connector
  • Plugin version: 1.41.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Nov 29, 2018
  • Latest release: Nov 28, 2023
  • Number of updates: 388
  • Update frequency: every 4.7 days
  • Top authors: ntbyk (44.59%)papryk (43.56%)platzkejtl (11.6%)drieschel (1.03%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /103,051 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/woo-jtl-connector/includes/JtlConnectorAdmin.php+39
    Trying to get property 'version' of non-object

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

An overview of server-side resources used by WooCommerce JTL-Connector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.00 ▼7.24
Dashboard /wp-admin3.31 ▼0.0446.64 ▼23.17
Posts /wp-admin/edit.php3.36 ▲0.0049.01 ▲0.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.86 ▼12.48
Media Library /wp-admin/upload.php3.24 ▲0.0032.74 ▲1.22

Server storage [IO: ▲38.70MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • Total filesystem usage must be limited to 25MB (currently using 38.70MB)
Filesystem: 4,420 new files
Database: 10 new tables, 6 new options
New tables
wp_jtl_connector_link_currency
wp_jtl_connector_link_crossselling_group
wp_jtl_connector_category_level
wp_jtl_connector_link_language
jtl_connector_link_image
jtl_connector_link_customer
wp_jtl_connector_link_manufacturer
wp_jtl_connector_link_crossselling
jtl_connector_link_customer_group
wp_jtl_connector_link_category
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce JTL-Connector
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲3914.27 ▲0.031.65 ▲0.0341.06 ▼5.27
Dashboard /wp-admin2,195 ▲175.62 ▼0.0593.00 ▼22.4242.20 ▼3.91
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0238.31 ▲3.7934.69 ▼3.70
Add New Post /wp-admin/post-new.php1,526 ▼023.37 ▲0.29673.73 ▲61.8052.75 ▼5.39
Media Library /wp-admin/upload.php1,394 ▼34.21 ▲0.0497.64 ▲2.2042.97 ▼0.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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 plugin did not uninstall successfully, leaving 7 tables in the database
    • wp_jtl_connector_link_manufacturer
    • jtl_connector_link_image
    • wp_jtl_connector_link_currency
    • wp_jtl_connector_link_language
    • wp_jtl_connector_link_crossselling_group
    • jtl_connector_link_customer
    • jtl_connector_link_customer_group
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • 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)
Good news, no errors were detected

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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woo-jtl-connector/vendor/jms/serializer/tests/benchmark.php
    • > /wp-content/plugins/woo-jtl-connector/vendor/jms/parser-lib/tests/bootstrap.php
    • > /wp-content/plugins/woo-jtl-connector/vendor/phpcollection/phpcollection/tests/bootstrap.php
  • 1964× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface' not found in wp-content/plugins/woo-jtl-connector/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Company' not found in wp-content/plugins/woo-jtl-connector/vendor/fakerphp/faker/src/Faker/Provider/it_CH/Company.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/woo-jtl-connector/vendor/jms/metadata/tests/Metadata/Tests/Driver/FileLocatorTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Faker\\Extension\\Extension' not found in wp-content/plugins/woo-jtl-connector/vendor/fakerphp/faker/src/Faker/Extension/NumberExtension.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'JtlWooCommerceConnector\\Controllers\\AbstractBaseController' not found in wp-content/plugins/woo-jtl-connector/src/Controllers/Order/CustomerOrderAddressController.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/woo-jtl-connector/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/woo-jtl-connector/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\PhoneNumber' not found in wp-content/plugins/woo-jtl-connector/vendor/fakerphp/faker/src/Faker/Provider/es_PE/PhoneNumber.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Contracts\\EventDispatcher\\Event' not found in wp-content/plugins/woo-jtl-connector/vendor/jtl/connector/src/Event/Manufacturer/ManufacturerAfterStatisticEvent.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Noodlehaus\\Parser\\ParserInterface' not found in wp-content/plugins/woo-jtl-connector/vendor/hassankhan/config/src/Parser/Php.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: warenwirtschaft, erp, woocommerce, jtl, wms...

woo-jtl-connector/woo-jtl-connector.php Passed 13 tests

The entry point to "WooCommerce JTL-Connector" version 1.41.1 is a PHP file that has certain tags in its header comment area
95 characters long description:
Connect your woocommerce-shop with JTL-Wawi, the free multichannel-erp for mail order business.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/woo-jtl-connector/vendor/twbs/bootstrap/nuget/MyGet.ps1
566,103 lines of code in 4,235 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,71453,85371,227242,450
HTML60260,89721211,373
JSON14411032,487
JavaScript725,9182,41026,543
Markdown1644,900018,871
CSS291,69113814,066
Sass1111,5741,2536,843
XML16464205,783
YAML1784021025,610
reStructuredText331,0821,7691,565
SVG1600268
Ant1120119
Twig37055
Bourne Shell1101431
make18018
Python1131612
PowerShell1559

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 163)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.58
▷ Minimum class complexity1.00
▷ Maximum class complexity356.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity163.00
Code structure
Namespaces404
Interfaces220
Traits42
Classes2,426
▷ Abstract classes1104.53%
▷ Concrete classes2,31695.47%
▷ Final classes2229.59%
Methods11,766
▷ Static methods1,75614.92%
▷ Public methods9,75382.89%
▷ Protected methods1,18610.08%
▷ Private methods8277.03%
Functions636
▷ Named functions13821.70%
▷ Anonymous functions49878.30%
Constants1,023
▷ Global constants222.15%
▷ Class constants1,00197.85%
▷ Public constants92292.11%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
61 PNG files occupy 1.92MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/twbs/bootstrap/nuget/bootstrap.png1.64KB1.70KB0.00%
vendor/jms/serializer/doc/logo-small.png6.32KB3.96KB▼ 37.29%
vendor/twbs/bootstrap/site/static/docs/4.6/assets/img/favicons/android-chrome-512x512.png4.17KB4.76KB0.00%
vendor/twbs/bootstrap/site/static/docs/4.6/assets/img/examples/carousel@2x.png30.73KB32.87KB0.00%
vendor/twbs/bootstrap/site/static/docs/4.6/assets/img/examples/album.png21.23KB11.12KB▼ 47.63%