68% smart-donations-stripe

Code Review | Smart Donations - Stripe Gateway

WordPress plugin Smart Donations - Stripe Gateway scored68%from 54 tests.

About plugin

  • Plugin page: smart-donations-s...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0
  • WordPress version: 6.3.1
  • First release: Oct 1, 2014
  • Latest release: Nov 7, 2014
  • Number of updates: 3
  • Update frequency: every 12.4 days
  • Top authors: EDGARROJAS (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,677 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▲0.44ms] Passed 4 tests

A check of server-side resources used by Smart Donations - Stripe Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.38 ▼2.15
Dashboard /wp-admin3.33 ▲0.0245.01 ▼4.05
Posts /wp-admin/edit.php3.38 ▲0.0248.04 ▲3.25
Add New Post /wp-admin/post-new.php5.91 ▲0.02109.30 ▲17.10
Media Library /wp-admin/upload.php3.25 ▲0.0236.09 ▲4.73

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Donations - Stripe Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼0.971.68 ▼0.0637.09 ▼11.49
Dashboard /wp-admin2,206 ▲155.88 ▲0.8399.43 ▼14.4341.27 ▼4.97
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0539.82 ▲0.2634.23 ▼1.42
Add New Post /wp-admin/post-new.php1,533 ▼622.73 ▼0.59574.78 ▼94.0957.49 ▼3.24
Media Library /wp-admin/upload.php1,388 ▲64.23 ▼0.0195.70 ▼4.6641.14 ▼2.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/smart-donations-stripe/smart-donations-stripe.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/Customer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/Coupon.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/InvoiceItem.php:3
    • > PHP Warning
      Use of undefined constant SMART_DONATIONS_DIR - assumed 'SMART_DONATIONS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/smart-donations-stripe/smart-donations-stripe-provider.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_SingletonApiResource' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/Account.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/ApplicationFee.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/Token.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/smart-donations-stripe/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_InvalidRequestError' not found in wp-content/plugins/smart-donations-stripe/stripe/Stripe/RateLimitError.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'SMART_DONATIONS_DIR/ipn/rednao_provider_base.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-donations-stripe/smart-donations-stripe-provider.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% 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:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
You can take inspiration from this readme.txt

smart-donations-stripe/smart-donations-stripe.php 85% from 13 tests

The primary PHP file in "Smart Donations - Stripe Gateway" version 0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/smart-donations-stripe/stripe/data/ca-certificates.crt
2,461 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP392805831,676
XML760571
JavaScript3577214

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.54
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes411.43%
▷ Concrete classes3188.57%
▷ Final classes00.00%
Methods158
▷ Static methods6541.14%
▷ Public methods14189.24%
▷ Protected methods85.06%
▷ Private methods95.70%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/textbox.png8.11KB3.45KB▼ 57.49%
img/success.png8.76KB4.12KB▼ 52.99%
img/fail.png9.43KB5.42KB▼ 42.51%
img/classic.png5.36KB2.32KB▼ 56.79%
img/form.png6.42KB2.45KB▼ 61.77%