84% product-sales-report-for-woocommerce

Code Review | Product Sales Report for WooCommerce

WordPress plugin Product Sales Report for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: product-sales-rep...
  • Plugin version: 1.5.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2.0
  • WordPress version: 6.3.1
  • First release: Jun 25, 2015
  • Latest release: May 9, 2023
  • Number of updates: 93
  • Update frequency: every 30.9 days
  • Top authors: hearken (88.17%)annaqq (7.53%)aspengrovestudios (6.45%)

Code review

54 tests

User reviews

54 reviews

Install metrics

9,000+ active / 110,586 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.01MB] [CPU: ▼7.07ms] Passed 4 tests

Server-side resources used by Product Sales Report for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.86 ▲1.69
Dashboard /wp-admin3.31 ▲0.0144.16 ▼4.52
Posts /wp-admin/edit.php3.36 ▲0.0145.42 ▼5.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.34 ▼18.58
Media Library /wp-admin/upload.php3.23 ▲0.0135.31 ▲0.19

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Product Sales Report for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.24 ▼1.141.75 ▼0.1646.98 ▲0.80
Dashboard /wp-admin2,209 ▲185.90 ▼0.0096.48 ▼7.5037.78 ▼0.11
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0233.77 ▼7.4333.46 ▼2.10
Add New Post /wp-admin/post-new.php1,514 ▼817.54 ▼5.69675.61 ▲65.2155.90 ▼6.67
Media Library /wp-admin/upload.php1,388 ▲34.26 ▲0.04103.65 ▲6.0944.58 ▼0.14

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_theme_textdomain() in wp-content/plugins/product-sales-report-for-woocommerce/hm-product-sales-report.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: You can look at the official readme.txt

product-sales-report-for-woocommerce/hm-product-sales-report.php 92% from 13 tests

The principal PHP file in "Product Sales Report for WooCommerce" v. 1.5.6 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 ("product-sales-report-for-woocommerce.php" instead of "hm-product-sales-report.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
Good job! No executable or dangerous file extensions detected2,971 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP42181041,173
CSS37233881
JavaScript3153109881
SVG60236

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity43.00
▷ Minimum class complexity11.00
▷ Maximum class complexity75.00
Average method complexity17.80
▷ Minimum method complexity4.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods5
▷ Static methods480.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/scheduled-email-reports.png61.36KB31.50KB▼ 48.67%
images/frontend-report-for-woocommerce.png34.89KB36.29KB0.00%
images/product_sales_report_pro.png43.02KB31.27KB▼ 27.31%