10% wizpay-gateway-for-woocommerce

Code Review | Wizpay Gateway for WooCommerce

WordPress plugin Wizpay Gateway for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: wizpay-gateway-fo...
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2021
  • Latest release: May 16, 2023
  • Number of updates: 40
  • Update frequency: every 16.1 days
  • Top authors: wizpayteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /6,680 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wizpay-gateway-for-woocommerce/wizardpay-gateway.php+415
    Undefined offset: 1

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.61ms] Passed 4 tests

This is a short check of server-side resources used by Wizpay Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.97 ▼4.94
Dashboard /wp-admin3.31 ▲0.0042.90 ▼8.02
Posts /wp-admin/edit.php3.36 ▲0.0043.77 ▼4.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.37 ▼13.16
Media Library /wp-admin/upload.php3.23 ▲0.0037.33 ▲2.08

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Wizpay Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.16 ▼1.191.73 ▼0.0143.95 ▲2.25
Dashboard /wp-admin2,209 ▲215.83 ▼0.07103.30 ▼4.6240.75 ▼4.75
Posts /wp-admin/edit.php2,086 ▼32.04 ▲0.0433.86 ▼2.1132.63 ▼3.11
Add New Post /wp-admin/post-new.php1,533 ▲1623.08 ▲5.59672.40 ▲49.2657.95 ▲3.20
Media Library /wp-admin/upload.php1,388 ▲34.16 ▼0.06108.94 ▲2.4443.62 ▼0.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wizpay-gateway-for-woocommerce/wizardpay-gateway.php+415
    Undefined offset: 1
  • This plugin has failed uninstalling correctly, leaving 39 files (2.78MB) in the plugin directory
    • (new file) assets/css/checkout.css
    • (new file) assets/css/custom-popup.css
    • (new file) assets/js/capture-payment.js
    • (new file) assets/js/custom-popup.js
    • (new file) assets/css/admin.css
    • (new file) assets/js/checkout-chart.js
    • (new file) GPL-3.0.txt
    • (new file) assets/js/admin.js
    • (new file) README.md
    • (new file) assets/js/chart-loader.js
    • ...
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wizpay-gateway-for-woocommerce/wizpay/access.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/wizpay-gateway-for-woocommerce/wizpay/wysiwyg.html.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (This screen shot description corresponds to screenshot-1.png.), #2 (This screen shot description corresponds to screenshot-2.png.), #3 (This screen shot description corresponds to screenshot-3.png.)
The official readme.txt is a good inspiration

wizpay-gateway-for-woocommerce/wizardpay-gateway.php 85% from 13 tests

The main file in "Wizpay Gateway for WooCommerce" v. 1.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wizpay-gateway-for-woocommerce.php" instead of "wizardpay-gateway.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.8.3" instead of "3.5")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin47,751 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
CSS665120344,074
PHP86804932,579
JavaScript912249811
HTML1100285
Markdown1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity59.40
▷ Minimum class complexity2.00
▷ Maximum class complexity104.00
Average method complexity4.84
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods76
▷ Static methods1418.42%
▷ Public methods6990.79%
▷ Protected methods00.00%
▷ Private methods79.21%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/popup/img/wizpay-logo-popup.png5.08KB3.00KB▼ 40.95%
images/Group_old.png40.00KB14.09KB▼ 64.78%
images/Group.png8.58KB2.75KB▼ 67.96%
assets/popup/img/lightning-bolt-popup.png63.77KB16.52KB▼ 74.10%
assets/popup/img/swoosh-popup.png67.35KB18.78KB▼ 72.11%