79% woocommerce-country-based-payments

Code Review | Country Based Payments for WooCommerce

WordPress plugin Country Based Payments for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: woocommerce-count...
  • Plugin version: 1.4.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 23, 2015
  • Latest release: Jul 11, 2023
  • Number of updates: 73
  • Update frequency: every 40.3 days
  • Top authors: ivan_paulin (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

5,000+ active /59,857 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.97MB] [CPU: ▲22.65ms] Passed 4 tests

A check of server-side resources used by Country Based Payments for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.89 ▲5.4370.02 ▲32.39
Dashboard /wp-admin8.91 ▲5.6168.38 ▲21.43
Posts /wp-admin/edit.php8.91 ▲5.5569.90 ▲23.05
Add New Post /wp-admin/post-new.php9.19 ▲3.29104.71 ▲13.71
Media Library /wp-admin/upload.php8.91 ▲5.6870.02 ▲34.55
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9158.72

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 231 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
fs_debug_mode
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

Country Based Payments for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.34 ▼0.031.81 ▲0.0931.13 ▼13.62
Dashboard /wp-admin2,209 ▲325.53 ▼0.0782.05 ▼24.6440.47 ▼3.64
Posts /wp-admin/edit.php2,118 ▲151.99 ▲0.0235.78 ▼6.1036.43 ▲6.86
Add New Post /wp-admin/post-new.php1,531 ▼423.16 ▲5.01692.98 ▲24.9059.36 ▼7.66
Media Library /wp-admin/upload.php1,417 ▲204.23 ▼0.1998.49 ▼9.7543.90 ▼4.50
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0541.6925.3426.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/woocommerce-country-based-payments/includes/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_theysaidso_widget
    • fs_debug_mode
    • widget_recent-comments
    • fs_accounts
    • theysaidso_admin_options
    • can_compress_scripts
    • fs_active_plugins
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
Congratulations! This plugin passed the SRP test

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: countries, payment gateway, woocommerce, country payment, payment gateways...

woocommerce-country-based-payments/woocommerce-country-based-payments.php 85% from 13 tests

The entry point to "Country Based Payments for WooCommerce" version 1.4.4.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.0")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin48,712 lines of code in 182 files:
LanguageFilesBlank linesComment linesLines of code
PHP1218,03517,36333,595
PO File105,5506,66712,010
Sass28399772,515
JavaScript45499301
Markdown2820239
JSON20037
CSS150015

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity89.78
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes00.00%
Methods1,270
▷ Static methods19715.51%
▷ Public methods88169.37%
▷ Protected methods171.34%
▷ Private methods37229.29%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/freemius/assets/img/woocommerce-country-based-payments.png9.16KB5.26KB▼ 42.58%
includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%