84% woocommerce-product-price-based-on-countries

Code Review | Price Based on Country for WooCommerce

WordPress plugin Price Based on Country for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 3.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 21, 2014
  • Latest release: Nov 30, 2023
  • Number of updates: 285
  • Update frequency: every 11.7 days
  • Top authors: oscargare (100%)

Code review

54 tests

User reviews

241 reviews

Install metrics

20,000+ active /909,141 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.92MB] [CPU: ▼1.67ms] Passed 4 tests

An overview of server-side resources used by Price Based on Country for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.18 ▲0.7242.81 ▲0.78
Dashboard /wp-admin4.35 ▲1.0050.22 ▼12.46
Posts /wp-admin/edit.php4.40 ▲1.0450.84 ▲5.54
Add New Post /wp-admin/post-new.php6.87 ▲0.9892.29 ▼0.53
Media Library /wp-admin/upload.php4.21 ▲0.9840.96 ▲8.79

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 119 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
_wcpay_feature_customer_multi_currency
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Price Based on Country for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4014.37 ▲0.231.69 ▲0.0836.07 ▼7.68
Dashboard /wp-admin2,210 ▲335.62 ▼0.0294.11 ▲0.9144.09 ▲3.59
Posts /wp-admin/edit.php2,115 ▲152.01 ▲0.0340.78 ▲1.1037.85 ▲0.77
Add New Post /wp-admin/post-new.php1,538 ▲923.25 ▼0.17670.98 ▲82.7359.89 ▲8.78
Media Library /wp-admin/upload.php1,415 ▲154.18 ▲0.0296.46 ▼3.6042.54 ▼0.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • _wcpay_feature_customer_multi_currency
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WooCommerce\\PayPalCommerce\\ApiClient\\ApiModule' not found in wp-content/plugins/woocommerce-product-price-based-on-countries/includes/integrations/paypal-payments/class-wcpbc-paypal-api-client-module.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% 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
7 plugin tags: dynamic price, dynamic price based country, woocommerce, country-targeted pricing, price by country...

woocommerce-product-price-based-on-countries/woocommerce-product-price-based-on-countries.php 92% from 13 tests

The entry point to "Price Based on Country for WooCommerce" version 3.4.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.8" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin11,574 lines of code in 113 files:
LanguageFilesBlank linesComment linesLines of code
PHP721,9043,7248,216
CSS18242631,247
PO File33734441,163
JavaScript20222212948

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity24.60
▷ Minimum class complexity1.00
▷ Maximum class complexity96.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes00.00%
▷ Concrete classes48100.00%
▷ Final classes12.08%
Methods465
▷ Static methods33371.61%
▷ Public methods34273.55%
▷ Protected methods4910.54%
▷ Private methods7415.91%
Functions44
▷ Named functions3988.64%
▷ Anonymous functions511.36%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin