83% woocomerce-price-by-country

Code Review | Woocommerce Price by Country

WordPress plugin Woocommerce Price by Country scored83%from 54 tests.

About plugin

  • Plugin page: woocomerce-price-...
  • Plugin version: 0.36
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1+
  • WordPress version: 6.3.1
  • First release: Jan 2, 2014
  • Latest release: Feb 25, 2015
  • Number of updates: 20
  • Update frequency: every 21.1 days
  • Top authors: Sweet Homes (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20+ active /9,918 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼13.53ms] Passed 4 tests

This is a short check of server-side resources used by Woocommerce Price by Country
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.44 ▼0.11
Dashboard /wp-admin3.43 ▲0.0946.05 ▼21.78
Posts /wp-admin/edit.php3.55 ▲0.1946.26 ▼3.08
Add New Post /wp-admin/post-new.php6.01 ▲0.1380.16 ▼29.13
Media Library /wp-admin/upload.php3.36 ▲0.1333.95 ▲1.37

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Price by Country
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.25 ▼0.101.69 ▲0.1141.98 ▲2.67
Dashboard /wp-admin2,205 ▲315.64 ▼0.1581.18 ▼30.4240.85 ▼3.90
Posts /wp-admin/edit.php2,111 ▲111.97 ▼0.0435.05 ▼2.6532.42 ▼4.65
Add New Post /wp-admin/post-new.php1,533 ▼423.43 ▲5.33576.09 ▼37.3664.42 ▼6.13
Media Library /wp-admin/upload.php1,407 ▲74.15 ▲0.0294.57 ▼1.5341.79 ▼0.42

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

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
Even though no errors were found, 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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocomerce-price-by-country/woocommerce-price-by-country.php:879

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

woocomerce-price-by-country/woocommerce-price-by-country.php 92% from 13 tests

This is the main PHP file of "Woocommerce Price by Country" version 0.36, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocomerce-price-by-country.php" instead of "woocommerce-price-by-country.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
There were no executable files found in this plugin1,099 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP25141161,012
JavaScript4191280
XML1007

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity50.33
▷ Minimum class complexity1.00
▷ Maximum class complexity126.00
Average method complexity6.29
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
sweethomes.png1.16KB0.33KB▼ 71.85%