78% ni-country-sales-report-for-woocommerce

Code Review | Country Sales Report For WooCommerce

WordPress plugin Country Sales Report For WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: ni-country-sales-...
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 2, 2021
  • Latest release: Jun 5, 2023
  • Number of updates: 13
  • Update frequency: every 54.2 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /668 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.05MB] [CPU: ▼6.77ms] Passed 4 tests

Server-side resources used by Country Sales Report For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.32 ▼5.40
Dashboard /wp-admin3.36 ▲0.0544.53 ▼3.55
Posts /wp-admin/edit.php3.41 ▲0.0548.77 ▲1.60
Add New Post /wp-admin/post-new.php5.94 ▲0.0578.09 ▼16.12
Media Library /wp-admin/upload.php3.28 ▲0.0533.28 ▼2.00
Country Product Report /wp-admin/admin.php?page=nicsrfwoo-country-product-report3.1024.83
Country Report /wp-admin/admin.php?page=nicsrfwoo-country-report3.1028.23
Dashboard /wp-admin/admin.php?page=nicsrfwoo-dashboard3.1024.70

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Country Sales Report For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.33 ▼0.021.72 ▲0.1043.20 ▼2.06
Dashboard /wp-admin2,225 ▲485.62 ▲0.1184.77 ▼21.3037.03 ▼6.17
Posts /wp-admin/edit.php2,131 ▲312.02 ▲0.0341.83 ▲6.6236.13 ▼0.65
Add New Post /wp-admin/post-new.php1,618 ▲9022.45 ▼0.60684.51 ▲17.4337.06 ▼17.53
Media Library /wp-admin/upload.php1,421 ▲274.20 ▼0.0696.12 ▼0.0744.41 ▲2.62
Country Product Report /wp-admin/admin.php?page=nicsrfwoo-country-product-report550.420.138.96
Country Report /wp-admin/admin.php?page=nicsrfwoo-country-report550.420.118.92
Dashboard /wp-admin/admin.php?page=nicsrfwoo-dashboard550.420.138.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nicsrfwoo-dashboard
    • > Error in wp-content/plugins/ni-country-sales-report-for-woocommerce/includes/nicsrfwoo-init.php+102
    Uncaught Error: Call to undefined function get_woocommerce_currency_symbol() in wp-content/plugins/ni-country-sales-report-for-woocommerce/includes/nicsrfwoo-init.php:102
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): NICSRFWoo_Init->admin_enqueue_scripts()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin-header.php(118): do_action()
    #4 wp-admin/admin.php(239): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

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

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=nicsrfwoo-country-product-report
    • > Network (severe)
    wp-admin/admin.php?page=nicsrfwoo-country-product-report - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=nicsrfwoo-country-report
    • > Network (severe)
    wp-admin/admin.php?page=nicsrfwoo-country-report - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=nicsrfwoo-dashboard
    • > Network (severe)
    wp-admin/admin.php?page=nicsrfwoo-dashboard - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 90% 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:
  • Screenshots: Add images for these screenshots: #1 (Dashboard shows country sale indicator), #2 (Country sales report.), #3 (Country sales bar chart.), #4 (Country sales pie chart.), #5 (Product country and product wise cross tab report.), #6 (Country sales report detail report.)
You can take inspiration from this readme.txt

ni-country-sales-report-for-woocommerce/ni-country-sales-report-for-woocommerce.php 85% from 13 tests

The main file in "Country Sales Report For WooCommerce" v. 1.0.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,583 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP5297291,109
JavaScript6114100427
CSS24647

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity29.00
▷ Minimum class complexity2.00
▷ Maximum class complexity63.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods43
▷ Static methods00.00%
▷ Public methods43100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.32MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png34.42KB10.09KB▼ 70.68%
screenshot-6.png44.65KB13.87KB▼ 68.94%
screenshot-2.png46.41KB13.98KB▼ 69.87%
screenshot-3.png63.81KB14.97KB▼ 76.54%
screenshot-4.png68.03KB17.71KB▼ 73.97%