10% smart-donations

Code Review | Donations Made Easy - Smart Donations

WordPress plugin Donations Made Easy - Smart Donations scored 10% from 54 tests.

About plugin

  • Plugin page: smart-donations
  • Plugin version: 4.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.1.1
  • WordPress version: 5.9.2
  • First release: Apr 13, 2013
  • Latest release: Jul 15, 2019
  • Number of updates: 197
  • Update frequency: every 11.6 days
  • Top authors: EDGARROJAS (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

1,000+ active / 79,883 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/smart-donations/smart-donations-widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; rednao_smart_donations_widget has a deprecated constructor

Server metrics [RAM: ▼2.21MB] [CPU: ▼344.44ms] Passed 4 tests

A check of server-side resources used by Donations Made Easy - Smart Donations
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.364.61 ▼45.28
Dashboard /wp-admin2.17 ▼1.234.81 ▼27.80
Posts /wp-admin/edit.php2.17 ▼1.465.48 ▼30.39
Add New Post /wp-admin/post-new.php2.17 ▼4.804.83 ▼1,274.30
Media Library /wp-admin/upload.php2.17 ▼1.124.29 ▼21.52
Smart Donations /wp-admin/admin.php?page=smart_donations_menu2.176.09
Analytics /wp-admin/admin.php?page=smart-donations/smartdonations.phpanalytics2.175.04
Settings /wp-admin/admin.php?page=smart-donations/smartdonations.phpsettings2.175.67
Wish List/Support /wp-admin/admin.php?page=smart-donations/smartdonations.phpwishlist2.174.91
Progress Indicators /wp-admin/admin.php?page=smart-donations/smartdonations.phpprogress_indicators2.175.20
Campaigns /wp-admin/admin.php?page=smart-donations/smartdonations.phpcampaigns2.174.37

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 172 new files
Database: 4 new tables, 3 new options
New tables
wp_smart_donations_transaction_table
wp_smart_donations_progress_table
wp_smart_donations_donation_item
wp_smart_donations_campaign_table
New WordPress options
REDNAO_SMART_DONATIONS_DB_VERSION
widget_rednao_smart_donations_progress_widget
widget_rednao_smart_donations_widget

Browser metrics Passed 4 tests

Checking browser requirements for Donations Made Easy - Smart Donations
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲8416.15 ▲0.396.17 ▼0.102.21 ▼0.43
Dashboard /wp-admin2,945 ▲876.18 ▼0.00117.88 ▼15.03179.65 ▲14.52
Posts /wp-admin/edit.php2,741 ▲473.12 ▼0.1263.60 ▼0.72141.02 ▼1.07
Add New Post /wp-admin/post-new.php1,723 ▲3318.58 ▼2.37415.89 ▼47.60172.75 ▲8.67
Media Library /wp-admin/upload.php1,751 ▲505.53 ▲0.05126.15 ▼14.11210.46 ▲20.69
Smart Donations /wp-admin/admin.php?page=smart_donations_menu1,2062.4455.71130.48
Analytics /wp-admin/admin.php?page=smart-donations/smartdonations.phpanalytics1,1683.7169.95108.20
Settings /wp-admin/admin.php?page=smart-donations/smartdonations.phpsettings1,1262.4554.2088.43
Wish List/Support /wp-admin/admin.php?page=smart-donations/smartdonations.phpwishlist1,0602.4854.67139.15
Progress Indicators /wp-admin/admin.php?page=smart-donations/smartdonations.phpprogress_indicators1,1603.5166.05102.11
Campaigns /wp-admin/admin.php?page=smart-donations/smartdonations.phpcampaigns1,5263.8268.66110.48

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/smart-donations/smart-donations-widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; rednao_smart_donations_widget has a deprecated constructor
  • Zombie tables were found after uninstall: 4 tables
    • wp_smart_donations_progress_table
    • wp_smart_donations_donation_item
    • wp_smart_donations_transaction_table
    • wp_smart_donations_campaign_table
  • Zombie WordPress options were found after uninstall: 3 options
    • widget_rednao_smart_donations_progress_widget
    • widget_rednao_smart_donations_widget
    • REDNAO_SMART_DONATIONS_DB_VERSION

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smart-donations/smartdonations.phpcampaigns
    • > Deprecated in wp-content/plugins/smart-donations/smart-donations-widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; rednao_smart_donations_widget has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smart-donations/smartdonations.phpcampaigns
    • > Deprecated in wp-content/plugins/smart-donations/smart-donations-progress-widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; rednao_smart_donations_progress_widget has a deprecated constructor

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 9× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/smart-donations/smartdonations-settings.php
    • > /wp-content/plugins/smart-donations/smart-donations-config.php
    • > /wp-content/plugins/smart-donations/smart-donations-add-new.php
    • > /wp-content/plugins/smart-donations/smart-donations-messages.php
    • > /wp-content/plugins/smart-donations/smart-donations-campaigns.php
    • > /wp-content/plugins/smart-donations/smartdonations.php
    • > /wp-content/plugins/smart-donations/smart-donations-progress-indicators.php
    • > /wp-content/plugins/smart-donations/smart-donations-progress-add.php
    • > /wp-content/plugins/smart-donations/wepay-ipn.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-donations/smart-donations-progress-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/smart-donations/smart-donations-wishlist.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-donations/smart-donations-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-donations/smart-donations-wall-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/smart-donations/smart-donations-list.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/smart-donations/smart-donations-progress-pro.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/smart-donations/smart-donations-analytics-pro.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/smart-donations/smart-donations-support-links.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/smart-donations/smart-donations-analytics.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/smart-donations/donation_provider/donation_provider_config.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
The official readme.txt is a good inspiration

smart-donations/smartdonations.php 77% from 13 tests

"Donations Made Easy - Smart Donations" version 4.0.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("smart-donations.php" instead of "smartdonations.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin33,215 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript412,5931,52215,732
CSS151,48820413,570
PHP301,1361463,559
SVG201354

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods65
▷ Static methods00.00%
▷ Public methods5381.54%
▷ Protected methods00.00%
▷ Private methods1218.46%
Functions48
▷ Named functions48100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
62 PNG files occupy 1.26MB with 0.77MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/slider_donation_wepay.png14.02KB4.32KB▼ 69.19%
images/threeButtonsStyle2.png30.65KB0.96KB▼ 96.86%
css/smartDonationsSlider/images/ui-icons_ffd27a_256x240.png4.44KB4.17KB▼ 6.02%
images/threeButtonsStyle1.png30.65KB1.18KB▼ 96.14%
css/smartDonationsSlider/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%