10% wp-donate

Code Review | WP Donate

WordPress plugin WP Donate scored10%from 54 tests.

About plugin

  • Plugin page: wp-donate
  • Plugin version: 2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.1
  • WordPress version: 6.3.1
  • First release: Aug 8, 2013
  • Latest release: Apr 26, 2022
  • Number of updates: 32
  • Update frequency: every 99.7 days
  • Top authors: ketanajani (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

100+ active /9,772 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/wp-donate/wp-donate.php+13
    Only variables should be passed by reference

Server metrics [RAM: ▼1.93MB] [CPU: ▼63.81ms] Passed 4 tests

Server-side resources used by WP Donate
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.55 ▼37.24
Dashboard /wp-admin2.09 ▼1.256.28 ▼63.03
Posts /wp-admin/edit.php2.09 ▼1.265.86 ▼48.55
Add New Post /wp-admin/post-new.php2.09 ▼3.796.29 ▼106.42
Media Library /wp-admin/upload.php2.09 ▼1.145.97 ▼29.76
WP Donate /wp-admin/options-general.php?page=wp_donate2.095.93

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 459 new files
Database: 2 new tables, 7 new options
New tables
wp_donate
wp_donate_setting
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
donate_db_version
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Donate
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.52 ▼1.039.17 ▲7.3943.43 ▲4.27
Dashboard /wp-admin2,226 ▲525.69 ▲0.0488.50 ▼3.6940.01 ▼1.68
Posts /wp-admin/edit.php2,125 ▲252.40 ▲0.3935.25 ▼2.7133.17 ▲2.05
Add New Post /wp-admin/post-new.php1,549 ▲2122.23 ▼0.88687.34 ▲78.7955.68 ▲2.10
Media Library /wp-admin/upload.php1,428 ▲254.33 ▲0.15100.70 ▼0.8341.54 ▼3.40
WP Donate /wp-admin/options-general.php?page=wp_donate8861.9434.7922.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wp-donate/wp-donate.php+13
    Only variables should be passed by reference
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_donate
    • wp_donate_setting
  • The uninstall procedure has failed, leaving 7 options in the database
    • donate_db_version
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp_donate
    • > Notice in wp-content/plugins/wp-donate/wp-donate.php+13
    Only variables should be passed by reference
    • > GET request to /wp-admin/options-general.php?page=wp_donate
    • > Deprecated in wp-content/plugins/wp-donate/includes/donate-function.php+201
    Array and string offset access syntax with curly braces is deprecated

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/examples/oauth.php
    • > /wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/build.php
  • 372× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/tests/Stripe/ApplePayDomainTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/lib/TaxRate.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/tests/Stripe/OrderReturnTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/tests/Stripe/Service/PaymentMethodServiceTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/tests/Stripe/Service/ReviewServiceTest.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Tags: There are too many tags (18 tag instead of maximum 10)
  • Screenshots: Add a description for screenshot #4 in wp-donate/assets to your readme.txt
You can look at the official readme.txt

wp-donate/wp-donate.php 92% from 13 tests

The entry point to "WP Donate" version 2.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Git Repository: Please do not include Git repositories in your plugin

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-donate/stripe/vendor/stripe/stripe-php/data/ca-certificates.crt
28,088 lines of code in 442 files:
LanguageFilesBlank linesComment linesLines of code
PHP4174,53211,36724,621
Markdown571601,199
JavaScript41911461,157
CSS412021779
JSON530142
YAML3287100
XML30067
make18023

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity2.46
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity1.26
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces26
Interfaces9
Traits9
Classes384
▷ Abstract classes102.60%
▷ Concrete classes37497.40%
▷ Final classes16544.12%
Methods2,047
▷ Static methods1838.94%
▷ Public methods1,88692.13%
▷ Protected methods1075.23%
▷ Private methods542.64%
Functions45
▷ Named functions1635.56%
▷ Anonymous functions2964.44%
Constants947
▷ Global constants121.27%
▷ Class constants93598.73%
▷ Public constants935100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.26MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png91.22KB36.00KB▼ 60.54%
screenshot-4.png66.09KB19.55KB▼ 70.42%
stripe/vendor/stripe/stripe-php/tests/data/test.png0.09KB0.09KB0.00%
screenshot-1.png57.75KB15.61KB▼ 72.97%
screenshot-2.png51.87KB19.66KB▼ 62.09%