83% test-gateway-for-woocommerce

Code Review | Test Payment Module for Woocommerce

WordPress plugin Test Payment Module for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: test-gateway-for-...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0+
  • WordPress version: 6.3.1
  • First release: Jul 22, 2015
  • Latest release: Aug 11, 2015
  • Number of updates: 4
  • Update frequency: every 5.0 days
  • Top authors: seanbarton (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active /8,383 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

An overview of server-side resources used by Test Payment Module for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.13 ▼5.76
Dashboard /wp-admin3.32 ▲0.0145.30 ▼3.43
Posts /wp-admin/edit.php3.37 ▲0.0147.32 ▼0.02
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.75 ▼16.31
Media Library /wp-admin/upload.php3.24 ▲0.0142.39 ▲8.42

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Test Payment Module for Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.23 ▼1.061.64 ▼0.4440.63 ▲1.81
Dashboard /wp-admin2,206 ▲184.85 ▼0.15110.20 ▲4.2040.68 ▼2.18
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0040.48 ▲0.4035.30 ▲3.58
Add New Post /wp-admin/post-new.php1,514 ▼1917.74 ▼5.42675.75 ▲3.1354.51 ▼0.19
Media Library /wp-admin/upload.php1,388 ▲64.22 ▲0.0293.97 ▼9.4142.29 ▼2.48

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
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/test-gateway-for-woocommerce/test_gateway_for_woocommerce.php:112

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tested up to: The plugin version is formatted incorrectly
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === test-gateway-for-woocommerce === )
You can take inspiration from this readme.txt

test-gateway-for-woocommerce/test_gateway_for_woocommerce.php 85% from 13 tests

This is the main PHP file of "Test Payment Module for Woocommerce" version 1.5, 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: The principal plugin file should be the same as the plugin slug ("test-gateway-for-woocommerce.php" instead of "test_gateway_for_woocommerce.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 167 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected82 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP123982

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected