84% payment-gateway-by-country-or-city-for-woocommerce

Code Review | Payment Gateway by county or city for Woocommerce

WordPress plugin Payment Gateway by county or city for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: payment-gateway-b...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.2.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2019
  • Latest release: Sep 10, 2019
  • Number of updates: 9
  • Update frequency: every 10.9 days
  • Top authors: primatree (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.55ms] Passed 4 tests

This is a short check of server-side resources used by Payment Gateway by county or city for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1044.05 ▲2.46
Dashboard /wp-admin3.40 ▲0.1053.97 ▲1.14
Posts /wp-admin/edit.php3.45 ▲0.0947.32 ▼4.53
Add New Post /wp-admin/post-new.php5.98 ▲0.0995.62 ▼0.70
Media Library /wp-admin/upload.php3.32 ▲0.0942.06 ▲1.90

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: 1 new table, 6 new options
New tables
wp_ptwpgbcc
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Payment Gateway by county or city for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.13 ▼0.431.72 ▼0.0643.65 ▼1.68
Dashboard /wp-admin2,195 ▲155.64 ▼0.0293.04 ▲2.1042.87 ▲0.61
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0334.86 ▼6.8932.83 ▼3.50
Add New Post /wp-admin/post-new.php1,526 ▼1223.05 ▼0.03675.21 ▼21.6354.58 ▼15.05
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.00112.32 ▲7.6646.27 ▼0.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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 following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payment-gateway-by-country-or-city-for-woocommerce/ptwpgbcc.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: country payment, gateway, address, city payment, woo...

payment-gateway-by-country-or-city-for-woocommerce/ptwpgbcc.php 85% from 13 tests

The main PHP script in "Payment Gateway by county or city for Woocommerce" version 1.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("payment-gateway-by-country-or-city-for-woocommerce.php" instead of "ptwpgbcc.php")

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
Good job! No executable or dangerous file extensions detected540 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP216541540

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.43
Average class complexity96.00
▷ Minimum class complexity96.00
▷ Maximum class complexity96.00
Average method complexity11.56
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin