84% ni-daily-sales-report-for-woocommerce

Code Review | Ni Daily Sales Report For Woocommerce

WordPress plugin Ni Daily Sales Report For Woocommerce scored 84% from 54 tests.

About plugin

  • Plugin page: ni-daily-sales-re...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 7, 2020
  • Latest release: Feb 19, 2023
  • Number of updates: 12
  • Update frequency: every 87.4 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 632 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.87ms] Passed 4 tests

Server-side resources used by Ni Daily Sales Report For Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0339.67 ▼2.00
Dashboard /wp-admin3.34 ▲0.0445.72 ▼5.60
Posts /wp-admin/edit.php3.40 ▲0.0448.32 ▲1.60
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.38 ▲1.49
Media Library /wp-admin/upload.php3.27 ▲0.0333.87 ▼1.35
Daily Sales Report /wp-admin/admin.php?page=nidsrfw-daily-sales-report3.3331.96
Dashboard /wp-admin/admin.php?page=nidsrfw-dashboard3.5331.80

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
recovery_mode_email_last_sent
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Ni Daily Sales Report For Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6613.19 ▼1.611.77 ▼0.4741.73 ▼7.13
Dashboard /wp-admin2,229 ▲384.84 ▼0.21114.52 ▲4.6145.12 ▲1.42
Posts /wp-admin/edit.php2,112 ▲232.01 ▼0.0439.49 ▲3.8733.91 ▼2.32
Add New Post /wp-admin/post-new.php1,547 ▲1223.04 ▼0.05603.71 ▼4.1848.45 ▲0.94
Media Library /wp-admin/upload.php1,405 ▲204.24 ▲0.0399.77 ▼4.7644.23 ▼1.96
Daily Sales Report /wp-admin/admin.php?page=nidsrfw-daily-sales-report9432.3136.3465.92
Dashboard /wp-admin/admin.php?page=nidsrfw-dashboard1,3802.2017.2058.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=nidsrfw-dashboard
    • > Error in wp-content/plugins/ni-daily-sales-report-for-woocommerce/includes/nidsrfw-dashboard.php+267
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-daily-sales-report-for-woocommerce/includes/nidsrfw-dashboard.php:267
    Stack trace:
    #0 wp-content/plugins/ni-daily-sales-report-for-woocommerce/includes/ni-daily-sales-report-for-woocommerce-init.php(47): NiDSRFW_Dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): Ni_Daily_Sales_Report_For_Woocommerce_Init->add_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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Search sales daliy sales report), #2 (Sales summary)
You can look at the official readme.txt

ni-daily-sales-report-for-woocommerce/ni-daily-sales-report-for-woocommerce.php Passed 13 tests

The main PHP file in "Ni Daily Sales Report For Woocommerce" ver. 1.0.8 adds more information about the plugin and also serves as the entry point for this plugin
88 characters long description:
Ni Daily Sales Report for Woocommerce provides the sales analysis for any sales periods.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin8,261 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS4108913,912
SVG2002,678
PHP4306821,565
JavaScript8411106

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity21.25
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/lib/images/ui-icons_444444_256x240.png3.19KB3.49KB0.00%
screenshot-1.png6.30KB4.01KB▼ 36.37%
screenshot-2.png17.55KB10.34KB▼ 41.08%