78% zettle-pos-integration

Code Review | PayPal Zettle POS for WooCommerce

WordPress plugin PayPal Zettle POS for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: zettle-pos-integr...
  • Plugin version: 1.5.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Feb 18, 2021
  • Latest release: Aug 21, 2023
  • Number of updates: 49
  • Update frequency: every 18.7 days
  • Top authors: alexp11223 (85.71%)danielhuesken (16.33%)

Code review

54 tests

User reviews

17 reviews

Install metrics

4,000+ active /44,461 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: ▲2.69MB] [CPU: ▲9.13ms] Passed 4 tests

Server-side resources used by PayPal Zettle POS for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.14 ▲2.6850.76 ▲9.20
Dashboard /wp-admin6.00 ▲2.6956.89 ▲9.20
Posts /wp-admin/edit.php6.05 ▲2.6961.57 ▲17.96
Add New Post /wp-admin/post-new.php8.59 ▲2.7195.38 ▲0.16
Media Library /wp-admin/upload.php5.92 ▲2.6957.88 ▲24.45

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,308 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PayPal Zettle POS for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7213.22 ▼1.391.87 ▼0.6938.91 ▼10.17
Dashboard /wp-admin2,210 ▲224.85 ▼0.96106.31 ▼11.0341.39 ▼5.72
Posts /wp-admin/edit.php2,092 ▼02.10 ▲0.1040.24 ▲4.7238.87 ▲8.57
Add New Post /wp-admin/post-new.php1,537 ▼723.17 ▲4.97674.64 ▲18.9152.00 ▼3.54
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.04100.60 ▼1.2043.40 ▼1.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • db_upgraded
    • woocommerce_zettle_info
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • woocommerce_zettle_settings

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/zettle-pos-integration/uninstall.php
  • 690× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/zettle-pos-integration/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/zettle-pos-integration/src/Container/ArrayContainer.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Zettle\\Auth\\OAuth\\Token\\TokenInterface' not found in wp-content/plugins/zettle-pos-integration/modules/zettle-auth/src/OAuth/Token/Token.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Dhii\\Collection\\MutableContainerInterface' not found in wp-content/plugins/zettle-pos-integration/vendor/dhii/containers/src/FlashContainer.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Queue\\Queue\\Job\\JobRepository' not found in wp-content/plugins/zettle-pos-integration/modules/inpsyde-queue/src/Queue/Job/EphemeralJobRepository.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Zettle\\PhpSdk\\DAL\\Provider\\Image\\UrlProviderInterface' not found in wp-content/plugins/zettle-pos-integration/modules/zettle-php-sdk/src/DAL/Provider/Image/WordpressUrlProvider.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Zettle\\Onboarding\\Settings\\View\\OnboardingView' not found in wp-content/plugins/zettle-pos-integration/modules/zettle-onboarding/src/Settings/View/WelcomeView.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Zettle\\PhpSdk\\Exception\\ValidatorException' not found in wp-content/plugins/zettle-pos-integration/modules/zettle-php-sdk/src/Exception/Validator/MaximumStockException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Zettle\\PhpSdk\\Exception\\ValidatorException' not found in wp-content/plugins/zettle-pos-integration/modules/zettle-php-sdk/src/DAL/Exception/Coordinates/InvalidLongitudeException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\HttpClient' not found in wp-content/plugins/zettle-pos-integration/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: woocommerce, zettle, point-of-sale, payments

zettle-pos-integration/zettle-pos-integration.php 92% from 13 tests

The main PHP file in "PayPal Zettle POS for WooCommerce" ver. 1.5.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected56,831 lines of code in 1,255 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,22413,05324,17652,207
JSON12003,741
XML5140485
Markdown2650224
YAML46092
reStructuredText1747875
JavaScript4034
CSS3003

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity3.94
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces254
Interfaces244
Traits36
Classes858
▷ Abstract classes151.75%
▷ Concrete classes84398.25%
▷ Final classes17620.88%
Methods3,810
▷ Static methods2215.80%
▷ Public methods3,27986.06%
▷ Protected methods1975.17%
▷ Private methods3348.77%
Functions876
▷ Named functions515.82%
▷ Anonymous functions82594.18%
Constants367
▷ Global constants308.17%
▷ Class constants33791.83%
▷ Public constants30089.02%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected