84% woocommerce-sales-by-location-report

Code Review | WooCommerce Sales By Location Report

WordPress plugin WooCommerce Sales By Location Report scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-sales...
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8.1
  • WordPress version: 6.3.1
  • First release: Oct 21, 2014
  • Latest release: Aug 21, 2017
  • Number of updates: 22
  • Update frequency: every 47.1 days
  • Top authors: chuckmac (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /8,717 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.94ms] Passed 4 tests

A check of server-side resources used by WooCommerce Sales By Location Report
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.48 ▲0.38
Dashboard /wp-admin3.31 ▼0.0445.95 ▼15.83
Posts /wp-admin/edit.php3.36 ▲0.0042.01 ▼5.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.16 ▼21.33
Media Library /wp-admin/upload.php3.23 ▲0.0034.00 ▼0.63

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Sales By Location Report
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.151.73 ▼0.0344.11 ▲1.26
Dashboard /wp-admin2,209 ▲244.88 ▼1.01114.91 ▲16.7542.54 ▼1.69
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0334.49 ▼3.3634.03 ▼1.36
Add New Post /wp-admin/post-new.php1,529 ▲118.35 ▲0.22584.27 ▼36.8862.22 ▲12.87
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0393.62 ▼11.1540.26 ▼0.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Admin_Report' not found in wp-content/plugins/woocommerce-sales-by-location-report/classes/class-wc-report-sales-by-location.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: reporting, woocommerce, extension, analytics

woocommerce-sales-by-location-report/woocommerce-location-report.php 85% from 13 tests

The primary PHP file in "WooCommerce Sales By Location Report" version 1.3.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-sales-by-location-report.php" instead of "woocommerce-location-report.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

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
Success! There were no dangerous files found in this plugin453 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP2114143325
CSS1220113
Markdown18012
JavaScript2003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.00
▷ Minimum class complexity5.00
▷ Maximum class complexity27.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods531.25%
▷ Public methods1593.75%
▷ Protected methods00.00%
▷ Private methods16.25%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected