83% woocommerce-payment-gateway

Code Review | WooCommerce Payment Gateway - Inspire

WordPress plugin WooCommerce Payment Gateway - Inspire scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-payme...
  • Plugin version: 2.1.25
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 19, 2012
  • Latest release: Nov 9, 2023
  • Number of updates: 82
  • Update frequency: every 48.9 days
  • Top authors: harmz (70.73%)innerfire (30.49%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /46,473 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.46ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Payment Gateway - Inspire
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.35 ▼3.29
Dashboard /wp-admin3.33 ▲0.0244.71 ▼5.33
Posts /wp-admin/edit.php3.38 ▲0.0247.34 ▼1.96
Add New Post /wp-admin/post-new.php5.91 ▲0.0282.54 ▼23.24
Media Library /wp-admin/upload.php3.25 ▲0.0233.43 ▲0.34

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Payment Gateway - Inspire
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13413.41 ▼0.757.49 ▲5.8239.94 ▼1.63
Dashboard /wp-admin2,198 ▲245.57 ▲0.0484.26 ▼10.6238.48 ▼3.90
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0238.91 ▼1.4737.65 ▲0.81
Add New Post /wp-admin/post-new.php1,526 ▼1023.11 ▼0.13624.65 ▼15.6955.88 ▼16.51
Media Library /wp-admin/upload.php1,394 ▼34.20 ▲0.0298.59 ▼2.8541.12 ▼1.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/woocommerce-payment-gateway/gateway-inspire.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% 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 to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

woocommerce-payment-gateway/gateway-inspire.php 85% from 13 tests

"WooCommerce Payment Gateway - Inspire" version 2.1.25's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-payment-gateway.php" instead of "gateway-inspire.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,081 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42923371,045
JavaScript269536

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity45.50
▷ Minimum class complexity5.00
▷ Maximum class complexity133.00
Average method complexity5.94
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods36
▷ Static methods12.78%
▷ Public methods3494.44%
▷ Protected methods25.56%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.94MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/mastercard.png0.81KB0.63KB▼ 22.18%
images/banner-1544x500.png685.15KB437.22KB▼ 36.19%
images/icon-256x256.png34.89KB14.89KB▼ 57.32%
images/banner-772x250.png218.82KB135.37KB▼ 38.14%
images/icon-128x128.png14.72KB6.73KB▼ 54.24%