10% csv-import

Code Review | CSV Import

WordPress plugin CSV Import scored 10% from 54 tests.

About plugin

  • Plugin page: csv-import
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 5.9.2
  • First release: Dec 15, 2015
  • Latest release: Apr 2, 2020
  • Number of updates: 15
  • Update frequency: every 104.7 days
  • Top authors: smackcoders (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active / 12,423 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+307
    Non-static method SmackCSVImportHelper::sm_activate_function() should not be called statically

Server metrics [RAM: ▲0.08MB] [CPU: ▼280.90ms] Passed 4 tests

An overview of server-side resources used by CSV Import
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.17124.58 ▲64.92
Dashboard /wp-admin3.52 ▲0.1138.87 ▲1.03
Posts /wp-admin/edit.php3.75 ▲0.1147.61 ▲2.44
Add New Post /wp-admin/post-new.php6.99 ▲0.02178.57 ▼1,121.85
Media Library /wp-admin/upload.php3.40 ▲0.1030.65 ▼5.23

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

CSV Import: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,778 ▲2415.91 ▲0.225.72 ▼0.052.30 ▼1.04
Dashboard /wp-admin2,906 ▲486.00 ▼0.21122.65 ▼17.77202.38 ▲35.98
Posts /wp-admin/edit.php2,703 ▲153.10 ▼0.1467.31 ▲3.32142.18 ▼8.61
Add New Post /wp-admin/post-new.php1,671 ▼11016.51 ▼0.40413.73 ▼31.54160.04 ▼25.92
Media Library /wp-admin/upload.php1,714 ▲135.55 ▲0.02126.34 ▼13.86205.03 ▼42.69

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
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 shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/csv-import/SmackCSVParser.php
    • > /wp-content/plugins/csv-import/csv-import.php
    • > /wp-content/plugins/csv-import/sm_ajax_class.php
    • > /wp-content/plugins/csv-import/sm_main_control.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (CSV Upload section.), #2 (Sample WordPress Fields and the CSV Headers list), #3 (Choose the Post type from dropdown.), #4 (Log for the import data.)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

csv-import/csv-import.php 92% from 13 tests

The entry point to "CSV Import" version 2.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected671 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4102122603
JavaScript27767
CSS1051

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity25.33
▷ Minimum class complexity13.00
▷ Maximum class complexity49.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods3296.97%
▷ Protected methods00.00%
▷ Private methods13.03%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
5 PNG files occupy 0.21MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png49.92KB13.87KB▼ 72.21%
screenshot-3.png29.98KB8.03KB▼ 73.22%
screenshot-2.png68.79KB19.27KB▼ 71.98%
images/csv-import.png1.90KB1.47KB▼ 22.83%
screenshot-4.png62.30KB10.26KB▼ 83.53%