52% export-stripe-csv

Code Review | Stripe CSV Exports

WordPress plugin Stripe CSV Exports scored52%from 54 tests.

About plugin

  • Plugin page: export-stripe-csv
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3
  • WordPress version: 6.3.1
  • First release: Jun 22, 2017
  • Latest release: Feb 24, 2020
  • Number of updates: 25
  • Update frequency: every 39.1 days
  • Top authors: munger41 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /857 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.10MB] [CPU: ▼26.51ms] Passed 4 tests

A check of server-side resources used by Stripe CSV Exports
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.29 ▲0.8242.80 ▲2.69
Dashboard /wp-admin3.84 ▲0.5429.47 ▼17.74
Posts /wp-admin/edit.php3.84 ▲0.4827.80 ▼17.01
Add New Post /wp-admin/post-new.php3.84 ▼2.0525.95 ▼66.29
Media Library /wp-admin/upload.php3.84 ▲0.6128.77 ▼4.99
Stripe CSV Exports /wp-admin/options-general.php?page=3.8428.25

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 271 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Stripe CSV Exports
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.23 ▼0.301.72 ▲0.3042.83 ▲6.16
Dashboard /wp-admin2,202 ▲255.61 ▼0.0783.04 ▼11.7636.75 ▼0.21
Posts /wp-admin/edit.php2,101 ▲42.01 ▼0.1235.69 ▼0.5234.40 ▼0.66
Add New Post /wp-admin/post-new.php1,537 ▲118.07 ▼7.05620.01 ▼9.85105.65 ▲3.91
Media Library /wp-admin/upload.php1,401 ▲14.19 ▼0.0295.92 ▼8.4642.80 ▼4.60
Stripe CSV Exports /wp-admin/options-general.php?page=7792.0026.1923.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/export-stripe-csv/stripe_csv_exports.php+194
    Undefined variable: menu_slug
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=
    • > Notice in wp-content/plugins/export-stripe-csv/stripe_csv_exports.php+194
    Undefined variable: menu_slug
    • > GET request to /wp-admin/options-general.php?page=
    • > Notice in wp-content/plugins/export-stripe-csv/stripe_csv_exports.php+253
    Undefined property: stripe_csv_exports::$updated

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/export-stripe-csv/vendor/apache/log4php/package.php
  • 169× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/export-stripe-csv/vendor/apache/log4php/package-config.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/lib/SubscriptionItem.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/lib/Error/Api.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/tests/PermissionsErrorTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerPatternConverter' not found in wp-content/plugins/export-stripe-csv/vendor/apache/log4php/src/main/php/pattern/LoggerPatternConverterLogger.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/tests/DiscountTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/tests/ApplicationFeeRefundTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/lib/Product.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/lib/TransferReversal.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'LoggerConfigurationAdapter' not found in wp-content/plugins/export-stripe-csv/vendor/apache/log4php/src/main/php/configurators/LoggerConfigurationAdapterXML.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: export, stripe, csv, custom

export-stripe-csv/stripe_csv_exports.php 92% from 13 tests

The main PHP script in "Stripe CSV Exports" version 1.2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("export-stripe-csv.php" instead of "stripe_csv_exports.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/export-stripe-csv/vendor/stripe/stripe-php/data/ca-certificates.crt
15,558 lines of code in 255 files:
LanguageFilesBlank linesComment linesLines of code
PHP2353,23910,30813,657
Markdown46130930
Maven13021305
JSON500291
Ant11930140
XML61558126
DTD1255469
YAML22040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.32
▷ Minimum class complexity1.00
▷ Maximum class complexity213.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces11
Interfaces8
Traits5
Classes209
▷ Abstract classes146.70%
▷ Concrete classes19593.30%
▷ Final classes00.00%
Methods1,264
▷ Static methods24219.15%
▷ Public methods1,08485.76%
▷ Protected methods1058.31%
▷ Private methods755.93%
Functions41
▷ Named functions921.95%
▷ Anonymous functions3278.05%
Constants71
▷ Global constants34.23%
▷ Class constants6895.77%
▷ Public constants68100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/stripe/stripe-php/data/test.png0.09KB0.09KB0.00%