64% ctcl-stripe

Code Review | CTCL Stripe

WordPress plugin CTCL Stripe scored 64% from 54 tests.

About plugin

  • Plugin page: ctcl-stripe
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.2-6.3.0
  • WordPress version: 6.3.1
  • First release: Nov 7, 2020
  • Latest release: Aug 27, 2023
  • Number of updates: 16
  • Update frequency: every 64.0 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 476 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.89MB] [CPU: ▼52.36ms] Passed 4 tests

This is a short check of server-side resources used by CTCL Stripe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.38 ▼33.83
Dashboard /wp-admin2.11 ▼1.195.52 ▼41.86
Posts /wp-admin/edit.php2.11 ▼1.246.21 ▼39.09
Add New Post /wp-admin/post-new.php2.11 ▼3.775.84 ▼94.67
Media Library /wp-admin/upload.php2.11 ▼1.125.74 ▼26.16

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 294 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

CTCL Stripe: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲19713.64 ▼1.116.05 ▲4.2943.36 ▼3.96
Dashboard /wp-admin2,218 ▲295.83 ▲0.8796.78 ▼15.3939.53 ▲0.44
Posts /wp-admin/edit.php2,108 ▲192.05 ▲0.0040.27 ▲7.1037.84 ▲1.23
Add New Post /wp-admin/post-new.php1,551 ▲3218.58 ▼4.74660.15 ▲2.3059.28 ▲6.48
Media Library /wp-admin/upload.php1,411 ▲204.22 ▲0.02105.80 ▲8.4547.44 ▲7.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the thickbox handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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)
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 250× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/ShippingRate.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Treasury/ReceivedDebit.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Service/TransferService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Terminal/ConnectionToken.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Service/InvoiceService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/FinancialConnections/Account.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Plan.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\InvalidRequestException' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Exception/RateLimitException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/Charge.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/ctcl-stripe/stripe-php/lib/SetupAttempt.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (Admin Panel)
Please take inspiration from this readme.txt

ctcl-stripe/ctcl-stripe.php 92% from 13 tests

"CTCL Stripe" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/ctcl-stripe/stripe-php/data/ca-certificates.crt
10,863 lines of code in 287 files:
LanguageFilesBlank linesComment linesLines of code
PHP2822,35011,6979,143
Markdown280701,615
JavaScript1121152
JSON10048
CSS1105

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.56
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces36
Interfaces9
Traits9
Classes264
▷ Abstract classes103.79%
▷ Concrete classes25496.21%
▷ Final classes00.00%
Methods882
▷ Static methods18120.52%
▷ Public methods79990.59%
▷ Protected methods414.65%
▷ Private methods424.76%
Functions15
▷ Named functions00.00%
▷ Anonymous functions15100.00%
Constants1,234
▷ Global constants20.16%
▷ Class constants1,23299.84%
▷ Public constants1,232100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png83.11KB26.02KB▼ 68.69%