84% bh-wc-set-gateway-by-url

Code Review | Set WooCommerce Payment Gateway by URL

WordPress plugin Set WooCommerce Payment Gateway by URL scored84%from 54 tests.

About plugin

  • Plugin page: bh-wc-set-gateway...
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-6.0
  • WordPress version: 6.3.1
  • First release: May 14, 2020
  • Latest release: Oct 26, 2022
  • Number of updates: 6
  • Update frequency: every 153.5 days
  • Top authors: brianhenryie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /671 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.71MB] [CPU: ▲2.25ms] Passed 4 tests

Server-side resources used by Set WooCommerce Payment Gateway by URL
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6744.74 ▲3.15
Dashboard /wp-admin4.08 ▲0.7751.57 ▲4.92
Posts /wp-admin/edit.php4.13 ▲0.7753.49 ▲6.84
Add New Post /wp-admin/post-new.php6.60 ▲0.7190.54 ▼5.93
Media Library /wp-admin/upload.php3.94 ▲0.7145.49 ▲11.04
logs /wp-admin/admin.php?page=bh-wc-set-gateway-by-url-logs3.9439.85

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 80 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
bh-wc-set-gateway-by-url-last-logs-view-time
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Set WooCommerce Payment Gateway by URL
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.44 ▲0.091.84 ▲0.0943.73 ▼0.25
Dashboard /wp-admin2,212 ▲325.65 ▼0.0296.71 ▲10.8636.32 ▼4.51
Posts /wp-admin/edit.php2,120 ▲172.07 ▲0.0842.90 ▼0.8041.51 ▲2.62
Add New Post /wp-admin/post-new.php1,546 ▲1617.97 ▼5.34621.58 ▼3.6863.50 ▲7.59
Media Library /wp-admin/upload.php1,417 ▲144.23 ▼0.0198.23 ▲1.8545.00 ▲3.16
logs /wp-admin/admin.php?page=bh-wc-set-gateway-by-url-logs8971.8226.1927.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • bh-wc-set-gateway-by-url-last-logs-view-time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 33× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Trait 'Psr\\Log\\LoggerAwareTrait' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-private-uploads/src/Frontend/class-serve-private-file.php on line 26
    • > PHP Fatal error
      Uncaught Error: Interface 'BrianHenryIE\\WC_Set_Gateway_By_URL\\WP_Logger\\API_Interface' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-logger/src/API/class-api.php:38
    • > PHP Fatal error
      Uncaught Error: Interface 'BrianHenryIE\\WC_Set_Gateway_By_URL\\WP_Logger\\Logger_Settings_Interface' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-logger/src/API/class-logger-settings.php:21
    • > PHP Fatal error
      Uncaught Exception in wp-content/plugins/bh-wc-set-gateway-by-url/bh-wc-set-gateway-by-url.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'BrianHenryIE\\WC_Set_Gateway_By_URL\\WPTRT\\AdminNotices\otices' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-private-uploads/src/Admin/class-admin-notices.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'BrianHenryIE\\WC_Set_Gateway_By_URL\\WPTRT\\AdminNotices\otices' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-logger/src/Admin/class-admin-notices.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'BrianHenryIE\\WC_Set_Gateway_By_URL\\WP_Logger\\API\\API' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-logger/src/API/class-bh-wp-psr-logger.php:26
    • > PHP Fatal error
      Trait 'Psr\\Log\\LoggerAwareTrait' not found in wp-content/plugins/bh-wc-set-gateway-by-url/vendor-prefixed/brianhenryie/bh-wp-private-uploads/src/WP_Includes/class-cli.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed: You can look at the official readme.txt

bh-wc-set-gateway-by-url/bh-wc-set-gateway-by-url.php 92% from 13 tests

This is the main PHP file of "Set WooCommerce Payment Gateway by URL" version 1.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.6.0" instead of "2.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected3,315 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP681,3223,4063,222
JavaScript115749
CSS213827
Markdown14017

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.30
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces22
Interfaces8
Traits4
Classes51
▷ Abstract classes11.96%
▷ Concrete classes5098.04%
▷ Final classes00.00%
Methods282
▷ Static methods51.77%
▷ Public methods23382.62%
▷ Protected methods4817.02%
▷ Private methods10.35%
Functions15
▷ Named functions16.67%
▷ Anonymous functions1493.33%
Constants12
▷ Global constants216.67%
▷ Class constants1083.33%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin