84% woocommerce-sales-by-country

Code Review | WooCommerce Sales by Country

WordPress plugin WooCommerce Sales by Country scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-sales...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2.3
  • WordPress version: 6.3.1
  • First release: Sep 25, 2013
  • Latest release: Jul 29, 2015
  • Number of updates: 15
  • Update frequency: every 44.9 days
  • Top authors: mitcmt (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /5,455 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.58ms] Passed 4 tests

A check of server-side resources used by WooCommerce Sales by Country
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0138.62 ▼5.09
Dashboard /wp-admin3.31 ▲0.0042.05 ▼5.90
Posts /wp-admin/edit.php3.36 ▲0.0047.69 ▲0.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.65 ▼9.37
Media Library /wp-admin/upload.php3.23 ▲0.0035.06 ▼1.95

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

WooCommerce Sales by Country: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.31 ▼1.061.73 ▼0.2341.41 ▼3.23
Dashboard /wp-admin2,206 ▲184.83 ▼0.16111.63 ▼7.5140.24 ▼7.86
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0339.70 ▼0.3934.19 ▼0.69
Add New Post /wp-admin/post-new.php1,529 ▲918.28 ▼4.98601.91 ▼62.3054.99 ▲2.54
Media Library /wp-admin/upload.php1,388 ▼04.17 ▼0.0196.19 ▼8.2242.32 ▼0.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-sales-by-country/sales-by-country.php on line 33
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-sales-by-country/sales-by-country.php on line 33
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-sales-by-country/sales-by-country.php on line 33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: sales, report, woocommerce, country

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

The principal PHP file in "WooCommerce Sales by Country" v. 1.5 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-sales-by-country.php" instead of "sales-by-country.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected148 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP251104128
JavaScript10020

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin