89% payment-gateways-per-product-categories-for-woocommerce

Code Review | Payment Methods by Product & Country for WooCommerce

WordPress plugin Payment Methods by Product & Country for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: payment-gateways-...
  • Plugin version: 1.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Aug 29, 2017
  • Latest release: Nov 9, 2023
  • Number of updates: 56
  • Update frequency: every 40.4 days
  • Top authors: omardabbas (69.64%)algoritmika (23.21%)wpcodefactory (10.71%)

Code review

54 tests

User reviews

17 reviews

Install metrics

6,000+ active /77,957 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 successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Payment Methods by Product & Country for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.66 ▼1.72
Dashboard /wp-admin3.33 ▼0.0247.46 ▼13.75
Posts /wp-admin/edit.php3.38 ▲0.0245.72 ▼1.16
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.21 ▼8.99
Media Library /wp-admin/upload.php3.25 ▲0.0232.14 ▼0.48

Server storage [IO: ▲0.07MB] [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: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Methods by Product & Country for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.06 ▼0.211.78 ▲0.0843.71 ▼0.44
Dashboard /wp-admin2,198 ▲245.60 ▼0.0289.00 ▼11.4641.08 ▼5.58
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0036.06 ▼1.7534.61 ▲0.82
Add New Post /wp-admin/post-new.php1,526 ▼023.49 ▼0.13642.85 ▼20.7053.84 ▲1.25
Media Library /wp-admin/upload.php1,397 ▼64.22 ▼0.0198.89 ▼0.8840.18 ▼1.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Main Page), #2 (Specify settings per category), #3 (Specify settings per tag)
You can take inspiration from this readme.txt

payment-gateways-per-product-categories-for-woocommerce/payment-gateways-per-product-for-woocommerce.php 92% from 13 tests

The main PHP script in "Payment Methods by Product & Country for WooCommerce" version 1.7.8 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("payment-gateways-per-product-categories-for-woocommerce.php" instead of "payment-gateways-per-product-for-woocommerce.php")

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
No dangerous file extensions were detected930 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9140356928
INI1002

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.61
Average class complexity14.33
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods43
▷ Static methods12.33%
▷ Public methods43100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected