84% dummy-gateway-for-woocommerce

Code Review | Dummy Gateway for WooCommerce

WordPress plugin Dummy Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: dummy-gateway-for...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 28, 2016
  • Latest release: Oct 28, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: vladopajic (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,822 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
Install script ran successfully

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

Server-side resources used by Dummy Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.05 ▼6.67
Dashboard /wp-admin3.31 ▲0.0153.16 ▼1.17
Posts /wp-admin/edit.php3.36 ▲0.0050.00 ▼5.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.21 ▲2.98
Media Library /wp-admin/upload.php3.23 ▲0.0043.10 ▲3.56

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Dummy Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.27 ▼0.081.99 ▲0.1540.77 ▼4.17
Dashboard /wp-admin2,195 ▲215.61 ▼0.0795.15 ▼2.5241.31 ▼4.23
Posts /wp-admin/edit.php2,100 ▲32.03 ▲0.0739.21 ▲0.6435.86 ▲1.39
Add New Post /wp-admin/post-new.php1,526 ▼223.66 ▲0.47697.84 ▲11.6447.57 ▼5.33
Media Library /wp-admin/upload.php1,400 ▲34.20 ▲0.08111.46 ▲3.4347.80 ▲2.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/dummy-gateway-for-woocommerce/wc-dummy-gateway.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/dummy-gateway-for-woocommerce/WCDummyGateway.class.php:3

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 93% from 29 tests

readme.txt 94% 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 your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

dummy-gateway-for-woocommerce/wc-dummy-gateway.php 92% from 13 tests

The main file in "Dummy Gateway for WooCommerce" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dummy-gateway-for-woocommerce.php" instead of "wc-dummy-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected72 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2141072

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.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
There were not PNG files found in your plugin