68% woo-gateway-payger

Code Review | Woocommerce Gateway Payger

WordPress plugin Woocommerce Gateway Payger scored68%from 54 tests.

About plugin

  • Plugin page: woo-gateway-payger
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Oct 17, 2018
  • Latest release: Oct 17, 2018
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: aaires (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /548 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼8.15ms] Passed 4 tests

Server-side resources used by Woocommerce Gateway Payger
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1128.61 ▼16.25
Dashboard /wp-admin3.43 ▲0.1252.67 ▼2.24
Posts /wp-admin/edit.php3.54 ▲0.1847.29 ▼1.49
Add New Post /wp-admin/post-new.php6.01 ▲0.1283.58 ▼12.62
Media Library /wp-admin/upload.php3.35 ▲0.1235.34 ▼0.38

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

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

Browser metrics Passed 4 tests

Woocommerce Gateway Payger: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,463 ▼29814.25 ▼0.150.67 ▼1.3219.26 ▼24.68
Dashboard /wp-admin2,198 ▲215.52 ▼0.1691.85 ▼10.1741.27 ▼0.91
Posts /wp-admin/edit.php2,110 ▲132.07 ▲0.0636.20 ▼0.6132.98 ▼2.58
Add New Post /wp-admin/post-new.php1,537 ▲1123.21 ▼0.32667.14 ▲11.1971.12 ▲21.08
Media Library /wp-admin/upload.php1,412 ▲124.16 ▼0.0496.63 ▼7.0945.97 ▼2.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/woo-gateway-payger/uninstall.php+39
    rmdir(wp-content/uploads/payger_tmp/): No such file or directory
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • payger_warning_message
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woo-gateway-payger/public/partials/pay-modal.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: order_id in wp-content/plugins/woo-gateway-payger/public/partials/pay-modal.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-gateway-payger/includes/class-woocommerce-payger-gateway.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% 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
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-gateway-payger === )
You can look at the official readme.txt

woo-gateway-payger/woocommerce-gateway-payger.php 85% from 13 tests

This is the main PHP file of "Woocommerce Gateway Payger" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-gateway-payger.php" instead of "woocommerce-gateway-payger.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,303 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP164558781,225
JavaScript213068503
CSS1617356
PO File17188151
SVG30345
JSON11023

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity12.67
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods62
▷ Static methods1625.81%
▷ Public methods5893.55%
▷ Protected methods00.00%
▷ Private methods46.45%
Functions3
▷ Named functions3100.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/logo_green.png4.48KB2.45KB▼ 45.35%
public/assets/images/logo.png9.48KB6.10KB▼ 35.61%