89% woo-ip-based-payment-method

Code Review | Woocommerce IP Based Payment Method

WordPress plugin Woocommerce IP Based Payment Method scored89%from 54 tests.

About plugin

  • Plugin page: woo-ip-based-paym...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Jul 6, 2018
  • Latest release: Apr 14, 2022
  • Number of updates: 10
  • Update frequency: every 137.8 days
  • Top authors: kudosta (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /837 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
This plugin's installer ran successfully

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

A check of server-side resources used by Woocommerce IP Based Payment Method
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.48 ▼6.18
Dashboard /wp-admin3.33 ▼0.0248.57 ▼15.68
Posts /wp-admin/edit.php3.38 ▲0.0249.38 ▲3.09
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.81 ▼21.31
Media Library /wp-admin/upload.php3.26 ▲0.0236.88 ▼3.37

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: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce IP Based Payment Method
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.021.72 ▲0.0640.22 ▼0.49
Dashboard /wp-admin2,198 ▲215.64 ▼0.0687.25 ▼3.1738.67 ▼1.51
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0542.44 ▲6.9536.03 ▲1.89
Add New Post /wp-admin/post-new.php1,545 ▼023.35 ▲0.28650.07 ▼30.7457.46 ▲0.80
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0797.82 ▼11.9743.48 ▼4.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

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)
No browser errors were detected

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
5 plugin tags: payment gateway, ip address, payment method, woocommerce, ip restriction

woo-ip-based-payment-method/woocommerce-ipbased-payment-method.php 85% from 13 tests

The main PHP file in "Woocommerce IP Based Payment Method" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-ip-based-payment-method.php" instead of "woocommerce-ipbased-payment-method.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin123 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11946123

PHP code Passed 2 tests

A brief analysis 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.42
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods7100.00%
▷ Public methods7100.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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/Screenshot_1.png23.59KB11.33KB▼ 51.98%