90% payment-gateways-by-customer-location-for-woocommerce

Code Review | Payment Gateways by Customer Location for WooCommerce

WordPress plugin Payment Gateways by Customer Location for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: payment-gateways-...
  • Plugin version: 1.5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: May 15, 2018
  • Latest release: Sep 26, 2023
  • Number of updates: 24
  • Update frequency: every 81.7 days
  • Top authors: algoritmika (83.33%)wpcodefactory (20.83%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /4,602 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.65ms] Passed 4 tests

This is a short check of server-side resources used by Payment Gateways by Customer Location for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.61 ▼1.31
Dashboard /wp-admin3.33 ▲0.0247.39 ▼5.35
Posts /wp-admin/edit.php3.38 ▲0.0248.14 ▼1.47
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.00 ▼14.46
Media Library /wp-admin/upload.php3.25 ▲0.0236.24 ▼0.49

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Gateways by Customer Location for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.20 ▼1.481.67 ▼0.4743.20 ▼8.49
Dashboard /wp-admin2,206 ▲184.87 ▼0.04102.02 ▼13.9241.17 ▼4.95
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0233.44 ▼7.1533.62 ▲0.93
Add New Post /wp-admin/post-new.php1,536 ▲323.13 ▼0.13585.59 ▼104.3853.15 ▼11.98
Media Library /wp-admin/upload.php1,382 ▼34.16 ▼0.0393.60 ▼18.0043.18 ▼4.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Payment Gateways by Country.) image required
You can take inspiration from this readme.txt

payment-gateways-by-customer-location-for-woocommerce/payment-gateways-by-customer-location-for-woocommerce.php Passed 13 tests

The principal PHP file in "Payment Gateways by Customer Location for WooCommerce" v. 1.5.4 is loaded by WordPress automatically on each request
106 characters long description:
Set countries, states, cities or postcodes to include/exclude for WooCommerce payment gateways to show up.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,056 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP121134211,047
JavaScript2189

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity7.33
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods32
▷ Static methods13.12%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin