89% yd-2checkout-gateway-for-woocommerce

Code Review | YD Gateway 2Checkout for WooCommerce

WordPress plugin YD Gateway 2Checkout for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: yd-2checkout-gate...
  • Plugin version: 0.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.7
  • WordPress version: 6.3.1
  • First release: Oct 5, 2019
  • Latest release: Mar 10, 2021
  • Number of updates: 26
  • Update frequency: every 20.1 days
  • Top authors: axeleus (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,502 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.55ms] Passed 4 tests

A check of server-side resources used by YD Gateway 2Checkout for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.23 ▼4.68
Dashboard /wp-admin3.32 ▼0.0354.84 ▼10.13
Posts /wp-admin/edit.php3.37 ▲0.0156.26 ▲3.78
Add New Post /wp-admin/post-new.php5.90 ▲0.01106.28 ▼2.19
Media Library /wp-admin/upload.php3.24 ▲0.0139.56 ▲2.79

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for YD Gateway 2Checkout for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.20 ▲0.011.92 ▲0.1342.89 ▼0.06
Dashboard /wp-admin2,189 ▲95.65 ▼0.0290.06 ▼10.5146.21 ▲4.50
Posts /wp-admin/edit.php2,103 ▲31.98 ▲0.0439.88 ▲4.0637.63 ▲4.42
Add New Post /wp-admin/post-new.php1,529 ▲123.38 ▲0.25629.70 ▼63.3748.88 ▼5.38
Media Library /wp-admin/upload.php1,397 ▼64.18 ▲0.0098.05 ▼15.3842.08 ▼11.57

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 did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: woocommerce payment gateway, payment gateway, 2co payment gateway, 2checkout payment with paypal, 2checkout woocommerce payment

yd-2checkout-gateway-for-woocommerce/yd-gateway-2checkout.php 77% from 13 tests

The main PHP file in "YD Gateway 2Checkout for WooCommerce" ver. 0.2.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "4.4")
  • 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
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("yd-2checkout-gateway-for-woocommerce.php" instead of "yd-gateway-2checkout.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin909 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP828488909

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity20.00
▷ Minimum class complexity6.00
▷ Maximum class complexity35.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods1680.00%
▷ Protected methods15.00%
▷ Private methods315.00%
Functions13
▷ Named functions861.54%
▷ Anonymous functions538.46%
Constants4
▷ Global constants4100.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
No PNG files were detected