78% zenkipay

Code Review | WooCommerce Zenkipay

WordPress plugin WooCommerce Zenkipay scored78%from 54 tests.

About plugin

  • Plugin page: zenkipay
  • Plugin version: 2.3.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.1
  • WordPress version: 6.3.1
  • First release: May 3, 2022
  • Latest release: Jul 4, 2023
  • Number of updates: 47
  • Update frequency: every 6.8 days
  • Top authors: zenkipay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,228 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.61ms] Passed 4 tests

Server-side resources used by WooCommerce Zenkipay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0445.93 ▲2.26
Dashboard /wp-admin3.33 ▲0.0355.05 ▲4.47
Posts /wp-admin/edit.php3.39 ▲0.0353.14 ▼2.16
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.25 ▼14.29
Media Library /wp-admin/upload.php3.26 ▲0.0338.74 ▼0.26

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 1,613 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Zenkipay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.18 ▼0.171.88 ▲0.1141.10 ▲1.01
Dashboard /wp-admin2,198 ▲185.61 ▲0.1090.89 ▲1.2737.14 ▼6.91
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0341.58 ▲2.9234.92 ▼5.12
Add New Post /wp-admin/post-new.php1,526 ▼023.48 ▲0.29662.58 ▼38.3054.38 ▼6.94
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0597.03 ▼7.1944.68 ▲1.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/zenkipay/lib/zenkipay/vendor/nikic/php-parser/grammar/rebuildParsers.php
  • 815× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Constraint\\Constraint' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Framework\\SelfDescribing' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SebastianBergmann\\CodeCoverage\\Driver\\Driver' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/phpunit/php-code-coverage/src/Driver/PhpdbgDriver.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'SebastianBergmann\\Type\\Type' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/sebastian/type/src/type/UnknownType.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr\\BinaryOp' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'PharIo\\Version\\Exception' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/phar-io/version/src/exceptions/UnsupportedVersionConstraintException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\StreamFactory' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Exception' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Constraint\\Constraint' not found in wp-content/plugins/zenkipay/lib/zenkipay/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (19 tag instead of maximum 10)
The official readme.txt might help

zenkipay/zenki.gateway.php 92% from 13 tests

"WooCommerce Zenkipay" version 2.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("zenkipay.php" instead of "zenki.gateway.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin100,177 lines of code in 1,496 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,29417,77232,37684,899
JSON55705,884
Markdown942,84104,533
yacc3332122,029
XSD300964
XML1550848
CSS86931457
JavaScript103521229
YAML5383162
PO File1304198
SVG60143
reStructuredText2231831

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 144)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity7.77
▷ Minimum class complexity1.00
▷ Maximum class complexity217.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity144.00
Code structure
Namespaces152
Interfaces120
Traits19
Classes1,098
▷ Abstract classes514.64%
▷ Concrete classes1,04795.36%
▷ Final classes56253.68%
Methods5,677
▷ Static methods72412.75%
▷ Public methods4,45778.51%
▷ Protected methods5579.81%
▷ Private methods66311.68%
Functions1,654
▷ Named functions35121.22%
▷ Anonymous functions1,30378.78%
Constants646
▷ Global constants142.17%
▷ Class constants63297.83%
▷ Public constants55988.45%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/crypto-btn-es.png27.26KB10.52KB▼ 61.41%
assets/icons/logo.png19.10KB7.54KB▼ 60.55%
assets/icons/logo-white.png3.85KB2.06KB▼ 46.52%
assets/icons/crypto-btn.png27.14KB10.57KB▼ 61.05%