84% paymentasia-gateway

Code Review | Payment Asia Gateway for WooCommerce

WordPress plugin Payment Asia Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: paymentasia-gateway
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jul 15, 2022
  • Latest release: Nov 21, 2022
  • Number of updates: 41
  • Update frequency: every 3.2 days
  • Top authors: paymentasia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /464 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.77ms] Passed 4 tests

A check of server-side resources used by Payment Asia Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0535.66 ▼8.69
Dashboard /wp-admin3.36 ▲0.0648.35 ▼5.72
Posts /wp-admin/edit.php3.41 ▲0.0549.36 ▼1.73
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.42 ▼6.92
Media Library /wp-admin/upload.php3.28 ▲0.0536.24 ▲1.77

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

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

Browser metrics Passed 4 tests

Payment Asia Gateway for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.34 ▲0.142.05 ▼0.3544.09 ▼0.06
Dashboard /wp-admin2,195 ▲185.59 ▲0.0692.97 ▼7.2438.01 ▼8.70
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0439.08 ▼2.6035.37 ▼4.40
Add New Post /wp-admin/post-new.php1,526 ▼523.46 ▲0.30665.26 ▲39.0156.13 ▲7.96
Media Library /wp-admin/upload.php1,400 ▼04.21 ▼0.1394.73 ▼11.1046.18 ▲0.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paymentasia-gateway/index.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Activate Payment Asia gateway.), #2 (Payment Asia payment settings.), #3 (Payment Asia payment settings.), #4 (Payment Asia payment page.), #5 (Payment Asia payment page.), #6 (Payment Asia merchant token and secret key in the merchant portal.), #7 (Payment Asia merchant token and secret key in the merchant portal)
Please take inspiration from this readme.txt

paymentasia-gateway/index.php 92% from 13 tests

The main PHP script in "Payment Asia Gateway for WooCommerce" version 1.0.3 is automatically included on every request by WordPress
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 ("paymentasia-gateway.php" instead of "index.php")

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
No dangerous file extensions were detected310 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP16260309
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected