83% polskie-eplatnosci-online-payment-gateway-for-woocommerce

Code Review | Polskie ePłatności Online Payment Gateway for WooCommerce

WordPress plugin Polskie ePłatności Online Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: polskie-eplatnosc...
  • Plugin version: 2.3.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.4
  • WordPress version: 6.3.1
  • First release: Dec 9, 2019
  • Latest release: May 12, 2020
  • Number of updates: 7
  • Update frequency: every 22.9 days
  • Top authors: polskieeplatnosci (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,141 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.00MB] [CPU: ▼10.73ms] Passed 4 tests

This is a short check of server-side resources used by Polskie ePłatności Online Payment Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.63 ▼7.89
Dashboard /wp-admin3.31 ▲0.0041.33 ▼6.86
Posts /wp-admin/edit.php3.36 ▲0.0044.50 ▼1.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.64 ▼24.35
Media Library /wp-admin/upload.php3.23 ▲0.0033.39 ▼3.83

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Polskie ePłatności Online Payment Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.14 ▲0.161.85 ▲0.1038.54 ▼5.09
Dashboard /wp-admin2,198 ▲245.63 ▼0.0285.01 ▼5.7436.82 ▲0.53
Posts /wp-admin/edit.php2,097 ▲182.02 ▲0.0433.69 ▼2.5333.43 ▼0.83
Add New Post /wp-admin/post-new.php1,526 ▼1022.93 ▼0.01609.32 ▲3.7857.98 ▼11.25
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.1297.71 ▼2.1441.26 ▼4.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/polskie-eplatnosci-online-payment-gateway-for-woocommerce/views/admin/notices/woocommerce-is-missing.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paylane_Gateway_Base' not found in wp-content/plugins/polskie-eplatnosci-online-payment-gateway-for-woocommerce/Gateway/Blik0.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paylane_Gateway_Base' not found in wp-content/plugins/polskie-eplatnosci-online-payment-gateway-for-woocommerce/Gateway/CreditCard.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_notices() in wp-content/plugins/polskie-eplatnosci-online-payment-gateway-for-woocommerce/views/error.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

polskie-eplatnosci-online-payment-gateway-for-woocommerce/woocommerce-gateway-paylane.php 77% from 13 tests

The main PHP script in "Polskie ePłatności Online Payment Gateway for WooCommerce" version 2.3.4 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("polskie-eplatnosci-online-payment-gateway-for-woocommerce.php" instead of "woocommerce-gateway-paylane.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.5.1" instead of "4.4")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 detected4,691 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP346956963,583
PO File1373519853
JavaScript4358150
SVG101103
CSS2222

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity24.00
▷ Minimum class complexity2.00
▷ Maximum class complexity185.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes17.14%
▷ Concrete classes1392.86%
▷ Final classes00.00%
Methods138
▷ Static methods53.62%
▷ Public methods8057.97%
▷ Protected methods3323.91%
▷ Private methods2518.12%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants17
▷ Global constants00.00%
▷ Class constants17100.00%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
34 PNG files occupy 0.25MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/banks/PP.png5.86KB3.10KB▼ 47.01%
assets/images/payment_methods/sepa_h50_w80.png1.93KB0.98KB▼ 49.37%
assets/images/banks/AS.png11.44KB5.51KB▼ 51.85%
assets/images/banks/NP.png13.36KB6.54KB▼ 51.06%
assets/images/banks/BG.png5.80KB2.75KB▼ 52.55%