83% yaad-sarig-payment-gateway-for-wc

Code Review | Yaad Sarig Payment Gateway For WC

WordPress plugin Yaad Sarig Payment Gateway For WC scored83%from 54 tests.

About plugin

  • Plugin page: yaad-sarig-paymen...
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: May 17, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 94
  • Update frequency: every 12.6 days
  • Top authors: yaadsarig (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /17,334 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
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Yaad Sarig Payment Gateway For WC
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1237.79 ▼3.97
Dashboard /wp-admin3.42 ▲0.1243.15 ▼4.36
Posts /wp-admin/edit.php3.47 ▲0.1246.23 ▲0.90
Add New Post /wp-admin/post-new.php6.00 ▲0.1292.24 ▼2.41
Media Library /wp-admin/upload.php3.34 ▲0.1229.54 ▼4.48

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Yaad Sarig Payment Gateway For WC
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.79 ▲0.411.75 ▲0.0041.64 ▼0.37
Dashboard /wp-admin2,206 ▲154.90 ▲0.01108.18 ▲6.3142.58 ▼0.29
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0039.70 ▲0.9736.00 ▼3.59
Add New Post /wp-admin/post-new.php1,533 ▼422.88 ▼0.25589.77 ▼58.0251.09 ▼2.48
Media Library /wp-admin/upload.php1,382 ▼94.17 ▼0.0294.80 ▼7.0040.22 ▼4.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Almost there! Just fix the following items
  • 28× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_item' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_item_v7.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_product' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_product_v6.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_order' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_order_v2.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_item' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_item_v2.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_product' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_product_v3.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_order' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_order_v7.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_product' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_product_v8.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_object' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_order.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_product' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_product_v5.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'tb_infra_1_0_11\\tb_wc_order' not found in wp-content/plugins/yaad-sarig-payment-gateway-for-wc/10bit-woocommerce-infra/class_tb_wc_order_v3.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
You can take inspiration from this readme.txt

yaad-sarig-payment-gateway-for-wc/woocommerce-gateway-yaadpay.php 85% from 13 tests

"Yaad Sarig Payment Gateway For WC" version 2.2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("yaad-sarig-payment-gateway-for-wc.php" instead of "woocommerce-gateway-yaadpay.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.0" instead of "3.0")

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
There were no executable files found in this plugin3,825 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP348901,2143,324
PO File1137236239
JavaScript2132146
CSS270116

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity9.43
▷ Minimum class complexity1.00
▷ Maximum class complexity198.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes30
▷ Abstract classes516.67%
▷ Concrete classes2583.33%
▷ Final classes28.00%
Methods354
▷ Static methods82.26%
▷ Public methods31789.55%
▷ Protected methods00.00%
▷ Private methods3710.45%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants412.50%
▷ Class constants2887.50%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/WWW.png1.44KB1.42KB▼ 1.08%
assets/images/Facebook.png1.12KB1.10KB▼ 1.31%
assets/images/YouTube.png1.32KB1.37KB0.00%
assets/images/email.png3.42KB0.63KB▼ 81.68%