78% payiq-wc-gateway

Code Review | PayIQ WooCommerce Gateway

WordPress plugin PayIQ WooCommerce Gateway scored78%from 54 tests.

About plugin

  • Plugin page: payiq-wc-gateway
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: May 2, 2016
  • Latest release: Mar 1, 2017
  • Number of updates: 21
  • Update frequency: every 14.7 days
  • Top authors: pekz0r (90.48%)kylegard (14.29%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /840 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼6.28ms] Passed 4 tests

Analyzing server-side resources used by PayIQ WooCommerce Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.58 ▼1.19
Dashboard /wp-admin3.32 ▼0.0347.00 ▼14.14
Posts /wp-admin/edit.php3.37 ▲0.0146.01 ▼5.18
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.44 ▼3.26
Media Library /wp-admin/upload.php3.24 ▲0.0132.47 ▼2.52

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for PayIQ WooCommerce Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.28 ▼1.084.90 ▲2.7543.88 ▼0.25
Dashboard /wp-admin2,206 ▲185.90 ▲0.02113.35 ▲6.8742.16 ▼1.74
Posts /wp-admin/edit.php2,089 ▼32.04 ▼0.0137.29 ▼10.2930.96 ▼6.36
Add New Post /wp-admin/post-new.php1,537 ▲2323.12 ▲5.44656.03 ▼54.6551.64 ▼11.77
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0195.09 ▼16.2642.99 ▼2.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/AuthorizeRecurring.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/PrepareSession.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/Reverse.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/CaptureTransaction.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/AuthorizeSubscription.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/GetTransactionDetails.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/Refund.php
    • > /wp-content/plugins/payiq-wc-gateway/xml-templates/GetSavedCards.php
  • 119× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/payiq-wc-gateway/xml-templates/AuthorizeSubscription.php on line 13
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/payiq-wc-gateway/xml-templates/AuthorizeRecurring.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/payiq-wc-gateway/xml-templates/PrepareSession.php on line 27
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/payiq-wc-gateway/xml-templates/PrepareSession.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payiq-wc-gateway/gateway-payiq.php:20
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/payiq-wc-gateway/xml-templates/Refund.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/payiq-wc-gateway/xml-templates/GetTransactionDetails.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/payiq-wc-gateway/xml-templates/GetSavedCards.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/payiq-wc-gateway/xml-templates/PrepareSession.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/payiq-wc-gateway/xml-templates/Refund.php on line 8

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: payments, woocommerce, psp, gateway, payiq...

payiq-wc-gateway/gateway-payiq.php 92% from 13 tests

The main file in "PayIQ WooCommerce Gateway" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("payiq-wc-gateway.php" instead of "gateway-payiq.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
Success! There were no dangerous files found in this plugin1,551 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP145132181,293
PO File15658169
JSON22065
XML13021
Markdown1403

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity29.50
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods70
▷ Static methods57.14%
▷ Public methods6897.14%
▷ Protected methods00.00%
▷ Private methods22.86%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.19MB with 0.12MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/logo_small.png5.80KB2.38KB▼ 58.96%
assets/screenshot-1.png125.06KB48.66KB▼ 61.10%
assets/logo@2x.png36.92KB12.05KB▼ 67.36%
assets/screenshot-2.png28.51KB10.96KB▼ 61.58%