52% charitable

Code Review | Donation Forms by Charitable - Donations Plugin & Fundraising Platform for WordPress

WordPress plugin Donation Forms by Charitable - Donations Plugin & Fundraising Platform for WordPress scored52%from 54 tests.

About plugin

  • Plugin page: charitable
  • Plugin version: 1.8.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2015
  • Latest release: Nov 15, 2023
  • Number of updates: 194
  • Update frequency: every 15.6 days
  • Top authors: WPCharitable (48.97%)ericdaams (30.41%)dimensionmedia (21.65%)

Code review

54 tests

User reviews

155 reviews

Install metrics

10,000+ active /650,176 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.48MB] [CPU: ▲15.18ms] 50% from 4 tests

Analyzing server-side resources used by Donation Forms by Charitable - Donations Plugin & Fundraising Platform for WordPress
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 2,752.92ms on /wp-admin/admin.php?page=charitable-addons)
  • RAM: Try to keep total memory usage under 10MB (currently 12.36MB on /wp-admin/admin.php?page=charitable-campaign-builder)
PageMemory (MB)CPU Time (ms)
Home /6.00 ▲2.5360.65 ▲18.06
Dashboard /wp-admin6.20 ▲2.9099.76 ▲51.01
Posts /wp-admin/edit.php6.26 ▲2.9160.30 ▲14.22
Add New Post /wp-admin/post-new.php7.56 ▲1.67101.45 ▲10.92
Media Library /wp-admin/upload.php6.06 ▲2.8350.26 ▲17.51
Addons /wp-admin/admin.php?page=charitable-addons7.182,752.92
Categories /wp-admin/edit-tags.php?taxonomy=campaign_category&post_type=campaign6.1850.40
Donations /wp-admin/edit.php?post_type=donation6.2748.44
Upgrade Charitable /wp-admin/index.php?page=charitable-upgrades6.0745.93
Customize /wp-admin/customize.php?autofocus[panel]=charitable&url=http%3A%2F%2Fwp.com9.12195.11
Charitable /wp-admin/admin.php?page=charitable6.59494.68
Campaign Builder /wp-admin/admin.php?page=charitable-campaign-builder12.36145.72
Tags /wp-admin/edit-tags.php?taxonomy=campaign_tag&post_type=campaign6.7549.38
Settings /wp-admin/admin.php?page=charitable-settings7.3455.07
Add New /wp-admin/edit.php?post_type=campaign&create=campaign6.9154.95

Server storage [IO: ▲18.27MB] [DB: ▲0.93MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 1,621 new files
Database: 3 new tables, 21 new options
New tables
wp_charitable_campaign_donations
wp_charitable_donors
wp_charitable_donormeta
New WordPress options
db_upgraded
charitable_doing_upgrade
widget_charitable_donors_widget
charitable_campaign_builder_templates
widget_charitable_campaigns_widget
charitable_activated
can_compress_scripts
charitable_notifications
widget_charitable_donate_widget
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Donation Forms by Charitable - Donations Plugin & Fundraising Platform for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,131 ▲34414.34 ▼0.378.96 ▲7.0234.17 ▼9.93
Dashboard /wp-admin2,410 ▲2305.35 ▼0.29109.63 ▲8.8378.53 ▲33.68
Posts /wp-admin/edit.php2,177 ▲742.11 ▲0.1749.83 ▲11.2039.38 ▲3.67
Add New Post /wp-admin/post-new.php1,644 ▲11723.93 ▲0.74614.56 ▼91.7230.51 ▼30.40
Media Library /wp-admin/upload.php1,483 ▲834.29 ▲0.11100.60 ▼8.9745.04 ▲0.45
Addons /wp-admin/admin.php?page=charitable-addons2,3012.5455.5190.00
Categories /wp-admin/edit-tags.php?taxonomy=campaign_category&post_type=campaign1,4112.0439.2562.13
Donations /wp-admin/edit.php?post_type=donation1,5692.7555.0572.49
Upgrade Charitable /wp-admin/index.php?page=charitable-upgrades3,2246.88110.4451.17
Customize /wp-admin/customize.php?autofocus[panel]=charitable&url=http%3A%2F%2Fwp.com9,32623.98638.09148.27
Charitable /wp-admin/admin.php?page=charitable1,1032.6937.9990.84
Campaign Builder /wp-admin/admin.php?page=charitable-campaign-builder6,1757.98232.74108.84
Tags /wp-admin/edit-tags.php?taxonomy=campaign_tag&post_type=campaign1,3931.9734.5952.54
Settings /wp-admin/admin.php?page=charitable-settings3,1392.5751.72116.47
Add New /wp-admin/edit.php?post_type=campaign&create=campaign1,6172.8866.2791.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_charitable_campaign_donations
    • wp_charitable_donors
    • wp_charitable_donormeta
  • This plugin does not fully uninstall, leaving 20 options in the database
    • wpcharitable_activated_datetime
    • widget_charitable_donation_stats_widget
    • can_compress_scripts
    • widget_charitable_donors_widget
    • charitable_activated
    • wp_charitable_donors_db_version
    • widget_recent-posts
    • charitable_campaign_builder_templates
    • widget_charitable_campaigns_widget
    • db_upgraded
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 44× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/frontend/medical-causes.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/admin/environmental.php
    • > /wp-content/plugins/charitable/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/charitable/includes/stripe/libraries/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/frontend/simple-2-col.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/admin/simple-2-col-colors.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/admin/basic.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/admin/school-trip.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/frontend/medical-bills.php
    • > /wp-content/plugins/charitable/assets/css/campaign-builder/themes/admin/medical-bills-colors.php
  • 559× 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/charitable/vendor/stripe/stripe-php/lib/LineItem.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/charitable/vendor/stripe/stripe-php/lib/SourceTransaction.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/charitable/templates/campaign/summary-donations.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/charitable/vendor/stripe/stripe-php/lib/Service/FileLinkService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/charitable/vendor/stripe/stripe-php/lib/File.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/charitable/includes/stripe/libraries/vendor/stripe/stripe-php/lib/Charge.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/charitable/vendor/stripe/stripe-php/lib/Service/InvoiceService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/charitable/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/charitable/includes/stripe/libraries/vendor/stripe/stripe-php/lib/Dispute.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/charitable/vendor/stripe/stripe-php/lib/ApiResource.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/customize.php?autofocus[panel]=charitable&url=http%3A%2F%2Fwp.com
    • > Javascript (severe) in unknown
    /wp-content/plugins/charitable/assets/js/blocks/build/index.js?ver=fe3232aaa35fb97386bb 58:25 Uncaught ReferenceError: charitable_block_data is not defined
    • > GET request to /wp-admin/customize.php?autofocus[panel]=charitable&url=http%3A%2F%2Fwp.com
    • > Security (warning) in unknown
    /?customize_changeset_uuid=2a38a061-2014-4949-a2ca-38915c93a086&customize_theme=twentytwentyone&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=charitable-campaign-builder
    • > Deprecation (warning) in unknown
    /wp-content/plugins/charitable/assets/lib/quill/quill.js?ver=2.2.6 4164 Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

charitable/charitable.php 92% from 13 tests

The main PHP script in "Donation Forms by Charitable - Donations Plugin & Fundraising Platform for WordPress" version 1.8.0.4 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "4.1")

Code Analysis 5% 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
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/charitable/includes/stripe/libraries/vendor/stripe/stripe-php/data/ca-certificates.crt
      • wp-content/plugins/charitable/vendor/stripe/stripe-php/data/ca-certificates.crt
145,399 lines of code in 1,344 files:
LanguageFilesBlank linesComment linesLines of code
PHP98522,34958,50680,479
JavaScript956,9795,52225,238
CSS7692446120,409
Sass992,5371,16313,470
SVG73022,892
Markdown51,09802,446
JSON700375
XML30061
make110029

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.70
▷ Minimum class complexity1.00
▷ Maximum class complexity290.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces37
Interfaces25
Traits8
Classes632
▷ Abstract classes335.22%
▷ Concrete classes59994.78%
▷ Final classes264.34%
Methods4,242
▷ Static methods60414.24%
▷ Public methods3,66786.45%
▷ Protected methods3087.26%
▷ Private methods2676.29%
Functions363
▷ Named functions34193.94%
▷ Anonymous functions226.06%
Constants1,083
▷ Global constants141.29%
▷ Class constants1,06998.71%
▷ Public constants1,069100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
140 compressed PNG files occupy 5.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/x.png0.35KB0.25KB▼ 29.53%
assets/images/campaign-builder/settings/marketing/mailpoet.png2.20KB2.11KB▼ 3.82%
assets/images/campaign-builder/settings/marketing/active-campaign_big.png25.22KB25.22KB0.00%
assets/images/campaign-builder/templates/save-the-museum/preview.png160.38KB169.21KB0.00%
assets/images/icons/panel_design.png0.48KB0.35KB▼ 26.72%