84% zilla-payment-gateway

Code Review | Zilla Payment Gateway

WordPress plugin Zilla Payment Gateway scored 84% from 54 tests.

About plugin

  • Plugin page: zilla-payment-gat...
  • Plugin version: 1.5.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Feb 17, 2022
  • Latest release: Jul 1, 2022
  • Number of updates: 7
  • Update frequency: every 20.0 days
  • Top authors: usezilla (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 556 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

A check of server-side resources used by Zilla Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0241.62 ▼1.69
Dashboard /wp-admin3.32 ▲0.0244.12 ▼2.69
Posts /wp-admin/edit.php3.37 ▲0.0148.52 ▲4.70
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.71 ▼8.04
Media Library /wp-admin/upload.php3.24 ▲0.0136.41 ▲1.81

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Zilla Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.63 ▼0.731.60 ▼0.3444.65 ▼5.83
Dashboard /wp-admin2,214 ▲265.87 ▲1.02105.79 ▼12.5442.64 ▼1.54
Posts /wp-admin/edit.php2,096 ▲72.03 ▲0.0339.44 ▲4.1440.16 ▲6.53
Add New Post /wp-admin/post-new.php1,522 ▼617.75 ▼0.58664.51 ▲30.3555.94 ▲2.39
Media Library /wp-admin/upload.php1,390 ▲24.19 ▲0.04100.26 ▲5.1642.85 ▲1.90

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
You still need 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 shallow check that no server-side errors were triggered
Good news, no errors were detected

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 fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zilla-payment-gateway/include/actions.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zilla-payment-gateway/include/checkout-customise.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/zilla-payment-gateway/include/class-wc-zilla-gateway.php:3
    • > PHP Notice
      Undefined variable: post_class in wp-content/plugins/zilla-payment-gateway/include/views/actions-views.php on line 6
    • > PHP Notice
      Undefined variable: price in wp-content/plugins/zilla-payment-gateway/include/views/actions-views.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_HTTPS' not found in wp-content/plugins/zilla-payment-gateway/include/views/actions-views.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in zilla-payment-gateway/assets to your readme.txt
  • Tags: There are too many tags (16 tag instead of maximum 10)
The official readme.txt is a good inspiration

zilla-payment-gateway/zilla-payment-gateway.php Passed 13 tests

The main PHP file in "Zilla Payment Gateway" ver. 1.5.3 adds more information about the plugin and also serves as the entry point for this plugin
48 characters long description:
Integrate zilla payment gateway with woocommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin720 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5125171671
JavaScript22340
SVG1009

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity29.50
▷ Minimum class complexity5.00
▷ Maximum class complexity54.00
Average method complexity4.79
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants3
▷ Global constants3100.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
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
assets/images/learn-more.png4.86KB4.09KB▼ 15.72%