89% woo-sales-data-by-product-category

Code Review | WooCommerce Sales Data by Product Category

WordPress plugin WooCommerce Sales Data by Product Category scored89%from 54 tests.

About plugin

  • Plugin page: woo-sales-data-by...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 16, 2019
  • Latest release: Jul 28, 2023
  • Number of updates: 9
  • Update frequency: every 170.4 days
  • Top authors: yasirkhalifa (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /517 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
Installer ran successfully

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

An overview of server-side resources used by WooCommerce Sales Data by Product Category
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.32 ▼10.39
Dashboard /wp-admin3.31 ▼0.0349.49 ▼22.67
Posts /wp-admin/edit.php3.36 ▲0.0147.24 ▼2.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.91 ▼22.27
Media Library /wp-admin/upload.php3.23 ▲0.0138.47 ▼0.56

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Sales Data by Product Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.031.73 ▼0.0644.64 ▲2.80
Dashboard /wp-admin2,198 ▲245.58 ▼0.0992.46 ▼1.0940.34 ▼2.25
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0535.39 ▼1.5035.02 ▼0.52
Add New Post /wp-admin/post-new.php1,538 ▲1018.36 ▼4.72615.56 ▼50.7774.92 ▲15.82
Media Library /wp-admin/upload.php1,397 ▼04.17 ▼0.02103.92 ▲3.9144.59 ▼0.93

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

woo-sales-data-by-product-category/woocommerce-sales-data-by-product-category.php 92% from 13 tests

The main PHP script in "WooCommerce Sales Data by Product Category" version 1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-sales-data-by-product-category.php" instead of "woocommerce-sales-data-by-product-category.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected116 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3010116

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon-128x128.png26.00KB15.22KB▼ 41.45%
(invalid) banner-772x250.png71.85KB0.00KB▼ 100.00%