83% csv-import-and-exporter

Code Review | CSV Import and Exporter

WordPress plugin CSV Import and Exporter scored83%from 54 tests.

About plugin

  • Plugin page: csv-import-and-ex...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 1, 2023
  • Latest release: Jun 1, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: kanakogi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /690 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼16.17ms] Passed 4 tests

Analyzing server-side resources used by CSV Import and Exporter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.99 ▼5.29
Dashboard /wp-admin3.34 ▼0.0050.29 ▼19.68
Posts /wp-admin/edit.php3.46 ▲0.1051.61 ▼0.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.87 ▼38.98
Media Library /wp-admin/upload.php3.27 ▲0.0439.64 ▲3.44
CSV Import /wp-admin/tools.php?page=wp-csv-importer3.3936.00
CSV Export /wp-admin/tools.php?page=csv-import-and-exporter3.3136.92

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by CSV Import and Exporter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.41 ▲0.052.06 ▼0.0843.91 ▼0.65
Dashboard /wp-admin2,206 ▲295.61 ▲0.0194.67 ▲4.6643.20 ▲0.17
Posts /wp-admin/edit.php2,108 ▲81.99 ▼0.0933.09 ▼8.7534.67 ▼4.43
Add New Post /wp-admin/post-new.php1,541 ▲1018.29 ▼4.71638.10 ▲9.8862.70 ▲9.44
Media Library /wp-admin/upload.php1,408 ▲114.18 ▲0.05102.24 ▼10.3744.53 ▼3.09
CSV Import /wp-admin/tools.php?page=wp-csv-importer8072.0324.0631.21
CSV Export /wp-admin/tools.php?page=csv-import-and-exporter1,6602.1335.2041.20

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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% 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)
Everything seems fine, however 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
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/csv-import-and-exporter/admin/admin.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/csv-import-and-exporter/admin/setting.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/csv-import-and-exporter/import/rs-csv-importer.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/csv-import-and-exporter/csv-import-and-exporter.php:18
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/csv-import-and-exporter/admin/index.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/import.php): failed to open stream: No such file or directory in wp-content/plugins/csv-import-and-exporter/import/rs-csv-importer.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/csv-import-and-exporter/admin/download.php:303
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/import.php' (include_path='.:/usr/share/php') in wp-content/plugins/csv-import-and-exporter/import/rs-csv-importer.php on line 12
    • > PHP Warning
      Use of undefined constant CSVIAE_PLUGIN_DIR - assumed 'CSVIAE_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/csv-import-and-exporter/admin/admin.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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:
  • Requires at least: Version not formatted correctly
  • Screenshots: A description for screenshot #2 is missing in csv-import-and-exporter/assets to your readme.txt
Please take inspiration from this readme.txt

csv-import-and-exporter/csv-import-and-exporter.php 85% from 13 tests

The primary PHP file in "CSV Import and Exporter" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 203 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected2,434 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP112163771,288
CSS25168538
PO File414961439
JavaScript23937169

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity24.33
▷ Minimum class complexity4.00
▷ Maximum class complexity57.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods55
▷ Static methods23.64%
▷ Public methods4989.09%
▷ Protected methods610.91%
▷ Private methods00.00%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants9
▷ Global constants555.56%
▷ Class constants444.44%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
css/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%