83% simple-csv-exporter

Code Review | Simple CSV Exporter

WordPress plugin Simple CSV Exporter scored83%from 54 tests.

About plugin

  • Plugin page: simple-csv-exporter
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0
  • WordPress version: 6.3.1
  • First release: Dec 11, 2020
  • Latest release: Jul 26, 2022
  • Number of updates: 5
  • Update frequency: every 118.4 days
  • Top authors: hamworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,412 total downloads

Benchmarks

Plugin footprint 83% 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.46MB] [CPU: ▲2.51ms] Passed 4 tests

Server-side resources used by Simple CSV Exporter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4644.81 ▲4.52
Dashboard /wp-admin3.77 ▲0.4654.33 ▲1.21
Posts /wp-admin/edit.php3.88 ▲0.5257.15 ▲6.62
Add New Post /wp-admin/post-new.php6.35 ▲0.4690.63 ▼0.94
Media Library /wp-admin/upload.php3.69 ▲0.4639.34 ▲5.25
CSV Export /wp-admin/tools.php?page=simple_csv_exporter3.7836.55

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 131 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Simple CSV Exporter: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.14 ▼1.222.09 ▲0.4341.43 ▼2.71
Dashboard /wp-admin2,207 ▲195.81 ▼0.0893.68 ▼9.0239.19 ▼0.04
Posts /wp-admin/edit.php2,093 ▲42.13 ▲0.1339.49 ▲0.3733.80 ▼0.17
Add New Post /wp-admin/post-new.php1,536 ▲2223.06 ▲5.65640.60 ▼38.0454.72 ▼3.13
Media Library /wp-admin/upload.php1,392 ▲14.18 ▼0.1494.19 ▼6.1940.19 ▼10.28
CSV Export /wp-admin/tools.php?page=simple_csv_exporter8462.0323.1627.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 57× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/simple-csv-exporter/vendor/psr/container/src/NotFoundExceptionInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function HAMWORKS\\WP\\Simple_CSV_Exporter\\add_action() in wp-content/plugins/simple-csv-exporter/src/Admin_UI.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'DI\\Container' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/CompiledContainer.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Helper\\DefinitionHelper' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/Definition/Helper/CreateDefinitionHelper.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Source\\DefinitionSource' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/Definition/Source/SourceCache.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Definition' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/Definition/ArrayDefinition.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DI\\Definition\\Resolver\\ObjectCreator' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/Definition/Resolver/InstanceInjector.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Resolver\\DefinitionResolver' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/Definition/Resolver/EnvironmentVariableResolver.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Definition' not found in wp-content/plugins/simple-csv-exporter/vendor/php-di/php-di/src/Definition/ValueDefinition.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: export, csv

simple-csv-exporter/simple-csv-exporter.php 85% from 13 tests

The primary PHP file in "Simple CSV Exporter" version 2.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected7,818 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
PHP1141,5693,0916,906
Markdown52810581
JSON100299
Bourne Shell28032

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 210)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity11.16
▷ Minimum class complexity1.00
▷ Maximum class complexity303.00
Average method complexity3.51
▷ Minimum method complexity1.00
▷ Maximum method complexity210.00
Code structure
Namespaces25
Interfaces16
Traits0
Classes86
▷ Abstract classes22.33%
▷ Concrete classes8497.67%
▷ Final classes22.38%
Methods442
▷ Static methods398.82%
▷ Public methods35379.86%
▷ Protected methods214.75%
▷ Private methods6815.38%
Functions36
▷ Named functions1336.11%
▷ Anonymous functions2363.89%
Constants12
▷ Global constants325.00%
▷ Class constants975.00%
▷ Public constants777.78%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin