77% woocommerce-xml-csv-product-import

Code Review | Import Products from any XML or CSV to WooCommerce

WordPress plugin Import Products from any XML or CSV to WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: woocommerce-xml-c...
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: Jun 21, 2013
  • Latest release: Aug 9, 2023
  • Number of updates: 134
  • Update frequency: every 27.6 days
  • Top authors: soflyy (100%)

Code review

54 tests

User reviews

227 reviews

Install metrics

30,000+ active /1,003,260 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.00MB] [CPU: ▲6.83ms] Passed 4 tests

Analyzing server-side resources used by Import Products from any XML or CSV to WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.45 ▲0.9951.82 ▲4.53
Dashboard /wp-admin4.30 ▲1.0064.11 ▲7.85
Posts /wp-admin/edit.php4.42 ▲1.0654.92 ▲7.75
Add New Post /wp-admin/post-new.php6.88 ▲1.00103.98 ▲7.20
Media Library /wp-admin/upload.php4.23 ▲1.0051.69 ▲14.88

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 132 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Import Products from any XML or CSV to WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲10213.55 ▼0.754.94 ▲3.0340.08 ▼6.55
Dashboard /wp-admin2,244 ▲444.86 ▼1.02115.73 ▼3.9746.37 ▼2.07
Posts /wp-admin/edit.php2,124 ▲212.14 ▲0.1438.34 ▼0.8336.83 ▼0.70
Add New Post /wp-admin/post-new.php1,572 ▲2723.31 ▲0.20653.45 ▲42.9354.68 ▼4.57
Media Library /wp-admin/upload.php1,423 ▲234.31 ▲0.05101.52 ▼2.4850.15 ▲4.28

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/confirm.php
  • 97× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/confirm.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'wpai_woocommerce_add_on\\libraries\\importer\\ImportBase' not found in wp-content/plugins/woocommerce-xml-csv-product-import/libraries/importer/products/ImportProductBase.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/shop_order/_tabs/_order_item_taxes.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/shop_order/_tabs/_order_payment.php:8
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/shop_order/_tabs/_order_item_taxes.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'wpai_woocommerce_add_on\\libraries\\importer\\ImportBase' not found in wp-content/plugins/woocommerce-xml-csv-product-import/libraries/importer/products/ImportProductBase.php:13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-xml-csv-product-import/plugin.php on line 12
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/confirm.php on line 5
    • > PHP Notice
      Undefined variable: isWizard in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/options/_reimport_options.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-xml-csv-product-import/views/admin/import/shop_order/_tabs/_order_billing.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (The WooCommerce add-on.)
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
The official readme.txt is a good inspiration

woocommerce-xml-csv-product-import/plugin.php 85% from 13 tests

"Import Products from any XML or CSV to WooCommerce" version 1.5.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 193 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-xml-csv-product-import.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin13,257 lines of code in 113 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,1092,1509,217
PO File31,3442,4812,706
CSS36140742
JavaScript38918592

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.59
Average class complexity21.12
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces3
Interfaces5
Traits0
Classes36
▷ Abstract classes1233.33%
▷ Concrete classes2466.67%
▷ Final classes28.33%
Methods284
▷ Static methods113.87%
▷ Public methods26191.90%
▷ Protected methods196.69%
▷ Private methods41.41%
Functions35
▷ Named functions3291.43%
▷ Anonymous functions38.57%
Constants24
▷ Global constants520.83%
▷ Class constants1979.17%
▷ Public constants19100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.27MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/img/data-example-1.png21.83KB6.24KB▼ 71.41%
static/img/data-example-3.png23.26KB6.40KB▼ 72.47%
static/img/left_btn.png1.14KB0.22KB▼ 80.50%
screenshot-1.png179.10KB49.31KB▼ 72.47%
static/img/data-example-4.png19.69KB5.24KB▼ 73.41%