93% simple-woocommerce-csv-loader

Code Review | Ultimate WooCommerce CSV Importer

WordPress plugin Ultimate WooCommerce CSV Importer scored 93% from 54 tests.

About plugin

  • Plugin page: simple-woocommerc...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7
  • WordPress version: 5.9.2
  • First release: Jul 19, 2013
  • Latest release: Mar 17, 2021
  • Number of updates: 44
  • Update frequency: every 63.7 days
  • Top authors: mag_oberon (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active / 38,932 total downloads

Benchmarks

Plugin footprint Passed 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: ▼296.30ms] Passed 4 tests

Analyzing server-side resources used by Ultimate WooCommerce CSV Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0160.40 ▲1.95
Dashboard /wp-admin3.42 ▲0.0137.63 ▼1.89
Posts /wp-admin/edit.php3.65 ▲0.0147.91 ▲7.66
Add New Post /wp-admin/post-new.php6.89 ▼0.0897.15 ▼1,182.24
Media Library /wp-admin/upload.php3.31 ▲0.0126.07 ▼3.02

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Ultimate WooCommerce CSV Importer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,805 ▲8316.01 ▲0.046.03 ▲0.302.09 ▼0.17
Dashboard /wp-admin2,909 ▲516.02 ▼0.06142.86 ▼10.06152.24 ▼11.67
Posts /wp-admin/edit.php2,708 ▲233.24 ▼0.0174.84 ▲9.19183.38 ▼10.26
Add New Post /wp-admin/post-new.php1,674 ▲1320.41 ▲4.10442.47 ▼6.42160.72 ▼21.67
Media Library /wp-admin/upload.php1,715 ▲205.53 ▼0.01170.61 ▲24.77184.51 ▲2.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-woocommerce-csv-loader/admin/CSVLoader.php:334
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-woocommerce-csv-loader/CSVLoaderForWoocommerce.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Screenshots: Screenshot #1 (admin area) image required
The official readme.txt is a good inspiration

simple-woocommerce-csv-loader/CSVLoaderForWoocommerce.php 92% from 13 tests

"Ultimate WooCommerce CSV Importer" version 2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-woocommerce-csv-loader.php" instead of "CSVLoaderForWoocommerce.php")

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
Success! There were no dangerous files found in this plugin538 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25158460
PO File1323378

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity2.00
▷ Minimum method complexity2.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png25.88KB14.72KB▼ 43.12%