90% product-visibility-by-country-for-woocommerce

Code Review | Product Visibility by Country for WooCommerce

WordPress plugin Product Visibility by Country for WooCommerce scored 90% from 54 tests.

About plugin

  • Plugin page: product-visibilit...
  • Plugin version: 1.4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 31, 2017
  • Latest release: Jul 15, 2023
  • Number of updates: 57
  • Update frequency: every 37.6 days
  • Top authors: algoritmika (59.65%)wpwham (42.11%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 14,241 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

An overview of server-side resources used by Product Visibility by Country for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.80 ▲0.34
Dashboard /wp-admin3.33 ▲0.0349.86 ▲1.49
Posts /wp-admin/edit.php3.38 ▲0.0245.40 ▼3.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.01 ▼7.85
Media Library /wp-admin/upload.php3.25 ▲0.0235.48 ▲2.36

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Product Visibility by Country for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.57 ▼0.833.94 ▲1.8743.13 ▼5.79
Dashboard /wp-admin2,209 ▲184.84 ▼0.13101.37 ▼8.8242.11 ▼3.30
Posts /wp-admin/edit.php2,086 ▼32.02 ▲0.0036.24 ▼3.1333.70 ▼2.05
Add New Post /wp-admin/post-new.php1,542 ▲2818.34 ▲0.88604.79 ▼51.7962.84 ▲5.93
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0694.65 ▼6.6740.70 ▼6.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: woocommerce, visibility, country, woo commerce, product

product-visibility-by-country-for-woocommerce/product-visibility-by-country-for-woocommerce.php 92% from 13 tests

"Product Visibility by Country for WooCommerce" version 1.4.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.4" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected1,371 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP101365421,317
JavaScript19854

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.63
Average class complexity19.67
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods59
▷ Static methods610.17%
▷ Public methods59100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin