58% recurring-payment-donation-through-stripe

Code Review | Recurring payment and donation through Stripe

WordPress plugin Recurring payment and donation through Stripe scored 58% from 54 tests.

About plugin

  • Plugin page: recurring-payment...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.3
  • WordPress version: 5.8.1
  • First release: Dec 11, 2017
  • Latest release: Nov 20, 2019
  • Number of updates: 11
  • Update frequency: every 64.7 days
  • Top authors: brainvireinfo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 1,633 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.85MB] [CPU: ▼133.97ms] Passed 4 tests

This is a short check of server-side resources used by Recurring payment and donation through Stripe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲1.0042.59 ▲22.38
Dashboard /wp-admin3.95 ▲0.9065.58 ▲30.36
Posts /wp-admin/edit.php4.01 ▲0.9051.36 ▲7.31
Add New Post /wp-admin/post-new.php6.23 ▲0.8096.59 ▼553.57
Media Library /wp-admin/upload.php3.82 ▲0.8133.07 ▼12.00
Help /wp-admin/admin.php?page=rpadts-help3.8136.02
Payments /wp-admin/admin.php?page=stripe-payments3.8240.91
Settings /wp-admin/admin.php?page=rpadts-settings3.8042.50

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 126 new files
Database: 1 new table, 4 new options
New tables
wp_stripe_transaction_table
New WordPress options
rpadts_currency
rpadts_email_messagebody
rpadts_apiMode
rpadts_email_subject

Browser metrics Passed 4 tests

This is an overview of browser requirements for Recurring payment and donation through Stripe
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,055 ▲46018.42 ▲2.8715.84 ▲5.7645.74 ▼5.48
Dashboard /wp-admin3,239 ▲3088.03 ▲2.08160.22 ▲13.65115.32 ▼2.22
Posts /wp-admin/edit.php3,025 ▲2864.48 ▲1.7781.08 ▲14.5494.18 ▲1.72
Add New Post /wp-admin/post-new.php1,538 ▼4318.58 ▲1.00327.42 ▼102.16122.04 ▲4.74
Media Library /wp-admin/upload.php1,877 ▲704.85 ▼0.15114.95 ▼63.45121.70 ▼19.15
Help /wp-admin/admin.php?page=rpadts-help1,5153.7177.1371.30
Payments /wp-admin/admin.php?page=stripe-payments1,5773.9673.9569.25
Settings /wp-admin/admin.php?page=rpadts-settings2,1723.7576.95101.99

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_stripe_transaction_table
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • rpadts_email_subject
    • rpadts_apiMode
    • rpadts_email_messagebody
    • rpadts_currency

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/build.php
  • 91× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/lib/Error/Card.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/lib/Dispute.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/lib/Transfer.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/lib/Event.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/tests/CollectionTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/tests/ApplicationFeeRefundTest.php:5
    • > PHP Notice
      Undefined variable: argv in wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/build.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/recurring-payment-donation-through-stripe/admin/rpadts-payment-page.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
Please take inspiration from this readme.txt

recurring-payment-donation-through-stripe/recurring-payment-and-donation-through-stripe.php 92% from 13 tests

The primary PHP file in "Recurring payment and donation through Stripe" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("recurring-payment-donation-through-stripe.php" instead of "recurring-payment-and-donation-through-stripe.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/recurring-payment-donation-through-stripe/vendor/stripe/stripe-php/data/ca-certificates.crt
10,733 lines of code in 115 files:
LanguageFilesBlank linesComment linesLines of code
PHP1021,1131,6496,362
JavaScript53962182,206
CSS3149571,803
Markdown22010296
JSON10036
XML20030

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.34
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces4
Interfaces3
Traits0
Classes92
▷ Abstract classes55.43%
▷ Concrete classes8794.57%
▷ Final classes00.00%
Methods425
▷ Static methods13431.53%
▷ Public methods38891.29%
▷ Protected methods225.18%
▷ Private methods153.53%
Functions21
▷ Named functions1885.71%
▷ Anonymous functions314.29%
Constants15
▷ Global constants640.00%
▷ Class constants960.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
vendor/stripe/stripe-php/data/test.png0.09KB0.09KB0.00%
assets/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
assets/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%