68% zipmoney-payments-woocommerce

Code Review | zipMoney(Zip Co) Payments Plugin for WooCommerce

WordPress plugin zipMoney(Zip Co) Payments Plugin for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: zipmoney-payments...
  • Plugin version: 2.3.18
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.13-6.2
  • WordPress version: 6.3.1
  • First release: Aug 4, 2017
  • Latest release: May 25, 2023
  • Number of updates: 203
  • Update frequency: every 10.5 days
  • Top authors: zipmoney (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

4,000+ active /75,120 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

A check of server-side resources used by zipMoney(Zip Co) Payments Plugin for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.54 ▼4.77
Dashboard /wp-admin3.31 ▲0.0147.13 ▼8.91
Posts /wp-admin/edit.php3.36 ▲0.0147.56 ▼2.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.99 ▼8.27
Media Library /wp-admin/upload.php3.23 ▲0.0134.69 ▼2.14

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

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

Browser metrics Passed 4 tests

A check of browser resources used by zipMoney(Zip Co) Payments Plugin for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.30 ▼0.081.81 ▼0.1441.64 ▼2.28
Dashboard /wp-admin2,195 ▲215.57 ▼0.1384.08 ▼10.5242.87 ▼1.22
Posts /wp-admin/edit.php2,100 ▼32.04 ▲0.0235.53 ▼6.3335.80 ▼0.42
Add New Post /wp-admin/post-new.php1,545 ▼323.13 ▼0.01632.10 ▼6.8449.53 ▼4.00
Media Library /wp-admin/upload.php1,394 ▼34.22 ▼0.0395.84 ▼8.9242.12 ▼2.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_zip_tokenisation
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

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
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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/zipmoney-payments-woocommerce/includes/view/frontend/checkout_notification_section.php
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Zip_Controller_Abstract_Controller' not found in wp-content/plugins/zipmoney-payments-woocommerce/includes/controller/class-wc-zipmoney-payment-checkout-controller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'zipMoney\\Setup' not found in wp-content/plugins/zipmoney-payments-woocommerce/vendor/zipmoney/merchantapi-php/test/Api/CheckoutsApiTest.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/zipmoney-payments-woocommerce/includes/view/frontend/notification_page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/zipmoney-payments-woocommerce/vendor/zipmoney/merchantapi-php/test/Setup.php:11
    • > PHP Notice
      Undefined variable: is_iframe_checkout in wp-content/plugins/zipmoney-payments-woocommerce/includes/view/frontend/order_button.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/zipmoney-payments-woocommerce/tests/test-sample.php:11
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/zipmoney-payments-woocommerce/includes/view/backend/charge_buttons.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Zip_Controller_Abstract_Controller' not found in wp-content/plugins/zipmoney-payments-woocommerce/includes/controller/class-wc-zipmoney-payment-charge-controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'zipMoney\\Setup' not found in wp-content/plugins/zipmoney-payments-woocommerce/vendor/zipmoney/merchantapi-php/test/Api/RefundsApiTest.php:16
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/zipmoney-payments-woocommerce/tests/bootstrap.php on line 14

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Requires at least: Version format is invalid
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can look at the official readme.txt

zipmoney-payments-woocommerce/zipmoney-payment-gateway.php 92% from 13 tests

This is the main PHP file of "zipMoney(Zip Co) Payments Plugin for WooCommerce" version 2.3.18, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("zipmoney-payments-woocommerce.php" instead of "zipmoney-payment-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin12,514 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP913,0187,61810,353
Markdown4544701,017
JavaScript48683576
PO File28091271
CSS2120132
JSON20099
Ant18032
XML11021
Bourne Shell171012
INI1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.81
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes75
▷ Abstract classes11.33%
▷ Concrete classes7498.67%
▷ Final classes11.35%
Methods1,139
▷ Static methods22119.40%
▷ Public methods1,10797.19%
▷ Protected methods110.97%
▷ Private methods211.84%
Functions11
▷ Named functions872.73%
▷ Anonymous functions327.27%
Constants148
▷ Global constants42.70%
▷ Class constants14497.30%
▷ Public constants144100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin