93% woocommerce-beanstream-payment-gateway

Code Review | WooCommerce - Beanstream Payment

WordPress plugin WooCommerce - Beanstream Payment scored 93% from 54 tests.

About plugin

  • Plugin page: woocommerce-beans...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.0.2
  • WordPress version: 5.8.1
  • First release: Sep 20, 2014
  • Latest release: Jan 3, 2019
  • Number of updates: 10
  • Update frequency: every 156.6 days
  • Top authors: aloktiwari (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 1,568 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by WooCommerce - Beanstream Payment
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1245.36 ▲21.10
Dashboard /wp-admin3.06 ▲0.0147.90 ▼1.71
Posts /wp-admin/edit.php3.11 ▲0.0144.11 ▼5.38
Add New Post /wp-admin/post-new.php5.42 ▼0.0296.74 ▼571.23
Media Library /wp-admin/upload.php3.00 ▲0.0039.88 ▲1.28

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce - Beanstream Payment
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲10715.95 ▲0.468.89 ▲0.2152.42 ▼1.23
Dashboard /wp-admin2,973 ▲395.85 ▼0.23146.92 ▼14.63120.46 ▼4.27
Posts /wp-admin/edit.php2,736 ▼32.69 ▲0.0071.83 ▼2.9197.15 ▲5.92
Add New Post /wp-admin/post-new.php1,500 ▼18318.75 ▲0.15394.67 ▼4.54112.85 ▼1.73
Media Library /wp-admin/upload.php1,810 ▲35.05 ▲0.03153.59 ▼0.94119.51 ▼6.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-beanstream-payment-gateway/woocommerce-gateway-beanstream.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woocommerce-beanstream-payment-gateway === )
The official readme.txt is a good inspiration

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

The main PHP script in "WooCommerce - Beanstream Payment" version 1.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 170 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-beanstream-payment-gateway.php" instead of "woocommerce-gateway-beanstream.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
Success! There were no dangerous files found in this plugin336 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15748336

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity7.29
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin