84% report-for-woocommerce

Code Review | Report For WooCommerce

WordPress plugin Report For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: report-for-woocom...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-4.7.4
  • WordPress version: 6.3.1
  • First release: Jul 12, 2017
  • Latest release: Jul 12, 2017
  • Number of updates: 2
  • Update frequency: every 25.5 days
  • Top authors: woocommercereport (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /589 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Server-side resources used by Report For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.72 ▲1.16
Dashboard /wp-admin3.32 ▲0.0250.24 ▼3.55
Posts /wp-admin/edit.php3.37 ▲0.0154.11 ▼10.92
Add New Post /wp-admin/post-new.php5.90 ▲0.01102.09 ▲2.63
Media Library /wp-admin/upload.php3.24 ▲0.0135.66 ▼2.26
Product Report /wp-admin/admin.php?page=woo-product3.2731.45
Dashboard /wp-admin/admin.php?page=woo-report3.2733.24
Order Report /wp-admin/admin.php?page=woo-order3.2733.86

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
recovery_mode_email_last_sent
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Report For WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.22 ▼0.331.70 ▲0.1037.49 ▼7.20
Dashboard /wp-admin2,222 ▲425.66 ▲0.0291.45 ▼39.2343.35 ▼13.84
Posts /wp-admin/edit.php2,130 ▲302.01 ▼0.0239.12 ▼0.7234.72 ▼5.09
Add New Post /wp-admin/post-new.php1,576 ▲2818.63 ▼4.73655.51 ▲10.3552.76 ▼4.25
Media Library /wp-admin/upload.php1,430 ▲334.19 ▼0.1094.85 ▼12.5543.73 ▼0.74
Product Report /wp-admin/admin.php?page=woo-product8011.4811.9127.71
Dashboard /wp-admin/admin.php?page=woo-report7561.567.0139.40
Order Report /wp-admin/admin.php?page=woo-order7981.4814.3422.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=woo-report
    • > Error in wp-content/plugins/report-for-woocommerce/includes/woo-dashboard.php+93
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/report-for-woocommerce/includes/woo-dashboard.php:93
    Stack trace:
    #0 wp-content/plugins/report-for-woocommerce/includes/woo-dashboard.php(11): Woo_Dashboard->woo_report_sales_by_month()
    #1 wp-content/plugins/report-for-woocommerce/includes/woo-report.php(51): Woo_Dashboard->woo_report()
    #2 wp-includes/class-wp-hook.php(310): Woo_Report->add_menu()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Monthly gross and net sales report), #2 (Order sales report), #3 (Product Sales report)
You can take inspiration from this readme.txt

report-for-woocommerce/report-for-woocommerce.php Passed 13 tests

The main PHP file in "Report For WooCommerce" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
52 characters long description:
WooCommerce order and product analysis sales report.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected600 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP67517508
CSS21269
JavaScript34723

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.17
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.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 Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png14.02KB6.92KB▼ 50.66%
screenshot-3.png29.47KB9.93KB▼ 66.31%
screenshot-1.png11.14KB5.11KB▼ 54.14%