10% exchange-addon-product-importer

Code Review | iThemes Exchange - Product Importer

WordPress plugin iThemes Exchange - Product Importer scored 10% from 54 tests.

About plugin

  • Plugin page: exchange-addon-pr...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.2-5.0
  • WordPress version: 6.3.1
  • First release: Aug 17, 2014
  • Latest release: Dec 10, 2018
  • Number of updates: 8
  • Update frequency: every 197.4 days
  • Top authors: visser (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,991 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/exchange-addon-product-importer/includes/functions.php+282
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.48ms] Passed 4 tests

Analyzing server-side resources used by iThemes Exchange - Product Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.45 ▲0.75
Dashboard /wp-admin3.31 ▲0.0047.06 ▼5.01
Posts /wp-admin/edit.php3.36 ▲0.0047.22 ▼4.17
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.09 ▲3.15
Media Library /wp-admin/upload.php3.23 ▲0.0037.65 ▲2.52

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

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

Browser metrics Passed 4 tests

A check of browser resources used by iThemes Exchange - Product Importer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.74 ▲0.371.96 ▲0.2144.22 ▲3.13
Dashboard /wp-admin2,206 ▲185.84 ▼0.0199.06 ▼0.6837.69 ▼0.87
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0234.31 ▼5.4038.97 ▲4.54
Add New Post /wp-admin/post-new.php1,535 ▲117.84 ▼5.37628.18 ▼95.3752.18 ▼8.45
Media Library /wp-admin/upload.php1,391 ▲64.20 ▼0.1395.24 ▼4.7040.12 ▼4.93

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 21× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'ITE_PI_PATHincludes/categories.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/exchange-addon-product-importer/includes/functions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/exchange-addon-product-importer/includes/common-dashboard_widgets.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function it_exchange_product_importer_finish_message() in wp-content/plugins/exchange-addon-product-importer/templates/admin/import_finish.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/exchange-addon-product-importer/templates/admin/tabs-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/exchange-addon-product-importer/includes/common.php:14
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/exchange-addon-product-importer/includes/functions.php on line 282
    • > PHP Warning
      include_once(ITE_PI_PATHincludes/tags.php): failed to open stream: No such file or directory in wp-content/plugins/exchange-addon-product-importer/includes/functions.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/exchange-addon-product-importer/templates/admin/tabs-overview.php:3
    • > PHP Warning
      include_once(ITE_PI_PATHincludes/categories.php): failed to open stream: No such file or directory in wp-content/plugins/exchange-addon-product-importer/includes/functions.php on line 3
    • > PHP Warning
      Use of undefined constant ITE_PI_PATH - assumed 'ITE_PI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/exchange-addon-product-importer/includes/functions.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Product Importer is an iThemes Exchange compatible Addon), #2 (From the Import screen you can upload CSV files for import), #3 (Link CSV columns to Exchange Product fields and review the Import Options), #4 (Watch as new Products are populated within your iThemes Exchange store), #5 (A final review report includes skipped Products with reasons and a detailed import log for re-import)
The official readme.txt might help

exchange-addon-product-importer/product-importer.php 92% from 13 tests

The main PHP script in "iThemes Exchange - Product Importer" version 1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("exchange-addon-product-importer.php" instead of "product-importer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin9,968 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,8131,3327,041
PHP184922682,706
CSS11632221

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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%
Functions65
▷ Named functions65100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/product-importer50px.png2.77KB1.84KB▼ 33.37%