83% open-brain-gateway

Code Review | OPEN-BRAIN Gateway for WooCommerce

WordPress plugin OPEN-BRAIN Gateway for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: open-brain-gateway
  • Plugin version: 4.0.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2023
  • Latest release: Mar 7, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: faridsaniee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 88 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.11MB] [CPU: ▼4.41ms] Passed 4 tests

Analyzing server-side resources used by OPEN-BRAIN Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.30 ▼4.03
Dashboard /wp-admin3.42 ▲0.1146.64 ▼1.06
Posts /wp-admin/edit.php3.47 ▲0.1146.12 ▼1.13
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.67 ▼8.51
Media Library /wp-admin/upload.php3.34 ▲0.1132.53 ▼3.97

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for OPEN-BRAIN Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.73 ▼0.951.75 ▲0.0640.14 ▼8.26
Dashboard /wp-admin2,206 ▲185.80 ▲0.86100.65 ▼6.9440.81 ▼1.96
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0437.57 ▼2.8134.97 ▼1.63
Add New Post /wp-admin/post-new.php1,534 ▼823.38 ▲4.86630.97 ▼3.2552.81 ▼2.35
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.0495.81 ▼5.9941.10 ▼4.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/open-brain-gateway/index.php
    • > /wp-content/plugins/open-brain-gateway/class-gateway-hp.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

open-brain-gateway/index.php 85% from 13 tests

The entry point to "OPEN-BRAIN Gateway for WooCommerce" version 4.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("open-brain-gateway.php" instead of "index.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 370 characters long)

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
There were no executable files found in this plugin559 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21228559

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity64.00
▷ Minimum class complexity64.00
▷ Maximum class complexity64.00
Average method complexity8.88
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.58MB with 0.34MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-1.png356.82KB144.79KB▼ 59.42%
assets/images/screenshot-2.png230.35KB93.68KB▼ 59.33%
assets/images/logo.png5.40KB2.17KB▼ 59.82%