58% wp-stripe-donation

Code Review | Accept Stripe Donation - AidWP

WordPress plugin Accept Stripe Donation - AidWP scored58%from 54 tests.

About plugin

  • Plugin page: wp-stripe-donation
  • Plugin version: 3.2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 19, 2020
  • Latest release: Jul 8, 2023
  • Number of updates: 154
  • Update frequency: every 8.0 days
  • Top authors: mhmrajib (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active /27,845 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.61MB] [CPU: ▲0.61ms] Passed 4 tests

This is a short check of server-side resources used by Accept Stripe Donation - AidWP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6244.26 ▲5.99
Dashboard /wp-admin3.96 ▲0.6153.97 ▼5.82
Posts /wp-admin/edit.php4.01 ▲0.6660.76 ▲13.71
Add New Post /wp-admin/post-new.php6.47 ▲0.5986.90 ▼7.89
Media Library /wp-admin/upload.php3.86 ▲0.6345.12 ▲10.17
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.2543.87

Server storage [IO: ▲6.15MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 524 new files
Database: 1 new table, 9 new options
New tables
wp_wpsd_stripe_donation
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
fs_active_plugins
fs_debug_mode
db_upgraded
widget_theysaidso_widget
fs_accounts

Browser metrics Passed 4 tests

A check of browser resources used by Accept Stripe Donation - AidWP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,157 ▲41123.11 ▲8.76285.43 ▲283.8130.77 ▼13.13
Dashboard /wp-admin2,388 ▲2146.37 ▲0.79108.39 ▲21.0542.01 ▼0.42
Posts /wp-admin/edit.php2,320 ▲2203.55 ▲1.5562.78 ▲20.3839.74 ▲2.31
Add New Post /wp-admin/post-new.php1,562 ▲3423.25 ▲0.16650.55 ▼22.8635.91 ▼17.33
Media Library /wp-admin/upload.php1,459 ▲594.30 ▲0.1281.61 ▼28.8543.30 ▼4.28
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,2823.2939.1525.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-stripe-donation/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_theysaidso_widget
    • fs_accounts
    • fs_active_plugins

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-stripe-donation/stripe/build.php
    • > /wp-content/plugins/wp-stripe-donation/admin/view/partial/form-content.php
    • > /wp-content/plugins/wp-stripe-donation/admin/view/partial/form-styles.php
    • > /wp-content/plugins/wp-stripe-donation/stripe/update_certs.php
  • 187× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/BalanceTransaction.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Service/ApplePayDomainService.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Exception/OAuth/ExceptionInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Issuing/Card.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Refund.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Exception/ApiConnectionException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Exception/BadMethodCallException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Service/WebhookEndpointService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Terminal/Reader.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-donation/stripe/lib/Radar/ValueList.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-stripe-donation/wp-stripe-donation.php Passed 13 tests

"Accept Stripe Donation - AidWP" version 3.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
127 characters long description:
Best Donation Plugin for WordPress allows you to collect donation or payment on your website via Stripe payment gateway method.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Almost there! Just fix the following issues
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-stripe-donation/stripe/data/ca-certificates.crt
57,027 lines of code in 430 files:
LanguageFilesBlank linesComment linesLines of code
PHP36010,02226,10844,250
CSS18153492,981
SVG1002,671
PO File88381,0331,928
Sass1536361,796
LESS1536461,786
Markdown366401,012
JavaScript69173494
JSON10048
XML10031
make19027
YAML1003

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity19.08
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces21
Interfaces6
Traits16
Classes249
▷ Abstract classes124.82%
▷ Concrete classes23795.18%
▷ Final classes00.00%
Methods1,990
▷ Static methods35217.69%
▷ Public methods1,50475.58%
▷ Protected methods733.67%
▷ Private methods41320.75%
Functions109
▷ Named functions10394.50%
▷ Anonymous functions65.50%
Constants860
▷ Global constants10912.67%
▷ Class constants75187.33%
▷ Public constants751100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%