52% csv-2-post

Code Review | CSV 2 POST

WordPress plugin CSV 2 POST scored52%from 54 tests.

About plugin

  • Plugin page: csv-2-post
  • Plugin version: 8.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 6.3.1
  • First release: Jul 20, 2009
  • Latest release: Jun 25, 2017
  • Number of updates: 268
  • Update frequency: every 10.8 days
  • Top authors: WebTechGlobal (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

30+ active /43,080 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼44.48ms] Passed 4 tests

Analyzing server-side resources used by CSV 2 POST
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.37 ▼0.0913.47 ▼27.66
Dashboard /wp-admin3.40 ▲0.0913.97 ▼37.77
Posts /wp-admin/edit.php3.40 ▲0.0416.33 ▼31.82
Add New Post /wp-admin/post-new.php3.40 ▼2.4918.29 ▼80.67
Media Library /wp-admin/upload.php3.40 ▲0.1714.84 ▼19.04
Create /wp-admin/post-new.php?post_type=wtgcsvcontent3.4015.21
All Content Templates /wp-admin/edit.php?post_type=wtgcsvcontent3.4015.38

Server storage [IO: ▲4.98MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 162 new files
Database: 2 new tables, 11 new options
New tables
wp_webtechglobal_schedule
wp_c2pprojects
New WordPress options
widget_recent-posts
csv2post_installedversion
csv2post_notifications
csv2post_is_installed
widget_recent-comments
csv2post_installeddate
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for CSV 2 POST
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲9714.26 ▼0.231.66 ▼0.3743.70 ▼3.31
Dashboard /wp-admin2,264 ▲845.58 ▼0.1190.51 ▲1.9739.65 ▼5.99
Posts /wp-admin/edit.php2,169 ▲901.95 ▼0.0140.27 ▲2.2738.11 ▲1.64
Add New Post /wp-admin/post-new.php1,458 ▼6817.82 ▼5.79629.81 ▼49.2549.00 ▼19.09
Media Library /wp-admin/upload.php1,463 ▲634.15 ▼0.0898.32 ▼5.4943.47 ▲0.14
Create /wp-admin/post-new.php?post_type=wtgcsvcontent2,3207.57176.8872.55
All Content Templates /wp-admin/edit.php?post_type=wtgcsvcontent1,1301.9335.9933.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/csv-2-post/classes/class-csv2post.php+402
    count(): Parameter must be an array or an object that implements Countable
  • Zombie tables were found after uninstall: 2 tables
    • wp_c2pprojects
    • wp_webtechglobal_schedule
  • This plugin does not fully uninstall, leaving 11 options in the database
    • db_upgraded
    • csv2post_settings
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • csv2post_is_installed
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • csv2post_installedversion
    • csv2post_notifications
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wtgcsvcontent
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/csv-2-post/classes/class-csv2post.php+402
    count(): Parameter must be an array or an object that implements Countable

SRP 0% 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
Please fix the following
  • 67× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/csv-2-post/views/lastpost.php
    • > /wp-content/plugins/csv-2-post/views/infoprojectsdata.php
    • > /wp-content/plugins/csv-2-post/views/infochecklist.php
    • > /wp-content/plugins/csv-2-post/views/infodirectorysources.php
    • > /wp-content/plugins/csv-2-post/views/infoallprojectshistory.php
    • > /wp-content/plugins/csv-2-post/views/import.php
    • > /wp-content/plugins/csv-2-post/classes/class-files.php
    • > /wp-content/plugins/csv-2-post/classes/class-ui.php
    • > /wp-content/plugins/csv-2-post/views/infocsvfiles.php
    • > /wp-content/plugins/csv-2-post/classes/class-csv2post.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/csv-2-post/uninstall.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/csv-2-post/inc/fields/automationsettings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CSV2POST_UI' not found in wp-content/plugins/csv-2-post/classes/class-forms.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === csv-2-post === )
The official readme.txt is a good inspiration

csv-2-post/csv-2-post.php 92% from 13 tests

The main PHP file in "CSV 2 POST" ver. 8.3.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected22,596 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
PHP775,57612,89218,562
JavaScript52823032,668
CSS91191101,362
INI1104

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity30.27
▷ Minimum class complexity1.00
▷ Maximum class complexity360.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits2
Classes87
▷ Abstract classes11.15%
▷ Concrete classes8698.85%
▷ Final classes00.00%
Methods1,173
▷ Static methods141.19%
▷ Public methods1,15598.47%
▷ Protected methods110.94%
▷ Private methods70.60%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants60
▷ Global constants5998.33%
▷ Class constants11.67%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
28 PNG files occupy 2.13MB with 1.94MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/question_large.png64.36KB5.79KB▼ 91.01%
images/themeforest-light-background.png24.50KB4.47KB▼ 81.76%
images/info-icon.png29.12KB1.12KB▼ 96.14%
images/chat-icon.png29.26KB0.91KB▼ 96.89%
images/warning_extra.png105.76KB10.47KB▼ 90.10%