89% payment-gateways-by-user-roles-for-woocommerce

Code Review | Payment Gateways by User Roles for WooCommerce

WordPress plugin Payment Gateways by User Roles for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: payment-gateways-...
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.4
  • WordPress version: 6.3.1
  • First release: May 14, 2018
  • Latest release: Nov 10, 2023
  • Number of updates: 33
  • Update frequency: every 60.8 days
  • Top authors: Dhruvin (57.58%)algoritmika (45.45%)

Code review

54 tests

User reviews

3 reviews

Install metrics

3,000+ active /18,410 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

This is a short check of server-side resources used by Payment Gateways by User Roles for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.96 ▼3.81
Dashboard /wp-admin3.32 ▼0.0246.39 ▼14.38
Posts /wp-admin/edit.php3.37 ▲0.0245.50 ▼1.47
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.34 ▼12.51
Media Library /wp-admin/upload.php3.24 ▲0.0233.14 ▲1.86

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Payment Gateways by User Roles for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.33 ▲0.271.57 ▼0.1238.08 ▼5.54
Dashboard /wp-admin2,195 ▲185.51 ▼0.0190.91 ▼13.5640.77 ▼2.18
Posts /wp-admin/edit.php2,097 ▼31.97 ▼0.0638.78 ▲2.2035.12 ▲1.72
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▲0.34648.48 ▼18.0247.49 ▼6.99
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0799.93 ▼0.9645.36 ▲4.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
You can take inspiration from this readme.txt

payment-gateways-by-user-roles-for-woocommerce/payment-gateways-by-user-roles-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Payment Gateways by User Roles for WooCommerce" v. 1.3.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("4.4" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected340 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP567291340

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity6.80
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods25
▷ Static methods14.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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