93% woocommerce-product-importer

Code Review | WooCommerce - Product Importer

WordPress plugin WooCommerce - Product Importer scored 93% from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-5.8.2
  • WordPress version: 5.8.1
  • First release: Aug 18, 2014
  • Latest release: Nov 16, 2021
  • Number of updates: 42
  • Update frequency: every 63.3 days
  • Top authors: visser (54.76%)byronkeet (47.62%)

Code review

54 tests

User reviews

23 reviews

Install metrics

2,000+ active / 59,888 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼144.29ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce - Product Importer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0043.20 ▲7.95
Dashboard /wp-admin3.42 ▲0.3747.55 ▼3.06
Posts /wp-admin/edit.php3.12 ▲0.0242.88 ▼4.11
Add New Post /wp-admin/post-new.php5.43 ▼0.0086.03 ▼565.89
Media Library /wp-admin/upload.php3.01 ▲0.0130.64 ▼4.10

Server storage [IO: ▲0.50MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce - Product Importer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲16713.86 ▼1.7010.07 ▼0.3845.87 ▼4.89
Dashboard /wp-admin3,140 ▲2095.99 ▲0.06145.36 ▼5.22101.11 ▼4.58
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0263.66 ▼1.9482.56 ▼2.34
Add New Post /wp-admin/post-new.php1,683 ▼1,97018.87 ▼0.09372.97 ▼104.05119.05 ▲16.61
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.02164.63 ▲17.33122.88 ▲7.33

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 21× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/woocommerce-product-importer/common/common.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-product-importer/templates/admin/tabs-tools.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-importer/includes/common-dashboard_widgets.php:26
    • > PHP Warning
      include_once(WOO_PI_PATHincludes/tag.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-product-importer/includes/functions.php on line 4
    • > PHP Warning
      include_once(): Failed opening 'WOO_PI_PATHincludes/tag.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-product-importer/includes/functions.php on line 4
    • > PHP Warning
      Use of undefined constant WOO_PI_PATH - assumed 'WOO_PI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-product-importer/includes/functions.php on line 4
    • > PHP Warning
      include_once(WOO_PI_PATHincludes/category.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-product-importer/includes/functions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-product-importer/templates/admin/import_save.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woo_pi_admin_active_tab() in wp-content/plugins/woocommerce-product-importer/templates/admin/tabs.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woocommerce-product-importer/includes/admin.php:95

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)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes: Please take inspiration from this readme.txt

woocommerce-product-importer/product-importer.php 77% from 13 tests

The main file in "WooCommerce - Product Importer" v. 1.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("2.9.2" instead of "2.3")
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-product-importer.php" instead of "product-importer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected11,275 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,8191,3357,074
PHP175913433,874
CSS21833327

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods9100.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions76
▷ Named functions76100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
There were not PNG files found in your plugin