83% bridgerpay-woocommerce

Code Review | BridgerPay Woocommerce

WordPress plugin BridgerPay Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: bridgerpay-woocom...
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.2
  • WordPress version: 6.3.1
  • First release: May 21, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 38
  • Update frequency: every 34.3 days
  • Top authors: bridgerpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,953 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 gracefully, with no errors

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

An overview of server-side resources used by BridgerPay Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.66 ▼7.77
Dashboard /wp-admin3.31 ▲0.0152.60 ▲0.98
Posts /wp-admin/edit.php3.36 ▲0.0148.96 ▲0.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.57 ▼21.83
Media Library /wp-admin/upload.php3.23 ▲0.0132.12 ▼0.17

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

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

Browser metrics Passed 4 tests

BridgerPay Woocommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.67 ▼0.041.66 ▼0.2538.06 ▼9.95
Dashboard /wp-admin2,198 ▲245.62 ▲0.0796.14 ▲0.7443.74 ▲1.42
Posts /wp-admin/edit.php2,103 ▼02.01 ▲0.0239.50 ▲0.2035.65 ▲2.45
Add New Post /wp-admin/post-new.php1,526 ▼023.28 ▲0.27624.10 ▼1.5248.51 ▼14.73
Media Library /wp-admin/upload.php1,397 ▼64.17 ▼0.0999.19 ▼2.2641.04 ▼1.32

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/bridgerpay-woocommerce/bridgerpay-woocommerce.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/bridgerpay-woocommerce/includes/class-wc-bridgerpay-gateway.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
  • Screenshots: These screenshots do not have images: #1 (Bridger Plugin Settings), #2 (Bridger Cashier), #3 (Bridger Transactions)
  • Plugin Name: You should set the name of your plugin on the first line ( === bridgerpay-woocommerce === )
The official readme.txt is a good inspiration

bridgerpay-woocommerce/bridgerpay-woocommerce.php 77% from 13 tests

This is the main PHP file of "BridgerPay Woocommerce" version 1.2.0, 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:
  • Description: Please keep the plugin description shorter than 140 characters (currently 164 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,192 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6260921,051
JavaScript32517106
CSS11035

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity36.50
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods79
▷ Static methods00.00%
▷ Public methods6784.81%
▷ Protected methods1215.19%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected