84% ni-woocommerce-sales-report-email

Code Review | Ni WooCommerce Sales Report Email

WordPress plugin Ni WooCommerce Sales Report Email scored84%from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-sa...
  • Plugin version: 3.1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.1
  • WordPress version: 6.3.1
  • First release: Dec 24, 2015
  • Latest release: May 24, 2023
  • Number of updates: 59
  • Update frequency: every 45.9 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /6,409 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.14MB] [CPU: ▼4.98ms] Passed 4 tests

Server-side resources used by Ni WooCommerce Sales Report Email
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1541.38 ▲2.92
Dashboard /wp-admin3.45 ▲0.1146.58 ▼12.11
Posts /wp-admin/edit.php3.57 ▲0.2148.49 ▲3.05
Add New Post /wp-admin/post-new.php6.03 ▲0.1590.22 ▼10.31
Media Library /wp-admin/upload.php3.38 ▲0.1535.54 ▼0.40
Setting /wp-admin/admin.php?page=niwooer-setting3.4031.13
Dashboard /wp-admin/admin.php?page=ni-email-dashboard3.6331.19
Order List /wp-admin/admin.php?page=ni-email-order-list3.4530.98
Add-ons /wp-admin/admin.php?page=ni-add-ons-email-report3.3732.20

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 40 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ni WooCommerce Sales Report Email
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲5913.34 ▼1.024.35 ▲2.4543.51 ▲3.35
Dashboard /wp-admin2,236 ▲505.83 ▼0.0395.99 ▼9.1469.58 ▲26.03
Posts /wp-admin/edit.php2,122 ▲362.06 ▲0.0535.72 ▲0.8435.07 ▲1.30
Add New Post /wp-admin/post-new.php1,548 ▲1418.11 ▼4.91630.64 ▼14.5564.70 ▲4.46
Media Library /wp-admin/upload.php1,412 ▲304.22 ▲0.01103.53 ▲4.3046.39 ▲3.74
Setting /wp-admin/admin.php?page=niwooer-setting9912.0514.1950.38
Dashboard /wp-admin/admin.php?page=ni-email-dashboard1,3572.1815.4584.51
Order List /wp-admin/admin.php?page=ni-email-order-list8872.1217.7432.00
Add-ons /wp-admin/admin.php?page=ni-add-ons-email-report1,0781.9111.3138.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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=ni-email-dashboard
    • > Error in wp-content/plugins/ni-woocommerce-sales-report-email/include/ni-email-dashboard.php+249
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-woocommerce-sales-report-email/include/ni-email-dashboard.php:249
    Stack trace:
    #0 wp-content/plugins/ni-woocommerce-sales-report-email/include/ni-init.php(117): ni_email_dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): ni_email_report_init->add_menu_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Summary Report.), #2 (Recent Order List), #3 (Order Status Report.), #4 (Payment Gateway Report .), #5 (Sales Order List.), #6 (Email Summary Report.), #7 (Email Settings option.), #8 (Total product sold.), #9 (Send to multiple email comma separated.)
The official readme.txt is a good inspiration

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

The main PHP file in "Ni WooCommerce Sales Report Email" ver. 3.1.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 304 characters long)

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
Good job! No executable or dangerous file extensions detected10,003 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
CSS51061093,919
PHP95221383,249
SVG1002,671
JavaScript72334155
HTML1109

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity27.67
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods93
▷ Static methods11.08%
▷ Public methods93100.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

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.41MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png230.40KB112.94KB▼ 50.98%
screenshot-2.png31.84KB19.84KB▼ 37.67%
screenshot-5.png24.82KB13.20KB▼ 46.82%
include/images/icon.png1.05KB1.20KB0.00%
screenshot-4.png27.64KB14.33KB▼ 48.18%