83% woo-product-country-base-restrictions

Code Review | Country Based Restrictions for WooCommerce

WordPress plugin Country Based Restrictions for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-product-count...
  • Plugin version: 3.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 4, 2018
  • Latest release: Nov 9, 2023
  • Number of updates: 109
  • Update frequency: every 17.1 days
  • Top authors: zorem (96.33%)kuldipzorem (4.59%)

Code review

54 tests

User reviews

46 reviews

Install metrics

5,000+ active /80,311 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼17.02ms] Passed 4 tests

This is a short check of server-side resources used by Country Based Restrictions for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.48 ▼6.26
Dashboard /wp-admin3.20 ▼0.1030.87 ▼17.08
Posts /wp-admin/edit.php3.27 ▼0.0934.69 ▼16.88
Add New Post /wp-admin/post-new.php5.44 ▼0.4571.85 ▼27.87
Media Library /wp-admin/upload.php3.21 ▼0.0227.70 ▼5.45

Server storage [IO: ▲0.97MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Country Based Restrictions for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5814.34 ▲0.211.86 ▲0.1038.08 ▼0.21
Dashboard /wp-admin2,203 ▲265.62 ▲0.0689.88 ▲0.6143.58 ▲0.82
Posts /wp-admin/edit.php2,106 ▲61.94 ▼0.0038.94 ▼1.1937.47 ▲0.49
Add New Post /wp-admin/post-new.php1,601 ▲7523.35 ▲0.14639.58 ▲23.4236.92 ▼20.26
Media Library /wp-admin/upload.php1,399 ▲24.19 ▼0.0695.68 ▼5.4541.47 ▼0.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-product-country-base-restrictions/include/views/admin_message_panel.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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 your attention: You can take inspiration from this readme.txt

woo-product-country-base-restrictions/woocommerce-product-country-base-restrictions.php 85% from 13 tests

The principal PHP file in "Country Based Restrictions for WooCommerce" v. 3.5 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.3" instead of "4.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-product-country-base-restrictions.php" instead of "woocommerce-product-country-base-restrictions.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 detected9,171 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
CSS48525,5236,084
PHP92735251,515
PO File63123301,244
JavaScript44418287
SVG20234
XML1007

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity37.17
▷ Minimum class complexity8.00
▷ Maximum class complexity89.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods71
▷ Static methods57.04%
▷ Public methods6997.18%
▷ Protected methods00.00%
▷ Private methods22.82%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
10 PNG files occupy 0.16MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cev-icon.png18.66KB2.33KB▼ 87.50%
assets/images/alp-icon.png26.99KB3.52KB▼ 86.96%
assets/images/cbr-logo.png15.53KB7.99KB▼ 48.56%
assets/images/cbr-icon.png29.03KB4.35KB▼ 85.02%
assets/images/sre-icon.png18.92KB2.65KB▼ 85.98%