78% sales-report-for-woocommerce

Code Review | Sales Report for WooCommerce

WordPress plugin Sales Report for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: sales-report-for-...
  • Plugin version: 3.5.7.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 74
  • Update frequency: every 35.1 days
  • Top authors: RazyRx (64.86%)dholovnia (36.49%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /39,517 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.50MB] [CPU: ▲10.14ms] Passed 4 tests

Server-side resources used by Sales Report for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5251.39 ▲11.22
Dashboard /wp-admin4.82 ▲1.4772.94 ▲10.30
Posts /wp-admin/edit.php4.93 ▲1.5770.83 ▲19.80
Add New Post /wp-admin/post-new.php7.40 ▲1.51101.92 ▲3.68
Media Library /wp-admin/upload.php4.74 ▲1.5160.87 ▲15.37

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Sales Report for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲2014.67 ▲0.151.69 ▼0.2138.48 ▼6.84
Dashboard /wp-admin2,200 ▲205.57 ▼0.0984.27 ▼2.2270.41 ▲30.89
Posts /wp-admin/edit.php2,123 ▲201.96 ▼0.0339.46 ▼1.7336.74 ▲2.88
Add New Post /wp-admin/post-new.php1,542 ▲1623.75 ▲0.64742.79 ▲81.0352.66 ▼10.19
Media Library /wp-admin/upload.php1,417 ▲204.22 ▲0.09102.84 ▼6.0572.14 ▲27.93

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • berocket_key_activated_plugins
    • berocket_admin_notices_rate_stars
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/sales-report-for-woocommerce/templates/email.php
    • > /wp-content/plugins/sales-report-for-woocommerce/templates/email_head.php
    • > /wp-content/plugins/sales-report-for-woocommerce/templates/email_foot.php
  • 38× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: html_data in wp-content/plugins/sales-report-for-woocommerce/templates/email.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sales-report-for-woocommerce/berocket/libraries/wpml_compatibility.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sales-report-for-woocommerce/berocket/libraries/popup.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/sales-report-for-woocommerce/includes/paid.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sales-report-for-woocommerce/main.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sales-report-for-woocommerce/templates/send_empty.php:2
    • > PHP Notice
      Undefined variable: date_string in wp-content/plugins/sales-report-for-woocommerce/templates/email_head.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sales-report-for-woocommerce/berocket/libraries/tippy.php:7
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/sales-report-for-woocommerce/templates/email.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sales-report-for-woocommerce/templates/email.php on line 9

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 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (General settings), #2 (Weekly report)
  • Tags: You are using too many tags: 36 tag instead of maximum 10
Please take inspiration from this readme.txt

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

"Sales Report for WooCommerce" version 3.5.7.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sales-report-for-woocommerce.php" instead of "woocommerce-sales-report.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
Success! There were no dangerous files found in this plugin21,555 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP404361,3229,479
CSS142,516799,470
JavaScript749622,068
PO File3221243509
XML10029

PHP code Passed 2 tests

This is a short overview 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.53
Average class complexity52.67
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods377
▷ Static methods14839.26%
▷ Public methods377100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
7 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ad_white_on_orange.png20.67KB15.57KB▼ 24.67%
berocket/assets/images/submenu-icon-a.png0.54KB0.48KB▼ 10.20%
berocket/assets/css/mail.png2.59KB1.92KB▼ 26.02%
berocket/libraries/templates/default.png3.87KB2.63KB▼ 31.94%
berocket/libraries/addons/default.png3.87KB2.63KB▼ 31.94%