74% metizpay-payment-gateway-for-woocommerce

Code Review | Metizpay Payment Gateway For WooCommerce

WordPress plugin Metizpay Payment Gateway For WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: metizpay-payment-...
  • Plugin version: 1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.1-5.9.1
  • WordPress version: 6.3.1
  • First release: Feb 23, 2022
  • Latest release: Feb 23, 2022
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: metizsoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /220 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.68MB] [CPU: ▼22.21ms] Passed 4 tests

An overview of server-side resources used by Metizpay Payment Gateway For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.64 ▼5.96
Dashboard /wp-admin3.31 ▼0.0348.48 ▼18.36
Posts /wp-admin/edit.php3.36 ▲0.0143.07 ▼7.95
Add New Post /wp-admin/post-new.php3.19 ▼2.7037.64 ▼56.57
Media Library /wp-admin/upload.php3.23 ▲0.0138.37 ▲2.86

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: 1 new table, 6 new options
New tables
wp_metizpayment
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Metizpay Payment Gateway For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.341.78 ▲0.0740.93 ▼2.40
Dashboard /wp-admin2,192 ▲125.50 ▼0.0887.40 ▼3.2740.93 ▲1.14
Posts /wp-admin/edit.php2,100 ▼31.98 ▲0.0434.89 ▼1.3340.25 ▲8.08
Add New Post /wp-admin/post-new.php1,526 ▼023.07 ▼0.38671.34 ▼16.2867.30 ▲16.07
Media Library /wp-admin/upload.php1,394 ▼64.19 ▼0.0199.58 ▼4.8841.54 ▼5.61

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
  • Zombie tables detected upon uninstall: 1 table
    • wp_metizpayment
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/media.php): failed to open stream: No such file or directory in wp-content/plugins/metizpay-payment-gateway-for-woocommerce/metizpay-payment-gateway-for-woocommerce.php on line 17
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/metizpay-payment-gateway-for-woocommerce/metizpay-payment-gateway-for-woocommerce.php on line 17
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/media.php' (include_path='.:/usr/share/php') in wp-content/plugins/metizpay-payment-gateway-for-woocommerce/metizpay-payment-gateway-for-woocommerce.php on line 17

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)
No browser errors were detected

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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Activate Plugin.), #2 (Go to WooCommerce Settings.), #3 (Select Payment Gateways tab.), #4 (Select Metizpay option.), #5 (Enable Metizpay option from this page.), #6 (Enter the details.), #7 (Set gateway mode.), #8 (Sample screenshot from checkout page)
The official readme.txt is a good inspiration

metizpay-payment-gateway-for-woocommerce/metizpay-payment-gateway-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Metizpay Payment Gateway For WooCommerce" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin375 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP110240375

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png1.41KB0.81KB▼ 42.59%