67% jc-importer

Code Review | Import WP – Export and Import CSV and XML files to WordPress

WordPress plugin Import WP – Export and Import CSV and XML files to WordPress scored67%from 54 tests.

About plugin

  • Plugin page: jc-importer
  • Plugin version: 2.11.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 13, 2014
  • Latest release: Dec 3, 2023
  • Number of updates: 172
  • Update frequency: every 19.6 days
  • Top authors: jcollings (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

4,000+ active /131,299 total downloads

Benchmarks

Plugin footprint 65% from 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.85MB] [CPU: ▲2.51ms] Passed 4 tests

Server-side resources used by Import WP – Export and Import CSV and XML files to WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8643.92 ▲4.97
Dashboard /wp-admin4.16 ▲0.8555.27 ▲1.47
Posts /wp-admin/edit.php4.21 ▲0.8553.13 ▲4.65
Add New Post /wp-admin/post-new.php6.81 ▲0.9298.37 ▼1.07
Media Library /wp-admin/upload.php4.08 ▲0.8540.87 ▲6.01
Import WP /wp-admin/tools.php?page=importwp5.0562.40

Server storage [IO: ▲1.11MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • The plugin illegally modified 1 file (1.05KB) outside of "wp-content/plugins/jc-importer/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/importwp-compatibility.php
Filesystem: 123 new files
Database: 1 new table, 7 new options
New tables
wp_iwp_sessions
New WordPress options
db_upgraded
widget_recent-posts
iwp_muplugin_version
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Import WP – Export and Import CSV and XML files to WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5714.34 ▼0.061.82 ▼0.0342.44 ▼2.60
Dashboard /wp-admin2,196 ▲195.53 ▼0.1187.91 ▼10.3140.57 ▼4.44
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0438.85 ▼1.9234.73 ▲0.15
Add New Post /wp-admin/post-new.php1,529 ▲323.34 ▼0.22583.90 ▼49.1453.05 ▼4.42
Media Library /wp-admin/upload.php1,407 ▲44.23 ▲0.0296.24 ▼0.1140.82 ▼0.01
Import WP /wp-admin/tools.php?page=importwp1,0343.12104.7734.28

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/jc-importer/views/admin.php
  • 53× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Importer\\Template\\PostTemplate' not found in wp-content/plugins/jc-importer/class/Common/Importer/Template/PageTemplate.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Importer\\Parser\\AbstractParser' not found in wp-content/plugins/jc-importer/class/Common/Importer/Parser/CSVParser.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Importer\\File\\AbstractIndexedFile' not found in wp-content/plugins/jc-importer/class/Common/Importer/File/CSVFile.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Addon\\AddonBaseData' not found in wp-content/plugins/jc-importer/class/Common/Addon/AddonBaseContainer.php:5
    • > PHP Fatal error
      Trait 'ImportWP\\Common\\Util\\Singleton' not found in wp-content/plugins/jc-importer/class/Common/Properties/Properties.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Runner\\RunnerState' not found in wp-content/plugins/jc-importer/class/Common/Exporter/State/ExporterState.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/jc-importer/views/tools-card.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Importer\\Template\\Template' not found in wp-content/plugins/jc-importer/class/Common/Importer/Template/UserTemplate.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Exporter\\Mapper\\AbstractMapper' not found in wp-content/plugins/jc-importer/class/Common/Exporter/Mapper/PostMapper.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ImportWP\\Common\\Importer\\Template\\Template' not found in wp-content/plugins/jc-importer/class/Common/Importer/Template/AttachmentTemplate.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

jc-importer/jc-importer.php 92% from 13 tests

This is the main PHP file of "Import WP – Export and Import CSV and XML files to WordPress" version 2.11.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 150 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected15,514 lines of code in 115 files:
LanguageFilesBlank linesComment linesLines of code
PHP1134,0912,69115,499
CSS11014
JavaScript1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.88
▷ Minimum class complexity1.00
▷ Maximum class complexity194.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces30
Interfaces13
Traits1
Classes90
▷ Abstract classes77.78%
▷ Concrete classes8392.22%
▷ Final classes00.00%
Methods932
▷ Static methods464.94%
▷ Public methods89495.92%
▷ Protected methods151.61%
▷ Private methods232.47%
Functions63
▷ Named functions1219.05%
▷ Anonymous functions5180.95%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dist/images/iwp-premium-placeholder.517e8c22.png13.57KB7.08KB▼ 47.83%